This commit is contained in:
2026-09-11 11:19:47 +08:00
parent 991150e64b
commit f8ebbd9610
10 changed files with 54 additions and 30 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<view v-if="user" class="page-shell portal-page"><PortalHeader title="作业记录" :user="user" /><view class="portal-content"><view class="summary-card"><view><text class="summary-number">{{ overview.completedCount }}</text><text class="summary-label">今日完成</text></view><view><text class="summary-number pending-color">{{ overview.pendingBoxCount }}</text><text class="summary-label">待处理</text></view></view><text class="group-title">最近作业</text><view v-if="completedEntries.length === 0" class="history-empty"><text class="history-empty-icon">▤</text><text class="history-empty-title">暂无作业记录</text><text class="history-empty-desc">完成的现场任务会显示在这里</text></view><view v-else class="operation-list"><view v-for="entry in completedEntries" :key="entry.box.taskId || entry.index" class="history-item"><view class="history-check">✓</view><view class="operation-info"><text class="operation-name">集装箱拣货 · {{ containerReference(entry.box) }}</text></view><text class="history-status">已完成</text></view></view></view></view>
<view v-if="user" class="page-shell portal-page"><PortalHeader title="作业记录" :user="user" /><view class="portal-content"><view class="summary-card"><view><text class="summary-number">{{ overview.completedCount }}</text><text class="summary-label">今日完成</text></view><view><text class="summary-number pending-color">{{ overview.pendingBoxCount }}</text><text class="summary-label">待处理</text></view></view><text class="group-title">最近作业</text><view v-if="completedEntries.length === 0" class="history-empty"><text class="history-empty-icon">▤</text><text class="history-empty-title">暂无作业记录</text><text class="history-empty-desc">完成的现场任务会显示在这里</text></view><view v-else class="operation-list"><view v-for="entry in completedEntries" :key="entry.box.taskId || entry.index" class="history-item"><view class="history-check">✓</view><view class="operation-info"><text class="operation-name">出库拣货 · {{ containerReference(entry.box) }}</text></view><text class="history-status">已完成</text></view></view></view></view>
</template>
<script>
import PortalHeader from '@/components/PortalHeader.vue'; import { session, requireSession } from '@/stores/session.js'; import { getPickingOverview } from '@/stores/picking.js'; import { containerReference } from '@/utils/user-facing.js'
+10 -5
View File
@@ -24,7 +24,7 @@
const ICON_TYPES = {
'到货收货': 'download', '商品上架': 'upload', '入库质检': 'checkbox',
'一件代发合托': 'map', '集装箱拣货': 'cart', '出库复核': 'compose', '装箱交接': 'paperplane',
'一件代发合托': 'map', '出库拣货': 'cart', '出库复核': 'compose', '装箱交接': 'paperplane',
'库存盘点': 'list', '商品移库': 'loop', '库存调整': 'compose',
'商品查询': 'search', '库位查询': 'location', '任务查询': 'flag'
}
@@ -33,8 +33,9 @@
...module,
name: module.key === 'inventory' ? '库内作业' : module.name,
available: module.operations.some((operation) => operation.available),
operations: module.operations.map((operation) => ({ ...operation, iconType: ICON_TYPES[operation.name] || 'circle' }))
}))
operations: module.operations.filter((operation) => operation.visible)
.map((operation) => ({ ...operation, iconType: ICON_TYPES[operation.name] || 'circle' }))
})).filter((module) => module.operations.length)
export default {
components: { PortalHeader },
@@ -48,8 +49,12 @@
methods: {
openOperation(operation) {
if (!operation.available) return
const routes = { '一件代发合托': '/pages/dropship-tasks/dropship-tasks', '集装箱拣货': '/pages/tasks/tasks' }
uni.navigateTo({ url: routes[operation.name] || '/pages/operation/operation' })
const routes = {
'一件代发合托': '/pages/dropship-tasks/dropship-tasks',
'出库拣货': '/pages/tasks/tasks',
'库位查询': `/pages/operation/operation?module=query&name=${encodeURIComponent('库位查询')}`
}
uni.navigateTo({ url: routes[operation.name] })
}
}
}
+11 -4
View File
@@ -5,7 +5,7 @@
<view class="module-hero" :class="`module-hero-${currentModule.key}`"><view class="module-hero-icon">{{ currentModule.icon }}</view><view><text class="module-hero-title">{{ currentModule.name }}</text><text class="module-hero-desc">{{ currentModule.description }}</text></view></view>
<text class="group-title">业务功能</text>
<view class="operation-list"><button v-for="operation in currentModule.operations" :key="operation.name" class="operation-item" :class="{ 'operation-item-disabled': !operation.available }" :disabled="!operation.available" @tap="openOperation(operation)"><view class="operation-icon">{{ operation.icon }}</view><view class="operation-info"><text class="operation-name">{{ operation.name }}</text><text class="operation-desc">{{ operation.description }}</text></view><text v-if="operation.available" class="operation-count">{{ overview.pendingBoxCount }}</text><text v-else class="operation-prototype">未开放</text><text v-if="operation.available" class="operation-arrow">›</text></button></view>
<view class="module-empty-note">当前开放“一件代发合托”和“集装箱拣货”两条真实作业流程。</view>
<view class="module-empty-note">当前展示“一件代发合托”“出库拣货”和“库位查询”。</view>
</view>
</view>
</template>
@@ -18,14 +18,21 @@
export default {
components: { PortalHeader },
data() { return { user: session.currentUser, moduleKey: 'outbound', overview: getPickingOverview() } },
computed: { currentModule() { return MODULES.find((module) => module.key === this.moduleKey) || MODULES[0] } },
computed: {
currentModule() {
const module = MODULES.find((item) => item.key === this.moduleKey) || MODULES[0]
return { ...module, operations: module.operations.filter((operation) => operation.visible) }
}
},
onLoad(options) { this.moduleKey = options.key || 'outbound' },
onShow() { if (!requireSession()) return; this.user = session.currentUser; this.overview = getPickingOverview() },
methods: {
openOperation(operation) {
if (!operation.available) return
const routes = { '一件代发合托': '/pages/dropship-tasks/dropship-tasks', '集装箱拣货': '/pages/tasks/tasks' }
uni.navigateTo({ url: routes[operation.name] || '/pages/operation/operation' })
const routes = { '一件代发合托': '/pages/dropship-tasks/dropship-tasks', '出库拣货': '/pages/tasks/tasks' }
const url = routes[operation.name]
|| `/pages/operation/operation?module=${encodeURIComponent(this.moduleKey)}&name=${encodeURIComponent(operation.name)}`
uni.navigateTo({ url })
}
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<view class="app-header">
<view class="header-top">
<button class="header-back" aria-label="返回上一页" @tap="leavePicking">‹</button>
<text class="header-title">集装箱拣货</text>
<text class="header-title">出库拣货</text>
<view class="header-actions">
<text class="header-badge">{{ currentUser.warehouse }}</text>
</view>