维修管理bug修复
This commit is contained in:
		
							parent
							
								
									4caac39667
								
							
						
					
					
						commit
						e782a52db5
					
				| 
						 | 
					@ -287,7 +287,7 @@
 | 
				
			||||||
              style="width: 80%"
 | 
					              style="width: 80%"
 | 
				
			||||||
              placeholder="请选择规格型号"
 | 
					              placeholder="请选择规格型号"
 | 
				
			||||||
              ref="partTypeCascader"
 | 
					              ref="partTypeCascader"
 | 
				
			||||||
              popper-class="popper-select"
 | 
					              popper-class="part-select"
 | 
				
			||||||
              @change="partTypeChange"
 | 
					              @change="partTypeChange"
 | 
				
			||||||
            ></el-cascader>
 | 
					            ></el-cascader>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
| 
						 | 
					@ -1072,13 +1072,6 @@ export default {
 | 
				
			||||||
            trigger: "change",
 | 
					            trigger: "change",
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        remark: [
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            required: true,
 | 
					 | 
				
			||||||
            message: "请填写备注",
 | 
					 | 
				
			||||||
            trigger: "blur",
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        ],
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      //厂商下拉选
 | 
					      //厂商下拉选
 | 
				
			||||||
      supplierList: [],
 | 
					      supplierList: [],
 | 
				
			||||||
| 
						 | 
					@ -1145,6 +1138,15 @@ export default {
 | 
				
			||||||
            trigger: "blur",
 | 
					            trigger: "blur",
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        supplierId: [
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            required: true,
 | 
				
			||||||
 | 
					            message: "请选择厂家",
 | 
				
			||||||
 | 
					            trigger: "change",
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        partPrice: [
 | 
					        partPrice: [
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            required: false,
 | 
					            required: false,
 | 
				
			||||||
| 
						 | 
					@ -1215,6 +1217,12 @@ export default {
 | 
				
			||||||
      flagSave: false, 
 | 
					      flagSave: false, 
 | 
				
			||||||
      //合格勾选对象数组
 | 
					      //合格勾选对象数组
 | 
				
			||||||
      idsList:[],
 | 
					      idsList:[],
 | 
				
			||||||
 | 
					      //
 | 
				
			||||||
 | 
					      supplierId:undefined,
 | 
				
			||||||
 | 
					      //
 | 
				
			||||||
 | 
					      remark:undefined,
 | 
				
			||||||
 | 
					      //
 | 
				
			||||||
 | 
					      taskIdTemp:undefined,
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  mounted() {
 | 
					  mounted() {
 | 
				
			||||||
| 
						 | 
					@ -1248,9 +1256,8 @@ export default {
 | 
				
			||||||
        taskId: this.repairRow.taskId,
 | 
					        taskId: this.repairRow.taskId,
 | 
				
			||||||
        keyword: "",
 | 
					        keyword: "",
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
      console.log(param);
 | 
					      this.taskIdTemp = this.repairRow.taskId;
 | 
				
			||||||
      const res = await getAppRepairMaTypeList(param);
 | 
					      const res = await getAppRepairMaTypeList(param);
 | 
				
			||||||
      console.log(res);
 | 
					 | 
				
			||||||
      this.equipmentList = res.data;
 | 
					      this.equipmentList = res.data;
 | 
				
			||||||
      this.equipmentList.forEach((e) => {
 | 
					      this.equipmentList.forEach((e) => {
 | 
				
			||||||
        e.disrepairNum = Number(e.repairNum) - Number(e.repairedNum);
 | 
					        e.disrepairNum = Number(e.repairNum) - Number(e.repairedNum);
 | 
				
			||||||
| 
						 | 
					@ -1342,13 +1349,6 @@ export default {
 | 
				
			||||||
      if (row.manageType == 0) {
 | 
					      if (row.manageType == 0) {
 | 
				
			||||||
        this.repairRowData = row;
 | 
					        this.repairRowData = row;
 | 
				
			||||||
        this.repairDeviceList = [];
 | 
					        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;
 | 
					        this.openCode = true;
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        this.innerRowData = row;
 | 
					        this.innerRowData = row;
 | 
				
			||||||
| 
						 | 
					@ -1362,6 +1362,9 @@ export default {
 | 
				
			||||||
        // const res = partTypeTreeList(params);
 | 
					        // const res = partTypeTreeList(params);
 | 
				
			||||||
        partTypeTreeList(params).then((res) => {
 | 
					        partTypeTreeList(params).then((res) => {
 | 
				
			||||||
          this.partTypeTreeTwo = this.filterTree(res.data);
 | 
					          this.partTypeTreeTwo = this.filterTree(res.data);
 | 
				
			||||||
 | 
					          this.resetForm("formLeft");
 | 
				
			||||||
 | 
					          this.resetForm("formMiddle")
 | 
				
			||||||
 | 
					          this.resetForm("formRight")
 | 
				
			||||||
          this.openNum = true;
 | 
					          this.openNum = true;
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					@ -1381,15 +1384,25 @@ export default {
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 编码维修弹窗保存
 | 
					    // 编码维修弹窗保存
 | 
				
			||||||
    saveCodeDialog() {
 | 
					  async  saveCodeDialog() {
 | 
				
			||||||
      this.repairRowData.repairDeviceList = this.repairDeviceList;
 | 
					      this.repairRowData.repairDeviceList = this.repairDeviceList;
 | 
				
			||||||
      saveCodeList(this.repairRowData.repairDeviceList).then((response) => {
 | 
					    await  saveCodeList(this.repairRowData.repairDeviceList).then((response) => {
 | 
				
			||||||
        if (response.code == 200) {
 | 
					        if (response.code == 200) {
 | 
				
			||||||
          this.$modal.msgSuccess("保存成功");
 | 
					          this.$modal.msgSuccess("保存成功");
 | 
				
			||||||
          this.fileList = [];
 | 
					          this.fileList = [];
 | 
				
			||||||
          this.fileListTemp = [];
 | 
					          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;
 | 
					      this.openCode = false;
 | 
				
			||||||
      // console.log(this.equipmentList)
 | 
					      // console.log(this.equipmentList)
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					@ -1657,14 +1670,24 @@ export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // 返场维修-打开
 | 
					    // 返场维修-打开
 | 
				
			||||||
    openBackDialog(row) {
 | 
					    openBackDialog(row) {
 | 
				
			||||||
 | 
					      console.log('row',row)
 | 
				
			||||||
      this.backRowData = row;
 | 
					      this.backRowData = row;
 | 
				
			||||||
      this.backTableList = [];
 | 
					      this.backTableList = [];
 | 
				
			||||||
 | 
					      if(row.backTableList){
 | 
				
			||||||
 | 
					      this.backForm = {
 | 
				
			||||||
 | 
					        //返场厂家
 | 
				
			||||||
 | 
					        supplierId: row.backTableList[0].supplierId,
 | 
				
			||||||
 | 
					        //备注
 | 
				
			||||||
 | 
					        remark: row.backTableList[0].remark,
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					      }else{
 | 
				
			||||||
        this.backForm = {
 | 
					        this.backForm = {
 | 
				
			||||||
        //返场厂家
 | 
					        //返场厂家
 | 
				
			||||||
        supplierId: null,
 | 
					        supplierId: null,
 | 
				
			||||||
        //备注
 | 
					        //备注
 | 
				
			||||||
        remark: "",
 | 
					        remark: '',
 | 
				
			||||||
      }; 
 | 
					      }; 
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      if (
 | 
					      if (
 | 
				
			||||||
        this.backRowData.backTableList &&
 | 
					        this.backRowData.backTableList &&
 | 
				
			||||||
        this.backRowData.backTableList.length > 0
 | 
					        this.backRowData.backTableList.length > 0
 | 
				
			||||||
| 
						 | 
					@ -1676,17 +1699,19 @@ export default {
 | 
				
			||||||
          isCharge: "0",
 | 
					          isCharge: "0",
 | 
				
			||||||
          partNum: 1,
 | 
					          partNum: 1,
 | 
				
			||||||
          backCost: 0,
 | 
					          backCost: 0,
 | 
				
			||||||
 | 
					          supplier:this.backForm.supplierId,
 | 
				
			||||||
 | 
					          remark:this.backForm.remark,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
        this.backTableList.push(obj);
 | 
					        this.backTableList.push(obj);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.openBack = true;
 | 
					      this.openBack = true;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    //返场维修- 删除
 | 
					    //返场维修- 添加
 | 
				
			||||||
    handleAddBack() {
 | 
					    handleAddBack() {
 | 
				
			||||||
      let obj = {
 | 
					      let obj = {
 | 
				
			||||||
        partName: "",
 | 
					        partName: "",
 | 
				
			||||||
        isCharge: "0",
 | 
					        isCharge: "0",
 | 
				
			||||||
        partNum: 0,
 | 
					        partNum: 1,
 | 
				
			||||||
        backCost: 0,
 | 
					        backCost: 0,
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
      this.backTableList.push(obj);
 | 
					      this.backTableList.push(obj);
 | 
				
			||||||
| 
						 | 
					@ -1721,6 +1746,10 @@ export default {
 | 
				
			||||||
              this.$message.error("维修金额不能为0!");
 | 
					              this.$message.error("维修金额不能为0!");
 | 
				
			||||||
              return;
 | 
					              return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            this.backTableList.forEach(item=>{
 | 
				
			||||||
 | 
					              item.supplierId = this.backForm.supplierId
 | 
				
			||||||
 | 
					              item.remark = this.backForm.remark
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
            this.backRowData.backTableList = this.backTableList;
 | 
					            this.backRowData.backTableList = this.backTableList;
 | 
				
			||||||
            this.backRowData.repairType = 2;
 | 
					            this.backRowData.repairType = 2;
 | 
				
			||||||
            this.backRowData.backTableList.forEach((item) => {
 | 
					            this.backRowData.backTableList.forEach((item) => {
 | 
				
			||||||
| 
						 | 
					@ -1787,7 +1816,8 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //数量管理保存
 | 
					    //数量管理保存
 | 
				
			||||||
    saveNumAll() {
 | 
					  async  saveNumAll() {
 | 
				
			||||||
 | 
					    if(this.formRight.scrapNum!=0){
 | 
				
			||||||
      this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
 | 
					      this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
 | 
				
			||||||
      if(valid){
 | 
					      if(valid){
 | 
				
			||||||
      for (let i = 0; i < this.partItems.length; i++) {
 | 
					      for (let i = 0; i < this.partItems.length; i++) {
 | 
				
			||||||
| 
						 | 
					@ -1818,16 +1848,79 @@ export default {
 | 
				
			||||||
      console.log('this.formRight',this.formRight)
 | 
					      console.log('this.formRight',this.formRight)
 | 
				
			||||||
      this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight)
 | 
					      this.innerRowData.repairDeviceList[0].numberScrapRepairPartList.push(this.formRight)
 | 
				
			||||||
      this.innerRowData.repairDeviceList[0].repairType = 1;
 | 
					      this.innerRowData.repairDeviceList[0].repairType = 1;
 | 
				
			||||||
      saveCodeList(this.innerRowData.repairDeviceList).then((response) => {
 | 
					      saveCodeList(this.innerRowData.repairDeviceList).then(async (response) => {
 | 
				
			||||||
        if (response.code == 200) {
 | 
					        if (response.code == 200) {
 | 
				
			||||||
          this.$modal.msgSuccess("保存成功");
 | 
					          this.$modal.msgSuccess("保存成功");
 | 
				
			||||||
          this.fileList=[];
 | 
					          this.fileList=[];
 | 
				
			||||||
          this.fileListTemp=[];
 | 
					          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;
 | 
					          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(){
 | 
					    saveCancelAll(){
 | 
				
			||||||
| 
						 | 
					@ -1863,7 +1956,7 @@ export default {
 | 
				
			||||||
    display: none;
 | 
					    display: none;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.popper-select {
 | 
					.part-select {
 | 
				
			||||||
  .el-cascader-panel .el-scrollbar .el-checkbox {
 | 
					  .el-cascader-panel .el-scrollbar .el-checkbox {
 | 
				
			||||||
    display: none;
 | 
					    display: none;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue