qx
qx
4 天以前 ebe4f10feba18e18bd4c744858a779ab75bcf622
src/components/public/index.vue
@@ -60,11 +60,12 @@
            :data="dataList"
            ref="multipleTable"
            v-loading="loading"
            row-key="aid"
            @selection-change="handleSelectionChange"
            border
            height="480px"
          >
            <el-table-column type="selection" width="40" align="center" />
            <el-table-column type="selection" width="40" align="center" :reserve-selection="true"/>
            <el-table-column
              label="序号"
              type="index"
@@ -180,7 +181,7 @@
      queryParams: {
        ruleStr: "",
        pageNum: 1,
        pageSize: 10,
        pageSize: 50,
      },
      list: [],
      fList: {},
@@ -190,7 +191,6 @@
  },
  watch: {
    checkStatus(newValue) {
      console.log(565658);
      if (newValue === "1") {
        this.updateData(this.proResult, this.conclusion);
      }
@@ -263,10 +263,7 @@
      if (this.checkStatus == 1) {
        this.form.jcsj = proResult; // 更新检查所见
        this.form.desc = conclusion; // 更新检查结论
      } else {
        this.form.desc = "";
        this.form.jcsj = "";
      }
      }
      if (this.list.length != 0) {
        let desc = "";
@@ -279,8 +276,11 @@
          .map((item) => item.yxbx)
          .filter(Boolean)
          .join(",");
        this.form.jcsj = this.form.jcsj + jcsj; // 更新检查所见
        this.form.desc = this.form.desc + desc;
        this.form.jcsj = jcsj; // 更新检查所见
        this.form.desc =  desc;
      }else {
        this.form.desc = "";
        this.form.jcsj = "";
      }
    },
@@ -291,6 +291,8 @@
    updateFormContent(selection) {
      // if (!selection.length) return;
      console.log(selection, 123456);
      this.updateData(this.proResult, this.conclusion);
      // 如果处于检查状态,使用传入的值
      // if (this.checkStatus === "1") {
@@ -314,35 +316,30 @@
      //   .join(",");
    },
    /* handleOk() {
    handleOk() {
      if (!this.form.desc && !this.form.jcsj) {
        this.$message.warning("请选择数据");
        return;
      } else {
        const desc = this.form.desc?.trim();
        const jcsj = this.form.jcsj?.trim();
        // 如果没有选中表格项
        if (!this.list || this.list.length === 0) {
          if (!desc && !jcsj) {
            this.$message.warning(
              "请填写有效的检查所见和检查结论,或选择表格数据"
            );
            return;
          }
        }
      }
      try {
        this.$emit("add", this.form.desc, this.form.jcsj);
        this.resetForm();
        this.open = false;
      } catch (error) {
        console.error("处理数据失败:", error);
        this.$message.error("操作失败");
      }
    }, */
    handleOk() {
      const jcsjTrim = this.form.jcsj?.trim();
      const descTrim = this.form.desc?.trim();
      if (!jcsjTrim || !descTrim) {
        this.$message.warning("检查所见和检查结论不能为空");
        return;
      }
      try {
        this.$emit("add", this.form.desc, this.form.jcsj);
        this.resetForm();
        this.open = false;
         this.$refs.multipleTable.clearSelection();
      } catch (error) {
        console.error("处理数据失败:", error);
        this.$message.error("操作失败");
@@ -359,6 +356,7 @@
    },
    callcolos() {
      this.open = false;
       this.$refs.multipleTable.clearSelection();
    },
  },
  computed: {