qx
qx
6 小时以前 01c3a2e0238539b19781048259c0df84a76d46fa
src/views/doctor/checkAll/index.vue
@@ -50,10 +50,8 @@
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <!-- <el-form :model="queryParams" ref="tableList" :inline="true" label-width="76px" style="margin-top: 10px"
      v-if="tjStatus == 1">
@@ -110,7 +108,7 @@
      <el-radio-button label="1">已审核</el-radio-button>
    </el-radio-group>
    <el-row :gutter="10" class="mb8" v-if="piliang" style="margin: 15px;">
    <el-row :gutter="10" class="mb8" v-if="piliang" style="margin: 15px">
      <el-col :span="1.5">
        <el-button type="primary" size="mini" @click="handleshenhe">批量核收</el-button>
      </el-col>
@@ -154,7 +152,8 @@
        </el-table-column>
        <el-table-column label="操作" align="center" width="120px" fixed="right">
          <template slot-scope="scope">
            <el-button fixed="right" type="text" size="mini" @click.stop="rowClick(scope.row)"  v-if="msgkcf == 'y' || msgkcf == 'Y'">处方</el-button>
            <el-button fixed="right" type="text" size="mini" @click.stop="rowClick(scope.row)"
              v-if="msgkcf == 'y' || msgkcf == 'Y'">处方</el-button>
            <el-button fixed="right" type="text" size="mini" @click.stop="handleClick(scope.row)">详情</el-button>
            <el-button type="text" size="mini" @click.stop="viewReport(scope.row)"
              v-if="scope.row.tjStatus == '1'">预览</el-button>
@@ -176,25 +175,60 @@
    <el-drawer custom-class="tanchu" :visible.sync="drawer" :before-close="handleClose" :with-header="false" size="100%"
      :show-close="true">
      <div v-loading="isLoading" element-loading-text="正在加载数据,请稍候..." element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(255, 255, 255, 0.8)" style="height: 100%; padding: 20px; position: relative;">
        element-loading-background="rgba(255, 255, 255, 0.8)" style="height: 100%; padding: 20px; position: relative">
        <div class="top">
          <table style="width: 100%; margin: 10px 10px; border: 1px solid #dfe6ec; border-collapse: collapse;"
            cellspacing="4">
          <table style="
              width: 100%;
              margin: 10px 10px;
              border: 1px solid #dfe6ec;
              border-collapse: collapse;
            " cellspacing="4">
            <caption style="background-color: #f8f8f9; font-size: 18px">
              {{ tableAll.cusName }}的体检资料
              {{
                tableAll.cusName
              }}的体检资料
            </caption>
            <tr style="border: 1px solid #dfe6ec; border-collapse: collapse; height: 36px;">
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">姓名:{{ tableAll.cusName }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">性别:{{ tableAll.cusSex == 0 ? "男" :
                tableAll.cusSex == 1 ? "女" : "未知" }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">年龄:{{ tableAll.age }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">体检号:{{ tableAll.tjNumber }}</td>
            <tr style="
                border: 1px solid #dfe6ec;
                border-collapse: collapse;
                height: 36px;
              ">
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                姓名:{{ tableAll.cusName }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                性别:{{
                  tableAll.cusSex == 0
                    ? "男"
                    : tableAll.cusSex == 1
                      ? "女"
                      : "未知"
                }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                年龄:{{ tableAll.age }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                体检号:{{ tableAll.tjNumber }}
              </td>
            </tr>
            <tr style="border: 1px solid #dfe6ec; border-collapse: collapse; height: 36px;">
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">单位名称:{{ tableAll.tjCompName }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">体检类型:{{ tableAll.tjCategory }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">套餐:{{ tableAll.pacName }}</td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">体检时间:{{ tableAll.tjTime }}</td>
            <tr style="
                border: 1px solid #dfe6ec;
                border-collapse: collapse;
                height: 36px;
              ">
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                单位名称:{{ tableAll.tjCompName }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                体检类型:{{ tableAll.tjCategory }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                套餐:{{ tableAll.pacName }}
              </td>
              <td style="border: 1px solid #dfe6ec; border-collapse: collapse">
                体检时间:{{ tableAll.tjTime }}
              </td>
            </tr>
          </table>
          <i class="el-icon-close" @click="guanbi"></i>
@@ -208,6 +242,9 @@
          </div>
          <div class="btn1">
            <el-button @click="historicalreport()" type="primary"><span class="vertical-text">历史报告</span></el-button>
          </div>
          <div class="btn1">
            <el-button @click="hisycxm()" type="primary"><span class="vertical-text">重置异常项目</span></el-button>
          </div>
          <div v-if="tableAll.tjCategory == '02'" class="btn1">
            <el-button @click="medicalhistory()" type="primary"><span class="vertical-text">职业病史</span></el-button>
@@ -232,7 +269,11 @@
          <div class="left-container">
            <div class="left">
              <div v-for="(item, index) in changedate" :key="index">
                <div style="text-align: center; background-color: #aad8df; margin-top: 10px;">
                <div style="
                    text-align: center;
                    background-color: #aad8df;
                    margin-top: 10px;
                  ">
                  {{ item.parent || "" }}
                </div>
                <div v-if="item.xmlb == '0'">
@@ -246,7 +287,9 @@
                    <el-table-column align="center" prop="proResult" label="检测结果" width="180"></el-table-column>
                    <el-table-column align="center" prop="" label="单位">
                      <template slot-scope="scope">
                        <div v-if="scope.row.project != null">{{ scope.row.standard.company || "" }}</div>
                        <div v-if="scope.row.project != null">
                          {{ scope.row.standard.company || "" }}
                        </div>
                        <div v-else>{{ scope.row.proAdvice }}</div>
                      </template>
                    </el-table-column>
@@ -254,33 +297,61 @@
                    <el-table-column align="center" prop="" label=" 参考范围">
                      <template slot-scope="scope">
                        <div v-if="scope.row.project != null">
                          {{ scope.row.standard.tjStandardGtValue || "/" + "-" + scope.row.standard.tjStandardLtValue ||
                            "/" }}
                          {{
                            scope.row.standard.tjStandardGtValue ||
                            "/" + "-" + scope.row.standard.tjStandardLtValue ||
                            "/"
                          }}
                        </div>
                        <div v-else>{{ scope.row.stanId || "/" }}</div>
                      </template>
                    </el-table-column>
                  </el-table>
                  <table style="width: 100%" v-if="tjproject != '1'">
                    <tr style="border: 1px solid #dfe6ec; border-collapse: collapse">
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 7%;">
                    <tr style="
                        border: 1px solid #dfe6ec;
                        border-collapse: collapse;
                      ">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                          width: 7%;
                        ">
                        小结:
                      </td>
                      <td style="border: 1px solid #dfe6ec; width: 45%">
                        <el-input v-model="item.remark" disabled></el-input>
                      </td>
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 15%;">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                          width: 15%;
                        ">
                        主检医师:
                      </td>
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse" colspan="2">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                        " colspan="2">
                        {{ item.doctorName }}
                      </td>
                    </tr>
                    <tr style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 200px;">
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 240px;">
                    <tr style="
                        border: 1px solid #dfe6ec;
                        border-collapse: collapse;
                        width: 200px;
                      ">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                          width: 240px;
                        ">
                        备注:
                      </td>
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse" colspan="3">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                        " colspan="3">
                        <el-input type="textarea" autosize placeholder="请输入内容" v-model="changedate[index].remark"
                          v-on:input="change" style="width: 100%"></el-input>
                      </td>
@@ -290,7 +361,12 @@
                <div v-else>
                  <table style="width: 100%" v-if="tjproject != '1'">
                    <tr style="border: 1px solid #dfe6ec">
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 15%; height: auto;">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                          width: 15%;
                          height: auto;
                        ">
                        检查所见:
                      </td>
                      <td style="border: 1px solid #dfe6ec; height: auto" colspan="2">
@@ -298,27 +374,50 @@
                          style="width: 100%"></el-input>
                      </td>
                    </tr>
                    <tr style="border: 1px solid #dfe6ec; border-collapse: collapse">
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 15%;">
                    <tr style="
                        border: 1px solid #dfe6ec;
                        border-collapse: collapse;
                      ">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                          width: 15%;
                        ">
                        检查提示:
                      </td>
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse" colspan="2">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                        " colspan="2">
                        <el-input type="textarea" autosize placeholder="请输入内容" v-model="item.remark"
                          style="width: 100%"></el-input>
                      </td>
                    </tr>
                    <tr style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 200px;">
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse; width: 15%;">
                    <tr style="
                        border: 1px solid #dfe6ec;
                        border-collapse: collapse;
                        width: 200px;
                      ">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                          width: 15%;
                        ">
                        主检医师:
                      </td>
                      <td style="border: 1px solid #dfe6ec; border-collapse: collapse" colspan="2">
                      <td style="
                          border: 1px solid #dfe6ec;
                          border-collapse: collapse;
                        " colspan="2">
                        {{ item.doctorName }}
                      </td>
                    </tr>
                  </table>
                </div>
              </div>
              <div v-if="tableAll && tableAll.tjCategory === '02'" class="section-title">职业病总检</div>
              <div v-if="tableAll && tableAll.tjCategory === '02'" class="section-title">
                职业病总检
              </div>
              <el-form v-if="tableAll && tableAll.tjCategory === '02'" ref="numberValidateForm" label-width="80px"
                class="demo-ruleForm">
                <el-form-item label="检查结论">
@@ -337,7 +436,8 @@
              <el-form ref="numberValidateForm" label-width="80px" class="demo-ruleForm" v-if="tjproject != '1'">
                <el-form-item label="总检建议">
                  <el-input type="textarea" placeholder="请输入内容" v-model="textarea1" :autosize="{ minRows: minRows, maxRows: maxRows }"></el-input>
                  <el-input type="textarea" placeholder="请输入内容" v-model="textarea1"
                    :autosize="{ minRows: minRows, maxRows: maxRows }" style="font-size: 16px"></el-input>
                </el-form-item>
              </el-form>
              <div slot="footer" class="dialog-footers">
@@ -345,7 +445,7 @@
                <el-button v-if="tjproject == '0' && (msgkcf == 'y' || msgkcf == 'Y')" type="primary"
                  @click.stop="rowClick" icon="el-icon-edit-outline">开处方</el-button>
                <div v-if="tjproject == '0'">
                  <el-button type="primary" @click="determine" :disabled="isdisabled">提交并生成报告</el-button>
                  <el-button type="primary" @click="determine" :disabled="isdisabled || isLoading">提交并生成报告</el-button>
                </div>
              </div>
            </div>
@@ -354,18 +454,25 @@
            <div class="right">
              <template v-if="status1 == 0">
                <div v-for="(item, index) in yichangList" :key="index">
                  <div style="text-align: center; background-color: #67c23a; margin-top: 10px;">
                  <div style="
                      text-align: center;
                      background-color: #67c23a;
                      margin-top: 10px;
                    ">
                    {{ item.proName || "" }}
                  </div>
                  <template v-if="item.jyjc == '0'">
                    <el-table :stripe="true" :row-style="red" :data="item.sone" border style="width: 100%"
                      :header-cell-style="{ background: '#67C23A' }" :row-key="getRowKeys" v-loading="loading">
                      :header-cell-style="{ background: '#67C23A' }" :row-key="getRowKeys">
                      <!-- :expand-row-keys="expends" -->
                      <el-table-column type="expand">
                        <template slot-scope="props">
                          <div style="padding: 10px;">
                          <div style="padding: 10px">
                            <!-- 内容区域 -->
                            <div v-if="props.row.advices && props.row.advices.length > 0">
                            <div v-if="
                              props.row.advices &&
                              props.row.advices.length > 0
                            ">
                              <div v-for="(jianyi, index1) in props.row.advices" :key="index1"
                                style="margin-bottom: 10px">
                                <div>
@@ -393,7 +500,7 @@
                                  @blur="handleAdviceBlur(props.row, -1)"></el-input>
                              </div>
                            </div>
                            <div style="margin-top: 10px;">
                            <div style="margin-top: 10px">
                              <el-button @click="shanchu(props.row)" type="danger" size="small">删除</el-button>
                            </div>
                          </div>
@@ -422,9 +529,12 @@
                      <!-- :expand-row-keys="expends"  -->
                      <el-table-column type="expand">
                        <template slot-scope="props">
                          <div style="padding: 10px;">
                          <div style="padding: 10px">
                            <!-- 内容区域 -->
                            <div v-if="props.row.advices && props.row.advices.length > 0">
                            <div v-if="
                              props.row.advices &&
                              props.row.advices.length > 0
                            ">
                              <div v-for="(jianyi, index1) in props.row.advices" :key="index1"
                                style="margin-bottom: 10px">
                                <div>
@@ -452,7 +562,7 @@
                                  @blur="handleAdviceBlur(props.row, -1)"></el-input>
                              </div>
                            </div>
                            <div style="margin-top: 10px;">
                            <div style="margin-top: 10px">
                              <el-button @click="shanchu(props.row)" type="danger" size="small">删除</el-button>
                            </div>
                          </div>
@@ -477,7 +587,11 @@
              </template>
              <template v-if="status1 == 1">
                <div>
                  <div style="text-align: center; background-color: #e6a23c; margin-top: 10px;">
                  <div style="
                      text-align: center;
                      background-color: #e6a23c;
                      margin-top: 10px;
                    ">
                    项目检查情况
                  </div>
                  <el-table :row-style="redxiangmu" :data="statusList" style="width: 100%"
@@ -508,21 +622,32 @@
              <template v-if="status1 == 2">
                <div>
                  <div style="text-align: center; margin-top: 10px;">
                  <div style="text-align: center; margin-top: 10px">
                    复查项目
                  </div>
                  <div style="display: flex;margin:15px ;">
                    <span slot="label" style="display: inline-block; border-bottom: 2px solid blue;font-size: 0.8vw;"
                      @click="handleQuery">
                  <div style="display: flex; margin: 15px">
                    <span slot="label" style="
                        display: inline-block;
                        border-bottom: 2px solid blue;
                        font-size: 0.8vw;
                      " @click="handleQuery">
                      项目选择
                    </span>
                    <div v-if="xmChange.length > 0" style="display: flex;">
                      <div style="margin:0 40px;font-size: 0.8vw;">项目名称:{{ xmChange[0].proName || "" }}</div>
                      <div style="margin:0 80px ;font-size: 0.8vw;">价格:{{ xmChange[0].price || "" }}</div>
                    <div v-if="xmChange.length > 0" style="display: flex">
                      <div style="margin: 0 40px; font-size: 0.8vw">
                        项目名称:{{ xmChange[0].proName || "" }}
                      </div>
                      <div style="margin: 0 80px; font-size: 0.8vw">
                        价格:{{ xmChange[0].price || "" }}
                      </div>
                    </div>
                    <div v-else style="display: flex;">
                      <div style="margin:0 40px;font-size: 0.8vw;">项目名称:{{ }}</div>
                      <div style="margin:0 80px ;font-size: 0.8vw;">价格:{{ }}</div>
                    <div v-else style="display: flex">
                      <div style="margin: 0 40px; font-size: 0.8vw">
                        项目名称:{{}}
                      </div>
                      <div style="margin: 0 80px; font-size: 0.8vw">
                        价格:{{}}
                      </div>
                    </div>
                    <el-button type="primary" size="mini" @click="handleaddClick()">添加</el-button>
                  </div>
@@ -623,8 +748,7 @@
                            <el-input v-model="formobj.xiyanpinlv" disabled style="width: 70px" />支/天
                          </el-form-item>
                          <el-form-item label="吸烟时间" prop="xiyanyear">
                            <el-input v-model="formobj.xiyanyear" disabled style="width: 70px" />年
                          </el-form-item><br />
                            <el-input v-model="formobj.xiyanyear" disabled style="width: 70px" />年 </el-form-item><br />
                          <el-form-item label="是否饮酒" prop="yinjiu">
                            <el-select filterable v-model="formobj.yinjiu" disabled placeholder="请选择是否饮酒" clearable
                              style="width: 150px">
@@ -753,12 +877,15 @@
                  </el-table>
                </div>
              </template>
              <el-button type="primary" @click="addnew" :disabled="isdisabled" style="margin-top: 20px;">新增</el-button>
              <template v-if="status1 == 5">
                <div>
                </div>
              </template>
              <el-button type="primary" @click="addnew" :disabled="isdisabled" style="margin-top: 20px">新增</el-button>
            </div>
          </div>
        </div>
      </div>
    </el-drawer>
    <el-dialog title="PDF 预览" :visible.sync="dialogVisible" :close-on-click-modal="false" width="50%">
@@ -803,10 +930,10 @@
              @focus="tan($event)"></el-input>
          </el-form-item>
          <el-button v-if="index > 0" type="danger" size="small" @click="removeAdvice(index)"
            style="margin-left: 100px; margin-bottom: 10px;">删除</el-button>
            style="margin-left: 100px; margin-bottom: 10px">删除</el-button>
        </div>
        <el-form-item>
          <el-button type="primary" size="small" @click="addAdvice" style="margin-left: 100px;">添加建议</el-button>
          <el-button type="primary" size="small" @click="addAdvice" style="margin-left: 100px">添加建议</el-button>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
@@ -817,7 +944,7 @@
    <el-dialog title="快捷建议选择" :visible.sync="showjianyi" width="1000px" class="custom-dialog"
      :before-close="handleCloseAdviceDialog">
      <!-- 搜索区域 -->
      <div style="margin-bottom: 15px;">
      <div style="margin-bottom: 15px">
        <el-form :inline="true">
          <el-form-item label="建议名称">
            <el-input v-model="queryParams1.zyzd" placeholder="请输入建议名称进行筛选" clearable style="width: 200px"
@@ -828,7 +955,7 @@
      <!-- 建议表格 -->
      <el-table v-loading="adviceLoading" :data="advicerulesList" ref="adviceTable" border highlight-current-row
        @current-change="handleCurrentChangeAdvice" style="max-height: 400px; overflow-y: auto;"
        @current-change="handleCurrentChangeAdvice" style="max-height: 400px; overflow-y: auto"
        :empty-text="adviceEmptyText">
        <el-table-column label="科室" prop="ks" width="100" align="center" />
        <el-table-column label="建议名称" prop="jymc" align="center" />
@@ -851,7 +978,7 @@
    </el-dialog>
    <el-dialog :visible.sync="xmopen" width="800px" append-to-body>
      <div style="margin: 20px;">
      <div style="margin: 20px">
        <el-table :data="datasList" ref="elTable" v-loading="loading" @selection-change="handlexmChange" border
          height="320px">
          <el-table-column type="selection" width="40" align="center" />
@@ -874,7 +1001,7 @@
  </div>
</template>
<script>
import _ from 'lodash';
import _ from "lodash";
import { getConfigKey } from "@/api/system/config";
import jianqianwenzhen from "@/components/jianqianwenzhen";
import Packages from "@/components/Packages";
@@ -899,14 +1026,14 @@
  UpdFcPro,
  huiFuyichangxiangmu,
  hfbt,
  chexiao
  chexiao,tjjcycxm
} from "@/api/doctor/checkAll";
import { getInfoById } from "@/api/hosp/history";
import { getInfo } from "@/api/login";
import { getCompany, queryCompany } from "@/api/team/tuanti";
import { reportHistory, yichang, shanchu } from "@/api/doctor/check";
import { getPdf, revoke } from "@/api/hosp/order";
import { cSWebGetPro, huifu, } from "@/api/doctor/examination";
import { cSWebGetPro, huifu } from "@/api/doctor/examination";
import ViewPdf from "@/components/ViewPdf";
import Historicalreport from "@/components/Historicalreport";
import { getDicts } from "@/api/system/dict/data";
@@ -941,8 +1068,8 @@
  name: "checkAll",
  data() {
    return {
      zhiyeJl: '', // 初始化检查结论为空
      zhiyeJg: '', // 初始化体检结果为默认值
      zhiyeJl: "", // 初始化检查结论为空
      zhiyeJg: "", // 初始化体检结果为默认值
      selectedAdvice: null,
      activeAdviceIndex: 0,
      minRows: 3,
@@ -954,27 +1081,27 @@
      piliang: false,
      isLoading: false,
      adviceLoading: false,
      adviceEmptyText: '暂无数据',
      adviceEmptyText: "暂无数据",
      total1: 0,
      forms: {
        pacName: ""
        pacName: "",
      },
      xmopen: false,
      datasList: [],
      queryParams1: {
        pageNum: 1,
        pageSize: 10,
        zyzd: '',
        zyzd: "",
      },
      adviceCache: new Map(),
      addNewDialogVisible: false,
      newItem: {
        parentName: '',
        jcxm: '',
        jcjg: '',
        ckfw: '',
        dw: '',
        map: [{ bt: '', nr: '' }]
        parentName: "",
        jcxm: "",
        jcjg: "",
        ckfw: "",
        dw: "",
        map: [{ bt: "", nr: "" }],
      },
      projectCategories: [],
      emptyAdvice: {
@@ -1074,7 +1201,7 @@
        checkStatus: null,
        shys: null,
        tcm: null,
        tjCategory: null
        tjCategory: null,
      },
      formobj: {},
      yichangList: [],
@@ -1111,14 +1238,14 @@
  },
  created() {
    console.log(this.dict.type.dict_tjtype, "职业体检");
    this.getConfigKey();
    this.getdate();
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.inputName.focus();
      this.viewportHeight = window.innerHeight || document.documentElement.clientHeight;
      this.viewportHeight =
        window.innerHeight || document.documentElement.clientHeight;
    });
    getConfigKey("zjysjymrhs").then((res) => {
      const val = parseInt(res.msg); // 确保是数字
@@ -1131,13 +1258,14 @@
  methods: {
    // 打开建议选择弹窗
    tan(event) {
      this.activeAdviceIndex = event.target.closest('.advice-group')
        ? Array.from(event.target.closest('.el-form').querySelectorAll('.advice-group'))
          .indexOf(event.target.closest('.advice-group'))
      this.activeAdviceIndex = event.target.closest(".advice-group")
        ? Array.from(
          event.target.closest(".el-form").querySelectorAll(".advice-group")
        ).indexOf(event.target.closest(".advice-group"))
        : 0;
      this.queryParams1.pageNum = 1;
      this.queryParams1.pageSize = 10;
      this.queryParams1.zyzd = '';
      this.queryParams1.zyzd = "";
      this.selectedAdvice = null;
      this.advicerulesList = [];
      this.total1 = 0;
@@ -1152,18 +1280,20 @@
        this.queryParams1.pageNum = 1;
      }
      const cacheKey = `${this.queryParams1.zyzd || ''}_${this.queryParams1.pageNum}_${this.queryParams1.pageSize}`;
      const cacheKey = `${this.queryParams1.zyzd || ""}_${this.queryParams1.pageNum
        }_${this.queryParams1.pageSize}`;
      if (this.adviceCache.has(cacheKey)) {
        const cachedData = this.adviceCache.get(cacheKey);
        this.advicerulesList = cachedData.rows;
        this.total1 = cachedData.total;
        this.adviceEmptyText = this.advicerulesList.length === 0 ? '暂无匹配的建议' : '暂无数据';
        this.adviceEmptyText =
          this.advicerulesList.length === 0 ? "暂无匹配的建议" : "暂无数据";
        return;
      }
      this.adviceLoading = true;
      this.adviceEmptyText = '加载中...';
      this.adviceEmptyText = "加载中...";
      listAdvicerules(this.queryParams1)
        .then((response) => {
@@ -1175,14 +1305,14 @@
            total: this.total1,
          });
          this.adviceEmptyText = this.advicerulesList.length === 0 ? '暂无匹配的建议' : '暂无数据';
          this.adviceEmptyText =
            this.advicerulesList.length === 0 ? "暂无匹配的建议" : "暂无数据";
        })
        .catch((error) => {
          console.error('筛选快捷建议失败:', error);
          this.advicerulesList = [];
          this.total1 = 0;
          this.adviceEmptyText = '加载失败,请稍后重试';
          this.$message.error('加载建议失败,请检查网络后重试');
          this.adviceEmptyText = "加载失败,请稍后重试";
          this.$message.error("加载建议失败,请检查网络后重试");
        })
        .finally(() => {
          this.adviceLoading = false;
@@ -1198,7 +1328,6 @@
      const date = moment(row.qdcreateTime, "YYYY-MM-DD");
      return date.isValid() ? date.format("YYYY-MM-DD") : "无效日期";
    },
    toggleCollapse3() {
      this.isCollapsed = 0;
@@ -1216,14 +1345,14 @@
        this.showjianyi = false;
        this.selectedAdvice = null;
      } else {
        this.$message.warning('请先选择一条建议');
        this.$message.warning("请先选择一条建议");
      }
    },
    cancelAdviceDialog() {
      this.showjianyi = false;
      this.selectedAdvice = null;
      this.queryParams1.zyzd = '';
      this.queryParams1.zyzd = "";
      this.queryParams1.pageNum = 1;
      this.advicerulesList = [];
      this.total1 = 0;
@@ -1232,10 +1361,10 @@
    handleCloseAdviceDialog(done) {
      if (this.selectedAdvice) {
        this.$confirm('您已选择一条建议,确定要关闭吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning',
        this.$confirm("您已选择一条建议,确定要关闭吗?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            this.cancelAdviceDialog();
@@ -1253,8 +1382,10 @@
      if (index === -1) {
        if (this.emptyAdvice.bt || this.emptyAdvice.nr) {
          advicesToSubmit = [{ bt: this.emptyAdvice.bt || '', nr: this.emptyAdvice.nr || '' }];
          this.$set(row, 'advices', advicesToSubmit);
          advicesToSubmit = [
            { bt: this.emptyAdvice.bt || "", nr: this.emptyAdvice.nr || "" },
          ];
          this.$set(row, "advices", advicesToSubmit);
        }
      } else {
        advicesToSubmit = row.advices;
@@ -1264,12 +1395,14 @@
        return;
      }
      const parentItem = this.yichangList.find(item =>
        item.sone.some(soneItem => soneItem.orderDetailId === row.orderDetailId)
      const parentItem = this.yichangList.find((item) =>
        item.sone.some(
          (soneItem) => soneItem.orderDetailId === row.orderDetailId
        )
      );
      if (!parentItem) {
        this.$message.error('未找到对应的父级项目');
        this.$message.error("未找到对应的父级项目");
        return;
      }
@@ -1285,16 +1418,17 @@
        id: row.orderDetailId,
      };
      addOrder1(data).then((res) => {
        if (res.code === 200) {
          // 成功更新建议
        } else {
          this.$message.error('建议更新失败:' + (res.msg || '未知错误'));
        }
      }).catch((error) => {
        console.error('建议更新失败:', error);
        this.$message.error('建议更新失败:' + error.message);
      });
      addOrder1(data)
        .then((res) => {
          if (res.code === 200) {
            // 成功更新建议
          } else {
            this.$message.error("建议更新失败:" + (res.msg || "未知错误"));
          }
        })
        .catch((error) => {
          this.$message.error("建议更新失败:" + error.message);
        });
    },
    handleSelectionChange(selection) {
@@ -1310,46 +1444,48 @@
        ckfw: this.newItem.ckfw,
        dw: this.newItem.dw,
        map: this.newItem.map,
        jyjc: this.newItem.ckfw ? "0" : "1"
        jyjc: this.newItem.ckfw ? "0" : "1",
      };
      addOrder1(data).then((res) => {
        if (res.code === 200) {
          this.$message.success('新增异常结果成功');
          this.addNewDialogVisible = false;
          this.yichangjieguo();
        } else {
          this.$message.error('新增失败');
        }
      }).catch((error) => {
        console.error('新增异常结果失败:', error);
        this.$message.error('新增异常结果失败');
      });
      addOrder1(data)
        .then((res) => {
          if (res.code === 200) {
            this.$message.success("新增异常结果成功");
            this.addNewDialogVisible = false;
            this.yichangjieguo();
          } else {
            this.$message.error("新增失败");
          }
        })
        .catch((error) => {
          this.$message.error("新增异常结果失败");
        });
    },
    addnew() {
      this.newItem = {
        parentName: '',
        jcxm: '',
        jcjg: '',
        ckfw: '',
        dw: '',
        map: [{ bt: '', nr: '' }]
        parentName: "",
        jcxm: "",
        jcjg: "",
        ckfw: "",
        dw: "",
        map: [{ bt: "", nr: "" }],
      };
      this.addNewDialogVisible = true;
      cSWebGetPro(this.tjNumber).then((res) => {
        if (res.data && Array.isArray(res.data)) {
          this.projectCategories = res.data;
        } else {
          this.$message.warning('未获取到项目分类数据');
      cSWebGetPro(this.tjNumber)
        .then((res) => {
          if (res.data && Array.isArray(res.data)) {
            this.projectCategories = res.data;
          } else {
            this.$message.warning("未获取到项目分类数据");
            this.projectCategories = [];
          }
        })
        .catch((error) => {
          this.$message.error("获取项目分类失败");
          this.projectCategories = [];
        }
      }).catch((error) => {
        console.error('获取项目分类失败:', error);
        this.$message.error('获取项目分类失败');
        this.projectCategories = [];
      });
        });
    },
    handleCategoryChange(value) {
@@ -1359,18 +1495,18 @@
    },
    change(val) {
      console.log('选中的值是:', val);
      console.log("选中的值是:", val);
    },
    addAdvice() {
      this.newItem.map.push({ bt: '', nr: '' });
      this.newItem.map.push({ bt: "", nr: "" });
    },
    removeAdvice(index) {
      if (this.newItem.map.length > 1) {
        this.newItem.map.splice(index, 1);
      } else {
        this.$message.warning('至少保留一组建议');
        this.$message.warning("至少保留一组建议");
      }
    },
@@ -1379,71 +1515,77 @@
      shanchu({
        id: row.orderDetailId,
      }).then((res) => {
        console.log(res, 1111);
      })
        .then((res) => {
        if (res.code === 200) {
          const parentItem = this.yichangList.find(item =>
            item.sone.some(soneItem => soneItem.orderDetailId === row.orderDetailId)
          );
          if (res.code === 200) {
            const parentItem = this.yichangList.find((item) =>
              item.sone.some(
                (soneItem) => soneItem.orderDetailId === row.orderDetailId
              )
            );
          if (parentItem) {
            const index = parentItem.sone.findIndex(item => item.orderDetailId === row.orderDetailId);
            if (index > -1) {
              parentItem.sone.splice(index, 1);
            if (parentItem) {
              const index = parentItem.sone.findIndex(
                (item) => item.orderDetailId === row.orderDetailId
              );
              if (index > -1) {
                parentItem.sone.splice(index, 1);
              if (parentItem.sone.length === 0) {
                const parentIndex = this.yichangList.indexOf(parentItem);
                if (parentIndex > -1) {
                  this.yichangList.splice(parentIndex, 1);
                if (parentItem.sone.length === 0) {
                  const parentIndex = this.yichangList.indexOf(parentItem);
                  if (parentIndex > -1) {
                    this.yichangList.splice(parentIndex, 1);
                  }
                }
              }
              this.getExpends();
              this.$forceUpdate();
              this.$message.success('删除成功');
                this.getExpends();
                this.$forceUpdate();
                this.$message.success("删除成功");
              } else {
                this.$message.error("未找到要删除的子项");
              }
            } else {
              this.$message.error('未找到要删除的子项');
              this.$message.error("未找到要删除的父项");
            }
          } else {
            this.$message.error('未找到要删除的父项');
            this.$message.error("后端删除失败:" + (res.msg || "未知错误"));
          }
        } else {
          this.$message.error('后端删除失败:' + (res.msg || '未知错误'));
        }
      }).catch((error) => {
        console.error('删除失败:', error);
        this.$message.error('删除操作失败:' + error.message);
      }).finally(() => {
        this.isdisabled = false;
      });
        })
        .catch((error) => {
          this.$message.error("删除操作失败:" + error.message);
        })
        .finally(() => {
          this.isdisabled = false;
        });
    },
    handleQuery() {
      this.xmopen = true;
      let data = {
        tjNum: this.tjNumber,
        type: 0
        type: 0,
      };
      getFcList(data).then(res => {
      getFcList(data).then((res) => {
        this.datasList = res.data;
      });
    },
    handleaddClick() {
      console.log(this.xmChange);
      let data = {
        orderId: this.xmChange[0].orderId,
        data: [{
          proId: this.xmChange[0].proId,
          type: 1
        }]
        data: [
          {
            proId: this.xmChange[0].proId,
            type: 1,
          },
        ],
      };
      UpdFcPro(data).then(res => { });
      UpdFcPro(data).then((res) => { });
    },
    handledeleteClick() {
      UpdFcPro(data).then(res => { });
      UpdFcPro(data).then((res) => { });
    },
    handlexmChange(selection) {
@@ -1465,8 +1607,8 @@
    },
    getExpends() {
      this.expends = this.yichangList.flatMap(item =>
        item.sone.map(soneItem => soneItem.orderDetailId)
      this.expends = this.yichangList.flatMap((item) =>
        item.sone.map((soneItem) => soneItem.orderDetailId)
      );
    },
@@ -1497,8 +1639,7 @@
          }
        })
        .catch((error) => {
          console.error('获取项目情况失败:', error);
          this.$message.error('获取项目情况失败');
          this.$message.error("获取项目情况失败");
        })
        .finally(() => {
          this.loading = false;
@@ -1510,35 +1651,50 @@
    },
    yichangjieguo() {
      this.isLoading = true
      this.loading = true;
      this.status1 = 0;
      this.yichangList = []
      yichang({
        tjNum: this.tjNumber,
      })
        .then((res) => {
          this.isLoading = false
          this.yichangList = res.data;
          this.yichangList.forEach((item) => {
            item.sone.forEach((soneItem) => {
              if (!Array.isArray(soneItem.advices) || soneItem.advices.length === 0) {
                soneItem.advices = [{ bt: "", nr: "" }];
              }
      this.yichangList = [];
      return new Promise((resolve, reject) => {
        yichang({
          tjNum: this.tjNumber,
        })
          .then((res) => {
            const data = res.data;
            if (!data || data.length === 0) {
              this.loading = false;
              resolve(); // 返回 Promise,但不继续后续逻辑
              return;
            }
            this.yichangList = data;
            this.yichangList.forEach((item) => {
              item.sone.forEach((soneItem) => {
                if (
                  !Array.isArray(soneItem.advices) ||
                  soneItem.advices.length === 0
                ) {
                  soneItem.advices = [{ bt: "", nr: "" }];
                }
              });
            });
            /* if (!this.yichangList) {
              this.$message.warning("暂无异常报告");
            } */
            resolve(); // 成功完成
          })
          .catch((error) => {
            this.loading = false;
            this.$message.error("获取异常结果失败");
            reject(error); // 返回错误
          })
          .finally(() => {
            if (this.loading) {
              this.loading = false;
            }
          });
          if (!this.yichangList) {
            this.$message.warning("暂无异常报告");
          }
        })
        .catch((error) => {
          this.isLoading = false
          console.error('获取异常结果失败:', error);
          this.$message.error('获取异常结果失败');
        })
        .finally(() => {
          this.isLoading = false
          this.loading = false;
        });
      });
    },
    fuchaxiangmu() {
@@ -1546,15 +1702,14 @@
      this.status1 = 2;
      let data = {
        tjNum: this.tjNumber,
        type: 1
        type: 1,
      };
      getFcList(data)
        .then((res) => {
          this.fcList = res.data;
        })
        .catch((error) => {
          console.error('获取复查项目失败:', error);
          this.$message.error('获取复查项目失败');
          this.$message.error("获取复查项目失败");
        })
        .finally(() => {
          this.loading = false;
@@ -1659,7 +1814,7 @@
              }, 3000);
              this.$message({
                message: "请撤回重新生成报告",
                type: "error"
                type: "error",
              });
            } else {
              this.dialogVisible = true;
@@ -1669,7 +1824,11 @@
        } else {
          let url = response.data.url;
          const params = { url };
          this.$tab.openPage("健康证检查表", "/report/zongjianjiankangzheng", params);
          this.$tab.openPage(
            "健康证检查表",
            "/report/zongjianjiankangzheng",
            params
          );
        }
      });
    },
@@ -1688,7 +1847,7 @@
            let dictTypes = "sys_user_sex";
            return getDicts(dictTypes);
          } else {
            throw new Error('获取年龄单位字典失败');
            throw new Error("获取年龄单位字典失败");
          }
        })
        .then((res) => {
@@ -1707,7 +1866,7 @@
            };
            return getTjYxjcList(data);
          } else {
            throw new Error('获取性别字典失败');
            throw new Error("获取性别字典失败");
          }
        })
        .then((res) => {
@@ -1716,8 +1875,7 @@
          this.$refs.bbb.title = "报告字典";
        })
        .catch((error) => {
          console.error('生成图文报告失败:', error);
          this.$message.error('生成图文报告失败');
          this.$message.error("生成图文报告失败");
        })
        .finally(() => {
          this.loading = false;
@@ -1738,11 +1896,34 @@
          }
        })
        .catch((error) => {
          console.error('获取历史报告失败:', error);
          this.$message.error('获取历史报告失败');
          this.$message.error("获取历史报告失败");
        })
        .finally(() => {
          this.loading = false;
        });
    },
    hisycxm() {
      this.status1 = 5;
      this.$confirm("重置异常项目后不可恢复    请谨慎重置", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 用户确认后执行接口
          let tjh = this.tableAll.tjNumber
          tjjcycxm(tjh)
            .then((res) => {
              this.$message.success("重置异常项目成功");
            })
            .catch((err) => {
              this.$message.error("重置异常项目失败");
            });
        })
        .catch(() => {
          // 用户取消了操作
          this.$message.info("已取消");
        });
    },
@@ -1773,8 +1954,7 @@
          }
        })
        .catch((error) => {
          console.error('获取职业病史失败:', error);
          this.$message.error('获取职业病史失败');
          this.$message.error("获取职业病史失败");
        })
        .finally(() => {
          this.loading = false;
@@ -1802,9 +1982,9 @@
    radioChange(value) {
      this.loading = true;
      if (value == "0" && this.gotyval == "01") {
        this.piliang = true
        this.piliang = true;
      } else {
        this.piliang = false
        this.piliang = false;
      }
      this.queryParams.checkStatus = value;
      this.queryParams.page = 1;
@@ -1822,8 +2002,10 @@
    propoChange() {
      this.cusobj = { sex: this.tableAll.cusSex, isZj: 0 };
      getConfigKey("mrzscyjy").then((res) => {
        this.mrjy = res.msg;
        this.mrjy = res.msg;
        this.$refs.proposal.clearSearchFields();
        this.$refs.proposal.title = "建议方案";
        this.$refs.proposal.open = true;
      });
@@ -1859,6 +2041,7 @@
    radiotjprojectChange() {
      if (this.tjproject == "0") {
        getupdateCheckType(this.tjNumber).then((response) => {
          this.isLoading = false;
          this.changedate = response.data;
          this.changedate.forEach((item) => {
            this.textarea1 = item.checkAdvice;
@@ -1910,17 +2093,15 @@
    },
    searchCategory(val) {
      this.gotyval = val
      this.gotyval = val;
      if (val == "01" && this.tjStatus == "0") {
        this.piliang = true
        this.piliang = true;
      } else {
        this.piliang = false
        this.piliang = false;
      }
    },
    handleshenhe() {
    },
    handleshenhe() { },
    dateChangebirthday1(val) {
      this.startTime = val;
@@ -1965,7 +2146,7 @@
      const proId = row.proId;
      huifu(tjNUm, proId).then((res) => {
        if (res.code == 200) {
          this.xiangmuqingkuang()
          this.xiangmuqingkuang();
        }
      });
    },
@@ -1981,25 +2162,24 @@
      });
    },
    yichanghuifu() {
      this.loading = true;
      let tjNum = this.tjNumber;
      huiFuyichangxiangmu(tjNum).then((res) => {
        this.status1 = 4;
        this.ychfList = res.data;
        if (this.ychfList.length == 0) {
          this.$message.success("暂无异常恢复项目")
        }
      })
      huiFuyichangxiangmu(tjNum)
        .then((res) => {
          this.status1 = 4;
          this.ychfList = res.data;
          if (this.ychfList.length == 0) {
            this.$message.success("暂无异常恢复项目");
          }
        })
        .catch((error) => {
          console.error("获取项目失败:", error);
          this.$message.error("获取项目失败")
          this.$message.error("获取项目失败");
        })
        .finally(() => {
          this.loading = false;
        })
        });
    },
    hfyc(id) {
@@ -2016,7 +2196,6 @@
              this.yichanghuifu(); // 恢复后刷新列表
            })
            .catch((err) => {
              console.error(err);
              this.$message.error("恢复失败");
            });
        })
@@ -2028,7 +2207,7 @@
    resetQuery() {
      this.startTime = [];
      this.queryParams = {
      (this.queryParams = {
        page: 1,
        pageSize: 10,
        tjNumber: "",
@@ -2038,8 +2217,8 @@
        name: null,
        checkStatus: null,
        shys: null,
        tjCategory: null
      },
        tjCategory: null,
      }),
        this.resetForm("tableList");
      this.submitForm();
    },
@@ -2067,37 +2246,36 @@
    },
    handleCurrentChange(val) {
      console.log(val)
      if (val != null) {
        this.handleClick(val);
      }
    },
    qingkong() {
      this.tableAll = {}
      this.changedate = []
      this.yichangList = []
      this.statusList = []
      this.xmChange = []
      this.fcList = []
      this.formobj = {}
      this.tableAll = {};
      this.changedate = [];
      this.yichangList = [];
      this.statusList = [];
      this.xmChange = [];
      this.fcList = [];
      this.formobj = {};
    },
    handleClick(row) {
      this.qingkong()
    /* handleClick(row) {
      this.qingkong();
      this.$refs.Pre.open = false;
      this.tableAll = row;
      let dict = "dict_tjtype"
      getDicts(dict).then(res => {
         if (res.code == 200) {
            res.data.forEach((item) => {
              if (this.tableAll.tjCategory == item.dictValue) {
                this.tableAll.tjCategory = item.dictLabel;
              }
            });
          } else {
            throw new Error('获取体检类型字典失败');
          }
      })
      let dict = "dict_tjtype";
      getDicts(dict).then((res) => {
        if (res.code == 200) {
          res.data.forEach((item) => {
            if (this.tableAll.tjCategory == item.dictValue) {
              this.tableAll.tjCategory = item.dictLabel;
            }
          });
        } else {
          throw new Error("获取体检类型字典失败");
        }
      });
      this.tjproject = "0";
      this.tjNumber = this.tableAll.tjNumber;
@@ -2105,96 +2283,199 @@
        this.status = res.data;
        if (this.status) {
          if (this.status.status === "1") {
            this.yichangjieguo();
            getInfo().then((response) => {
              this.userId = response.user.userId;
              if (this.userId) {
                let data = {
                  userId: this.userId,
                  tjNumber: this.tjNumber,
                  state: 0,
                };
                getModifiedState(data).then((res) => {
                  this.MsgId = res.msg;
                  this.isLoading = true
                  this.drawer = true;
                  getupdateCheckType(this.tjNumber).then((response) => {
                    this.isLoading = false
                    this.changedate = response.data;
                    if (this.changedate) {
                      this.changedate.forEach((item) => {
                        this.textarea1 = item.checkAdvice || "";
                      });
                      this.initialTotalCheckAdvice = this.textarea1;
                      this.initialState = JSON.parse(JSON.stringify(this.changedate));
                      for (let i = 0; i < this.changedate.length; i++) {
                        this.remark = this.changedate[i].remark;
                      }
                      // 回显 zhiyeJl 和 zhiyeJg
                      this.zhiyeJl = this.changedate[0].zhiyejl || '';
                      this.zhiyeJg = this.changedate[0].zhiyejg || '未发现目标性疾病';
                    } else {
                      this.$message({
                        type: "warning",
                        message: "该客户没有体检项目数据",
                      });
                      // 如果没有数据,清空字段
                      this.zhiyeJl = '';
                      this.zhiyeJg = '未发现目标性疾病';
                    }
                  });
                });
              }
            });
            // 没有强制进入弹框,直接开启加载和弹框
            this.isLoading = true;
            this.drawer = true;
            // 直接在handleClick中实现并行加载
            this.loadDataInHandleClick();
          } else {
            this.$confirm("" + this.status.name + "正在修改该信息, 是否强制进去?", "提示", {
              confirmButtonText: "是",
              cancelButtonText: "否",
              type: "warning",
            })
            this.$confirm(
              "" + this.status.name + "正在修改该信息, 是否强制进去?",
              "提示",
              {
                confirmButtonText: "是",
                cancelButtonText: "否",
                type: "warning",
              }
            )
              .then(() => {
                this.yichangjieguo();
                getInfo().then((response) => {
                  this.userId = response.user.userId;
                  if (this.userId) {
                    let data = {
                      userId: this.userId,
                      tjNumber: this.tjNumber,
                      state: 0,
                    };
                    getforceIn(data).then((res) => {
                      this.MsgId = res.msg;
                      this.isLoading = true
                      this.drawer = true;
                      getupdateCheckType(this.tjNumber).then((response) => {
                        this.isLoading = false
                        this.changedate = response.data;
                        if (this.changedate) {
                          for (let i = 0; i < this.changedate.length; i++) {
                            this.remark = this.changedate[i].remark;
                          }
                          this.initialState = JSON.parse(JSON.stringify(this.changedate));
                          this.changedate.forEach((item) => {
                            this.textarea1 = item.checkAdvice || "";
                          });
                          // 回显 zhiyeJl 和 zhiyeJg
                          this.zhiyeJl = this.changedate[0].zhiyejl || '';
                          this.zhiyeJg = this.changedate[0].zhiyejg || '未发现目标性疾病';
                        } else {
                          this.$message({
                            type: "warning",
                            message: "该客户没有体检项目数据",
                          });
                          // 如果没有数据,清空字段
                          this.zhiyeJl = '';
                          this.zhiyeJg = '未发现目标性疾病';
                        }
                      });
                    });
                  }
                // 关闭表格的loading状态
                this.loading = false;
                // 用户确认强制进入,开启加载和弹框
                this.isLoading = true;
                this.drawer = true;
                // 直接在handleClick中实现并行加载(强制进入模式)
                this.loadDataInHandleClick(true);
              })
              .catch(() => {
                this.isLoading = false; // 取消时也要关闭加载框
                this.$message({
                  type: "info",
                  message: "已取消进入",
                });
              });
          }
        }
      });
    }, */
    handleClick(row) {
      this.qingkong();
      this.$refs.Pre.open = false;
      this.tableAll = row;
      let dict = "dict_tjtype";
      getDicts(dict).then((res) => {
        if (res.code == 200) {
          res.data.forEach((item) => {
            if (this.tableAll.tjCategory == item.dictValue) {
              this.tableAll.tjCategory = item.dictLabel;
            }
          });
        } else {
          throw new Error("获取体检类型字典失败");
        }
      });
      this.tjproject = "0";
      this.tjNumber = this.tableAll.tjNumber;
      getState(this.tjNumber).then((res) => {
        this.status = res.data;
        if (this.status) {
          if (this.status.status === "1") {
            // 开启加载和弹框
            this.isLoading = true;
            this.drawer = true;
            // 并行执行异常结果、用户信息获取和体检项目数据获取
            Promise.all([
              this.yichangjieguo(),
              getInfo(),
              getupdateCheckType(this.tjNumber),
            ])
              .then(([yichangResult, userInfo, checkTypeResult]) => {
                this.userId = userInfo.user.userId;
                if (this.userId) {
                  let data = {
                    userId: this.userId,
                    tjNumber: this.tjNumber,
                    state: 0,
                  };
                  getModifiedState(data)
                    .then((res) => {
                      this.MsgId = res.msg;
                      // 所有数据都已加载完成,关闭loading
                      this.isLoading = false;
                      this.changedate = checkTypeResult.data;
                      if (this.changedate) {
                        this.changedate.forEach((item) => {
                          this.textarea1 = item.checkAdvice || "";
                        });
                        this.initialTotalCheckAdvice = this.textarea1;
                        this.initialState = JSON.parse(
                          JSON.stringify(this.changedate)
                        );
                        for (let i = 0; i < this.changedate.length; i++) {
                          this.remark = this.changedate[i].remark;
                        }
                        // 回显 zhiyeJl 和 zhiyeJg
                        this.zhiyeJl = this.changedate[0].zhiyejl || "";
                        this.zhiyeJg =
                          this.changedate[0].zhiyejg || "未发现目标性疾病";
                      } else {
                        this.$message({
                          type: "warning",
                          message: "该客户没有体检项目数据",
                        });
                        // 如果没有数据,清空字段
                        this.zhiyeJl = "";
                        this.zhiyeJg = "未发现目标性疾病";
                      }
                    })
                    .catch((error) => {
                      this.isLoading = false;
                      this.$message.error("修改状态失败");
                    });
                } else {
                  this.isLoading = false;
                }
              })
              .catch((error) => {
                this.isLoading = false;
                this.$message.error("加载数据失败,请重试");
              });
          } else {
            this.$confirm(
              "" + this.status.name + "正在修改该信息, 是否强制进去?",
              "提示",
              {
                confirmButtonText: "是",
                cancelButtonText: "否",
                type: "warning",
              }
            )
              .then(() => {
                // 开启加载和弹框
                this.isLoading = true;
                this.drawer = true;
                // 并行执行异常结果、用户信息获取和体检项目数据获取
                Promise.all([
                  this.yichangjieguo(),
                  getInfo(),
                  getupdateCheckType(this.tjNumber),
                ])
                  .then(([yichangResult, userInfo, checkTypeResult]) => {
                    this.userId = userInfo.user.userId;
                    if (this.userId) {
                      let data = {
                        userId: this.userId,
                        tjNumber: this.tjNumber,
                        state: 0,
                      };
                      getforceIn(data)
                        .then((res) => {
                          this.MsgId = res.msg;
                          // 所有数据都已加载完成,关闭loading
                          this.isLoading = false;
                          this.changedate = checkTypeResult.data;
                          if (this.changedate) {
                            for (let i = 0; i < this.changedate.length; i++) {
                              this.remark = this.changedate[i].remark;
                            }
                            this.initialState = JSON.parse(
                              JSON.stringify(this.changedate)
                            );
                            this.changedate.forEach((item) => {
                              this.textarea1 = item.checkAdvice || "";
                            });
                            // 回显 zhiyeJl 和 zhiyeJg
                            this.zhiyeJl = this.changedate[0].zhiyejl || "";
                            this.zhiyeJg =
                              this.changedate[0].zhiyejg || "未发现目标性疾病";
                          } else {
                            this.$message({
                              type: "warning",
                              message: "该客户没有体检项目数据",
                            });
                            // 如果没有数据,清空字段
                            this.zhiyeJl = "";
                            this.zhiyeJg = "未发现目标性疾病";
                          }
                        })
                        .catch((error) => {
                          this.isLoading = false;
                          this.$message.error("强制进入失败");
                        });
                    } else {
                      this.isLoading = false;
                    }
                  })
                  .catch((error) => {
                    this.isLoading = false;
                    this.$message.error("加载数据失败,请重试");
                  });
              })
              .catch(() => {
                this.$message({
@@ -2208,7 +2489,10 @@
    },
    handleClose(done) {
      if (JSON.stringify(this.initialState) !== JSON.stringify(this.changedate) || this.initialTotalCheckAdvice !== this.textarea1) {
      if (
        JSON.stringify(this.initialState) !== JSON.stringify(this.changedate) ||
        this.initialTotalCheckAdvice !== this.textarea1
      ) {
        this.$confirm("您有未保存的更改,确定要关闭吗?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
@@ -2249,12 +2533,13 @@
      let tjNumber = this.tableAll.tjNumber;
      let tjh = this.tableAll.tjNumber;
      let advice = this.textarea1;
      this.isLoading = true;
      let data = {
        tjNumber,
        advice,
        checkStatus: 1,
        zhiyeJl: this.zhiyeJl, // 添加检查结论
        zhiyeJg: this.zhiyeJg  // 添加体检结果
        zhiyeJg: this.zhiyeJg, // 添加体检结果
      };
      let dataList = this.yichangList
        .map((item) => {
@@ -2275,10 +2560,11 @@
      getTjdetailList(data)
        .then((response) => {
          if (response.code === 200) {
            this.$modal.msgSuccess("提交成功");
            this.isLoading = false;
            this.$modal.msgSuccess(response.msg);
            // 清空字段
            this.zhiyeJl = '';
            this.zhiyeJg = '';
            this.zhiyeJl = "";
            this.zhiyeJg = "";
            let reportData = {
              userId: this.userId,
@@ -2286,8 +2572,44 @@
              state: 1,
              id: this.MsgId,
            };
            /* gettoPdf(tjNumber)
              .then((res) => {
                this.$modal.msgSuccess("已生成报告!请前往报告核收页面确认!");
              })
              .catch(() => {
                this.$modal.msgError(
                  "打印报告失败,请前往报告打印页面补打报告!"
                );
              }); */
            const statePromise = getfiedState(reportData).then(() => {
              this.drawer = false;
            });
            const updatePromises = this.changedate.map((item) => {
              this.proIds = item.parentId;
              let remarks = item.remark;
              let updateOrderRemarkVos = [
                {
                  tjNumber,
                  proId: this.proIds.toString(),
                  remarks,
                },
              ];
              return getModified(updateOrderRemarkVos);
            });
            addOrder(dataList)
            Promise.all([statePromise, ...updatePromises])
              .then(() => {
                this.loading = false;
                this.queryParams.page = 1;
                this.queryParams.pageSize = 10;
                this.submitForm();
                this.$forceUpdate();
              })
              .catch((error) => {
                this.loading = false;
              });
            /* addOrder(dataList)
              .then((res) => {
                if (res.code == 200) {
                  gettoPdf(tjNumber)
@@ -2327,14 +2649,12 @@
                    })
                    .catch((error) => {
                      this.loading = false;
                      console.error("发生错误:", error);
                    });
                }
              })
              .catch((error) => {
                this.loading = false;
                console.error("addOrderPromise 失败:", error);
              });
              }); */
          } else {
            this.loading = false;
            this.$modal.msgError("提交失败");
@@ -2342,7 +2662,6 @@
        })
        .catch((error) => {
          this.loading = false;
          console.error("提交请求失败:", error);
          this.$modal.msgError("提交请求失败");
        });
    },