This commit is contained in:
2026-08-17 15:55:17 +08:00
parent bab911028d
commit db43e3049a
3 changed files with 30 additions and 9 deletions
+10 -6
View File
@@ -170,7 +170,7 @@
<text class="remote-error" role="alert">{{ remoteError }}</text>
<button class="evidence-retry-btn" :disabled="remoteLoading" @tap="refreshTask">刷新任务</button>
</view>
<button class="submit-btn" aria-label="提交拣货完成" :disabled="submitting || completedBoxes[currentBoxIndex] || pickingCompleted || !summary.canSubmit" @tap="submitPicking">
<button class="submit-btn" aria-label="提交拣货完成" :disabled="submitting || pickingCompleted || !summary.canSubmit" @tap="submitPicking">
{{ submitting ? '正在提交…' : submitButtonText }}
</button>
</view>
@@ -421,7 +421,8 @@
return this.boxes.length - this.completedCount
},
pickingCompleted() {
if (this.remotePick) {
if (this.remoteTaskId || this.currentBox.taskId) {
if (!this.remotePick) return false
const hasServerPending = this.currentBox.items.some((item) => ['PENDING', 'PICKING'].includes(item.itemStatus))
return isPickingCompleteTask(this.remotePick) && !hasServerPending
}
@@ -469,10 +470,10 @@
return ''
},
submitButtonText() {
return this.completedBoxes[this.currentBoxIndex] || this.pickingCompleted ? '该柜次已完成' : this.summary.buttonText
return this.pickingCompleted ? '该柜次已完成' : this.summary.buttonText
},
submitStatusHint() {
if (this.completedBoxes[this.currentBoxIndex] || this.pickingCompleted) return '本柜次任务已完成'
if (this.pickingCompleted) return '本柜次任务已完成'
if (!this.summary.canSubmit) return '请先处理至少一件'
if (this.summary.pending > 0) return '提交时需选择原因'
return `已处理 ${this.summary.processed}/${this.summary.total}`
@@ -503,6 +504,9 @@
onLoad(options = {}) {
if (!requireSession()) return
if (options.taskId) {
// A local completion marker belongs to the previously opened task. The
// canonical server detail decides whether this task is complete.
this.completedBoxes = {}
this.boxes = [{
boxNo: String(options.currentContainerNo || options.cabinetNo || '同步中'), cabinetNo: options.cabinetNo ? String(options.cabinetNo) : null, currentContainerNo: options.currentContainerNo ? String(options.currentContainerNo) : null, orderNo: String(options.orderNo || options.inboundCode || ''),
taskId: String(options.taskId), loadingPlanId: null, containerBookingId: null,
@@ -1305,7 +1309,7 @@
} catch (error) {
if (!this.isEvidenceContextActive(contextId, identity)) return
if (this.isTaskConflict(error)) {
await this.refreshAfterTaskConflict(error.message || '装柜前置条件已变化,请刷新后重试')
await this.refreshAfterTaskConflict(error.message || '订舱、装柜关联或证据状态已变化,请刷新后重试')
return
}
this.remoteError = error.network ? '网络失败,装柜完成未提交' : (error.message || '装柜完成失败')
@@ -1434,7 +1438,7 @@
},
submitPicking() {
if (!this.requirePickingOperation()) return
if (!this.summary.canSubmit || this.completedBoxes[this.currentBoxIndex] || this.pickingCompleted) return
if (!this.summary.canSubmit || this.pickingCompleted) return
if (this.summary.pending > 0) {
this.selectedIncompleteReason = ''
this.openOverlay('submitConfirm')