维修管理

This commit is contained in:
jjLv 2024-11-23 11:11:53 +08:00
parent e782a52db5
commit 051b4cb8c1
1 changed files with 53 additions and 27 deletions

View File

@ -253,7 +253,7 @@
<el-button type="primary" size="mini" @click="saveCodeDialog" <el-button type="primary" size="mini" @click="saveCodeDialog"
>保存</el-button >保存</el-button
> >
<el-button type="normal" size="mini" @click="openCode=false" <el-button type="normal" size="mini" @click="cancelCodeDialog"
>取消</el-button >取消</el-button
> >
</div> </div>
@ -653,6 +653,7 @@
placeholder="请输入内部维修数量" placeholder="请输入内部维修数量"
maxlength="20" maxlength="20"
type="number" type="number"
min="0"
style="width: 265px" style="width: 265px"
@input="waitRepairCount" @input="waitRepairCount"
/> />
@ -753,6 +754,7 @@
placeholder="请输入返厂维修数量" placeholder="请输入返厂维修数量"
maxlength="20" maxlength="20"
type="number" type="number"
min="0"
style="width: 265px" style="width: 265px"
@input="waitRepairCount" @input="waitRepairCount"
/> />
@ -885,6 +887,7 @@
maxlength="20" maxlength="20"
type="number" type="number"
style="width: 250px" style="width: 250px"
min="0"
@input="waitRepairCount" @input="waitRepairCount"
/> />
</el-form-item> </el-form-item>
@ -1115,9 +1118,13 @@ export default {
repairNum:0 repairNum:0
}, },
formMiddle: { formMiddle: {
supplierId:undefined,
repairNum:0 repairNum:0
}, },
formRight:{ formRight:{
scrapNum:0,
scrapType:undefined,
scrapReason:undefined,
scrapNum:0 scrapNum:0
}, },
@ -1139,13 +1146,13 @@ export default {
}, },
], ],
supplierId: [ // supplierId: [
{ // {
required: true, // required: true,
message: "请选择厂家", // message: "",
trigger: "change", // trigger: "change",
}, // },
], // ],
partPrice: [ partPrice: [
{ {
@ -1214,14 +1221,10 @@ export default {
// //
disrepairNumTemp: undefined, disrepairNumTemp: undefined,
// //
flagSave: false, flagSave: true,
// //
idsList:[], idsList:[],
// //id
supplierId:undefined,
//
remark:undefined,
//
taskIdTemp:undefined, taskIdTemp:undefined,
}; };
}, },
@ -1365,6 +1368,10 @@ export default {
this.resetForm("formLeft"); this.resetForm("formLeft");
this.resetForm("formMiddle") this.resetForm("formMiddle")
this.resetForm("formRight") this.resetForm("formRight")
this.partItems = [{ partType: "", partNum: "", isCharge: "" }],
this.partItemsMiddle= [
{ partName: "", partNum: "", partPrice: "0", isCharge: "" },
],
this.openNum = true; this.openNum = true;
}); });
} }
@ -1406,6 +1413,21 @@ export default {
this.openCode = false; this.openCode = false;
// console.log(this.equipmentList) // console.log(this.equipmentList)
}, },
//
async cancelCodeDialog(){
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;
},
// //
beforeFileUpload(row) { beforeFileUpload(row) {
this.fileData = row; this.fileData = row;
@ -1484,6 +1506,7 @@ export default {
// //
async saveSubmit() { async saveSubmit() {
this.uploadKey = Date.now(); this.uploadKey = Date.now();
if(this.fileList.length!=0){ if(this.fileList.length!=0){
await this.getImaUpload(), await this.getImaUpload(),
await this.addWaitRepairPic(this.scrapForm); await this.addWaitRepairPic(this.scrapForm);
@ -1494,8 +1517,9 @@ export default {
this.scrapRowData.codeScrapRepairPartList.push(this.scrapForm) this.scrapRowData.codeScrapRepairPartList.push(this.scrapForm)
this.openScrap = false; this.openScrap = false;
this.reset(); // this.reset();
}, },
// //
async getImaUpload(){ async getImaUpload(){
this.fileListTemp = []; this.fileListTemp = [];
@ -1673,6 +1697,7 @@ export default {
console.log('row',row) console.log('row',row)
this.backRowData = row; this.backRowData = row;
this.backTableList = []; this.backTableList = [];
this.resetForm("backForm")
if(row.backTableList){ if(row.backTableList){
this.backForm = { this.backForm = {
// //
@ -1680,14 +1705,7 @@ export default {
// //
remark: row.backTableList[0].remark, remark: row.backTableList[0].remark,
}; };
}else{ }
this.backForm = {
//
supplierId: null,
//
remark: '',
};
}
if ( if (
this.backRowData.backTableList && this.backRowData.backTableList &&
this.backRowData.backTableList.length > 0 this.backRowData.backTableList.length > 0
@ -1776,6 +1794,7 @@ export default {
// - // -
openScrapDialog(row) { openScrapDialog(row) {
console.log('row11',row)
this.scrapRowData = row; this.scrapRowData = row;
this.scrapForm = {}; this.scrapForm = {};
this.openScrap = true; this.openScrap = true;
@ -1926,22 +1945,29 @@ export default {
saveCancelAll(){ saveCancelAll(){
this.fileList=[]; this.fileList=[];
this.fileListTemp=[]; this.fileListTemp=[];
this.resetForm("formLeft");
this.resetForm("formMiddle")
this.resetForm("formRight")
this.partItems = [{ partType: "", partNum: "", isCharge: "" }],
this.partItemsMiddle = [
{ partName: "", partNum: "", partPrice: "0", isCharge: "" },
],
this.openNum=false; this.openNum=false;
}, },
// //
waitRepairCount(){ waitRepairCount(){
console.log('this.formLeft.repairNum',this.formLeft.repairNum)
console.log('this.formMiddle.repairNum',this.formMiddle.repairNum)
console.log('this.formRight.scrapNum',this.formRight.scrapNum)
console.log('this.disrepairNumTemp',this.disrepairNumTemp)
if((Number(this.formLeft.repairNum) + Number(this.formMiddle.repairNum)+ Number(this.formRight.scrapNum)) >this.disrepairNumTemp){ if((Number(this.formLeft.repairNum) + Number(this.formMiddle.repairNum)+ Number(this.formRight.scrapNum)) >this.disrepairNumTemp){
this.flagSave = true; this.flagSave = true;
this.$message.error("输入的数字之和大于"+this.disrepairNumTemp); this.$message.error("输入的数字之和大于"+this.disrepairNumTemp);
}else if((Number(this.formLeft.repairNum) + Number(this.formMiddle.repairNum)+ Number(this.formRight.scrapNum))==0){
this.flagSave = true;
this.$message.error("输入的数字之和不能为0");
}else{ }else{
this.flagSave = false; this.flagSave = false;
} }
}, },
}, },
}; };
</script> </script>