yxh
昨天 0e5553e2390bb336e589e5b7f0fa890d59aed735
src/views/project/donationdetails/index.vue
@@ -1,9 +1,20 @@
<template>
  <div class="particularsdiv">
    <div class="left-course">
    <div class="left-course" :class="{ 'left-collapsed': isLeftCollapsed }">
      <div class="postfilx">
        <div class="title">工作进程</div>
        <div>
        <div class="title">
          案例进程
          <el-button
            class="collapse-btn"
            @click="toggleLeftCollapse"
            :icon="
              isLeftCollapsed ? 'el-icon-arrow-right' : 'el-icon-arrow-left'
            "
            size="mini"
          >
          </el-button>
        </div>
        <div v-show="!isLeftCollapsed">
          <el-steps direction="vertical" :active="workflow">
            <el-step title="潜在捐献" icon="el-icon-user">
              <template slot="description" v-if="donatebaseinfo.createtime">
@@ -155,7 +166,7 @@
      </div>
    </div>
    <!-- 右侧数据 -->
    <div style="background: #fff; width: 80%;">
    <div class="right-content" :class="{ 'right-expanded': isLeftCollapsed }">
      <!-- 顶部数据 -->
      <div class="boxdiv">
        <div class="top-text">捐献案例信息</div>
@@ -210,7 +221,7 @@
                    clearable
                    size="small"
                    v-model="form.reporttime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择报告日期"
                  >
@@ -256,7 +267,7 @@
                    clearable
                    size="small"
                    v-model="form.birthday"
                    type="date"
                    type="date" format="yyyy-MM-dd"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择出生日期"
                  >
@@ -768,7 +779,7 @@
                  size="small"
                  style="width: 190px"
                  v-model="form.contacttime"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择报告时间"
                >
@@ -851,7 +862,7 @@
                  clearable
                  size="small"
                  v-model="medicineform.hospitalassesstime"
                  type="date"
                  type="date" format="yyyy-MM-dd"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择院级评估时间"
                >
@@ -904,7 +915,7 @@
                  clearable
                  size="small"
                  v-model="medicineform.provincialassesstime"
                  type="date"
                  type="date" format="yyyy-MM-dd"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择省级评估时间"
                >
@@ -958,7 +969,7 @@
                  clearable
                  size="small"
                  v-model="medicineform.coreteamassesstime"
                  type="date"
                  type="date" format="yyyy-MM-dd"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="评估时间"
                >
@@ -1184,20 +1195,29 @@
          </el-row>
          <el-row>
            <el-form-item label-width="100px" label="捐献决定">
              <el-checkbox-group v-model="organdecision">
                <el-checkbox
                  v-for="item in fixedOrganSelection"
                  :key="item"
                  :label="item"
                  >{{ item }}
                </el-checkbox>
                <el-checkbox
                  v-if="shouldShowConditionalOrgan"
                  :key="conditionalOrgan"
                  :label="conditionalOrgan"
                  >{{ conditionalOrgan }}</el-checkbox
                >
              </el-checkbox-group>
             <el-checkbox-group v-model="organdecision">
  <!-- 第一行 -->
  <el-checkbox
    v-for="item in firstLineOrgans"
    :key="item"
    :label="item"
  >{{ item }}</el-checkbox>
  <!-- 第二行 -->
  <div style="clear: both;"></div>
  <el-checkbox
    v-for="item in secondLineOrgans"
    :key="item"
    :label="item"
  >{{ item }}</el-checkbox>
  <el-checkbox
    v-if="shouldShowConditionalOrgan"
    :key="conditionalOrgan"
    :label="conditionalOrgan"
  >{{ conditionalOrgan }}</el-checkbox>
</el-checkbox-group>
              <el-input
                v-if="organdecision.includes('其他')"
                v-model="affirmform.organdecisionOther"
@@ -1368,7 +1388,7 @@
                  clearable
                  size="small"
                  v-model="ethicform.conclusiontime"
                  type="date"
                  type="date" format="yyyy-MM-dd"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择结论时间"
                >
@@ -1458,7 +1478,7 @@
                        size="small"
                        style="width: 100%"
                        v-model="scope.row.applicanttime"
                        type="datetime"
                        type="datetime" format="yyyy-MM-dd HH:mm"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="选择分配接收时间"
                      >
@@ -1503,6 +1523,7 @@
                        <org-selecter
                          ref="tranHosSelect"
                          :org-type="'4'"
                          :filterable="true"
                          :dataList="dataList"
                          v-model="scope.row.transplanthospitalno"
                        />
@@ -1637,7 +1658,7 @@
                <el-date-picker
                  clearable
                  v-model="witnessform.deathtime"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择死亡时间"
                >
@@ -1676,7 +1697,7 @@
                <el-date-picker
                  clearable
                  v-model="witnessform.operationbegtime"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择手术开始时间"
                >
@@ -1693,7 +1714,7 @@
                <el-date-picker
                  clearable
                  v-model="witnessform.operationendtime"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择手术结束时间"
                >
@@ -1712,7 +1733,7 @@
                <el-date-picker
                  clearable
                  v-model="witnessform.coordinatorInOperating"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择手术开始时间"
                >
@@ -1729,7 +1750,7 @@
                <el-date-picker
                  clearable
                  v-model="witnessform.coordinatorOutOperating"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择手术结束时间"
                >
@@ -1746,7 +1767,7 @@
                <el-date-picker
                  clearable
                  v-model="witnessform.coordinatorSignTime"
                  type="datetime"
                  type="datetime" format="yyyy-MM-dd HH:mm"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择手术结束时间"
                >
@@ -1773,7 +1794,7 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.abdominalaortacannulatime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择腹主动脉插管时间"
                  >
@@ -1790,7 +1811,7 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.abdominalaortaperfusiontime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择腹主动脉灌注时间"
                  >
@@ -1807,7 +1828,7 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.portalveincannulatime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择门静脉脉插管时间"
                  >
@@ -1824,7 +1845,7 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.portalveinperfusiontime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择门静脉灌注时间"
                  >
@@ -1843,7 +1864,7 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.pulmonaryarterycannulatime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择门静脉插管时间"
                  >
@@ -1860,7 +1881,7 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.pulmonaryarteryperfusiontime"
                    type="datetime"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择门静脉灌注时间"
                  >
@@ -1877,8 +1898,8 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.aortacannulatime"
                    type="datetime"
                    value-format="yyyy-MM-dd  HH:mm:ss"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择主动脉插管时间"
                  >
                  </el-date-picker>
@@ -1894,8 +1915,8 @@
                  <el-date-picker
                    clearable
                    v-model="witnessform.aortaperfusiontime"
                    type="datetime"
                    value-format="yyyy-MM-dd  HH:mm:ss"
                    type="datetime" format="yyyy-MM-dd HH:mm"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    placeholder="选择主动脉灌注时间"
                  >
                  </el-date-picker>
@@ -1966,27 +1987,6 @@
                  </el-table-column> -->
                  <el-table-column
                    v-if="organgettimetrue"
                    label="器官离体时间"
                    align="center"
                    width="200"
                    prop="organgettime"
                  >
                    <template slot-scope="scope">
                      <el-date-picker
                        clearable
                        size="small"
                        style="width: 100%"
                        v-model="scope.row.organgettime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请输入器官离体时间"
                      >
                      </el-date-picker>
                    </template>
                  </el-table-column>
                  <el-table-column
                    label="获取医院"
                    align="center"
                    width="280"
@@ -2028,9 +2028,29 @@
                        size="small"
                        style="width: 100%"
                        v-model="scope.row.organStartTime"
                        type="datetime"
                        type="datetime" format="yyyy-MM-dd HH:mm"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请输入获取开始时间"
                      >
                      </el-date-picker>
                    </template>
                  </el-table-column>
                  <el-table-column
                    v-if="organgettimetrue"
                    label="器官离体时间"
                    align="center"
                    width="200"
                    prop="organgettime"
                  >
                    <template slot-scope="scope">
                      <el-date-picker
                        clearable
                        size="small"
                        style="width: 100%"
                        v-model="scope.row.organgettime"
                        type="datetime" format="yyyy-MM-dd HH:mm"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请输入器官离体时间"
                      >
                      </el-date-picker>
                    </template>
@@ -2349,7 +2369,7 @@
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
          <el-row v-if="accomplishform.isbodydonation">
            <el-col :span="6">
              <el-form-item align="left" label="遗体捐献" prop="isbodydonation">
                <el-radio-group v-model="accomplishform.isbodydonation">
@@ -2430,8 +2450,8 @@
                  clearable
                  size="small"
                  v-model="accomplishform.completetime"
                  type="date"
                  value-format="yyyy-MM-dd hh:mm:ss"
                  type="date" format="yyyy-MM-dd"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择完成时间"
                >
                </el-date-picker>
@@ -2746,6 +2766,7 @@
    return {
      infoid: 736,
      drawer: false,
      isLeftCollapsed: false,
      form: {
        donorno: "",
        reporterno: "",
@@ -2790,18 +2811,6 @@
        contacttime: "",
        reporttime: ""
      },
      organOrder: [
        "肝脏",
        "左肾",
        "右肾",
        "心脏",
        "左肺",
        "右肺",
        "胰腺",
        "小肠",
        "左眼角膜",
        "右眼角膜"
      ], // 指定的器官顺序
      isSorting: false, // 标志位,表示是否正在排序
      tableKey: 0,
      istb: false,
@@ -2832,18 +2841,14 @@
      kinshiplist: ["配偶", "父亲", "母亲", "子女", "受托人"],
      // 固定的选项列表(移除了"遗体")
      fixedOrganSelection: [
        "肝脏",
        "肾脏",
        "单左肾",
        "单右肾",
        "心脏",
        "肺脏",
        "胰腺",
        "小肠",
        "双眼组织",
        "其他"
      ],
      firstLineOrgans: [
      "肝脏", "肾脏", "左肾脏", "右肾脏",
      "心脏", "肺脏", "胰腺", "小肠"
    ],
    // 第二行选项(您需要一起换行的两项)
    secondLineOrgans: [
      "双眼组织", "其他"
    ],
      // 需要条件显示的选项
      conditionalOrgan: "遗体",
@@ -3002,9 +3007,9 @@
        ],
        sex: [{ required: true, message: "性别不能为空", trigger: "blur" }],
        age: [{ required: true, message: "请输入年龄", trigger: "blur" }],
        treatmenthospitalno: [
          { required: true, message: "请选择医疗机构", trigger: "blur" }
        ],
        // treatmenthospitalno: [
        //   { required: true, message: "请选择医疗机构", trigger: "blur" }
        // ],
        bloodtype: [
          { required: true, message: "请选择ABO血型", trigger: "blur" }
        ],
@@ -3039,7 +3044,23 @@
        ]
      },
      // 各级明细效验
      medicinerules: {},
      medicinerules: {
        illnessoverview: [
          { required: true, message: "请输入病情概况", trigger: "blur" }
        ],
        diagnosisname: [
          { required: true, message: "请输入疾病诊断", trigger: "blur" }
        ],
        hospitalassessdoctor: [
          { required: true, message: "请输入院级评估医生", trigger: "blur" }
        ],
        provincialassessdoctor: [
          { required: true, message: "请输入省级评估医生", trigger: "blur" }
        ],
        coreteamassessdoctor: [
          { required: true, message: "请输入核心成员评估医生", trigger: "blur" }
        ]
      },
      affirmrules: {
        name: [
          { required: true, message: "亲属姓名不能为空", trigger: "blur" }
@@ -3149,7 +3170,8 @@
    // 监听 procureddata 的变化,数据更新后重新排序
    procureddata: {
      handler(newVal) {
        if (this.procureddata[0].organgettime) {
        // 判空:取消最后一个器官时数组会变成空,直接取 [0] 会抛 TypeError
        if (this.procureddata[0] && this.procureddata[0].organgettime) {
          this.organgettimetrue = true;
        }
        if (this.isSorting) {
@@ -3259,32 +3281,41 @@
      } else if (this.actives == 2) {
        this.activetele = "捐献确认";
        listRelativesconfirmation(searchParam).then(response => {
          if (response.code == 200 && response.rows[0]) {
            this.affirmform = response.rows[0];
            if (this.affirmform.organdecision) {
              this.organdecision = this.affirmform.organdecision
                .split(",")
                .flatMap(item => (item === "双肾脏" ? ["左肾", "右肾"] : item));
            }
            if (this.affirmform.kinship) {
              this.kinship = this.affirmform.kinship.split(",");
            }
            if (!this.affirmform) {
              this.affirmform = {};
              this.affirmform.residenceprovincename = "";
              this.affirmform.residencecityname = "";
              this.affirmform.residencetownname = "";
            }
            this.defultAddresss.sheng = this.affirmform.residenceprovincename;
            this.defultAddresss.shi = this.affirmform.residencecityname;
            this.defultAddresss.qu = this.affirmform.residencetownname;
          } else {
            // this.$modal.msgError(
            //   "查询是否存在确认登记记录失败" + JSON.stringify(response)
            // );
          }
        });
       listRelativesconfirmation(searchParam).then(response => {
  if (response.code == 200 && response.rows[0]) {
    this.affirmform = response.rows[0];
    // 修改器官决策的显示文本
    if (this.affirmform.organdecision) {
      // 替换器官名称
      let organdecision = this.affirmform.organdecision
        .replace(/单左肾/g, '左肾脏')
        .replace(/单右肾/g, '右肾脏')
        .replace(/双肾脏/g, '双肾脏'); // 保持双肾脏不变
      this.organdecision = organdecision
        .split(",")
        .flatMap(item => (item === "双肾脏" ? ["左肾", "右肾"] : item));
    }
    if (this.affirmform.kinship) {
      this.kinship = this.affirmform.kinship.split(",");
    }
    if (!this.affirmform) {
      this.affirmform = {};
      this.affirmform.residenceprovincename = "";
      this.affirmform.residencecityname = "";
      this.affirmform.residencetownname = "";
    }
    this.defultAddresss.sheng = this.affirmform.residenceprovincename;
    this.defultAddresss.shi = this.affirmform.residencecityname;
    this.defultAddresss.qu = this.affirmform.residencetownname;
  } else {
    // this.$modal.msgError(
    //   "查询是否存在确认登记记录失败" + JSON.stringify(response)
    // );
  }
});
      } else if (this.actives == 3) {
        this.activetele = "伦理审查";
@@ -3300,7 +3331,8 @@
        listDonateorgan(searchParam).then(res => {
          if (res.code == 200) {
            if (res.rows[0]) {
              this.allocateddata = res.rows;
              // 2026-10-23:按器官排队序号排序后再渲染
              this.allocateddata = this.sortOrganRows(res.rows);
              console.log("this.allocateddata", this.allocateddata);
              this.allocateddataform.allocateddata = this.allocateddata;
            }
@@ -3341,6 +3373,8 @@
              });
              // this.procureddata.infoid = this.infoid;
            }
            // 2026-10-23:按器官排队序号排序后再渲染
            this.procureddata = this.sortOrganRows(this.procureddata);
            this.organList.organprocured = [];
            for (let i = 0; i < this.procureddata.length; i++) {
              this.organList.organprocured.push(this.procureddata[i].organno);
@@ -3395,6 +3429,8 @@
              this.transplantdata.infoid = this.infoid;
            }
            // 2026-10-23:按器官排队序号排序后再渲染
            this.transplantdata = this.sortOrganRows(this.transplantdata);
            for (let i = 0; i < this.transplantdata.length; i++) {
              this.organList.organtransplant.push(
                this.transplantdata[i].organno
@@ -3438,9 +3474,17 @@
        });
      }
    },
    // 切换侧边隐藏
    toggleLeftCollapse() {
      this.isLeftCollapsed = !this.isLeftCollapsed;
    },
    /** 保存主表按钮 */
    submitForm() {
    submitForm(fromProcess) {
      // 保存防重:非"流程推进"触发的保存,2 秒内的重复点击直接忽略(防止重复插入)
      if (!fromProcess && !this.canSave()) {
        this.$modal.msgWarning("请勿重复提交");
        return;
      }
      this.$refs["form"].validate(valid => {
        console.log("提交的数据们:", this.form);
        if (valid) {
@@ -3450,14 +3494,21 @@
            "YYYY-MM-DD HH:mm:ss"
          );
          this.form.diseasetype = this.form.diseasetype.join(",");
          this.form.infectious = this.form.infectious.join(",");
          this.form.selfwill = this.form.selfwill.join(",");
          this.form.othercases = this.form.othercases.join(",");
          this.form.infosources = this.form.infosources.join(",");
          this.form.kinship = this.form.kinship.join(",");
          this.form.patientstate = this.form.patientstate.join(",");
          // 多选字段转字符串:幂等处理(已是字符串时保持原样),
          // 避免"保存成功后未重新加载再次保存"时抛 join is not a function
          [
            "diseasetype",
            "infectious",
            "selfwill",
            "othercases",
            "infosources",
            "kinship",
            "patientstate"
          ].forEach(key => {
            if (Array.isArray(this.form[key])) {
              this.form[key] = this.form[key].join(",");
            }
          });
          this.form.registerprovince = this.$refs.registerSelect.getSheng();
          this.form.registerprovincename = this.registerAddresss.sheng;
@@ -3539,6 +3590,11 @@
    },
    // 保存二级表按钮
    Savethedetails() {
      // 保存防重:2 秒内的重复点击直接忽略(防止重复插入)
      if (!this.canSave()) {
        this.$modal.msgWarning("请勿重复提交");
        return;
      }
      console.log(this.actives);
      if (this.actives == 1) {
        this.medicineform.infoid = this.infoid;
@@ -3549,14 +3605,19 @@
              updateMedicalevaluation(this.medicineform).then(response => {
                this.$modal.msgSuccess("医学评估信息修改成功");
                this.$modal.closeLoading();
                this.Processvalidation();
              });
            } else {
              addMedicalevaluation(this.medicineform).then(response => {
                // 回填主键:否则下次保存仍走"新增",会产生重复行
                if (response && response.data && response.data.id) {
                  this.medicineform.id = response.data.id;
                }
                this.$modal.msgSuccess("医学评估信息新增成功");
                this.$modal.closeLoading();
                this.Processvalidation();
              });
            }
            this.Processvalidation();
          }
        });
      } else if (this.actives == 2) {
@@ -3576,17 +3637,22 @@
              updateRelativesconfirmation(this.affirmform).then(response => {
                this.$modal.msgSuccess("捐献确认信息修改成功");
                this.$modal.closeLoading();
                this.Processvalidation();
              });
            } else {
              this.affirmform.residenceprovincename = this.defultAddresss.sheng;
              this.affirmform.residencecityname = this.defultAddresss.shi;
              this.affirmform.residencetownname = this.defultAddresss.qu;
              addRelativesconfirmation(this.affirmform).then(response => {
                // 回填主键:否则下次保存仍走"新增",会产生重复行
                if (response && response.data && response.data.id) {
                  this.affirmform.id = response.data.id;
                }
                this.$modal.msgSuccess("捐献确认信息新增成功");
                this.$modal.closeLoading();
                this.Processvalidation();
              });
            }
            this.Processvalidation();
          }
        });
      } else if (this.actives == 3) {
@@ -3599,15 +3665,20 @@
              updateEthicalreviewopinions(this.ethicform).then(res => {
                this.$modal.msgSuccess("伦理审查信息修改成功");
                this.$modal.closeLoading();
                this.Processvalidation();
              });
            } else {
              //addDonateflowchart(this.ethicform).then(response => {
              addEthicalreviewopinions(this.ethicform).then(res => {
                // 回填主键:否则下次保存仍走"新增",会产生重复行
                if (res && res.data && res.data.id) {
                  this.ethicform.id = res.data.id;
                }
                this.$modal.msgSuccess("伦理审查信息新增成功");
                this.$modal.closeLoading();
                this.Processvalidation();
              });
            }
            this.Processvalidation();
          }
        });
      } else if (this.actives == 4) {
@@ -3626,7 +3697,15 @@
              item.transplanthospitalname = objs.organizationname;
            }
          });
          // 2026-10-23:提交前按器官排队序号排序,保证入库顺序与展示一致
          this.sortOrganRows(this.allocateddata);
          saveDonateorgan(this.allocateddata).then(res => {
            // 回填主键:后端已按"同一案例同一器官"做 upsert,回填后前端不会再误判为新增
            if (res && res.data && res.data.length === this.allocateddata.length) {
              res.data.forEach((row, i) => {
                this.allocateddata[i].id = row.id;
              });
            }
            if (res.code == 200) {
              this.$modal.msgSuccess("器官捐献分配信息保存成功!");
              this.$modal.closeLoading();
@@ -3674,8 +3753,15 @@
                  }
                });
                //保存器官获取表数据
                // 2026-10-23:提交前按器官排队序号排序
                this.sortOrganRows(this.procureddata);
                saveDonationwitnessorgan(this.procureddata).then(res => {
                  if (res == 200) {
                  if (res && res.data && res.data.length === this.procureddata.length) {
                    res.data.forEach((row, i) => {
                      this.procureddata[i].id = row.id;
                    });
                  }
                  if (res.code == 200) {
                    this.$modal.msgSuccess("捐献器官获取信息保存成功!");
                  }
                  this.$modal.closeLoading();
@@ -3684,6 +3770,10 @@
            } else {
              addDonationwitness(this.witnessform).then(response => {
                if (response.code === 200) {
                  // 回填主键:否则下次保存仍走"新增"
                  if (response.data && response.data.id) {
                    this.witnessform.id = response.data.id;
                  }
                  this.$modal.msgSuccess("获取见证信息新增成功");
                  this.form.donationcategory = this.witnessform.donationcategory;
                  let data = JSON.parse(JSON.stringify(this.form));
@@ -3701,8 +3791,15 @@
                    this.Processvalidation();
                  });
                  //保存器官获取表数据
                  // 2026-10-23:提交前按器官排队序号排序
                  this.sortOrganRows(this.procureddata);
                  saveDonationwitnessorgan(this.procureddata).then(res => {
                    if (res == 200) {
                    if (res && res.data && res.data.length === this.procureddata.length) {
                      res.data.forEach((row, i) => {
                        this.procureddata[i].id = row.id;
                      });
                    }
                    if (res.code == 200) {
                      this.$modal.msgSuccess("捐献器官获取信息保存成功!");
                    }
                    this.$modal.closeLoading();
@@ -3736,8 +3833,15 @@
            if (this.accomplishform.id) {
              updateDonatecompletioninfo(this.accomplishform).then(response => {
                this.$modal.msgSuccess("完成登记信息修改成功");
                // 2026-10-23:提交前按器官排队序号排序
                this.sortOrganRows(this.transplantdata);
                saveDonatecomporgan(this.transplantdata).then(res => {
                  if (res == 200) {
                  if (res && res.data && res.data.length === this.transplantdata.length) {
                    res.data.forEach((row, i) => {
                      this.transplantdata[i].id = row.id;
                    });
                  }
                  if (res.code == 200) {
                    this.$modal.msgSuccess("捐献器官登记信息保存成功!");
                  } else {
                    this.$modal.msgSuccess(res.msg);
@@ -3747,8 +3851,19 @@
              });
            } else {
              addDonatecompletioninfo(this.accomplishform).then(response => {
                // 回填主键:否则下次保存仍走"新增"
                if (response && response.data && response.data.id) {
                  this.accomplishform.id = response.data.id;
                }
                this.$modal.msgSuccess("完成登记成功");
                // 2026-10-23:提交前按器官排队序号排序
                this.sortOrganRows(this.transplantdata);
                saveDonatecomporgan(this.transplantdata).then(res => {
                  if (res && res.data && res.data.length === this.transplantdata.length) {
                    res.data.forEach((row, i) => {
                      this.transplantdata[i].id = row.id;
                    });
                  }
                  if (res.code == 200) {
                    this.$modal.msgSuccess("捐献器官登记信息保存成功!");
                  } else {
@@ -3775,35 +3890,48 @@
      }
    },
    customOrganSort() {
      console.log("调用");
    /**
     * 取器官的排队序号:字典 sys_Organ 的 dict_sort 原值
     * 字典里没有该器官时返回 null(排序时排最后)
     */
    getOrganSort(organno) {
      const list =
        (this.dict && this.dict.type && this.dict.type.sys_Organ) || [];
      const item = list.find(d => d.value === organno);
      if (item && item.raw) {
        const s = item.raw.dictSort;
        if (s !== null && s !== undefined && s !== "") {
          return Number(s);
        }
      }
      return null;
    },
    /**
     * 按器官排队序号升序排序(原地)
     * sort 为空/0 视为未知,排最后;相同序号按 id 兜底,保证顺序稳定
     */
    sortOrganRows(rows) {
      if (!rows || !rows.length) {
        return rows;
      }
      const weight = r => {
        const s = Number(r.sort);
        if (r.sort === null || r.sort === undefined || isNaN(s) || s === 0) {
          return 999999;
        }
        return s;
      };
      rows.sort((a, b) => weight(a) - weight(b) || (a.id || 0) - (b.id || 0));
      return rows;
    },
    customOrganSort() {
      // 1. 加锁,阻止监听器执行
      this.isSorting = true;
      this.loading = true;
      // 自定义排序函数
      this.procureddata.sort((a, b) => {
        const indexA = this.organOrder.indexOf(a.organname);
        const indexB = this.organOrder.indexOf(b.organname);
        // 如果两个都在列表中,按列表中的顺序排序
        if (indexA !== -1 && indexB !== -1) {
          return indexA - indexB;
        }
        // 如果 a 在列表中,b 不在,a 排前面
        if (indexA !== -1) {
          return -1;
        }
        // 如果 b 在列表中,a 不在,b 排前面
        if (indexB !== -1) {
          return 1;
        }
        // 两个都不在列表中,保持原顺序(或按其他规则,比如按字母排序,这里按原始顺序)
        return 0;
      });
      console.log(this.procureddata, "顺序");
      this.sortOrganRows(this.procureddata);
      this.tableKey += 1; // 改变 key 迫使表格重新渲染
      // 你可以使用 this.$forceUpdate() 或者重新赋值数组来触发更新
      this.procureddata = [...this.procureddata];
      this.$nextTick(() => {
        this.isSorting = false;
@@ -3811,33 +3939,10 @@
      });
    },
    allocateddataSort() {
      console.log("调用");
      // 1. 加锁,阻止监听器执行
      this.isSorting = true;
      // 自定义排序函数
      this.allocateddata.sort((a, b) => {
        const indexA = this.organOrder.indexOf(a.organname);
        const indexB = this.organOrder.indexOf(b.organname);
        // 如果两个都在列表中,按列表中的顺序排序
        if (indexA !== -1 && indexB !== -1) {
          return indexA - indexB;
        }
        // 如果 a 在列表中,b 不在,a 排前面
        if (indexA !== -1) {
          return -1;
        }
        // 如果 b 在列表中,a 不在,b 排前面
        if (indexB !== -1) {
          return 1;
        }
        // 两个都不在列表中,保持原顺序(或按其他规则,比如按字母排序,这里按原始顺序)
        return 0;
      });
      console.log(this.allocateddata, "顺序");
      this.sortOrganRows(this.allocateddata);
      this.tableKey += 1; // 改变 key 迫使表格重新渲染
      // 你可以使用 this.$forceUpdate() 或者重新赋值数组来触发更新
      this.allocateddata = [...this.allocateddata];
      this.$nextTick(() => {
        this.isSorting = false;
@@ -3917,6 +4022,8 @@
            this.allocateddata.push({
              organname: temporganname,
              organno: value,
              // 2026-10-23:写入器官排队序号(字典 dict_sort)
              sort: this.getOrganSort(value),
              id: null,
              infoid: this.infoid,
              donorno: this.form.donorno,
@@ -3987,6 +4094,8 @@
            this.procureddata.push({
              organname: temporganname,
              organno: value,
              // 2026-10-23:写入器官排队序号(字典 dict_sort)
              sort: this.getOrganSort(value),
              id: null,
              infoid: this.infoid,
              donorno: this.form.donorno,
@@ -4063,12 +4172,17 @@
            this.transplantdata.push({
              organname: temporganname,
              organno: value,
              // 2026-10-23:写入器官排队序号(字典 dict_sort)
              sort: this.getOrganSort(value),
              id: null,
              infoid: this.infoid,
              donorno: this.form.donorno,
              organstate: 1,
              transplantstate: 1
            });
            // 2026-10-23:完成登记原先没有 watch,新增器官会停在表格最后;
            // 这里立即按排队序号归位(原地排序后必须重新赋值,否则表格不重渲染)
            this.transplantdata = this.sortOrganRows([...this.transplantdata]);
          }
        } else {
          this.$modal.msgWarning("该器官已经选择,请勿重复选择!");
@@ -4085,6 +4199,15 @@
        console.log("已到达最大值");
      }
    },
    // 保存防重:2 秒内重复点击视为重复提交
    canSave() {
      const now = Date.now();
      if (this.saveLockAt && now - this.saveLockAt < 2000) {
        return false;
      }
      this.saveLockAt = now;
      return true;
    },
    // 更改进程效验
    Processvalidation() {
      if (this.form.workflow + 1 == this.actives) {
@@ -4092,15 +4215,12 @@
          this.form.workflow++;
        } else {
        }
        this.submitForm();
        // this.GetAttacheddata();
        // 由"保存二级表"触发的保存,不参与防重(否则会被 canSave 拦掉)
        this.submitForm(true);
      } else if (this.form.workflow > this.actives) {
        this.submitForm();
        // Modifydonationattachment(this.donatelist).then(res => {});
        // this.GetAttacheddata();
        this.submitForm(true);
      } else {
        this.submitForm();
        // this.$modal.msgWarning("请先完成前部步骤");
        this.submitForm(true);
        return;
      }
    },
@@ -4416,124 +4536,249 @@
<style lang="scss" scoped>
.particularsdiv {
  display: -webkit-box;
  background-color: #f5f7fa;
  height: 100%;
  display: flex;
  background-color: var(--opo-bg-page, #f5f7fa);
  height: 100vh;
  overflow: hidden;
  transition: all 0.3s ease;
  // 左侧工作进程栏(2026-10-22:去掉底色,只留一条分隔线;标题文字改品牌青)
  .left-course {
    background: #fff;
    width: 14vw;
    background: transparent;
    width: 220px;
    min-width: 220px;
    text-align: center;
    margin: 20px 10px;
    padding: 10px;
    margin-top: 0;
    min-height: 888px;
    margin: 0;
    padding: 0;
    height: 100%;
    border-right: 1px solid var(--opo-border-base, #e5e7eb);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    &.left-collapsed {
      width: 64px; // 改为固定宽度,而不是0
      min-width: 64px; // 保持最小宽度
      transform: translateX(0); // 移除平移
      // 折叠状态下隐藏步骤内容,只显示标题和按钮
      .postfilx > div:last-child {
        opacity: 0;
        visibility: hidden;
        pointer-events: none; // 禁用交互
      }
      .title {
        padding: 15px 5px; // 调整内边距适应窄宽度
        .collapse-btn {
          margin: 0 auto; // 按钮居中
        }
      }
    }
    .postfilx {
      width: 12vw;
      text-align: center;
      margin: 20px 10px;
      padding: 10px;
      margin-top: 0;
      // z-index: 999;
      // position: -webkit-sticky;
      // position: fixed;
      // top: 50;
    }
    .title {
      background: #22a2c3;
      margin-bottom: 20px;
      padding: 10px 0;
      color: #fff;
    }
  }
}
.upload-demo {
  text-align: center;
}
.pdfimg {
  display: flex; // text-align: center;
  width: 100%;
  height: 600px;
  .box-pdf {
    width: 400px;
    margin-right: 30px;
    border: 1px solid #dcdfe6;
    -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
      0 0 6px 0 rgba(0, 0, 0, 0.04);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); // <- Add this to fix.
  }
  .pdftit {
    width: 200px;
    padding: 20px;
    font-size: 18px;
  }
  .pdftit:hover {
    background: #c0cef7;
  }
  .pdfimgmin {
    width: 60%;
    img {
      width: 100%;
      height: 100%;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      .title {
        background: transparent;
        margin-bottom: 0;
        padding: 15px 10px;
        color: var(--opo-primary, #0e768f);
        font-size: 16px;
        font-weight: 600;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        transition: all 0.3s ease;
        min-height: 54px; // 确保标题区域有固定高度
        box-sizing: border-box;
        border-bottom: 1px solid var(--opo-border-base, #e5e7eb);
        .collapse-btn {
          // 标题底色去掉后,按钮改为浅青描边风格,避免白底白字看不见
          background: var(--opo-primary-light-9, #e7f1f4);
          border: 1px solid var(--opo-primary-light-7, #b7d6dd);
          color: var(--opo-primary, #0e768f);
          width: 32px; // 稍微增大确保可点击区域
          height: 32px;
          padding: 0;
          border-radius: 4px;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: all 0.3s ease;
          flex-shrink: 0; // 防止按钮被压缩
          &:hover {
            background: var(--opo-primary-light-7, #b7d6dd);
            border-color: var(--opo-primary, #0e768f);
            transform: scale(1.1);
          }
          // 确保图标居中显示
          .el-icon {
            margin: 0;
          }
        }
        // 折叠状态下调整标题文字
      }
      // 折叠状态下隐藏完整标题文字
      &.left-collapsed .title {
        &:after {
          opacity: 0;
        }
      }
      > div:last-child {
        flex: 1;
        overflow-y: auto;
        padding: 20px 15px;
        transition: all 0.3s ease;
      }
    }
  }
  .new-line {
  clear: both; /* 关键属性:清除两侧浮动,强制换行 */
  display: block; /* 可选:设置为块级元素,确保独占一行 */
}
  .Ticket-button {
    text-align: right;
    margin-right: 50px;
  }
  // 右侧内容区域
  .right-content {
    flex: 1;
    background: #fff;
    transition: all 0.3s ease;
    overflow-y: auto;
    margin: 0;
  .pdfimgmins {
    font-size: 28px;
    width: 60%;
    text-align: center;
    &.right-expanded {
      margin-left: 0;
    }
    .boxdiv {
      width: 100%;
      max-width: none;
      font-size: 18px;
      padding: 0 30px;
      padding-bottom: 20px;
      margin-top: 0;
      .top-text {
        text-align: center;
        font-size: 23px;
        font-weight: 600;
        margin: 20px 0;
        margin-bottom: 30px;
        padding-top: 20px;
      }
    }
  }
}
.Ticket-button {
  margin-top: 10px;
  text-align: right;
  padding-right: 66px;
}
// 步骤样式优化(配色统一到系统品牌色:teal #0E768F)
::v-deep .el-steps {
  &.el-steps--vertical {
    height: 100%;
.boxdiv {
  max-width: 85vw;
  font-size: 18px;
  padding: 0 30px;
  padding-bottom: 10px;
  margin-top: 10px;
    .el-step {
      margin-bottom: 15px;
  .top-text {
    text-align: center;
    font-size: 23px;
    font-weight: 600;
    margin: 20px 0;
    margin-bottom: 30px;
      .el-step__head {
        &.is-finish {
          color: var(--opo-primary, #0e768f);
          border-color: var(--opo-primary, #0e768f);
        }
      }
      .el-step__title {
        font-size: var(--opo-font-size-sm);
        font-weight: 600;
        &.is-finish {
          color: var(--opo-primary, #0e768f);
        }
      }
      .el-step__description {
        font-size: var(--opo-font-size-xs);
        // 描述文字统一用中性灰,避免整块面板被品牌色淹没
        color: var(--opo-text-secondary, #6b7280);
        line-height: 1.5;
        &.is-finish {
          color: var(--opo-text-regular, #4b5563);
        }
        p {
          margin: 4px 0;
        }
      }
    }
  }
}
::v-deep .el-step__head.is-finish {
  color: #22a2c3;
  border-color: #22a2c3;
// 响应式设计
@media (max-width: 768px) {
  .particularsdiv {
    flex-direction: column;
    .left-course {
      width: 100%;
      height: auto;
      max-height: 300px;
      &.left-collapsed {
        width: 100%; // 移动端保持全宽
        min-width: 100%;
        height: 60px; // 只显示标题栏高度
        max-height: 60px;
        .postfilx > div:last-child {
          display: none; // 完全隐藏内容而不是透明
        }
      }
      .postfilx {
        .title {
          .collapse-btn {
            transform: rotate(0deg); // 保持正常方向
          }
        }
      }
    }
    .right-content {
      margin-left: 0;
    }
  }
}
::v-deep .el-step__title.is-finish {
  color: #22a2c3;
// 滚动条样式优化
.left-course ::-webkit-scrollbar {
  width: 4px;
}
::v-deep .el-step__description.is-finish {
  color: #22a2c3;
.left-course ::-webkit-scrollbar-track {
  background: #f1f1f1;
}
:v-deep .el-select {
  display: inline-block;
  position: relative;
  width: 80%;
.left-course ::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}
:v-deep .el-tabs__nav-scroll {
  overflow: auto;
.left-course ::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
</style>