From f747c5151051c12a1c44eaf5ef49f0a3805702b0 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期日, 09 十一月 2025 10:22:53 +0800
Subject: [PATCH] 1
---
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 53 insertions(+), 6 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
index 8a38acf..33c3072 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue"
@@ -14,7 +14,7 @@
<!-- 鎵樼洏淇℃伅鏄剧ず -->
<div class="tray-info" v-if="trayBarcode">
- <i class="el-icon-s-management"></i> 褰撳墠鎵樼洏: {{ trayBarcode }}
+ <i class="el-icon-s-management"></i> 褰撳墠鏂欑: {{ trayBarcode }}
<!-- <el-button
class="small-button"
type="text"
@@ -37,11 +37,11 @@
<!-- 鎵樼洏鏉$爜杈撳叆 -->
<div class="input-wrapper custom-input-group">
- <div class="input-label">鎵樼洏鏉$爜</div>
+ <div class="input-label">鏂欑鐮�</div>
<el-input
ref="trayInput"
v-model="trayBarcode"
- placeholder="璇锋壂鎻忔垨杈撳叆鎵樼洏鏉$爜鍚庢寜鍥炶溅閿�"
+ placeholder="璇锋壂鎻忔垨杈撳叆鏂欑鐮佸悗鎸夊洖杞﹂敭"
clearable
@keyup.enter.native="handleTraySubmit"
@clear="handleTrayClear"
@@ -49,7 +49,7 @@
class="custom-input"
>
<template slot="prepend">
- <span>鎵樼洏鏉$爜</span>
+ <span> 鏂欑鐮�</span>
</template>
<template slot="append">
<el-button
@@ -95,7 +95,7 @@
</div>
<div class="input-tips">
- <p>鎻愮ず锛氬厛杈撳叆鎵樼洏鏉$爜锛岀劧鍚庤緭鍏ョ墿鏂欐潯鐮�</p>
+ <p>鎻愮ず锛氬厛杈撳叆鏂欑鐮侊紝鐒跺悗杈撳叆鐗╂枡鏉$爜</p>
</div>
@@ -126,6 +126,8 @@
<span><i class="el-icon-tickets"></i> 缁勭洏鏁版嵁</span>
<span class="list-actions">
<el-tag type="primary">鍏� {{ materials.length }} 鏉¤褰�</el-tag>
+ <el-tag type="primary">宸茬粍鐩� {{ totalStockCount }}</el-tag>
+ <el-tag type="primary">搴撳瓨鏁伴噺 {{ totalStockSum }}<span>{{ uniqueUnit }}</span></el-tag>
<el-tag v-if="trayBarcode" type="success">鎵樼洏: {{ trayBarcode }}</el-tag>
<!-- <el-button
v-if="materials.length > 0"
@@ -147,7 +149,7 @@
<div v-if="materials.length === 0" class="empty-state">
<i class="el-icon-document"></i>
- <p v-if="!trayBarcode">璇峰厛杈撳叆鎵樼洏鏉$爜</p>
+ <p v-if="!trayBarcode">璇峰厛杈撳叆鏂欑鏉$爜</p>
<p v-else>鏆傛棤鐗╂枡鏁版嵁锛岃鎵弿鎴栬緭鍏ョ墿鏂欐潯鐮�</p>
</div>
@@ -197,6 +199,7 @@
import VolTable from '@/components/basic/VolTable.vue';
import { ElLoading, ElMessage,ElMessageBox } from 'element-plus';
import { ref, onMounted, onUnmounted } from 'vue'
+import InboundOrder from '../../../views/inbound/inboundOrder.vue';
export default {
name: 'BarcodeScanner',
@@ -225,6 +228,13 @@
scanTimer: null,
manualInputTimer: null,
scanTarget: 'tray', // 褰撳墠鎵爜鐩爣: tray 鎴� material
+
+ // 搴撳瓨缁熻鐩稿叧鍙橀噺
+ totalStockSum: 0,
+ totalStockCount: 0,
+ uniqueUnit: '',
+ sumLoading: false,
+ sumError: ''
}
},
computed: {
@@ -245,6 +255,7 @@
this.$nextTick(() => {
setTimeout(() => {
this.focusTrayInput();
+ this.fetchStockStatistics(); // 鍔犺浇缁熻鏁版嵁
}, 300);
});
}
@@ -263,6 +274,7 @@
this.palletForm = { palletCode: '', barcode: '' };
this.backData = [];
this.$refs.palletForm?.reset();
+ this.fetchStockStatistics(); // 鍗曟嵁鍙峰彉浜嗭紝鍒锋柊缁熻
}
}
},
@@ -283,6 +295,37 @@
this.clearAllTimers();
},
methods: {
+ // 鏂板锛氭煡璇㈠悗绔簱瀛樼粺璁℃暟鎹紙璋冪敤涔嬪墠鐨� SumQuantity 鎺ュ彛锛�
+ async fetchStockStatistics() {
+ // 鍗曟嵁鍙蜂负绌烘椂涓嶆煡璇�
+ if (!this.docNo) {
+ this.sumError = '鍗曟嵁鍙蜂负绌猴紝鏃犳硶缁熻';
+ return;
+ }
+
+ this.sumLoading = true;
+ this.sumError = '';
+ try {
+ // 璋冪敤鍚庣缁熻鎺ュ彛锛堟浛鎹负浣犵殑瀹為檯鎺ュ彛璺緞锛�
+ const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo='+this.docNo, {
+
+ });
+
+ // 缁戝畾鏁版嵁锛堝尮閰� PalletSumQuantityDTO 缁撴瀯锛�
+ if (response.data) {
+ this.totalStockSum = response.data.stockSumQuantity || 0; // 鎬诲簱瀛樻暟閲�
+ this.totalStockCount = response.data.stockCount || 0; // 鎬诲簱瀛樿褰曟暟
+ this.uniqueUnit = response.data.uniqueUnit || ''; // 璁¢噺鍗曚綅
+ }
+ } catch (err) {
+ this.sumError = '缁熻鍔犺浇澶辫触';
+ this.totalStockSum = 0;
+ this.totalStockCount = 0;
+ console.error('搴撳瓨缁熻鏌ヨ寮傚父锛�', err);
+ } finally {
+ this.sumLoading = false;
+ }
+ },
// 閲嶇疆鎵�鏈夋暟鎹�
resetData() {
console.log('閲嶇疆寮规鏁版嵁');
@@ -298,6 +341,10 @@
this.currentFocus = 'tray';
this.scanTarget = 'tray';
this.clearAllTimers();
+ this.totalStockSum = 0;
+ this.totalStockCount = 0;
+ this.sumLoading = false;
+ this.sumError = '';
},
// 娓呴櫎鎵�鏈夎鏃跺櫒
--
Gitblit v1.9.3