手持机

This commit is contained in:
张怡蓉
2025-08-20 14:08:19 +08:00
parent 0e9da3259f
commit d4e53370bf
15 changed files with 354 additions and 62 deletions

View File

@@ -4,10 +4,13 @@
import { getToken } from '@/utils/auth'
export default {
globalData: {
config: {}
},
onLaunch: function() {
this.initApp()
},
onShow: function() {
onShow: function() {
// 检查应用状态,确保从后台恢复时状态一致
this.checkAppState()
},
@@ -30,27 +33,36 @@
}
},
checkAppState() {
// 检查Token状态和页面导航栈状态
console.log('应用从后台切换到前台,检查应用状态')
// 检查Token状态
if (!getToken()) {
console.log('Token不存在,提示并跳转到登录页')
uni.showToast({
icon: 'none',
title: '登录已过期,请重新登录'
})
setTimeout(() => {
uni.reLaunch({ url: loginPage })
}, 1500)
} else {
console.log('Token存在,不做操作')
}
// 注意:应用从后台切换到前台的逻辑已在permission.js中处理
// 这里不需要重复处理,保留此方法以便未来扩展
}
// 检查Token状态和页面导航栈状态
console.log('应用从后台切换到前台,检查应用状态')
// 获取当前页面路径,判断是否在登录页
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const currentPagePath = currentPage ? currentPage.route : ''
// 如果当前页面是登录页,则不检查token
if (currentPagePath === 'pages/login') {
console.log('当前已在登录页面,不进行token检查')
return
}
// 检查Token状态
if (!getToken()) {
console.log('Token不存在,提示并跳转到登录页')
uni.showToast({
icon: 'none',
title: '登录已过期,请重新登录'
})
setTimeout(() => {
uni.reLaunch({ url: '/pages/login' })
}, 1500)
} else {
console.log('Token存在,不做操作')
}
}
}
}

View File

@@ -44,6 +44,11 @@
"desc": "Cycle Count, Spot Check"
}
},
"tabBar": {
"workbench": "Workbench",
"task": "Task",
"mine": "Mine"
},
"login": {
"title": "Login",
"username": "Username",
@@ -94,6 +99,16 @@
"settingsSaved": "Settings saved",
"saveSettingsFailed": "Failed to save settings"
},
"spaceAnalysis": {
"warehouse": "Warehouse:",
"warehousePlaceholder": "Please select a warehouse",
"cargoSpaceStatus": "Cargo Space Status Distribution",
"aisleStatistics": "Aisle Inbound/Outbound Statistics",
"quantity": "Quantity",
"inboundQuantity": "Inbound Quantity",
"outboundQuantity": "Outbound Quantity",
"aisle": "Aisle"
},
"task": {
"list": {
"all": "All",
@@ -450,4 +465,5 @@
"getInventoryListFailed": "Failed to get inventory list"
}
}
}

View File

@@ -44,6 +44,11 @@
"desc": "周期盘点、抽查"
}
},
"tabBar": {
"workbench": "工作台",
"task": "任务",
"mine": "我的"
},
"login": {
"title": "登录",
"username": "用户名",
@@ -94,6 +99,16 @@
"settingsSaved": "设置已保存",
"saveSettingsFailed": "保存设置失败"
},
"spaceAnalysis": {
"warehouse": "仓库:",
"warehousePlaceholder": "请选择仓库",
"cargoSpaceStatus": "货位状态分布",
"aisleStatistics": "巷道出入库统计",
"quantity": "数量",
"inboundQuantity": "入库数量",
"outboundQuantity": "出库数量",
"aisle": "巷道"
},
"task": {
"list": {
"all": "全部",
@@ -451,4 +466,5 @@
"getInventoryListFailed": "获取库存列表失败"
}
}
}

View File

@@ -1,5 +1,5 @@
{
"name" : "若依移动端",
"name" : "手持机",
"appid" : "__UNI__A2DE016",
"description" : "",
"versionName" : "1.1.0",

View File

@@ -2,12 +2,12 @@
<view class="container">
<view class="warehouse-selector">
<uni-forms>
<uni-forms-item label="仓库:">
<uni-forms-item :label="$t('spaceAnalysis.warehouse')">
<uni-data-select
v-model="selectedWarehouseId"
:localdata="warehouseList"
:clear="false"
placeholder="请选择仓库"
:placeholder="$t('spaceAnalysis.warehousePlaceholder')"
@change="handleWarehouseChange"
/>
</uni-forms-item>
@@ -58,7 +58,7 @@ export default {
},
pieOpts: {
title: {
name: '货位状态分布',
name: this.$t('spaceAnalysis.cargoSpaceStatus'),
fontSize: 15
},
legend: {
@@ -86,7 +86,7 @@ export default {
},
columnOpts: {
title: {
name: '巷道出入库统计',
name: this.$t('spaceAnalysis.aisleStatistics'),
fontSize: 15
},
legend: {
@@ -96,7 +96,7 @@ export default {
fontSize: 12
},
yAxis: {
name: '数量',
name: this.$t('spaceAnalysis.quantity'),
fontSize: 12
},
extra: {
@@ -159,12 +159,12 @@ export default {
if (res.code === 200 && res.data) {
// 更新柱状图数据
this.columnData = {
categories: ['1巷道'],
categories: [`1${this.$t('spaceAnalysis.aisle')}`],
series: [{
name: '入库数量',
name: this.$t('spaceAnalysis.inboundQuantity'),
data:[res.data["in"]]
},{
name: '出库数量',
name: this.$t('spaceAnalysis.outboundQuantity'),
data:[res.data["out"]]
}]
}

View File

@@ -78,7 +78,8 @@
</template>
<script>
import { getPrepareTask } from '@/api/search/job.js'
import { getPrepareTask } from '@/api/search/job'
export default {
data() {
return {