qx
1 天以前 6bb2a23358624f72c886fccff39bfb54de868e4f
src/components/public/index.vue
@@ -1,11 +1,6 @@
<template>
  <div>
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1080px"
      append-to-body
    >
    <el-dialog :title="title" :visible.sync="open" width="1080px" append-to-body>
      <h3 v-if="fList.proResult">检测项目 :{{ fList.project.proName }}</h3>
      <h3 v-if="fList.proResult">
        检测结果 :{{ fList.proResult }}{{ fList.project.proMetering }}
@@ -14,13 +9,7 @@
      <h2 style="text-align: center">{{ proName || "暂无项目名称" }}</h2>
      <div style="display: flex; width: 100%">
        <div style="width: 50%; margin-right: 40px">
          <el-form
            :model="queryParams"
            ref="queryForm"
            size="small"
            :inline="true"
            label-width="68px"
          >
          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
            <!-- <el-form-item label="病种名称" prop="bingzhong">
          <el-input
            v-model="queryParams.bingzhong"
@@ -31,22 +20,11 @@
          />
        </el-form-item>-->
            <el-form-item label="检查结论" prop="ruleStr">
              <el-input
                v-model="queryParams.ruleStr"
                placeholder="请输入检查结论"
                clearable
                @keyup.enter.native="getList"
                style="width: 130px"
              />
              <el-input v-model="queryParams.ruleStr" placeholder="请输入检查结论" clearable @keyup.enter.native="getList"
                style="width: 130px" />
            </el-form-item>
            <el-form-item>
              <el-button
                type="primary"
                icon="el-icon-search"
                size="mini"
                @click="getList"
                >搜索</el-button
              >
              <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">搜索</el-button>
            </el-form-item>
            <!-- <el-form-item>
          <h3 >{{ queryParams.proName  || '暂无项目名称'  }}</h3>
@@ -55,48 +33,25 @@
          <h3 style="margin-left: 160px">已选项目</h3>
        </el-form-item> -->
          </el-form>
          <el-table
            :data="dataList"
            ref="multipleTable"
            v-loading="loading"
            @selection-change="handleSelectionChange"
            border
            height="480px"
          >
            <el-table-column type="selection" width="40" align="center" />
            <el-table-column
              label="序号"
              type="index"
              align="center"
              width="50px"
            />
          <el-table :data="dataList" ref="multipleTable" row-key="aid" v-loading="loading" @selection-change="handleSelectionChange"
            border height="480px">
            <el-table-column type="selection" width="40" align="center"  :reserve-selection="true"/>
            <el-table-column label="序号" type="index" align="center" width="50px" />
            <!-- <el-table-column label="规则" align="center" prop="ruleStr" /> -->
            <el-table-column label="检查所见" align="center" prop="yxbx" />
            <el-table-column label="检查结论" align="center" prop="ruleStr" />
          </el-table>
          <div class="pag">
            <div class="pag1" style="margin-left: 630px">
              <pagination
                small
                v-show="total > 0"
                :total="total"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getList"
              />
              <pagination small v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize" @pagination="getList" />
            </div>
          </div>
        </div>
        <div class="jianc">
          <!-- <h3 style="margin-top: -30px;">已选项目</h3> -->
          <el-form
            :model="form"
            ref="queryForm"
            size="small"
            label-width="68px"
            :label-position="labelPosition"
          >
          <el-form :model="form" ref="queryForm" size="small" label-width="68px" :label-position="labelPosition">
            <!--  :inline="true" -->
            <!-- <el-form-item>
              <el-input
@@ -106,22 +61,10 @@
              ></el-input>
            </el-form-item> -->
            <el-form-item label="检查所见" prop="jcsj">
              <el-input
                v-model="form.jcsj"
                clearable
                type="textarea"
                :autosize="{ minRows: 7 }"
                style="width: 380px"
              />
              <el-input v-model="form.jcsj" clearable type="textarea" :autosize="{ minRows: 7 }" style="width: 380px" />
            </el-form-item>
            <el-form-item label="检查结论" prop="desc">
              <el-input
                v-model="form.desc"
                clearable
                type="textarea"
                :autosize="{ minRows: 7 }"
                style="width: 380px"
              />
              <el-input v-model="form.desc" clearable type="textarea" :autosize="{ minRows: 7 }" style="width: 380px" />
            </el-form-item>
          </el-form>
        </div>
@@ -179,7 +122,7 @@
      queryParams: {
        ruleStr: "",
        pageNum: 1,
        pageSize: 10,
        pageSize: 50,
      },
      list: [],
      fList: {},
@@ -189,16 +132,16 @@
  },
  watch: {
    checkStatus(newValue) {
      console.log(565658);
      if (newValue === "1") {
        this.updateData(this.proResult, this.conclusion);
      }else{
      }
    },
    projectList: {
      immediate: true,
      deep: true,
      handler(newVal) {
        console.log("收到的项目数据:", newVal);
        // 你可以在这里处理数据,比如保存到 data 或做逻辑判断
        if (newVal && newVal.length > 0) {
          const firstProject = newVal[0]; // 你也可以遍历所有项目,看你业务需求
@@ -209,9 +152,11 @@
      },
    },
  },
  mounted() {},
  mounted() { },
  created() {},
  created() {
  },
  methods: {
    async getList() {
      try {
@@ -258,14 +203,11 @@
    },
    updateData(proResult, conclusion) {
      console.log(proResult, conclusion, 5658);
      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 = "";
@@ -278,13 +220,29 @@
          .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;
        // if (this.queryParams.pageNum == 1) {
        // } else {
        //   this.form.jcsj = this.form.jcsj + jcsj; // 更新检查所见
        //   this.form.desc = this.form.desc + desc;
        //   this.form.jcsj = this.uniqueStrings(this.form.jcsj)
        //   this.form.desc = this.uniqueStrings(this.form.desc)
        // }
      }else{
           this.form.jcsj = ""; // 更新检查所见
          this.form.desc = "";
      }
    },
    },
    // uniqueStrings(strings) {
    //   // 使用Set来去重
    //   const uniqueSet = new Set(strings);
    //   return Array.from(uniqueSet).join("")
    // },
    handleSelectionChange(selection) {
      this.list = selection;
      this.list = selection
      this.updateFormContent(selection);
    },
@@ -340,6 +298,7 @@
        console.error("处理数据失败:", error);
        this.$message.error("操作失败");
      }
         this.$refs.multipleTable?.clearSelection();
    },
    resetForm() {
@@ -352,6 +311,7 @@
    },
    callcolos() {
      this.open = false;
         this.$refs.multipleTable?.clearSelection();
    },
  },
  computed: {