From 15c7ffd52dc07300c911c46e41432194668f2930 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Fri, 29 Nov 2024 13:55:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=B4=AD=E7=BB=91=E5=AE=9A=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=EF=BC=8C=E7=BB=B4=E4=BF=AE=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/purchase/goodsBind.js | 5 +- src/api/repair/testedInBound.js | 16 +- .../goodsBind/component/bindTools.vue | 15 +- .../purchase/goodsBind/component/home.vue | 9 - .../repair/repairManage/component/edit.vue | 317 +++++++++++------- .../material/repair/testedInBound/index.vue | 18 +- 6 files changed, 228 insertions(+), 152 deletions(-) diff --git a/src/api/purchase/goodsBind.js b/src/api/purchase/goodsBind.js index 8009d275..5318fdfb 100644 --- a/src/api/purchase/goodsBind.js +++ b/src/api/purchase/goodsBind.js @@ -51,12 +51,11 @@ export function getListDetailById(query) { // 导出 -export function exportNewBuy(data) { +export function exportNewBuy(purchaseId) { return request({ - url: '/material/purchase/bind/downloadQrCode', + url: '/material/purchase/bind/downloadQrCode?purchaseId='+purchaseId, method: 'post', responseType: 'blob', - data: data, }) } diff --git a/src/api/repair/testedInBound.js b/src/api/repair/testedInBound.js index f989f7cc..96b13f7b 100644 --- a/src/api/repair/testedInBound.js +++ b/src/api/repair/testedInBound.js @@ -8,14 +8,14 @@ export function getListTested(query) { params: query }) } -// // 查询修试审核详细列表 -// export function getAuditInfo(query) { -// return request({ -// url: '/material/repair_audit_details/getRepairAuditList', -// method: 'get', -// params: query -// }) -// } + +// 查询修试审核详细列表 +export function getRepairedDetailList(taskId) { + return request({ + url: '/material/repair/getRepairedDetailList?taskId='+taskId, + method: 'get', + }) +} // //修试审核二级-通过,驳回 // export function auditPass(data) { diff --git a/src/views/material/purchase/goodsBind/component/bindTools.vue b/src/views/material/purchase/goodsBind/component/bindTools.vue index 151ad64e..16bfba9b 100644 --- a/src/views/material/purchase/goodsBind/component/bindTools.vue +++ b/src/views/material/purchase/goodsBind/component/bindTools.vue @@ -130,7 +130,7 @@ - + diff --git a/src/views/material/repair/repairManage/component/edit.vue b/src/views/material/repair/repairManage/component/edit.vue index fb7bfda0..a04d2deb 100644 --- a/src/views/material/repair/repairManage/component/edit.vue +++ b/src/views/material/repair/repairManage/component/edit.vue @@ -102,6 +102,12 @@ align="center" prop="typeRepairedNum" show-overflow-tooltip + > + - - - 合格 - - { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); + e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); }); // this.GetDeviceTypeTreeFn(data.backApplyInfo.agreementId) }, @@ -1306,7 +1308,7 @@ export default { const res = await getAppRepairMaTypeList(param); this.equipmentList = res.data; this.equipmentList.forEach((e) => { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); + e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); }); this.$modal.msgSuccess("通过成功"); } @@ -1330,7 +1332,7 @@ export default { const res = await getAppRepairMaTypeList(param); this.equipmentList = res.data; this.equipmentList.forEach((e) => { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); + e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); }); this.$modal.msgSuccess("合格成功"); }) @@ -1437,7 +1439,7 @@ export default { const res = await getAppRepairMaTypeList(param); this.equipmentList = res.data; this.equipmentList.forEach((e) => { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); + e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); }); this.openCode = false; // console.log(this.equipmentList) @@ -1453,7 +1455,7 @@ export default { const res = await getAppRepairMaTypeList(param); this.equipmentList = res.data; this.equipmentList.forEach((e) => { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); + e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); }); this.openCode = false; }, @@ -1863,111 +1865,188 @@ export default { } }, + async validateForms(refs){ + const validationResults = await Promise.all(refs.map(ref =>ref.validate())) + return validationResults.every(result=> result===true) + }, //数量管理保存 async saveNumAll() { - if(this.formRight.scrapNum!=0){ - this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{ - if(valid){ - for (let i = 0; i < this.partItems.length; i++) { - this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ - isCharge: this.partItems[i].isCharge, - partId: this.partItems[i].partId, - partNum: this.partItems[i].partNum, - repairNum: this.formLeft.repairNum, - }); - } - for (let i = 0; i < this.partItemsMiddle.length; i++) { - this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({ - isCharge: this.partItemsMiddle[i].isCharge, - partPrice: this.partItemsMiddle[i].partPrice, - partNum: this.partItemsMiddle[i].partNum, - partName: this.partItemsMiddle[i].partName, - supplierId: this.formMiddle.supplierId, - repairNum: this.formMiddle.repairNum, - }); - } - this.uploadKey = Date.now(); - if(this.fileList.length!=0){ - await this.getImaUpload(), - this.formRight.fileList = this.fileListTemp; - }else{ - this.formRight.fileList = this.fileListTemp; - } - console.log('this.formRight',this.formRight) - this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight) - this.innerRowData.repairDeviceList[0].repairType = 1; - saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => { - if (response.code == 200) { - this.$modal.msgSuccess("保存成功"); - this.fileList=[]; - this.fileListTemp=[]; - let param = { - taskId: this.repairRow.taskId, - keyword: "", - }; - this.taskIdTemp = this.repairRow.taskId; - const res = await getAppRepairMaTypeList(param); - this.equipmentList = res.data; - this.equipmentList.forEach((e) => { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); - }); - this.openNum=false; - } - }); - } - }) - }else{ - this.$refs["formLeft","formMiddle"].validate(async(valid)=>{ - if(valid){ - for (let i = 0; i < this.partItems.length; i++) { - this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ - isCharge: this.partItems[i].isCharge, - partId: this.partItems[i].partId, - partNum: this.partItems[i].partNum, - repairNum: this.formLeft.repairNum, - }); - } - for (let i = 0; i < this.partItemsMiddle.length; i++) { - this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({ - isCharge: this.partItemsMiddle[i].isCharge, - partPrice: this.partItemsMiddle[i].partPrice, - partNum: this.partItemsMiddle[i].partNum, - partName: this.partItemsMiddle[i].partName, - supplierId: this.formMiddle.supplierId, - repairNum: this.formMiddle.repairNum, - }); - } - this.uploadKey = Date.now(); - if(this.fileList.length!=0){ - await this.getImaUpload(), - this.formRight.fileList = this.fileListTemp; - }else{ - this.formRight.fileList = this.fileListTemp; - } - console.log('this.formRight',this.formRight) - this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight) - this.innerRowData.repairDeviceList[0].repairType = 1; - saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => { - if (response.code == 200) { - this.$modal.msgSuccess("保存成功"); - this.fileList=[]; - this.fileListTemp=[]; - let param = { - taskId: this.repairRow.taskId, - keyword: "", - }; - this.taskIdTemp = this.repairRow.taskId; - const res = await getAppRepairMaTypeList(param); - this.equipmentList = res.data; - this.equipmentList.forEach((e) => { - e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum); - }); - this.openNum=false; - } - }); - } - }) + let refTemp = []; + if(this.formLeft.repairNum!=0){ + refTemp.push(this.$refs.formLeft) } + if(this.formMiddle.repairNum!=0){ + refTemp.push(this.$refs.formMiddle) + } + if(this.formRight.scrapNum!=0){ + refTemp.push(this.$refs.formRight) + } + const valid = await this.validateForms(refTemp) + if(valid){ + for (let i = 0; i < this.partItems.length; i++) { + this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ + isCharge: this.partItems[i].isCharge, + partId: this.partItems[i].partId, + partNum: this.partItems[i].partNum, + repairNum: this.formLeft.repairNum, + }); + } + for (let i = 0; i < this.partItemsMiddle.length; i++) { + this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({ + isCharge: this.partItemsMiddle[i].isCharge, + partPrice: this.partItemsMiddle[i].partPrice, + partNum: this.partItemsMiddle[i].partNum, + partName: this.partItemsMiddle[i].partName, + supplierId: this.formMiddle.supplierId, + repairNum: this.formMiddle.repairNum, + }); + } + this.uploadKey = Date.now(); + if(this.fileList.length!=0){ + await this.getImaUpload(), + this.formRight.fileList = this.fileListTemp; + }else{ + this.formRight.fileList = this.fileListTemp; + } + console.log('this.formRight',this.formRight) + this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight) + this.innerRowData.repairDeviceList[0].repairType = 1; + saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => { + if (response.code == 200) { + this.$modal.msgSuccess("保存成功"); + this.fileList=[]; + this.fileListTemp=[]; + let param = { + taskId: this.repairRow.taskId, + keyword: "", + }; + this.taskIdTemp = this.repairRow.taskId; + const res = await getAppRepairMaTypeList(param); + this.equipmentList = res.data; + this.equipmentList.forEach((e) => { + e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); + }); + this.openNum=false; + } + }); + } + // this.$refs.refTemp.validate(async(valid)=>{ + // if(valid){ + // for (let i = 0; i < this.partItems.length; i++) { + // this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ + // isCharge: this.partItems[i].isCharge, + // partId: this.partItems[i].partId, + // partNum: this.partItems[i].partNum, + // repairNum: this.formLeft.repairNum, + // }); + // } + // } + // }) + // } + // if(this.formRight.scrapNum!=0){ + // this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{ + // if(valid){ + // for (let i = 0; i < this.partItems.length; i++) { + // this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ + // isCharge: this.partItems[i].isCharge, + // partId: this.partItems[i].partId, + // partNum: this.partItems[i].partNum, + // repairNum: this.formLeft.repairNum, + // }); + // } + // for (let i = 0; i < this.partItemsMiddle.length; i++) { + // this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({ + // isCharge: this.partItemsMiddle[i].isCharge, + // partPrice: this.partItemsMiddle[i].partPrice, + // partNum: this.partItemsMiddle[i].partNum, + // partName: this.partItemsMiddle[i].partName, + // supplierId: this.formMiddle.supplierId, + // repairNum: this.formMiddle.repairNum, + // }); + // } + // this.uploadKey = Date.now(); + // if(this.fileList.length!=0){ + // await this.getImaUpload(), + // this.formRight.fileList = this.fileListTemp; + // }else{ + // this.formRight.fileList = this.fileListTemp; + // } + // console.log('this.formRight',this.formRight) + // this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight) + // this.innerRowData.repairDeviceList[0].repairType = 1; + // saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => { + // if (response.code == 200) { + // this.$modal.msgSuccess("保存成功"); + // this.fileList=[]; + // this.fileListTemp=[]; + // let param = { + // taskId: this.repairRow.taskId, + // keyword: "", + // }; + // this.taskIdTemp = this.repairRow.taskId; + // const res = await getAppRepairMaTypeList(param); + // this.equipmentList = res.data; + // this.equipmentList.forEach((e) => { + // e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); + // }); + // this.openNum=false; + // } + // }); + // } + // }) + // }else{ + // this.$refs["formLeft","formMiddle"].validate(async(valid)=>{ + // if(valid){ + // for (let i = 0; i < this.partItems.length; i++) { + // this.innerRowData.repairDeviceList[0].numberInRepairPartList.push({ + // isCharge: this.partItems[i].isCharge, + // partId: this.partItems[i].partId, + // partNum: this.partItems[i].partNum, + // repairNum: this.formLeft.repairNum, + // }); + // } + // for (let i = 0; i < this.partItemsMiddle.length; i++) { + // this.innerRowData.repairDeviceList[0].numberOutRepairPartList.push({ + // isCharge: this.partItemsMiddle[i].isCharge, + // partPrice: this.partItemsMiddle[i].partPrice, + // partNum: this.partItemsMiddle[i].partNum, + // partName: this.partItemsMiddle[i].partName, + // supplierId: this.formMiddle.supplierId, + // repairNum: this.formMiddle.repairNum, + // }); + // } + // this.uploadKey = Date.now(); + // if(this.fileList.length!=0){ + // await this.getImaUpload(), + // this.formRight.fileList = this.fileListTemp; + // }else{ + // this.formRight.fileList = this.fileListTemp; + // } + // console.log('this.formRight',this.formRight) + // this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight) + // this.innerRowData.repairDeviceList[0].repairType = 1; + // saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => { + // if (response.code == 200) { + // this.$modal.msgSuccess("保存成功"); + // this.openNum=false; + // } + // }); + // this.fileList=[]; + // this.fileListTemp=[]; + // let param = { + // taskId: this.repairRow.taskId, + // keyword: "", + // }; + // this.taskIdTemp = this.repairRow.taskId; + // const res = await getAppRepairMaTypeList(param); + // this.equipmentList = res.data; + // this.equipmentList.forEach((e) => { + // e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum)-Number(e.typeScrapNum); + // }); + + // } + // }) + // } }, //数量管理取消 diff --git a/src/views/material/repair/testedInBound/index.vue b/src/views/material/repair/testedInBound/index.vue index b3120813..af6c69da 100644 --- a/src/views/material/repair/testedInBound/index.vue +++ b/src/views/material/repair/testedInBound/index.vue @@ -244,7 +244,7 @@