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 @@