riku
5 天以前 f19e5267cc23b1c714dc746239864f33ed715dd9
src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -165,7 +165,11 @@
          </el-form-item>
        </el-form>
        <el-row justify="end">
          <el-button type="primary" @click="onSubmit" v-show="!readonly"
          <el-button
            type="primary"
            @click="onSubmit"
            v-show="!readonly"
            :loading="loading"
            >保存</el-button
          >
          <el-button @click="onCancel" v-show="!readonly">取消</el-button>
@@ -314,7 +318,8 @@
        { id: 0, label: '监控设备' },
        { id: 1, label: '治理设备' },
        { id: 2, label: '生产设备' }
      ]
      ],
      loading: false
    };
  },
  watch: {
@@ -532,9 +537,7 @@
    onProAdviseEditChange(value) {},
    onProTypeChange(value) {
      // 默认问题描述和问题建议为第一个
      this.currProTypeGuid = this.descriptionOptions[0].guid;
      this.deepCopyProblem.description = this.descriptionOptions[0].description;
      this.onProDesChange(this.deepCopyProblem.description);
      this.onProDesChange(this.descriptionOptions[0].description);
      this.deepCopyProblem.advice = this.adviseOptions[0].adName;
      this.deepCopyProblem._adviseEdit = this.deepCopyProblem.advice;
    },
@@ -550,7 +553,8 @@
    onProDesChange(value) {
      let currPro = this.findProByProDesName(value);
      this.currProTypeGuid = currPro.guid;
      // this.deepCopyProblem.description = currPro.description;
      this.deepCopyProblem.description = currPro.description;
      this.deepCopyProblem.ptguid = this.currProTypeGuid;
      this.changeProblemname();
      var adName =
        this.adviseOptions.length == 0 ? '' : this.adviseOptions[0].adName;
@@ -588,6 +592,7 @@
      this.$emit('update:visible', false);
    },
    onSubmit() {
      this.loading = true;
      this.$refs.formRef.validate((valid) => {
        if (valid && this.pictureValidate()) {
          // 数据准备
@@ -616,7 +621,7 @@
            let deleteImgCopy = this.deleteImg;
            fileUtil.getImageFiles(picUrls, (files) => {
              data.append('deleteImg', deleteImgCopy);
              deepCopyPro.advise = deepCopyPro.advice;
              deepCopyPro.advise = deepCopyPro._adviseEdit;
              delete deepCopyPro['advice'];
              delete deepCopyPro['mediafileList'];
              delete deepCopyPro['description'];
@@ -627,9 +632,14 @@
              files.forEach((image) => {
                data.append('images', image);
              });
              problemApi.updateProblem(data).then((res) => {
                this.$emit('submit', false);
              });
              problemApi
                .updateProblem(data)
                .then((res) => {
                  this.$emit('submit', false);
                })
                .finally(() => {
                  this.loading = false;
                });
            });
          } else {
            const deepCopySubTask = useCloned(this.subtask).cloned.value;
@@ -638,9 +648,8 @@
              delete deepCopyPro['description'];
              deepCopyPro.proName = deepCopyPro.problemname;
              delete deepCopyPro['problemname'];
              deepCopyPro.ptGuid = this.findProTypeByGuid(
                this.currProTypeGuid
              ).guid;
              deepCopyPro.ptGuid = this.currProTypeGuid;
              delete deepCopyPro['ptguid'];
              deepCopyPro.locationId = deepCopyPro.locationid;
              delete deepCopyPro['locationid'];
              delete deepCopyPro['_adviseEdit'];
@@ -649,9 +658,14 @@
              files.forEach((image) => {
                data.append('images', image);
              });
              problemApi.newProblem(data).then((res) => {
                this.$emit('submit', true);
              });
              problemApi
                .newProblem(data)
                .then((res) => {
                  this.$emit('submit', true);
                })
                .finally(() => {
                  this.loading = false;
                });
            });
          }
        }
@@ -750,7 +764,7 @@
.row {
  width: 100%;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail {
:deep(.el-upload-list--picture-card .el-upload-list__item-thumbnail) {
  object-fit: cover !important;
}
.preview-pic {
@@ -758,11 +772,11 @@
  width: 100%;
  height: 100%;
}
::v-deep .el-upload--picture-card {
:deep(.el-upload--picture-card) {
  display: none;
}
/* 隐藏el-upload上传成功组件 */
::v-deep .el-upload-list__item-status-label {
:deep(.el-upload-list__item-status-label) {
  display: none !important;
}
</style>