|  | @@ -7,13 +7,11 @@
 | 
												
													
														
															|  |            <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
 |  |            <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
 | 
												
													
														
															|  |          </el-form-item>
 |  |          </el-form-item>
 | 
												
													
														
															|  |          <el-form-item class="divLine"></el-form-item>
 |  |          <el-form-item class="divLine"></el-form-item>
 | 
												
													
														
															|  | -        <el-form-item>
 |  | 
 | 
												
													
														
															|  | -          {{mouldName}}
 |  | 
 | 
												
													
														
															|  | -        </el-form-item>
 |  | 
 | 
												
													
														
															|  | 
 |  | +        <el-form-item>{{mouldName}}</el-form-item>
 | 
												
													
														
															|  |          <!-- <el-form-item style="float:right;">
 |  |          <!-- <el-form-item style="float:right;">
 | 
												
													
														
															|  |            保养提醒:
 |  |            保养提醒:
 | 
												
													
														
															|  |            <el-switch v-model="prompt" active-color="#ff4949"></el-switch>
 |  |            <el-switch v-model="prompt" active-color="#ff4949"></el-switch>
 | 
												
													
														
															|  | -        </el-form-item> -->
 |  | 
 | 
												
													
														
															|  | 
 |  | +        </el-form-item>-->
 | 
												
													
														
															|  |          <el-form-item style="float: right">
 |  |          <el-form-item style="float: right">
 | 
												
													
														
															|  |            当前保养状态:
 |  |            当前保养状态:
 | 
												
													
														
															|  |            <span style="color: #ff4949; margin-right: 16px;">需要</span>
 |  |            <span style="color: #ff4949; margin-right: 16px;">需要</span>
 | 
												
											
												
													
														
															|  | @@ -78,9 +76,9 @@
 | 
												
													
														
															|  |            </el-select>
 |  |            </el-select>
 | 
												
													
														
															|  |          </el-form-item>
 |  |          </el-form-item>
 | 
												
													
														
															|  |          <!-- 保养类型为1时 选择易损件ID -->
 |  |          <!-- 保养类型为1时 选择易损件ID -->
 | 
												
													
														
															|  | -        <el-form-item v-if="type.value == 1" label="选择易损件" prop="action">
 |  | 
 | 
												
													
														
															|  | 
 |  | +        <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
 | 
												
													
														
															|  |            <el-select
 |  |            <el-select
 | 
												
													
														
															|  | -            v-model="action.value"
 |  | 
 | 
												
													
														
															|  | 
 |  | +            v-model="vulnerable.value"
 | 
												
													
														
															|  |              clearable
 |  |              clearable
 | 
												
													
														
															|  |              filterable
 |  |              filterable
 | 
												
													
														
															|  |              placeholder="请选择易损件"
 |  |              placeholder="请选择易损件"
 | 
												
											
												
													
														
															|  | @@ -97,7 +95,7 @@
 | 
												
													
														
															|  |          <!-- 保养类型为0时 选择保养动作 -->
 |  |          <!-- 保养类型为0时 选择保养动作 -->
 | 
												
													
														
															|  |          <el-form-item v-else label="选择动作" prop="action">
 |  |          <el-form-item v-else label="选择动作" prop="action">
 | 
												
													
														
															|  |            <el-select
 |  |            <el-select
 | 
												
													
														
															|  | -            v-model="maintenanceForm.action"
 |  | 
 | 
												
													
														
															|  | 
 |  | +            v-model="action.value"
 | 
												
													
														
															|  |              filterable
 |  |              filterable
 | 
												
													
														
															|  |              placeholder="请选择动作"
 |  |              placeholder="请选择动作"
 | 
												
													
														
															|  |              style="width:202px"
 |  |              style="width:202px"
 | 
												
											
												
													
														
															|  | @@ -110,10 +108,21 @@
 | 
												
													
														
															|  |              ></el-option>
 |  |              ></el-option>
 | 
												
													
														
															|  |            </el-select>
 |  |            </el-select>
 | 
												
													
														
															|  |          </el-form-item>
 |  |          </el-form-item>
 | 
												
													
														
															|  | 
 |  | +        <el-form-item label="选择照片">
 | 
												
													
														
															|  | 
 |  | +          <el-upload
 | 
												
													
														
															|  | 
 |  | +            ref="upload"
 | 
												
													
														
															|  | 
 |  | +            action="customize"
 | 
												
													
														
															|  | 
 |  | +            :http-request="maintain"
 | 
												
													
														
															|  | 
 |  | +            :limit="1"
 | 
												
													
														
															|  | 
 |  | +            :auto-upload="false"
 | 
												
													
														
															|  | 
 |  | +          >
 | 
												
													
														
															|  | 
 |  | +            <el-button size="small" type="primary">上传</el-button>
 | 
												
													
														
															|  | 
 |  | +          </el-upload>
 | 
												
													
														
															|  | 
 |  | +        </el-form-item>
 | 
												
													
														
															|  |        </el-form>
 |  |        </el-form>
 | 
												
													
														
															|  |        <div slot="footer" class="dialog-footer">
 |  |        <div slot="footer" class="dialog-footer">
 | 
												
													
														
															|  |          <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
 |  |          <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
 | 
												
													
														
															|  | -        <el-button type="primary" @click.native="maintain" :loading="maintenanceLoading">立即处理</el-button>
 |  | 
 | 
												
													
														
															|  | 
 |  | +        <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">立即处理</el-button>
 | 
												
													
														
															|  |        </div>
 |  |        </div>
 | 
												
													
														
															|  |      </el-dialog>
 |  |      </el-dialog>
 | 
												
													
														
															|  |    </section>
 |  |    </section>
 | 
												
											
												
													
														
															|  | @@ -167,7 +176,8 @@ export default {
 | 
												
													
														
															|  |          companyId: "",
 |  |          companyId: "",
 | 
												
													
														
															|  |          roleType: "",
 |  |          roleType: "",
 | 
												
													
														
															|  |          flag: 0
 |  |          flag: 0
 | 
												
													
														
															|  | -      }
 |  | 
 | 
												
													
														
															|  | 
 |  | +      },
 | 
												
													
														
															|  | 
 |  | +      imageUrl: ""
 | 
												
													
														
															|  |      };
 |  |      };
 | 
												
													
														
															|  |    },
 |  |    },
 | 
												
													
														
															|  |    methods: {
 |  |    methods: {
 | 
												
											
												
													
														
															|  | @@ -186,6 +196,17 @@ export default {
 | 
												
													
														
															|  |      backToDetection() {
 |  |      backToDetection() {
 | 
												
													
														
															|  |        this.$router.go(-1);
 |  |        this.$router.go(-1);
 | 
												
													
														
															|  |      },
 |  |      },
 | 
												
													
														
															|  | 
 |  | +    beforeUpload(file) {
 | 
												
													
														
															|  | 
 |  | +      const isJPG = file.type === "image/png";
 | 
												
													
														
															|  | 
 |  | +      const isLt2M = file.size / 1024 / 1024 < 2;
 | 
												
													
														
															|  | 
 |  | +      if (!isJPG) {
 | 
												
													
														
															|  | 
 |  | +        this.$message.error("上传头像图片只能是 PNG 格式!");
 | 
												
													
														
															|  | 
 |  | +      }
 | 
												
													
														
															|  | 
 |  | +      if (!isLt2M) {
 | 
												
													
														
															|  | 
 |  | +        this.$message.error("上传头像图片大小不能超过 2MB!");
 | 
												
													
														
															|  | 
 |  | +      }
 | 
												
													
														
															|  | 
 |  | +      return isJPG && isLt2M;
 | 
												
													
														
															|  | 
 |  | +    },
 | 
												
													
														
															|  |      //显示新增界面
 |  |      //显示新增界面
 | 
												
													
														
															|  |      showMaintenance: function() {
 |  |      showMaintenance: function() {
 | 
												
													
														
															|  |        this.maintenanceFormVisible = true;
 |  |        this.maintenanceFormVisible = true;
 | 
												
											
												
													
														
															|  | @@ -241,21 +262,33 @@ export default {
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  |        );
 |  |        );
 | 
												
													
														
															|  |      },
 |  |      },
 | 
												
													
														
															|  | -    //模具保养 N/A
 |  | 
 | 
												
													
														
															|  | -    maintain() {
 |  | 
 | 
												
													
														
															|  | -      var param = {
 |  | 
 | 
												
													
														
															|  | -        mouldId: this.mouldId,
 |  | 
 | 
												
													
														
															|  | -        maintainType: this.type.value,
 |  | 
 | 
												
													
														
															|  | -        ways: null
 |  | 
 | 
												
													
														
															|  | -      };
 |  | 
 | 
												
													
														
															|  | -      if (param.maintainType == 0) {
 |  | 
 | 
												
													
														
															|  | -        param.ways = this.action.value;
 |  | 
 | 
												
													
														
															|  | 
 |  | +    //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
 | 
												
													
														
															|  | 
 |  | +    maintainConfirm() {
 | 
												
													
														
															|  | 
 |  | +      if (this.$refs.upload.uploadFiles.length == 1) {
 | 
												
													
														
															|  | 
 |  | +        this.$refs.upload.submit();
 | 
												
													
														
															|  | 
 |  | +        this.$refs.upload.clearFiles();
 | 
												
													
														
															|  |        } else {
 |  |        } else {
 | 
												
													
														
															|  | -        param.ways = null; //后面应该换成易损件的ID
 |  | 
 | 
												
													
														
															|  | 
 |  | +        this.$message({
 | 
												
													
														
															|  | 
 |  | +          message: "必须上传照片",
 | 
												
													
														
															|  | 
 |  | +          type: "error"
 | 
												
													
														
															|  | 
 |  | +        });
 | 
												
													
														
															|  |        }
 |  |        }
 | 
												
													
														
															|  | -      this.http.post(
 |  | 
 | 
												
													
														
															|  | 
 |  | +    },
 | 
												
													
														
															|  | 
 |  | +    //模具保养
 | 
												
													
														
															|  | 
 |  | +    maintain(params) {
 | 
												
													
														
															|  | 
 |  | +      var fileObj = params.file;
 | 
												
													
														
															|  | 
 |  | +      var form = new FormData();
 | 
												
													
														
															|  | 
 |  | +      form.append("file", fileObj);
 | 
												
													
														
															|  | 
 |  | +      form.append("mouldId", this.mouldId);
 | 
												
													
														
															|  | 
 |  | +      form.append("maintainType", this.type.value);
 | 
												
													
														
															|  | 
 |  | +      if (this.type.value == 0) {
 | 
												
													
														
															|  | 
 |  | +        form.append("ways", this.action.value);
 | 
												
													
														
															|  | 
 |  | +      } else {
 | 
												
													
														
															|  | 
 |  | +        form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
 | 
												
													
														
															|  | 
 |  | +      }
 | 
												
													
														
															|  | 
 |  | +      this.http.uploadFile(
 | 
												
													
														
															|  |          this.port.mold.moldMaintain,
 |  |          this.port.mold.moldMaintain,
 | 
												
													
														
															|  | -        param,
 |  | 
 | 
												
													
														
															|  | 
 |  | +        form,
 | 
												
													
														
															|  |          res => {
 |  |          res => {
 | 
												
													
														
															|  |            if (res.code == "ok") {
 |  |            if (res.code == "ok") {
 | 
												
													
														
															|  |              this.$message({
 |  |              this.$message({
 |