From 31f2ba0c850f3455ef943dc574987fb6fa68aabc Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Fri, 6 Nov 2026 21:02:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(pda):=20=E4=BF=AE=E5=A4=8D=E6=B5=B7?= =?UTF-8?q?=E5=A4=96=E4=BD=9C=E4=B8=9A=E5=85=BC=E5=AE=B9=E6=80=A7=E5=B9=B6?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=89=AB=E7=A0=81=E4=B8=8E=E8=A3=85=E8=BD=A6?= =?UTF-8?q?=E6=94=B6=E5=B0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/receiving-adapter.js | 2 + src/components/DispatchLoadingDocuments.vue | 5 +- src/components/ReceivingSessionSummary.vue | 3 +- src/components/ScanTargetInput.vue | 13 ++- src/manifest.json | 4 +- src/pages/dispatch/dispatch.vue | 23 ++--- src/pages/operation/operation.vue | 13 +-- src/utils/dispatch-time.js | 31 ++++++ tests/business-identifiers-ui.test.mjs | 10 ++ tests/dispatch-loading-documents.test.mjs | 15 +++ tests/dispatch-workflow.test.mjs | 102 +++++++++++++++++++- tests/multi-plan-receiving.test.mjs | 2 + tests/receiving-adapter.test.mjs | 9 ++ tests/receiving-lifecycle.test.mjs | 25 +++++ 14 files changed, 227 insertions(+), 30 deletions(-) create mode 100644 src/utils/dispatch-time.js diff --git a/src/api/receiving-adapter.js b/src/api/receiving-adapter.js index e7e0925..eda9108 100644 --- a/src/api/receiving-adapter.js +++ b/src/api/receiving-adapter.js @@ -62,6 +62,7 @@ export function normalizeReceivingCandidate(value = {}) { ...value, sourceContainerBookingId: typeof value.sourceContainerBookingId === 'string' ? value.sourceContainerBookingId.trim() : '', containerNo: String(value.containerNo || '').trim(), + cabinetNo: text(value.cabinetNo), overseasWarehouseCode: text(value.overseasWarehouseCode), overseasWarehouseName: text(value.overseasWarehouseName), plannedArrivalAt: typeof value.plannedArrivalAt === 'string' && value.plannedArrivalAt.trim() ? value.plannedArrivalAt.trim() : null, @@ -95,6 +96,7 @@ export function normalizeReceivingSession(value) { ...value, overseasWarehouseCode: text(value.overseasWarehouseCode), overseasWarehouseName: text(value.overseasWarehouseName), + cabinetNo: text(value.cabinetNo), photos: RECEIVING_PHOTO_ROLES.map((role) => photos.find((photo) => photo?.role === role && photo?.fileId)).filter(Boolean), domesticLoadingPhotos, totalPackages: number(value.totalPackages), diff --git a/src/components/DispatchLoadingDocuments.vue b/src/components/DispatchLoadingDocuments.vue index 1160a5c..9c641ce 100644 --- a/src/components/DispatchLoadingDocuments.vue +++ b/src/components/DispatchLoadingDocuments.vue @@ -91,10 +91,11 @@ export default { throw cause } saved++; await this.previews() + if (!this.editable) break } uni.showToast({ title: this.snapshot.stage === 'DELIVERING' && this.snapshot.complete ? '资料齐全,已进入派送中' : `已保存${saved}张照片`, icon: 'none' }) }) - if ((saved || reconciled) && this.active) this.$emit('saved') + if ((saved || reconciled) && this.active) this.$emit('saved', this.snapshot) }, preview(url) { uni.previewImage({ current: url, urls: [url] }) }, async viewPdf(photo) { @@ -117,7 +118,7 @@ export default { try { this.ensureScope(); saved = await work() === true } catch (cause) { if (this.active && !String(cause.errMsg || '').includes('cancel')) { this.error = toDispatchError(cause, '装车资料操作失败,请重新操作') } } finally { if (this.active) { this.busy = false; this.$emit('busy-change', false) } } - if (saved && notify && this.active) this.$emit('saved') + if (saved && notify && this.active) this.$emit('saved', this.snapshot) } } } diff --git a/src/components/ReceivingSessionSummary.vue b/src/components/ReceivingSessionSummary.vue index 23f5d88..24cea55 100644 --- a/src/components/ReceivingSessionSummary.vue +++ b/src/components/ReceivingSessionSummary.vue @@ -1,7 +1,7 @@