From a605b6e19e1ddeae06f2f5bdc35395daece8a12c Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 17 十二月 2025 11:07:34 +0800
Subject: [PATCH] 1

---
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue          |   57 ++--------------------------
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs |    7 +++
 2 files changed, 11 insertions(+), 53 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 244102a..ee375f5 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"
@@ -266,7 +266,6 @@
         this.resetData();
         this.$nextTick(() => {
           setTimeout(() => {
-            this.fetchStockStatistics(); // 鍔犺浇缁熻鏁版嵁
             this.fetchUnpalletMaterialDetails();
           }, 300);
         });
@@ -286,18 +285,12 @@
         this.palletForm = { palletCode: '', barcode: '' };
         this.backData = [];
         this.$refs.palletForm?.reset();
-        this.fetchStockStatistics(); // 鍗曟嵁鍙峰彉浜嗭紝鍒锋柊缁熻
         this.fetchUnpalletMaterialDetails();
       }
     }
   },
   mounted() {
-
     document.addEventListener('keypress', this.handleKeyPress);
-
-    setTimeout(() => {
-      this.focusLocationSelect();
-    }, 300);
   },
   beforeDestroy() {
     document.removeEventListener('keypress', this.handleKeyPress);
@@ -306,9 +299,9 @@
   methods: {
     open() {
       this.show = true;
+      this.resetData();
       this.initLocationTypes();
       this.initwarehouseTypes();
-      this.fetchStockStatistics();
       this.fetchUnpalletMaterialDetails();
     },
     validateLocationType(rule, value, callback) {
@@ -361,9 +354,9 @@
       }
     },
 
-    async fetchStockStatistics() {
+    async fetchStockStatistics(orderNo) {
       // 鍗曟嵁鍙蜂负绌烘椂涓嶆煡璇�
-      if (!this.docNo) {
+      if (!orderNo) {
         this.sumError = '鍗曟嵁鍙蜂负绌猴紝鏃犳硶缁熻';
         return;
       }
@@ -371,7 +364,7 @@
       this.sumLoading = true;
       this.sumError = '';
       try {
-        const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo=' + this.orderNo, {});
+        const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo=' + orderNo, {});
         if (response.data) {
           this.totalStockSum = response.data.stockSumQuantity || 0;
           this.totalStockCount = response.data.stockCount || 0;
@@ -644,7 +637,6 @@
       this.error = '';
       this.loading = true;
 
-      console.log(currentBarcode);
       try {
         // 璋冪敤API鏌ヨ鐗╂枡淇℃伅
         const materialData = await this.fetchMaterialData(currentBarcode);
@@ -663,8 +655,7 @@
           });
         });
         this.orderNo = materialData[0].orderNo;
-
-        this.fetchStockStatistics();
+        await this.fetchStockStatistics(materialData[0].orderNo);
         // 娓呯┖鐗╂枡杈撳叆妗嗗苟淇濇寔鑱氱劍
         this.barcode = '';
         this.scanCode = ''; // 娓呯┖鎵爜缂撳瓨
@@ -772,44 +763,6 @@
       }, 100);
 
       this.lastKeyTime = currentTime;
-    },
-
-    // 鍒犻櫎鐗╂枡
-    removeMaterial(index) {
-      this.$confirm('纭畾瑕佸垹闄よ繖鏉$墿鏂欒褰曞悧?', '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
-      }).then(() => {
-        this.materials.splice(index, 1);
-        this.$message({
-          type: 'success',
-          message: '鍒犻櫎鎴愬姛!'
-        });
-        this.fetchStockStatistics();
-
-      }).catch(() => {
-        // 鍙栨秷鍒犻櫎
-      });
-    },
-
-    // 娓呯┖鎵�鏈夌墿鏂�
-    clearAllMaterials() {
-      if (this.materials.length === 0) return;
-
-      this.$confirm('纭畾瑕佹竻绌烘墍鏈夌墿鏂欒褰曞悧?', '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
-      }).then(() => {
-        this.materials = [];
-        this.$message({
-          type: 'success',
-          message: '宸叉竻绌烘墍鏈夎褰�!'
-        });
-      }).catch(() => {
-        // 鍙栨秷娓呯┖
-      });
     },
 
     // 鏍煎紡鍖栨椂闂�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
index 01502e4..2d8b63c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs"
@@ -90,6 +90,11 @@
                     stockInfo.Details = new List<Dt_StockInfoDetail>();
                 }
 
+                if (stockInfo != null && stockInfo.Details.Count>0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
+                {
+                    return content.Error($"璇ユ墭鐩樼粍鐩樹粨搴撲负{stockInfo.Details.FirstOrDefault()?.WarehouseCode}涓庡綋鍓嶄粨搴搟palletDto.WarehouseType}涓嶄竴鑷达紝涓嶅厑璁哥粍鐩�");
+                }
+
                 foreach (var item in details)
                 {
                     stockInfo.Details.Add(new Dt_StockInfoDetail
@@ -136,7 +141,7 @@
                 {
                     Dt_StockInfo? NewstockInfo = await _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.PalletCode == palletDto.PalletCode).FirstAsync();
 
-                    return WebResponseContent.Instance.OK(data: NewstockInfo.Details);
+                    return WebResponseContent.Instance.OK(data: NewstockInfo.Details.OrderByDescending(x => x.Id));
                 }
                 else
                 {

--
Gitblit v1.9.3