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 |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 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 1f42f05..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"
@@ -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"
@@ -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