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_MouldProdBackBillEdit.vue | 91 +++++++++
src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue | 95 +++++++++
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue | 92 +++++++++
src/views/scMould/warehouse/Sc_MouldInRequestBillEdit.vue | 90 +++++++++
src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue | 109 +++++++++-
src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue | 91 +++++++++
6 files changed, 553 insertions(+), 15 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: {
diff --git a/src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue b/src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue
index d2d169a..a5ad3a4 100644
--- a/src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue
+++ b/src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue
@@ -202,6 +202,8 @@
<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>
@@ -233,6 +235,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;"
@@ -732,6 +739,91 @@
});
},
/** 淇敼鎸夐挳鎿嶄綔 */
+
+ //#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
handleUpdate() {
this.reset()
let rowHmainid = this.linterid
diff --git a/src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue b/src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue
index 4c4ffb2..3fed1f3 100644
--- a/src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue
+++ b/src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue
@@ -202,6 +202,8 @@
<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>
@@ -233,6 +235,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;"
@@ -710,6 +717,91 @@
this.$emit('editClose', 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
//鏍规嵁鐢ㄦ埛鑾峰彇瀵瑰簲鑱屽憳銆侀儴闂ㄣ�侀攢鍞富绠�
getCzyglByUser() {
axios.get(this.$baseUrl + '/Xs_SeOrderBill/getCzyglByUser', {
@@ -937,6 +1029,8 @@
this.editData.push(copyRow);
}
},
+
+
handleMoveRowUp(zbSelForm) {
if (!this.zbIndex) {
this.$modal.msgError("璇烽�夋嫨涓�琛屾暟鎹�")
@@ -987,20 +1081,7 @@
this.$refs.zbTable.toggleRowSelection(del_row, false) //璁剧疆杩欎竴琛屽彇娑堥�変腑
}
},
-
- //#region 鏌ョ湅瀹瑰櫒搴撳瓨
- get_ICInventoryMould(zbSelForm) {
- if (!this.zbIndex) {
- this.$modal.msgError("璇烽�夋嫨涓�琛屾暟鎹�")
- } else {
- var index = zbSelForm.index-1;
- this.ICInventoryMouldShow = true
- this.$nextTick(() => {
- this.$refs.ICInventoryMould.open(this.editData[index]);
- })
- }
- },
- //#endregion
+
// 缂栬緫鎻愪氦淇濆瓨
submitForm() {
diff --git a/src/views/scMould/warehouse/Sc_MouldProdBackBillEdit.vue b/src/views/scMould/warehouse/Sc_MouldProdBackBillEdit.vue
index 3963759..cc30729 100644
--- a/src/views/scMould/warehouse/Sc_MouldProdBackBillEdit.vue
+++ b/src/views/scMould/warehouse/Sc_MouldProdBackBillEdit.vue
@@ -207,6 +207,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>
@@ -238,6 +239,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">
<span>{{ scope.row.HQtyMust }}</span>
@@ -882,6 +888,91 @@
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: {
diff --git a/src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue b/src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue
index 9fdfccc..139b13e 100644
--- a/src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue
+++ b/src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue
@@ -224,6 +224,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>
@@ -255,6 +256,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 }}
+ </template>
+ </el-table-column>
<el-table-column align="center" label="搴斿彂鏁伴噺" width="120">
<template slot-scope="scope">
<span>{{ scope.row.HQtyMust }}</span>
@@ -721,6 +727,91 @@
this.editData = rowdata
},
//寮圭獥璧嬪��
+
+ //#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
dbEmitData(deptRow, num) {
// num=1閮ㄩ棬 num=2浠撳簱
console.log(33,deptRow)
diff --git a/src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue b/src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue
index 3bad298..6af902a 100644
--- a/src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue
+++ b/src/views/scMould/warehouse/Sc_MouldProdOutBillEdit.vue
@@ -207,6 +207,9 @@
<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>
@@ -238,6 +241,13 @@
<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">
<span>{{ scope.row.HQtyMust }}</span>
@@ -1151,8 +1161,91 @@
}
},
//#endregion
+
+ //#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
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
--
Gitblit v1.9.1