11
WXL
2023-10-16 4434fc4e9fa6819452596445b71eb67f4b422f0d
src/views/project/donationdetails/index.vue
@@ -47,8 +47,9 @@
        </div>
      </div>
    </div>
<!-- 右侧数据 -->
    <!-- 右侧数据 -->
    <div style="background: #fff;">
      <!-- 顶部数据 -->
      <div class="boxdiv">
        <div class="top-text">捐献者记录工作台</div>
        <el-form
@@ -298,25 +299,22 @@
      <!-- 潜在捐献 -->
      <div class="boxdiv" style="margin: 30px 0 66px 0;" v-show="actives == 0">
        <el-form
          ref="latentform"
          :model="latentform"
          :rules="latentrules"
          ref="form"
          :model="form"
          :rules="rules"
          label-width="100px"
          label-position="right"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="住院号" prop="inpatientno">
                <el-input
                  v-model="latentform.inpatientno"
                  placeholder="住院号"
                />
                <el-input v-model="form.inpatientno" placeholder="住院号" />
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="疾病诊断" prop="diagnosisname">
                <el-input
                  v-model="latentform.diagnosisname"
                  v-model="form.diagnosisname"
                  placeholder="请输入疾病诊断名称"
                />
              </el-form-item>
@@ -325,7 +323,7 @@
          <el-row>
            <el-col :span="12">
              <el-form-item align="left" label="血型" prop="bloodtype">
                <el-radio-group v-model="latentform.bloodtype">
                <el-radio-group v-model="form.bloodtype">
                  <el-radio
                    v-for="dict in dict.type.sys_BloodType"
                    :key="dict.value"
@@ -337,7 +335,7 @@
            </el-col>
            <el-col :span="12" :pull="1">
              <el-form-item label="Rh(D)" align="left" prop="rhyin">
                <el-radio-group v-model="latentform.rhyin">
                <el-radio-group v-model="form.rhyin">
                  <el-radio
                    v-for="dict in dict.type.sys_bloodtype_rhd"
                    :key="dict.value"
@@ -350,7 +348,7 @@
          </el-row>
          <el-row>
            <el-form-item label="疾病类型" align="left">
              <el-checkbox-group v-model="latentform.diseasetype">
              <el-checkbox-group v-model="form.diseasetype">
                <el-checkbox
                  v-for="dict in dict.type.sys_DiseaseType"
                  :key="dict.value"
@@ -362,7 +360,7 @@
            </el-form-item>
            <el-form-item label="其他" prop="diseasetypeOther">
              <el-input
                v-model="latentform.diseasetypeOther"
                v-model="form.diseasetypeOther"
                placeholder="请输入其他"
              />
            </el-form-item>
@@ -370,7 +368,7 @@
          <el-row>
            <el-col :span="12">
              <el-form-item align="left" label="传染病">
                <el-checkbox-group v-model="latentform.infectious">
                <el-checkbox-group v-model="form.infectious">
                  <el-checkbox
                    v-for="dict in dict.type.sys_Infectious"
                    :key="dict.value"
@@ -384,7 +382,7 @@
            <el-col :span="12">
              <el-form-item align="left" label="其他" prop="infectiousOther">
                <el-input
                  v-model="latentform.infectiousOther"
                  v-model="form.infectiousOther"
                  placeholder="请输入其他"
                />
              </el-form-item>
@@ -393,7 +391,7 @@
          <el-row>
            <el-col :span="9">
              <el-form-item align="left" label="病人状况">
                <el-checkbox-group v-model="latentform.patientstate">
                <el-checkbox-group v-model="form.patientstate">
                  <el-checkbox
                    v-for="dict in dict.type.sys_patientstate"
                    :key="dict.value"
@@ -406,7 +404,7 @@
            </el-col>
            <el-col :span="15" align="left">
              <el-form-item label="其他情况">
                <el-checkbox-group v-model="latentform.othercases">
                <el-checkbox-group v-model="form.othercases">
                  <el-checkbox
                    v-for="dict in dict.type.sys_OtherCases"
                    :key="dict.value"
@@ -428,7 +426,7 @@
                    class="relation"
                    align="left"
                  >
                    <el-checkbox-group v-model="latentform.kinship">
                    <el-checkbox-group v-model="form.kinship">
                      <el-checkbox
                        v-for="dict in dict.type.sys_Kinship"
                        :key="dict.value"
@@ -442,7 +440,7 @@
                <el-col :span="12">
                  <el-form-item label="其他" prop="kinshipOther">
                    <el-input
                      v-model="latentform.kinshipOther"
                      v-model="form.kinshipOther"
                      placeholder="请输入其他"
                    />
                  </el-form-item>
@@ -453,7 +451,7 @@
          <el-row>
            <el-col :span="24">
              <el-form-item align="left" label="本人意愿 ">
                <el-checkbox-group v-model="latentform.selfwill">
                <el-checkbox-group v-model="form.selfwill">
                  <el-checkbox
                    v-for="dict in dict.type.sys_SelfWill"
                    :key="dict.value"
@@ -469,7 +467,7 @@
            <el-col :span="12">
              <el-form-item label="主要亲属" prop="majorrelatives">
                <el-input
                  v-model="latentform.majorrelatives"
                  v-model="form.majorrelatives"
                  placeholder="请输入主要亲属"
                />
              </el-form-item>
@@ -477,7 +475,7 @@
            <el-col :span="8">
              <el-form-item label="与捐赠者关系" prop="familyrelations">
                <el-select
                  v-model="latentform.familyrelations"
                  v-model="form.familyrelations"
                  placeholder="请选择与捐赠者关系"
                >
                  <el-option
@@ -493,7 +491,7 @@
          <el-row>
            <el-col :span="12">
              <el-form-item align="left" label="信息来源">
                <el-checkbox-group v-model="latentform.infosources">
                <el-checkbox-group v-model="form.infosources">
                  <el-checkbox
                    v-for="dict in dict.type.sys_InfoSources"
                    :key="dict.value"
@@ -507,7 +505,7 @@
            <el-col :span="8">
              <el-form-item label="其他" prop="infosourcesOther">
                <el-input
                  v-model="latentform.infosourcesOther"
                  v-model="form.infosourcesOther"
                  placeholder="请输入信息来源其他"
                />
              </el-form-item>
@@ -516,16 +514,13 @@
          <el-row>
            <el-col :span="8">
              <el-form-item label="信息员" prop="infoname">
                <el-input
                  v-model="latentform.infoname"
                  placeholder="请输入信息员"
                />
                <el-input v-model="form.infoname" placeholder="请输入信息员" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="联系电话" prop="infophone">
                <el-input
                  v-model="latentform.infophone"
                  v-model="form.infophone"
                  placeholder="请输入信息员联系电话"
                />
              </el-form-item>
@@ -537,14 +532,14 @@
                <org-selecter
                  ref="addCrossOrgSelect"
                  :org-type="'2'"
                  v-model="latentform.redorganno"
                  v-model="form.redorganno"
                />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="联系人" prop="contactperson">
                <el-input
                  v-model="latentform.contactperson"
                  v-model="form.contactperson"
                  placeholder="请输入联系人"
                />
              </el-form-item>
@@ -555,7 +550,7 @@
                  clearable
                  size="small"
                  style="width: 190px"
                  v-model="latentform.contacttime"
                  v-model="form.contacttime"
                  type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择报告时间"
@@ -575,7 +570,7 @@
                  style="width: 260px"
                  ref="orgSelecter"
                  :org-type="'1'"
                  v-model="latentform.acquisitiontissueno"
                  v-model="form.acquisitiontissueno"
                />
              </el-form-item>
            </el-col>
@@ -585,7 +580,7 @@
              <el-form-item label="报告人" prop="reporterno">
                <el-select
                  ref="getReportname"
                  v-model="latentform.reporterno"
                  v-model="form.reporterno"
                  placeholder="请选择"
                >
                  <el-option
@@ -601,7 +596,7 @@
            <el-col :span="8">
              <el-form-item label="联系电话" prop="reporterphone">
                <el-input
                  v-model="latentform.reporterphone"
                  v-model="form.reporterphone"
                  placeholder="请输入联系电话"
                />
              </el-form-item>
@@ -612,7 +607,7 @@
                  clearable
                  size="small"
                  style="width: 190px"
                  v-model="latentform.reporttime"
                  v-model="form.reporttime"
                  type="datetime"
                  value-format="yyyy-MM-dd HH:mm:ss"
                  placeholder="选择报告时间"
@@ -846,7 +841,7 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
            >保存评估信息</el-button
          >
          <el-button
@@ -1059,7 +1054,7 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
@@ -1122,7 +1117,7 @@
          </el-row>
        </el-form>
        <div class="dialog-footer" style="min-height: 500px; margin: 20px 0; ">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
@@ -1254,7 +1249,7 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
@@ -1700,7 +1695,7 @@
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
@@ -1930,7 +1925,7 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
            >保存捐献者信息</el-button
          >
          <el-button
@@ -1951,16 +1946,31 @@
<script>
import {
  listDonatebaseinfo,
  getDonatebaseinfo,
  delDonatebaseinfo,
  addDonatebaseinfo,
  updateDonatebaseinfo,
  exportDonatebaseinfo,
  downloadbaseinfo,
  getdonatorno
  // exportProvincemessage,
  updateDonatebaseinfo
} from "@/api/project/donatebaseinfo";
import {
  listMedicalevaluation,
  addMedicalevaluation,
  updateMedicalevaluation
} from "@/api/project/medicalevaluation";
import {
  addDonateflowchart,
  listDonateflowchart,
  updateDonateflowchart
} from "@/api/project/DonationEvaluation";
import {
  listOrganallocation,
  addOrganallocation,
  updateOrganallocation
} from "@/api/project/organallocation";
import {
  listDonateorgan,
  addDonateorgan,
  delDonateorgan,
  updateDonateorgan
} from "@/api/project/donateorgan";
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import AnnexUpload from "@/views/project/components/annexupload";
@@ -2001,13 +2011,13 @@
    return {
      id: 736,
      form: {},
      latentform: {},
      medicineform: {},
      affirmform: {},
      ethicform: {},
      allocationform: {},
      witnessform: {},
      accomplishform: {},
      tableData:[],
      actives: 0,
      //   保存、终止按钮确认
      showSaveBtn: true,
@@ -2057,11 +2067,7 @@
        age: [{ required: true, message: "请输入年龄", trigger: "blur" }],
        treatmenthospitalno: [
          { required: true, message: "请选择医疗机构", trigger: "blur" }
        ]
        // treatmenthospitalno: [{ required: true, message: "请选择医疗机构", trigger: "change" }],
      },
      // 潜在捐献效验
      latentrules: {
        ],
        bloodtype: [
          { required: true, message: "请选择ABO血型", trigger: "blur" }
        ],
@@ -2092,7 +2098,6 @@
            trigger: "blur"
          }
        ],
        // contactnumber: [{required: true,message: "请输入红十字会联系电话",trigger: "change"}],
        acquisitiontissueno: [
          { required: true, message: "器官获取组织不能为空", trigger: "blur" }
        ],
@@ -2106,6 +2111,7 @@
          { required: true, message: "请输入报告人联系电话", trigger: "blur" }
        ]
      },
      medicinerules: {},
      affirmrules: {},
      ethicrules: {},
@@ -2121,6 +2127,7 @@
  },
  methods: {
    // 获取主表数据
    Getbasicinformation() {
      getDonatebaseinfo(this.id).then(response => {
        this.form = response.data;
@@ -2141,8 +2148,309 @@
        this.residenceAddresss.shi = response.data.residencecityname;
        this.residenceAddresss.qu = response.data.residencetownname;
        this.registerAddresss.qu = response.data.registertownname;
        this.latentform = this.form;
      });
    },
    // 获取二级表数据
    GetAttacheddata() {
      let searchParam = {
        id: this.form.id
      };
      if (this.actives == 2) {
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.medicineform = response.rows[0];
          } else {
            this.$modal.msgError(
              "获取医学评估记录失败:" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 3) {
        listRelativesconfirmation(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.affirmform = response.rows[0];
            this.affirmform.donorno = row.donorno;
            this.affirmform.doname = row.name;
            this.affirmform.dosex = row.sex;
            // 出生日期
            this.affirmform.dobirthday = row.birthday;
            // 民族
            this.affirmform.donationality = row.nationality;
            // 学历
            this.affirmform.doeducation = row.education;
            // 职业
            this.affirmform.dooccupation = row.occupation;
            this.affirmform.donation = row.nation;
            this.affirmform.doidcardtype = row.idcardtype;
            this.affirmform.doidcardno = row.idcardno;
            this.affirmform.donativeplace = row.nativeplace;
            this.defultAddresss.sheng = this.affirmform.residenceprovincename;
            this.defultAddresss.shi = this.affirmform.residencecityname;
            this.defultAddresss.qu = this.affirmform.residencetownname;
            if (this.affirmform.kinship) {
              this.affirmform.kinship = this.affirmform.kinship.split(",");
            }
            if (this.affirmform.organdecision) {
              this.affirmform.organdecision = this.affirmform.organdecision.split(
                ","
              );
            }
          } else {
            this.$modal.msgError(
              "查询是否存在确认登记记录失败" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 4) {
        listDonateflowchart(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.form = response.rows[0];
          } else if (response.rows.length == 0) {
            this.$modal.msgError("未找到本案例的伦理审查记录,请联系管理员!");
          } else {
            this.$modal.msgError("数据重复");
          }
        });
      } else if (this.actives == 5) {
        listOrganallocation(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.form = response.rows[0];
            this.form.infoid = data.id;
            this.open = true;
          } else {
            this.$modal.msgError(
              "获取器官分配信息失败:" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 6) {
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.form = response.rows[0];
            this.form.infoid = data.id;
            this.open = true;
          } else {
            this.$modal.msgError(
              "获取医学评估记录失败:" + JSON.stringify(response)
            );
          }
        });
      } else if (this.actives == 7) {
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
            this.form = response.rows[0];
            this.form.infoid = data.id;
            this.open = true;
          } else {
            this.$modal.msgError(
              "获取医学评估记录失败:" + JSON.stringify(response)
            );
          }
        });
      }
    },
    /** 保存主表按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        console.log("提交的数据们:", this.form);
        if (valid) {
          this.form.birthday = this.$moment(this.form.birthday).format(
            "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(",");
          this.form.registerprovince = this.$refs.registerSelect.getSheng();
          this.form.registerprovincename = this.registerAddresss.sheng;
          this.form.residenceprovince = this.$refs.residenceSelect.getSheng();
          this.form.residenceprovincename = this.residenceAddresss.sheng;
          this.form.registercity = this.$refs.registerSelect.getShi();
          this.form.registercityname = this.registerAddresss.shi;
          this.form.residencecity = this.$refs.residenceSelect.getShi();
          this.form.residencecityname = this.residenceAddresss.shi;
          this.form.residencetown = this.$refs.residenceSelect.getQu();
          this.form.residencetownname = this.residenceAddresss.qu;
          this.form.registertown = this.$refs.registerSelect.getQu();
          this.form.registertownname = this.registerAddresss.qu;
          this.form.reportername = this.$refs.getReportname.$data.selectedLabel;
          try {
            this.form.treatmenthospitalname = this.$refs.addOrgSelect.getOptionByValue(
              this.form.treatmenthospitalno
            ).organizationname;
          } catch {
            this.form.treatmenthospitalname = this.form.treatmenthospitalno;
          }
          try {
            this.form.redorganname = this.$refs.addCrossOrgSelect.getOptionByValue(
              this.form.redorganno
            ).organizationname;
          } catch {
            this.form.redorganname = this.form.redorganno;
          }
          //尝试生成捐献编号(已经由addDonatebaseinfo接口中生成取代)
          // getdonatorno(this.form).then((response) => {
          //   // alert(JSON.stringify(response));
          //   this.reset();
          // });
          if (this.form.id != null) {
            updateDonatebaseinfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.Getbasicinformation();
              this.open = false;
            });
          } else {
            this.form.recordstate = 0;
            addDonatebaseinfo(this.form).then(response => {
              if (response.code == 200) {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
              } else {
                this.$modal.msgError("新增失败:" + response.msg);
              }
            });
          }
        }
      });
    },
    // 保存明细表
    Savethedetails() {
      if (this.actives == 2) {
        this.$refs["medicineform"].validate(valid => {
          if (valid) {
            if (this.medicineform.id != null) {
              updateMedicalevaluation(this.medicineform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addMedicalevaluation(this.medicineform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 3) {
        this.$refs["affirmform"].validate(valid => {
          if (valid) {
            if (this.affirmform.id != null) {
              updateMedicalevaluation(this.affirmform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addMedicalevaluation(this.affirmform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 4) {
        this.$refs["ethicform"].validate(valid => {
          if (valid) {
            if (this.ethicform.id != null) {
              updateDonateflowchart(this.ethicform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addDonateflowchart(this.ethicform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 5) {
        this.$refs["allocationform"].validate(valid => {
          if (valid) {
            if (this.allocationform.id != null) {
              updateOrganallocation(this.allocationform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addOrganallocation(this.allocationform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 6) {
        this.$refs["witnessform"].validate(valid => {
          if (valid) {
            if (this.witnessform.id != null) {
              // 获取捐献器官列表
              listDonateorgan(oraganqueryParam).then(response => {
                this.loading = false;
                if (response.code == 200) {
                  this.organdonation = [];
                  this.tableData = response.rows;
                  //获取医院默认是移植医院
                  for (let i = 0; i < this.tableData.length; i++) {
                    if (
                      this.tableData[i].gainhospitalname == null ||
                      this.tableData[i].gainhospitalname == ""
                    ) {
                      this.tableData[i].gainhospitalname = this.tableData[
                        i
                      ].transplanthospitalname;
                    }
                    if (
                      this.tableData[i].gainhospitalno == null ||
                      this.tableData[i].gainhospitalno == ""
                    ) {
                      this.tableData[i].gainhospitalno = this.tableData[
                        i
                      ].transplanthospitalno;
                    }
                  }
                  //this.organalForm.organname = [];
                  for (let i = 0; i < response.rows.length; i++) {
                    this.form.organdonation.push(response.rows[i].organno);
                  }
                } else {
                  this.$modal.msgError("获取捐献器官失败:" + response.msg);
                }
              });
              // 获取信息
            } else {
              addMedicalevaluation(this.witnessform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      } else if (this.actives == 7) {
        this.$refs["accomplishform"].validate(valid => {
          if (valid) {
            if (this.accomplishform.id != null) {
              updateMedicalevaluation(this.accomplishform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
            } else {
              addMedicalevaluation(this.accomplishform).then(response => {
                this.$modal.msgSuccess("新增成功");
              });
            }
            this.submitForm();
          }
        });
      }
    },
    // 切换tab
    on_click(e) {
@@ -2151,6 +2459,7 @@
        this.actives = e;
      }
    },
    // 前进步骤
    makeastepforward() {},
    // 上报审核
@@ -2199,7 +2508,7 @@
  font-size: 18px;
  padding: 0 30px;
  padding-bottom: 10px;
  margin-top:20px;
  margin-top: 20px;
  .top-text {
    text-align: center;