hcong
2024-11-21 55d42cc7a2e6e21e1f8e06ca80089fe911914ac9
src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -80,12 +80,6 @@
            </el-select>
          </el-form-item>
          <el-form-item
            v-show="
              problem &&
              problem.guid &&
              deepCopyProblem.advice &&
              deepCopyProblem.advice != ''
            "
            label="问题建议修正"
            prop="_adviseEdit"
            :disabled="false"
@@ -173,7 +167,7 @@
            <el-button type="primary" @click="onSubmit" v-show="!readonly"
              >保存</el-button
            >
            <el-button @click="$emit('submit', false)" v-show="!readonly"
            <el-button @click="onCancel" v-show="!readonly"
              >取消</el-button
            >
          </el-form-item>
@@ -220,7 +214,6 @@
  </CompGenericWrapper>
</template>
<script>
import CompGenericWrapper from './CompGenericWrapper.vue';
import ArbitraryPhoto from './ArbitraryPhoto.vue';
import CompLedgerPhoto from './CompLedgerPhoto.vue';
import CompDevicePhoto from './CompDevicePhoto.vue';
@@ -233,12 +226,11 @@
import deviceApi from '@/api/fysp/deviceApi';
import { useFormConfirm } from '@/composables/formConfirm';
export default {
  emits: ['submit'],
  emits: ['submit', 'cancel'],
  components: {
    ArbitraryPhoto,
    CompDevicePhoto,
    CompLedgerPhoto,
    CompGenericWrapper
  },
  props: {
    readonly: {
@@ -269,6 +261,8 @@
  },
  data() {
    return {
      // fixme 2024.11.20 子组件初始化时机问题
      initPropsCount: 0,
      // 初始预览图片index
      initialIndex: -1,
      // 图片选择最大数量
@@ -332,6 +326,38 @@
        this.pictureValidate();
      },
      deep: true
    },
    initPropsCount: {
      handler(nv, ov) {
        if (nv >= 3) {
          this.initOptions();
        }
      },
      immediate: true
    },
    problem: {
      handler(nv, ov) {
        if (nv != null && nv != undefined) {
          this.initPropsCount++;
        }
      },
      immediate: true
    },
    topTask: {
      handler(nv, ov) {
        if (nv != null && nv != undefined) {
          this.initPropsCount++;
        }
      },
      immediate: true
    },
    subtask: {
      handler(nv, ov) {
        if (nv != null && nv != undefined) {
          this.initPropsCount++;
        }
      },
      immediate: true
    }
  },
  computed: {
@@ -363,15 +389,13 @@
      return array;
    }
  },
  mounted() {
    this.initOptions();
  },
  mounted() {},
  methods: {
    onProAdviseChange(value) {
      this.deepCopyProblem._adviseEdit = this.deepCopyProblem.advice;
    },
    handlePictureCardPreview(uploadFile) {
      this.initialIndex = this.fileList.indexOf(uploadFile)
      this.initialIndex = this.fileList.indexOf(uploadFile);
      this.previewDialogVisible = true;
      this.previewDialogImageUrl = uploadFile.url;
    },
@@ -561,6 +585,10 @@
      }
      return true;
    },
    onCancel() {
      this.$emit("cancel")
      this.$emit('update:visible', false)
    },
    onSubmit() {
      this.$refs.formRef.validate((valid) => {
        if (valid && this.pictureValidate()) {