This commit is contained in:
2026-08-31 17:10:46 +08:00
parent 410802870d
commit e686e13772
8 changed files with 39 additions and 47 deletions
+4 -9
View File
@@ -14,12 +14,11 @@
<view v-else-if="!tasks.length && !error" class="task-state">暂无待处理的拣货任务</view>
<view v-if="notice" class="task-notice" role="status">{{ notice }}</view>
<view class="task-list">
<button v-for="task in tasks" :key="task.taskId" class="task-card" :disabled="!isTaskReady(task)" :aria-label="`${taskActionLabel(task)},集装箱号 ${displayBusinessValue(task.currentContainerNo)}`" @tap="enterTask(task)">
<button v-for="task in tasks" :key="task.taskId" class="task-card" :disabled="!isTaskReady(task)" :aria-label="`${taskActionLabel(task)},${containerReference(task)}`" @tap="enterTask(task)">
<view class="task-card-head">
<view class="task-container-info"><text class="task-label">集装箱号</text><text class="task-code">{{ displayBusinessValue(task.currentContainerNo) }}</text></view>
<view class="task-container-info"><text class="task-code">{{ containerReference(task) }}</text></view>
<text class="task-status" :class="{ progress: task.workflowStatus === 'IN_PROGRESS', evidence: task.workflowStatus === 'AWAITING_REVIEW', processing: task.workflowStatus === 'PROCESSING', failed: task.workflowStatus === 'COMPLETION_FAILED' }">{{ statusLabel(task.workflowStatus) }}</text>
</view>
<view class="task-identifiers"><text class="task-cabinet">柜次号 {{ displayBusinessValue(task.cabinetNo) }}</text><text class="task-order">{{ businessReference(task) }}</text></view>
<view class="task-card-foot">
<view class="task-meta-group"><text class="task-warehouse">仓库 {{ displayBusinessValue(task.warehouseName, '未关联') }}</text><text class="task-pending">待处理 {{ task.pendingItemCount ?? task.itemCount ?? 0 }} 项</text></view>
<view class="task-enter"><text>{{ taskActionLabel(task) }}</text><text class="task-enter-arrow">›</text></view>
@@ -37,7 +36,7 @@
import { session, requireSession } from '@/stores/session.js'
import { clearPickingDraft } from '@/stores/picking.js'
import { isOnline, watchNetwork } from '@/utils/network.js'
import { businessReference, displayBusinessValue, formatApiError } from '@/utils/user-facing.js'
import { containerReference, displayBusinessValue, formatApiError } from '@/utils/user-facing.js'
export default {
components: { PortalHeader },
@@ -47,7 +46,7 @@
onUnload() { if (this._stopNetwork) this._stopNetwork(); clearTimeout(this._toastTimer) },
methods: {
displayBusinessValue,
businessReference,
containerReference,
statusLabel(status) {
if (status === 'PROCESSING') return '完成处理中'
if (status === 'COMPLETION_FAILED') return '完成失败'
@@ -106,16 +105,12 @@
.task-card[disabled] { opacity: .62; }
.task-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-container-info { display: flex; min-width: 0; flex-direction: column; }
.task-label { color: #667085; font-size: 10px; line-height: 15px; }
.task-code { margin-top: 1px; color: #12233f; font-size: 17px; font-weight: 700; line-height: 23px; overflow-wrap: anywhere; }
.task-status { flex-shrink: 0; padding: 4px 7px; border-radius: 99px; color: #52616f; font-size: 10px; line-height: 16px; background: #eef2f6; }
.task-status.progress { color: #155eef; background: #eff4ff; }
.task-status.evidence { color: #9a5b13; background: #fff4e5; }
.task-status.processing { color: #155eef; background: #eff4ff; }
.task-status.failed { color: #b42318; background: #fff1f0; }
.task-identifiers { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 8px; }
.task-cabinet, .task-order { padding: 3px 7px; border-radius: 5px; color: #475467; font-size: 11px; line-height: 17px; background: #f2f4f7; }
.task-order { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.task-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f5; }
.task-meta-group { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.task-warehouse { color: #667085; font-size: 10px; line-height: 15px; overflow-wrap: anywhere; }