riku
2025-07-15 c40f4c1267dae4fcf27dbbd75ea83014fba87783
src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -1,5 +1,5 @@
<template>
  <CompGenericWrapper type="dialog">
  <CompGenericWrapper type="dialog" append-to-body>
    <template #content>
      <div class="main-container">
        <el-form
@@ -163,15 +163,13 @@
              </el-col>
            </el-row>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit" v-show="!readonly"
              >保存</el-button
            >
            <el-button @click="onCancel" v-show="!readonly"
              >取消</el-button
            >
          </el-form-item>
        </el-form>
        <el-row justify="end">
          <el-button type="primary" @click="onSubmit" v-show="!readonly"
            >保存</el-button
          >
          <el-button @click="onCancel" v-show="!readonly">取消</el-button>
        </el-row>
        <ArbitraryPhoto
          :max-select="maxSelectImgCount - fileList.length"
          v-model:dialog-visible="anyPhotoDialog"
@@ -230,7 +228,7 @@
  components: {
    ArbitraryPhoto,
    CompDevicePhoto,
    CompLedgerPhoto,
    CompLedgerPhoto
  },
  props: {
    readonly: {
@@ -424,7 +422,7 @@
        districtCode: this.topTask.districtcode
      };
      problemApi.fetchProblemType(data).then((res) => {
        this.problemTypeList = res.data;
        this.problemTypeList = res;
        if (this.type == 1) {
          let currProName = String(this.problem.problemname);
@@ -586,7 +584,8 @@
      return true;
    },
    onCancel() {
      this.$emit("cancel")
      this.$emit('cancel');
      this.$emit('update:visible', false);
    },
    onSubmit() {
      this.$refs.formRef.validate((valid) => {
@@ -615,7 +614,7 @@
          });
          if (this.type == 1) {
            let deleteImgCopy = this.deleteImg;
            fileUtil.getImageFiles(picUrls, function (files) {
            fileUtil.getImageFiles(picUrls, (files) => {
              data.append('deleteImg', deleteImgCopy);
              deepCopyPro.advise = deepCopyPro.advice;
              delete deepCopyPro['advice'];
@@ -628,19 +627,19 @@
              files.forEach((image) => {
                data.append('images', image);
              });
              problemApi.updateProblem(data).then((res) => {});
              problemApi.updateProblem(data).then((res) => {
                this.$emit('submit', false);
              });
            });
            this.$emit('submit', false);
          } else {
            const deepCopySubTask = useCloned(this.subtask).cloned.value;
            const that = this;
            fileUtil.getImageFiles(picUrls, function (files) {
            fileUtil.getImageFiles(picUrls, (files) => {
              deepCopyPro.insGuid = deepCopySubTask.insGuid;
              delete deepCopyPro['description'];
              deepCopyPro.proName = deepCopyPro.problemname;
              delete deepCopyPro['problemname'];
              deepCopyPro.ptGuid = that.findProTypeByGuid(
                that.currProTypeGuid
              deepCopyPro.ptGuid = this.findProTypeByGuid(
                this.currProTypeGuid
              ).guid;
              deepCopyPro.locationId = deepCopyPro.locationid;
              delete deepCopyPro['locationid'];
@@ -650,9 +649,10 @@
              files.forEach((image) => {
                data.append('images', image);
              });
              problemApi.newProblem(data).then((res) => {});
              problemApi.newProblem(data).then((res) => {
                this.$emit('submit', true);
              });
            });
            this.$emit('submit', true);
          }
        }
      });