维修管理
This commit is contained in:
		
							parent
							
								
									e782a52db5
								
							
						
					
					
						commit
						051b4cb8c1
					
				| 
						 | 
					@ -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>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue