维修管理bug修复

This commit is contained in:
jjLv 2024-11-22 17:03:53 +08:00
parent 4caac39667
commit e782a52db5
1 changed files with 120 additions and 27 deletions

View File

@ -287,7 +287,7 @@
style="width: 80%"
placeholder="请选择规格型号"
ref="partTypeCascader"
popper-class="popper-select"
popper-class="part-select"
@change="partTypeChange"
></el-cascader>
</div>
@ -1072,13 +1072,6 @@ export default {
trigger: "change",
},
],
remark: [
{
required: true,
message: "请填写备注",
trigger: "blur",
},
],
},
//
supplierList: [],
@ -1145,6 +1138,15 @@ export default {
trigger: "blur",
},
],
supplierId: [
{
required: true,
message: "请选择厂家",
trigger: "change",
},
],
partPrice: [
{
required: false,
@ -1215,6 +1217,12 @@ export default {
flagSave: false,
//
idsList:[],
//
supplierId:undefined,
//
remark:undefined,
//
taskIdTemp:undefined,
};
},
mounted() {
@ -1248,9 +1256,8 @@ export default {
taskId: this.repairRow.taskId,
keyword: "",
};
console.log(param);
this.taskIdTemp = this.repairRow.taskId;
const res = await getAppRepairMaTypeList(param);
console.log(res);
this.equipmentList = res.data;
this.equipmentList.forEach((e) => {
e.disrepairNum = Number(e.repairNum) - Number(e.repairedNum);
@ -1342,13 +1349,6 @@ export default {
if (row.manageType == 0) {
this.repairRowData = row;
this.repairDeviceList = [];
console.log(" this.repairRowData", this.repairRowData);
// if(this.repairRowData.repairDeviceList.length>0){
// this.repairRowData.repairDeviceList.forEach(item=>{
// item.materialName = item.
// })
// }
// getCodeManage();
this.openCode = true;
} else {
this.innerRowData = row;
@ -1362,6 +1362,9 @@ export default {
// const res = partTypeTreeList(params);
partTypeTreeList(params).then((res) => {
this.partTypeTreeTwo = this.filterTree(res.data);
this.resetForm("formLeft");
this.resetForm("formMiddle")
this.resetForm("formRight")
this.openNum = true;
});
}
@ -1381,15 +1384,25 @@ export default {
});
},
//
saveCodeDialog() {
async saveCodeDialog() {
this.repairRowData.repairDeviceList = this.repairDeviceList;
saveCodeList(this.repairRowData.repairDeviceList).then((response) => {
await saveCodeList(this.repairRowData.repairDeviceList).then((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.repairNum) - Number(e.repairedNum);
});
this.openCode = false;
// console.log(this.equipmentList)
},
@ -1657,14 +1670,24 @@ export default {
// -
openBackDialog(row) {
console.log('row',row)
this.backRowData = row;
this.backTableList = [];
if(row.backTableList){
this.backForm = {
//
supplierId: row.backTableList[0].supplierId,
//
remark: row.backTableList[0].remark,
};
}else{
this.backForm = {
//
supplierId: null,
//
remark: "",
};
remark: '',
};
}
if (
this.backRowData.backTableList &&
this.backRowData.backTableList.length > 0
@ -1676,17 +1699,19 @@ export default {
isCharge: "0",
partNum: 1,
backCost: 0,
supplier:this.backForm.supplierId,
remark:this.backForm.remark,
};
this.backTableList.push(obj);
}
this.openBack = true;
},
//-
//-
handleAddBack() {
let obj = {
partName: "",
isCharge: "0",
partNum: 0,
partNum: 1,
backCost: 0,
};
this.backTableList.push(obj);
@ -1721,6 +1746,10 @@ export default {
this.$message.error("维修金额不能为0");
return;
}
this.backTableList.forEach(item=>{
item.supplierId = this.backForm.supplierId
item.remark = this.backForm.remark
})
this.backRowData.backTableList = this.backTableList;
this.backRowData.repairType = 2;
this.backRowData.backTableList.forEach((item) => {
@ -1787,8 +1816,9 @@ export default {
},
//
saveNumAll() {
this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
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({
@ -1818,16 +1848,79 @@ export default {
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((response) => {
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.repairNum) - Number(e.repairedNum);
});
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.repairNum) - Number(e.repairedNum);
});
this.openNum=false;
}
});
}
})
}
},
//
saveCancelAll(){
@ -1863,7 +1956,7 @@ export default {
display: none;
}
}
.popper-select {
.part-select {
.el-cascader-panel .el-scrollbar .el-checkbox {
display: none;
}