From 8309a2e0c6bf88b96027b45ce1dae7f8ce280057 Mon Sep 17 00:00:00 2001 From: zhangdi <1104545947@qq.com> Date: Wed, 6 May 2026 14:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/firstOrder/components/outDialog.vue | 52 +++++++++++-------- src/views/secondOrder/components/inDialog.vue | 2 +- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/views/firstOrder/components/outDialog.vue b/src/views/firstOrder/components/outDialog.vue index 5768003..66e2bd5 100644 --- a/src/views/firstOrder/components/outDialog.vue +++ b/src/views/firstOrder/components/outDialog.vue @@ -580,7 +580,7 @@ export default { item.materialCode === stat.materialCode && item.materialName === stat.materialName ); - console.log(898989,detailList) + console.log(898989, detailList); detail.theOutboundQuantity = detailList.reduce( (acc, cur) => acc + cur.num, 0 @@ -601,6 +601,7 @@ export default { }); }, changeDepartment() { + this.getStatistics(); }, batchclose() { @@ -767,7 +768,7 @@ export default { ); const deptName = selectedDept ? selectedDept.department : ""; - // this.sizeForm.inTableData = res.data.result.map((item) => ({ + // this.sizeForm.inTableData = res.data.result.map((item) => ({ // ...item, // IdDemandEndld: this.inBatchForm.batchType, // department: deptName, @@ -778,13 +779,13 @@ export default { const appQty = Number(item.applicationQuantity || 0); const outQty = Number(item.outboundQuantity || 0); const defaultQty = appQty - outQty; - + return { ...item, IdDemandEndld: this.inBatchForm.batchType, - department: deptName, // 注意:这里存的是名称还是ID需根据后续submit逻辑确认,原代码存的是名称 + // department: deptName, // 注意:这里存的是名称还是ID需根据后续submit逻辑确认,原代码存的是名称 // 设置本次出库数量默认值,且不能小于0 - theOutboundQuantity: defaultQty > 0 ? defaultQty : 0 + theOutboundQuantity: defaultQty > 0 ? defaultQty : 0, }; }); this.sizeForm.inTableData = processedData; @@ -914,26 +915,27 @@ export default { this.sizeForm.status = index; this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData; let arr = this.list.find( - (item) => item.departmentId === this.inBatchForm.department || {} + (item) => item.departmentId === this.inBatchForm.department ); - - + this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map( (row) => { const deptId = row.department; const dept = this.list.find((item) => item.departmentId === deptId); - - let select = this.materials.find( + + let select = this.statisticsList.find( (item) => item.materialId === row.materialId ); - const oneFormId = (this.sizeForm.options === 1&&this.outDialogTiltle == "编辑")? row.oneFormId:row.id; + console.log(99999,select) + const oneFormId = + this.sizeForm.options === 1 && this.outDialogTiltle == "编辑" + ? row.oneFormId + : select.id; return { ...row, - department: - this.sizeForm.options == "1" ? arr.departmentId : deptId, - departmentName: - this.sizeForm.options == "1" ? arr.department : dept.department, + department: deptId, + departmentName: dept.department, oneFormId: oneFormId, }; } @@ -941,10 +943,13 @@ export default { if (this.outDialogTiltle == "编辑") { this.sizeForm.id = this.id; } - if (this.sizeForm.options === 1) { + + if (this.sizeForm.options == 1) { this.sizeForm.optionType = this.inBatchForm.optionType; } + try { + console.log(this.sizeForm, "提交数据"); this.saveLoading = true; const res = await submitData(this.sizeForm); if (res.data.success) { @@ -980,7 +985,7 @@ export default { this.sizeForm.options = Number(ldOneOutStorage.options); this.sizeForm.optionType = ldOneOutStorage.optionType; this.batchSelectionVisible = false; - + this.inBatchForm.optionType = ldOneOutStorage.optionType if (this.sizeForm.options == 2 && this.sizeForm.optionType == "YH") { this.getMaterialList(); } @@ -999,16 +1004,16 @@ export default { this.consumableVisible = false; this.inBatchDialogVisible = false; this.batchSelectionVisible = false; - this.sizeForm.optionType = ""; this.batchTableData = []; - this.inBatchForm.batchType = "" - this.inBatchForm.department = "" - this.sizeForm.demandEndInfo = '' - + // this.inBatchForm.batchType = "" + // this.inBatchForm.department = "" + this.sizeForm.demandEndInfo = ""; + if (this.sizeForm.options === 1) { this.getQuarterList(); this.inBatchDialogVisible = true; - + (this.inBatchForm.batchType = ""), (this.inBatchForm.department = ""); + this.inBatchForm.optionType = ""; this.inBatchForm.optionType = ""; } }, @@ -1016,6 +1021,7 @@ export default { handleDelete(index, row) { this.sizeForm.inTableData.splice(index, 1); this.$message.success("已成功删除该条记录"); + this.getStatistics(); }, }, watch: { diff --git a/src/views/secondOrder/components/inDialog.vue b/src/views/secondOrder/components/inDialog.vue index 7946251..1826313 100644 --- a/src/views/secondOrder/components/inDialog.vue +++ b/src/views/secondOrder/components/inDialog.vue @@ -73,7 +73,7 @@ - +