hcong
2024-11-20 0e5f14cf081b8cffda12e7c1773fe1b6b69ce2eb
问题和整改的新增以及修改页面点击取消按钮添加取消事件
已修改4个文件
58 ■■■■■ 文件已修改
src/views/fysp/check/ProCheck.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/ComChangeEdit.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/CompProblemAddOrUpd.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/components/CompProblemCard.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/fysp/check/ProCheck.vue
@@ -22,20 +22,20 @@
        :loading="mainLoading"
      ></ToolBar>
      <el-scrollbar
          v-if="curProList.length > 0"
          class="el-scrollbar"
          v-loading="mainLoading"
        >
          <CompProblemCard
            :key="i"
            v-for="(p, i) in curProList"
            :index="i + 1"
            :problem="p"
            :subtask="curSubtask.data"
            :topTask="topTask"
            @submit="updateSubtask"
          ></CompProblemCard>
        </el-scrollbar>
        v-if="curProList.length > 0"
        class="el-scrollbar"
        v-loading="mainLoading"
      >
        <CompProblemCard
          :key="i"
          v-for="(p, i) in curProList"
          :index="i + 1"
          :problem="p"
          :subtask="curSubtask.data"
          :topTask="topTask"
          @submit="updateSubtask"
        ></CompProblemCard>
      </el-scrollbar>
      <el-empty v-else description="暂无记录" v-loading="mainLoading" />
    </template>
  </BaseContentLayout>
@@ -46,6 +46,7 @@
    :subtask="curSubtask.data"
    :topTask="topTask"
    ref="compProblemAddOrUpdRef"
    @cancel="onAddProCanceled"
    @submit="updateSubtask"
  />
  <ArbitraryPhoto
@@ -279,12 +280,15 @@
          this.mainLoading = false;
        });
    },
    onAddProCanceled() {
      this.proAddOrUpdDialogVisible = false;
    },
    // 问题卡片组件主动发起刷新父组件数据
    updateSubtask(refresh = false) {
      this.curSubtask.data.proCheckedNum++;
      this.curSubtask.type = this.getSubtaskType(this.curSubtask.data);
      if (this.proAddOrUpdDialogVisible) {
        this.proAddOrUpdDialogVisible = false
        this.proAddOrUpdDialogVisible = false;
      }
      this.refreshCurrSubtask(refresh);
    },
src/views/fysp/check/components/ComChangeEdit.vue
@@ -47,7 +47,7 @@
      </el-row>
      <div class="flex-div">
        <el-button type="primary" @click="onSubmit">保存</el-button>
        <el-button @click="$emit('submit', false)">取消</el-button>
        <el-button @click="onCancel">取消</el-button>
      </div>
      <el-image-viewer
          v-if="previewDialogVisible"
@@ -68,7 +68,7 @@
import { useCloned } from '@vueuse/core';
import { ElMessage } from 'element-plus';
export default {
  emits: ['submit'],
  emits: ['submit', 'cancel'],
  components: {
    CompGenericWrapper
  },
@@ -162,6 +162,9 @@
      this.fileList = useCloned(beforeEditImgList).cloned.value;
      this.oldFileList = useCloned(beforeEditImgList).cloned.value;
    },
    onCancel() {
      this.$emit("cancel")
    },
    onSubmit() {
      if (!this.pictureValidate()) {
        return;
src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -173,7 +173,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>
@@ -233,7 +233,7 @@
import deviceApi from '@/api/fysp/deviceApi';
import { useFormConfirm } from '@/composables/formConfirm';
export default {
  emits: ['submit'],
  emits: ['submit', 'cancel'],
  components: {
    ArbitraryPhoto,
    CompDevicePhoto,
@@ -561,6 +561,9 @@
      }
      return true;
    },
    onCancel() {
      this.$emit("cancel")
    },
    onSubmit() {
      this.$refs.formRef.validate((valid) => {
        if (valid && this.pictureValidate()) {
src/views/fysp/check/components/CompProblemCard.vue
@@ -139,6 +139,7 @@
    :subtask="subtask"
    :topTask="topTask"
    ref="compProblemAddOrUpdRef"
    @cancel="onProCanceled"
    @submit="onProSubmited"
  />
  <!-- 整改 -->
@@ -151,6 +152,7 @@
    :subtask="subtask"
    :month="month"
    :oldChangeFileList="problem.mediafileList"
    @cancel="onChangeCanceled"
    @submit="onChangeSubmited"
  />
  <!-- 问题复现 -->
@@ -173,7 +175,7 @@
import CompProRecent from './CompProRecent.vue';
import { useCloned } from '@vueuse/core';
export default {
  emits: ['submmit'],
  emits: ['submmit', 'cancel'],
  components: {
    CompProblemAddOrUpd,
    ComChangeEdit,
@@ -281,10 +283,16 @@
    }
  },
  methods: {
    onProCanceled() {
      this.proAddOrUpdDialogVisible = false;
    },
    onProSubmited(isOk) {
      this.$emit('submit', isOk);
      this.proAddOrUpdDialogVisible = false;
    },
    onChangeCanceled() {
      this.changeDialogVisible = false;
    },
    onChangeSubmited(isOk) {
      this.$emit('submit', isOk);
      this.changeDialogVisible = false;