From ce50baff7fc1d3b6b23794dd6b0d609f40b9aab1 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Mon, 11 Aug 2025 15:08:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=EF=BC=8C=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=AF=BC=E5=85=A5=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchaseManage/productionPlan/index.vue | 20 +++- .../purchaseInspection/edit.vue | 33 +++++-- .../purchaseManage/purchasePlan/index.vue | 93 ++++++++++++++++++- .../stockManage/warehouseIn/edit.vue | 42 ++++++++- 4 files changed, 166 insertions(+), 22 deletions(-) diff --git a/src/views/foodManage/purchaseManage/productionPlan/index.vue b/src/views/foodManage/purchaseManage/productionPlan/index.vue index 7d90c954..a186cfdf 100644 --- a/src/views/foodManage/purchaseManage/productionPlan/index.vue +++ b/src/views/foodManage/purchaseManage/productionPlan/index.vue @@ -381,14 +381,14 @@ export default { handleUpdate(row) { this.$router.push({ path: "/foodManage/purchaseManage/productionPlanEdit",query: {productionPlanRowData:JSON.stringify(row)} }); }, - //批量弹窗勾选 + //批量弹窗勾选 handleSelectionChange(selection){ - this.batchList = selection + this.batchList = [...selection]; }, /** 合并生成采购计划操作 */ handleBatchPurchasePlan(){ if(this.batchList&&this.batchList.length>0){ - console.log(this.batchList) + const canteenIdIsSame = this.batchList.every(item => item.canteenId == this.batchList[0].canteenId); const ifBreakDownIsSame = this.batchList.every(item => item.ifBreakDown == false); if(canteenIdIsSame&&ifBreakDownIsSame){//只能选择相同食堂,审批同意且待分解的生产计划 @@ -396,8 +396,20 @@ export default { this.rowData = this.batchList[0] let param = [] this.batchList.forEach(item=>{ - param = param.concat(item.productionPlanGoodsSumVOList) + console.log(item.productionPlanGoodsSumVOList) + if(item.productionPlanGoodsSumVOList&&item.productionPlanGoodsSumVOList.length>0){ + item.productionPlanGoodsSumVOList.forEach(sub=>{ + let index = param.findIndex(v=>v.dishesId==sub.dishesId) + if(index==-1){ + let obj = Object.assign({}, sub) + param.push(obj) + }else{ + param[index].dishesNum = Number(param[index].dishesNum)+Number(sub.dishesNum) + } + }) + } }) + console.log(param) this.loading2=true; dishesConvertApi(param).then(response => { this.dialogTableList = response; diff --git a/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue b/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue index 52db127b..4393d1cd 100644 --- a/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue +++ b/src/views/foodManage/purchaseManage/purchaseInspection/edit.vue @@ -133,19 +133,19 @@ --> @@ -578,7 +578,7 @@ export default { if(this.materialList.length>0){ this.materialList.forEach(item=>{ if(item.orderNum>item.totalQualifiedNum){ - if(item.deliveryNum==0 || Number(item.qualifiedNum)==0){ + if(Number(item.deliveryNum)==0 || Number(item.qualifiedNum)==0){ this.noMaterial = true }else{ let obj = Object.assign({}, item) @@ -644,7 +644,7 @@ export default { if(this.materialList.length>0){ this.materialList.forEach(item=>{ if(item.orderNum>item.totalQualifiedNum){ - if(item.deliveryNum==0 || item.qualifiedNum==0){ + if(Number(item.deliveryNum)==0 || Number(item.qualifiedNum)==0){ this.noMaterial = true }else{ let obj = Object.assign({}, item) @@ -750,9 +750,11 @@ export default { this.$set(item,"unitPrice",Number(item.singlePrice)) this.$set(item,"orderNum",item.orderNum) if(item.totalQualifiedNum&&item.totalQualifiedNum>0){ - this.$set(item,"deliveryNum",item.orderNum-item.totalQualifiedNum) + this.$set(item,"deliveryNum",Number(item.orderNum)-Number(item.totalQualifiedNum)) + this.$set(item,"qualifiedNum",Number(item.orderNum)-Number(item.totalQualifiedNum)) }else{ - this.$set(item,"deliveryNum",item.orderNum) + this.$set(item,"deliveryNum",Number(item.orderNum)) + this.$set(item,"qualifiedNum",Number(item.orderNum)) } }) // this.materialList = []; @@ -810,8 +812,15 @@ export default { this.attachmentList.splice(sum, 1) this.baseInfo.inspectAttachmentList.splice(sum, 1) }, - patternValue(row){ - row.deliveryNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') + patternValue(row){ + console.log(row) + if(!row.deliveryNum||row.deliveryNum==""){ + row.deliveryNum=0 + row.qualifiedNum=0 + }else{ + row.deliveryNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') + row.qualifiedNum = row.deliveryNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') + } if(row.totalQualifiedNum&&row.totalQualifiedNum>0){ setTimeout(()=>{ if(Number(row.deliveryNum)>(Number(row.orderNum)-Number(row.totalQualifiedNum))){ @@ -827,7 +836,11 @@ export default { } }, patternValue2(row){ - row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') + if(!row.qualifiedNum||row.qualifiedNum==""){ + row.qualifiedNum=0 + }else{ + row.qualifiedNum = row.qualifiedNum.replace(/[^\d.]/g, '').replace(/^(\d*\.\d{2}).*$/, '$1') + } setTimeout(()=>{ if(Number(row.qualifiedNum)>Number(row.deliveryNum)){ row.qualifiedNum = Number(row.deliveryNum) diff --git a/src/views/foodManage/purchaseManage/purchasePlan/index.vue b/src/views/foodManage/purchaseManage/purchasePlan/index.vue index 7b69dd0e..04eaefe1 100644 --- a/src/views/foodManage/purchaseManage/purchasePlan/index.vue +++ b/src/views/foodManage/purchaseManage/purchasePlan/index.vue @@ -70,10 +70,20 @@ @click="handleAdd" >新增 + + 合并生成采购订单 + - + +