yxh
昨天 a79d67f8a9a9fa02f9d25f987b9611af965c484f
src/views/project/donationdetails/index.vue
@@ -3,7 +3,7 @@
    <div class="left-course" :class="{ 'left-collapsed': isLeftCollapsed }">
      <div class="postfilx">
        <div class="title">
          工作进程
          案例进程
          <el-button
            class="collapse-btn"
            @click="toggleLeftCollapse"
@@ -221,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="选择报告日期"
                  >
@@ -267,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="选择出生日期"
                  >
@@ -779,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="选择报告时间"
                >
@@ -862,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="选择院级评估时间"
                >
@@ -915,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="选择省级评估时间"
                >
@@ -969,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="评估时间"
                >
@@ -1388,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="选择结论时间"
                >
@@ -1478,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="选择分配接收时间"
                      >
@@ -1658,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="选择死亡时间"
                >
@@ -1697,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="选择手术开始时间"
                >
@@ -1714,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="选择手术结束时间"
                >
@@ -1733,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="选择手术开始时间"
                >
@@ -1750,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="选择手术结束时间"
                >
@@ -1767,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="选择手术结束时间"
                >
@@ -1794,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="选择腹主动脉插管时间"
                  >
@@ -1811,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="选择腹主动脉灌注时间"
                  >
@@ -1828,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="选择门静脉脉插管时间"
                  >
@@ -1845,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="选择门静脉灌注时间"
                  >
@@ -1864,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="选择门静脉插管时间"
                  >
@@ -1881,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="选择门静脉灌注时间"
                  >
@@ -1898,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>
@@ -1915,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>
@@ -2028,7 +2028,7 @@
                        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="请输入获取开始时间"
                      >
@@ -2048,7 +2048,7 @@
                        size="small"
                        style="width: 100%"
                        v-model="scope.row.organgettime"
                        type="datetime"
                        type="datetime" format="yyyy-MM-dd HH:mm"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请输入器官离体时间"
                      >
@@ -2450,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>
@@ -2854,7 +2854,7 @@
      // 固定的选项列表(移除了"遗体")
      firstLineOrgans: [
      "肝脏", "肾脏", "单左肾", "单右肾",
      "肝脏", "肾脏", "左肾脏", "右肾脏",
      "心脏", "肺脏", "胰腺", "小肠"
    ],
    // 第二行选项(您需要一起换行的两项)
@@ -3292,32 +3292,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 = "伦理审查";
@@ -3476,7 +3485,12 @@
      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) {
@@ -3486,14 +3500,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;
@@ -3575,6 +3596,11 @@
    },
    // 保存二级表按钮
    Savethedetails() {
      // 保存防重:2 秒内的重复点击直接忽略(防止重复插入)
      if (!this.canSave()) {
        this.$modal.msgWarning("请勿重复提交");
        return;
      }
      console.log(this.actives);
      if (this.actives == 1) {
        this.medicineform.infoid = this.infoid;
@@ -3585,14 +3611,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) {
@@ -3612,17 +3643,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) {
@@ -3635,15 +3671,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) {
@@ -3663,6 +3704,12 @@
            }
          });
          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();
@@ -3711,7 +3758,12 @@
                });
                //保存器官获取表数据
                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();
@@ -3720,6 +3772,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));
@@ -3738,7 +3794,12 @@
                  });
                  //保存器官获取表数据
                  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();
@@ -3773,7 +3834,12 @@
              updateDonatecompletioninfo(this.accomplishform).then(response => {
                this.$modal.msgSuccess("完成登记信息修改成功");
                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);
@@ -3783,8 +3849,17 @@
              });
            } else {
              addDonatecompletioninfo(this.accomplishform).then(response => {
                // 回填主键:否则下次保存仍走"新增"
                if (response && response.data && response.data.id) {
                  this.accomplishform.id = response.data.id;
                }
                this.$modal.msgSuccess("完成登记成功");
                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 {
@@ -4121,6 +4196,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) {
@@ -4128,15 +4212,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;
      }
    },
@@ -4453,7 +4534,7 @@
<style lang="scss" scoped>
.particularsdiv {
  display: flex;
  background-color: #f5f7fa;
  background-color: var(--opo-bg-page, #f5f7fa);
  height: 100vh;
  overflow: hidden;
  transition: all 0.3s ease;
@@ -4467,7 +4548,7 @@
    margin: 0;
    padding: 0;
    height: 100%;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    box-shadow: 2px 0 8px rgba(16, 24, 40, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
@@ -4502,7 +4583,7 @@
      flex-direction: column;
      .title {
        background: #22a2c3;
        background: var(--opo-primary, #0e768f);
        margin-bottom: 0;
        padding: 15px 10px;
        color: #fff;
@@ -4599,7 +4680,7 @@
  }
}
// 步骤样式优化
// 步骤样式优化(配色统一到系统品牌色:teal #0E768F)
::v-deep .el-steps {
  &.el-steps--vertical {
    height: 100%;
@@ -4609,27 +4690,28 @@
      .el-step__head {
        &.is-finish {
          color: #22a2c3;
          border-color: #22a2c3;
          color: var(--opo-primary, #0e768f);
          border-color: var(--opo-primary, #0e768f);
        }
      }
      .el-step__title {
        font-size: 14px;
        font-size: var(--opo-font-size-sm);
        font-weight: 600;
        &.is-finish {
          color: #22a2c3;
          color: var(--opo-primary, #0e768f);
        }
      }
      .el-step__description {
        font-size: 12px;
        color: #666;
        font-size: var(--opo-font-size-xs);
        // 描述文字统一用中性灰,避免整块面板被品牌色淹没
        color: var(--opo-text-secondary, #6b7280);
        line-height: 1.5;
        &.is-finish {
          color: #22a2c3;
          color: var(--opo-text-regular, #4b5563);
        }
        p {