11
WXL
2023-10-31 be42af700f901f496db68d97ab46e2c1d4bef85a
src/views/project/donationdetails/index.vue
@@ -4,45 +4,150 @@
      <div class="postfilx">
        <div class="title">工作进程</div>
        <div style="height: 666px;">
          <el-steps direction="vertical" :active="3">
          <el-steps direction="vertical" :active="workflow">
            <el-step title="潜在捐献" icon="el-icon-user">
              <template slot="description">
                <p>提交时间:<span>2023-9-20</span></p>
                <p>审核时间:<span>2023-9-30</span></p>
              <template
                slot="description"
                v-if="Processdata.donateorgan.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.donateorgan.createtime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.donateorgan.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step title="医学评估" icon="el-icon-edit-outline">
              <template slot="description">
                <p>提交时间:<span>2023-9-20</span></p>
                <p>审核时间:<span>2023-9-30</span></p>
            <el-step
              title="医学评估"
              icon="el-icon-edit-outline"
              description="请先完成前部步骤"
            >
              <template
                slot="description"
                v-if="Processdata.medicalevaluation.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.medicalevaluation.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.medicalevaluation.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="捐献确认"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-folder-checked"
            >
              <template
                slot="description"
                v-if="Processdata.relativesconfirmation.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.relativesconfirmation.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.relativesconfirmation.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="伦理审查"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-s-order"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.ethicalreviewopinions.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.ethicalreviewopinions.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.ethicalreviewopinions.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="器官分配"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-s-operation"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.organallocationService.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.organallocationService.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.organallocationService.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="获取见证"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-s-management"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.donationwitness.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.donationwitness.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.donationwitness.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
            <el-step
              title="完成登记"
              description="这是一段很长很长很长的描述性文字"
              description="请先完成前部步骤"
              icon="el-icon-circle-check"
            ></el-step>
            >
              <template
                slot="description"
                v-if="Processdata.donatecompletioninfo.createtime"
              >
                <p>
                  提交时间:<span>{{
                    parseTime(Processdata.donatecompletioninfo.updatetime)
                  }}</span>
                </p>
                <p>
                  更新时间:<span>{{
                    parseTime(Processdata.donatecompletioninfo.updatetime)
                  }}</span>
                </p>
              </template>
            </el-step>
          </el-steps>
        </div>
      </div>
@@ -296,7 +401,8 @@
          ></el-step>
        </el-steps>
      </div>
      <div class="Ticket-button">
      <!-- 凭证文件 -->
      <div class="Ticket-button" v-show="actives != 5 && actives != 4">
        <el-button @click.native.prevent="Filepopup" type="success"
          >凭证文件</el-button
        >
@@ -623,14 +729,16 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="submitForm"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="submitForm"
            >保存捐献者信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="Reportforreview"
@@ -852,14 +960,16 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存评估信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="makeastepforward"
@@ -1050,14 +1160,16 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="makeastepforward"
@@ -1116,14 +1228,16 @@
          </el-row>
        </el-form>
        <div class="dialog-footer" style="min-height: 500px; margin: 20px 0; ">
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="makeastepforward"
@@ -1282,14 +1396,16 @@
          </el-form-item>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="makeastepforward"
@@ -1731,14 +1847,16 @@
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="makeastepforward"
@@ -1964,14 +2082,16 @@
          </el-row>
        </el-form>
        <div class="dialog-footer">
          <el-button v-show="showSaveBtn" type="primary" @click="Savethedetails"
          <el-button
            v-show="!showTerminationBtn"
            type="primary"
            @click="Savethedetails"
            >保存捐献者信息</el-button
          >
          <el-button
            v-show="showTerminationBtn"
            type="primary"
            :type="showTerminationBtn == 0 ? 'warning' : 'success'"
            @click="Terminationcase"
            >终止案例</el-button
            >{{ showTerminationBtn == 0 ? "终止案例" : "恢复案例" }}</el-button
          >
          <el-button
            v-show="Reportforreview"
@@ -1983,6 +2103,7 @@
        </div>
      </div>
    </div>
    <!-- 附件弹窗 -->
    <el-dialog
      v-dialogDrags
      :modal="false"
@@ -1997,11 +2118,11 @@
        type="card"
        @tab-click="handleClick"
      >
        <el-tab-pane label="潜在捐献" :name="0"> </el-tab-pane>
        <el-tab-pane label="医学评估" :name="1"> </el-tab-pane>
        <el-tab-pane label="捐献确认" :name="2"> </el-tab-pane>
        <el-tab-pane label="伦理审查" :name="3"> </el-tab-pane>
        <el-tab-pane label="完成登记" :name="6"> </el-tab-pane>
        <el-tab-pane label="潜在捐献" :name="1"> </el-tab-pane>
        <el-tab-pane label="医学评估" :name="2"> </el-tab-pane>
        <el-tab-pane label="捐献确认" :name="3"> </el-tab-pane>
        <el-tab-pane label="伦理审查" :name="4"> </el-tab-pane>
        <el-tab-pane label="完成登记" :name="7"> </el-tab-pane>
      </el-tabs>
      <div class="pdfimg">
        <div class="box-pdf">
@@ -2104,9 +2225,15 @@
<script>
import {
  addDonateannex,
  listDonateannex,
  Modifydonationattachment
} from "@/api/project/donateannex";
import {
  getDonatebaseinfo,
  addDonatebaseinfo,
  updateDonatebaseinfo
  updateDonatebaseinfo,
  getDonatebaseinfoflow
} from "@/api/project/donatebaseinfo";
import {
  listMedicalevaluation,
@@ -2187,16 +2314,18 @@
      witnessform: {},
      accomplishform: {},
      tableData: [],
      actives: 0,
      actives: 0, //进程
      workflow:0,
      loading: false,
      //   保存、终止按钮确认
      showSaveBtn: true,
      showTerminationBtn: true,
      showTerminationBtn: 0, //终止状态 0-未终止 1-已终止
      //选择器官表单
      organalForm: {
        //器官列表
        organname: []
      },
      Processdata: {}, //流程数据
      //省市区默认值设置,可为空
      searchAddress: {
        sheng: "",
@@ -2291,6 +2420,7 @@
          { required: true, message: "请输入报告人联系电话", trigger: "blur" }
        ]
      },
      // 各级明细效验
      medicinerules: {},
      affirmrules: {},
      ethicrules: {},
@@ -2298,6 +2428,12 @@
      witnessrules: {},
      accomplishrules: {},
      //附件列表
      donatelist: [], //附件总组
      potentiallist: [], //潜在附件
      medicinelist: [], //医学附件
      affirmlist: [], //确认附件
      ethiclist: [], //伦理附件
      registerlist: [], //完成附件
      fileList: [],
      fileListto: [],
      invoicefileList: [],
@@ -2328,15 +2464,24 @@
  mounted() {
    // this.id = this.$route.query.id;
    this.Getbasicinformation();
    this.listDonateannex();
  },
  methods: {
    // 获取主表数据
    Getbasicinformation() {
      console.log(this.infoid);
      console.log(this.hintitle);
      // 左侧流程数据
      getDonatebaseinfoflow(this.infoid).then(res => {
        console.log(res.data);
        this.Processdata = res.data;
      });
      // 表单数据
      getDonatebaseinfo(this.infoid).then(response => {
        this.form = response.data;
        this.showTerminationBtn = response.data.terminationCase;
        this.actives = response.data.workflow;
        this.workflow=response.data.workflow;
        response.data.sex = parseInt(response.data.sex);
        this.form.id = response.data.id;
        this.form.diseasetype = this.form.diseasetype.split(",");
@@ -2446,6 +2591,40 @@
        });
      }
    },
    // 获取附件数据并分类二级列
    listDonateannex() {
      let parmi = {};
      parmi.infoid = this.infoid.toString();
      listDonateannex(parmi).then(res => {
        this.donatelist = res.rows;
      });
// 测试数据
      const arr = [
        { type: "type1", name: "saaada" },
        { type: "type2", name: "ssssda" },
        { type: "type3", name: "sdddda" },
        { type: "type4", name: "sdddda" },
        { type: "type5", name: "sdddda" }
      ];
      const groupedArr = arr.reduce((accumulator, currentValue) => {
        const key = currentValue.type;
        if (key == "type1") {
          this.potentiallist.push(currentValue);
        } else if (key == "type2") {
          this.medicinelist.push(currentValue);
        } else if (key == "type3") {
          this.affirmlist.push(currentValue);
        } else if (key == "type4") {
          this.ethiclist.push(currentValue);
        } else if (key == "type5") {
          this.registerlist.push(currentValue);
        }
        return accumulator;
      }, {});
      console.log(this.potentiallist);
      console.log(this.medicinelist);
    },
    /** 保存主表按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
@@ -2497,23 +2676,21 @@
            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.GetAttacheddata();
              this.open = false;
            });
          } else {
            this.form.workflow = 1;
            this.form.recordstate = 0;
            addDonatebaseinfo(this.form).then(response => {
              if (response.code == 200) {
                this.$modal.msgSuccess("新增成功");
                this.Getbasicinformation();
                this.GetAttacheddata();
                this.open = false;
              } else {
                this.$modal.msgError("新增失败:" + response.msg);
@@ -2526,6 +2703,7 @@
    // 保存二级表按钮
    Savethedetails() {
      if (this.actives == 1) {
        this.Processvalidation();
        this.medicineform.infoid = this.form.id;
        this.$refs["medicineform"].validate(valid => {
          if (valid) {
@@ -2540,8 +2718,8 @@
          }
        });
      } else if (this.actives == 2) {
        this.Processvalidation();
        this.affirmform.infoid = this.form.id;
        this.$refs["affirmform"].validate(valid => {
          if (valid) {
            if (this.affirmform.id != null) {
@@ -2555,6 +2733,7 @@
          }
        });
      } else if (this.actives == 3) {
        this.Processvalidation();
        this.ethicform.infoid = this.form.id;
        this.$refs["ethicform"].validate(valid => {
          if (valid) {
@@ -2569,10 +2748,11 @@
          }
        });
      } else if (this.actives == 4) {
        this.Processvalidation();
        this.allocationform.infoid = this.form.id;
        this.$refs["allocationform"].validate(valid => {
          if (valid) {
            if (this.allocationform.id != null) {
            if (this.allocationform[0].id != null) {
              updateOrganallocation(this.allocationform).then(response => {
                this.$modal.msgSuccess("修改成功");
              });
@@ -2585,6 +2765,7 @@
          }
        });
      } else if (this.actives == 5) {
        this.Processvalidation();
        this.witnessform.infoid = this.form.id;
        this.$refs["witnessform"].validate(valid => {
          if (valid) {
@@ -2632,6 +2813,7 @@
          }
        });
      } else if (this.actives == 6) {
        this.Processvalidation();
        this.accomplishform.infoid = this.form.id;
        this.$refs["accomplishform"].validate(valid => {
          if (valid) {
@@ -2657,6 +2839,7 @@
      // }
      this.GetAttacheddata();
    },
    // 器官分配栏目控制
    changeorganState(value) {
      let organIndex = this.allocationform.findIndex(
        item => item.organno == value
@@ -2720,13 +2903,31 @@
        console.log("已到达最大值");
      }
    },
    // 更改进程效验
    Processvalidation() {
      console.log(this.form.workflow);
      console.log(this.actives);
      if (this.form.workflow == this.actives) {
        this.form.workflow++;
      } else if (this.form.workflow > this.actives) {
      } else {
        this.$modal.msgWarning("请先完成前部步骤");
        return;
      }
      console.log(this.form.workflow);
    },
    // 上报审核
    Reportforreview() {},
    // 终止案例
    Terminationcase() {},
    Terminationcase() {
      this.form.terminationCase == 1
        ? (this.form.terminationCase = 0)
        : (this.form.terminationCase = 1);
      this.submitForm();
    },
    // 返回上一页
    cancel() {},
    // ------------------------票据
    // ----------------------------------文件
    // 获取请求头
    Getnetworkheader() {
      let string = window.location.href;
@@ -2800,12 +3001,10 @@
    // 点击票据
    Filepopup(index, rows, row) {
      this.tableDatatop = [];
      this.activeName = this.actives + 1;
      console.log(this.activeName);
      this.pdfimgsrcList = [];
      this.invoDatatop = [];
      this.invoicepdfimgsrcList = [];
      this.invoDatatop.push(row);
      this.tableDatatop.push(row);
      this.atpresent = index;
      this.pdfVisible = true;
      console.log(this.rbDetails[index]);
@@ -2940,7 +3139,9 @@
        const item = this.invoicefileListto.splice(index, 1)[0]; // 移除指定索引处的元素,并保存到item变量中
        this.invoicefileListto.splice(index - 1, 0, item); // 将item插入到索引位置的前一位
      }
    }
    },
    // 保存
    saveattachment(stype) {}
  }
};
</script>