From cbb173ba16980f1ff5d5cb1796f6ee0e900f734b Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Fri, 29 May 2026 18:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E7=94=A8=EF=BC=9Aprint.getList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/work/order/scatter-picking-detail.vue | 41 ++++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/pages/work/order/scatter-picking-detail.vue b/pages/work/order/scatter-picking-detail.vue index 94b8b66..f3e22f6 100644 --- a/pages/work/order/scatter-picking-detail.vue +++ b/pages/work/order/scatter-picking-detail.vue @@ -103,7 +103,8 @@ onlyMine: false, currentUserId: '', showPrintPopup: false, - printStationName: '默认打印台', + printStationName: '--', + printStationList: [], printMessage: '', pendingPrintCount: 0, orderList: [] @@ -156,6 +157,32 @@ this.safeDispatchBroadcast('stop'); }, methods: { + buildPrintRecordWhere() { + return {}; + }, + buildPrintRecordParams() { + return { + page: 1, + pageSize: 20, + where: this.buildPrintRecordWhere() + }; + }, + extractPrintRecordList(response) { + const list = response?.data?.list || response?.data?.data?.list; + return Array.isArray(list) ? list : []; + }, + normalizePrintStationNames(list) { + return list + .map(item => String(item?.name || '').trim()) + .filter(name => !!name); + }, + async loadPrintStations() { + const response = await this.$http('print.getList', this.buildPrintRecordParams()); + const list = this.extractPrintRecordList(response); + const names = this.normalizePrintStationNames(list); + this.printStationList = names; + this.printStationName = names.length ? names.join('、') : '--'; + }, safeDispatchBroadcast(action, payload) { try { const task = this.$store.dispatch(`broadcast/${action}`, payload); @@ -443,7 +470,7 @@ ]; this.$tools.routerTo(`/pages/work/order/scatter-pick-goods-detail?${params.join('&')}`); }, - handlePrintAllUnreviewed() { + async handlePrintAllUnreviewed() { const targetList = this.displayOrderList.filter(item => Number(item.unreviewedCount || 0) > 0); if (!targetList.length) { uni.showToast({ @@ -452,6 +479,16 @@ }); return; } + try { + await this.loadPrintStations(); + } catch (error) { + this.printStationList = []; + this.printStationName = '--'; + uni.showToast({ + title: '打印台加载失败', + icon: 'none' + }); + } this.pendingPrintCount = targetList.length; this.printMessage = `待打印未复核订单 ${targetList.length} 条`; this.showPrintPopup = true;