From fd9d75b6d9c8ce5b36afd46c2751164259af24ee Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期六, 28 二月 2026 15:02:52 +0800
Subject: [PATCH] 增加了容器及时库存

---
 src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue b/src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue
index 7b896ff..b5f9c24 100644
--- a/src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue
+++ b/src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue
@@ -185,6 +185,7 @@
             <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)"
               size="mini">涓嬬Щ</el-button>
             <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">瀹瑰櫒搴撳瓨</el-button>
+            <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">瀹瑰櫒鍗虫椂搴撳瓨</el-button>
           </div>
           <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable"
             @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border>
@@ -216,6 +217,11 @@
                 <span>{{ scope.row.HUnitName }}</span>
               </template>
             </el-table-column>
+               <el-table-column align="center" label="搴撳瓨鏁伴噺" width="120">
+            <template slot-scope="scope">
+                {{ scope.row.KuHQty || 0 }}
+            </template>
+          </el-table-column>
             <el-table-column align="center" label="鏁伴噺" width="120">
               <template slot-scope="scope">
                 <el-input-number v-model="scope.row.HQty" :min="1" style="width: 90px;"
@@ -646,6 +652,90 @@
         this.formLoading = false
       })
     },
+    //#region 鏌ョ湅瀹瑰櫒鍗虫椂搴撳瓨
+  async get_ContainerInstantStock(zbSelForm) {
+    if (!this.zbIndex) {
+      this.$modal.msgError("璇烽�夋嫨涓�琛屾暟鎹�");
+      return;
+    }
+    
+    var index = zbSelForm.index - 1;
+    const rowData = this.editData[index];
+    
+    if (rowData.HMaterID==0) {
+      this.$modal.msgError("璇峰厛閫夋嫨瀹瑰櫒");
+      return;
+    }
+    
+    const whId = rowData.HWHID || this.form.HWHID;
+    if (!whId || whId == 0) {
+      this.$modal.msgError("璇峰厛閫夋嫨鏈夋晥鐨勪粨搴�");
+      return;
+    }
+    
+    try {
+      this.$modal.loading("姝e湪鏌ヨ搴撳瓨...");
+      
+      // 鑾峰彇浠撳簱鍚嶇О
+      const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
+        params: { 
+          "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`,
+          "user": sessionStorage["HUserName"],
+          "ModRightNameCheck": ""
+        }
+      });
+      
+      const whName = whResponse.data.data[0]?.HName;
+      if (!whName) {
+        this.$modal.closeLoading();
+        this.$modal.msgError("鏈壘鍒颁粨搴撲俊鎭�");
+        return;
+      }
+      
+      // 鑾峰彇鎵�鏈夊簱瀛樻暟鎹�
+      var sql = "exec h_p_Kf_ICInventory_Mould ''";
+      const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
+        params: { 
+          "sql": sql,
+          "user": sessionStorage["HUserName"],
+          "ModRightNameCheck": ""
+        }
+      });
+      
+      let totalQty = 0;
+      
+      if (response.data.count == 1 && response.data.data) {
+        // 鍩虹杩囨护锛氬鍣↖D + 浠撳簱鍚嶇О
+        let filteredData = response.data.data.filter(item => 
+          item['HMaterID'] == rowData.HMaterID && item['浠撳簱'] === whName
+        );
+        
+        // 濡傛灉鏈夊簱浣嶏紝鎸夊簱浣嶈繃婊�
+        if (rowData.HSPName) {
+          filteredData = filteredData.filter(item => item['浠撲綅'] === rowData.HSPName);
+        }
+        
+        // 璁$畻鎬诲簱瀛�
+        filteredData.forEach(item => {
+          totalQty += Number(item['搴撳瓨鏁伴噺'] || 0);
+        });
+      }
+      
+      // 鏇存柊褰撳墠琛岀殑搴撳瓨鏁伴噺
+      this.$set(this.editData, index, {
+        ...rowData,
+        KuHQty: totalQty
+      });
+      
+      this.$modal.closeLoading();
+      this.$modal.msgSuccess(`搴撳瓨鏌ヨ鎴愬姛锛屽綋鍓嶅簱瀛橈細${totalQty}`);
+      
+    } catch (error) {
+      this.$modal.closeLoading();
+      this.$modal.msgError("鏌ヨ搴撳瓨澶辫触");
+    }
+  },
+  //#endregion
     getHBillNo() {
       axios.get(this.$baseUrl + "/WEBSController/GetMaxBillNo_Json", {
         params: {

--
Gitblit v1.9.1