From df7ba01211bf09e73c253352c8df4d9521d079db Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Tue, 23 Jun 2026 18:43:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9A=8F=E6=9C=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=A8=A1=E5=9D=97=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=95=A3?= =?UTF-8?q?=E5=8D=95=E5=A4=8D=E6=A0=B8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/page-nav/page-nav.vue | 20 +- core/request/apis.js | 12 + pages/work/order/order-review.vue | 9 +- pages/work/storage/random-storage.vue | 598 +++++++++++++++++++++++--- 4 files changed, 574 insertions(+), 65 deletions(-) diff --git a/components/page-nav/page-nav.vue b/components/page-nav/page-nav.vue index e683ca8..6ce2119 100644 --- a/components/page-nav/page-nav.vue +++ b/components/page-nav/page-nav.vue @@ -4,7 +4,7 @@ - + @@ -21,20 +21,30 @@ export default { props: { title: String, + showBack: { + type: Boolean, + default: undefined + } }, data() { return { - showBack: true, // 默认显示返回按钮 + internalShowBack: true, // 默认显示返回按钮 pagesLength: 0 } }, + computed: { + effectiveShowBack() { + // 如果父组件显式传了 showBack,优先使用;否则用自动检测值 + return this.showBack !== undefined ? this.showBack : this.internalShowBack; + } + }, methods: { checkPagesLength() { // 获取当前页面栈 const pages = getCurrentPages(); this.pagesLength = pages.length; - this.showBack = pages.length > 1; - console.log('当前页面栈长度:', pages.length, '显示返回按钮:', this.showBack); + this.internalShowBack = pages.length > 1; + console.log('当前页面栈长度:', pages.length, '显示返回按钮:', this.internalShowBack); }, back() { console.log("返回"); @@ -43,7 +53,7 @@ return; } - if (this.showBack) { + if (this.effectiveShowBack) { // 有上一页,正常返回 uni.navigateBack({ delta: 1, diff --git a/core/request/apis.js b/core/request/apis.js index 4f8aedc..3d1230d 100644 --- a/core/request/apis.js +++ b/core/request/apis.js @@ -182,6 +182,18 @@ export default { auth: true, method: "POST", isSystemApi: true + }, + addItem: { + path: "storage.directInbound.addItem", + auth: true, + method: "POST", + isSystemApi: true + }, + commit: { + path: "storage.directInbound.commit", + auth: true, + method: "POST", + isSystemApi: true } } }, diff --git a/pages/work/order/order-review.vue b/pages/work/order/order-review.vue index c124462..132f807 100644 --- a/pages/work/order/order-review.vue +++ b/pages/work/order/order-review.vue @@ -189,6 +189,7 @@ 打印模式 0 ? Math.round(kg * 1000) : 0; console.log('[refWeightG] itemsWeight:', this.detailInfo?.itemsWeight, 'kg:', kg, 'g:', g); return g; + }, + effectivePrintMode() { + // 散单模式只走先复核后打印 + return this.listType === 'single' ? 'reviewFirst' : this.printMode; } }, onLoad(options) { @@ -1816,7 +1821,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; this.listExpanded = false; // 先打印后复核:进入详情时自动触发未打印订单的打印 - if (this.printMode === 'printFirst' && this.printStationId) { + if (this.effectivePrintMode === 'printFirst' && this.printStationId) { const isGroup = this.listType === 'group'; const isAlreadyPrinted = isGroup ? (item.unprintedCount || 0) === 0 && (item.orderCount || 0) > 0 @@ -1866,7 +1871,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; listType: this.detailInfo.listType }); // 先复核后打印:复核完成后发送未打印订单的打印 - if (this.printMode === 'reviewFirst' && this.printStationId) { + if (this.effectivePrintMode === 'reviewFirst' && this.printStationId) { const isGroup = this.detailInfo?.listType === 'group'; const isAlreadyPrinted = isGroup ? (this.detailInfo?.unprintedCount || 0) === 0 && (this.detailInfo?.orderCount || 0) > 0 diff --git a/pages/work/storage/random-storage.vue b/pages/work/storage/random-storage.vue index 9eaa359..24820d8 100644 --- a/pages/work/storage/random-storage.vue +++ b/pages/work/storage/random-storage.vue @@ -1,8 +1,11 @@