11
WXL
2023-11-05 24112d26079c0010f0baff217d9ddcd9dfb595b4
src/views/project/donationdetails/index.vue
@@ -1892,6 +1892,10 @@
          <el-button @click="cancel">取 消</el-button>
        </div>
      </div>
      <!-- 完结流程 -->
      <div class="boxdiv" v-show="actives > 6">
         <h3>全部流程已完结!</h3>
      </div>
    </div>
    <!-- 附件弹窗 -->
    <el-dialog
@@ -1908,11 +1912,11 @@
        type="card"
        @tab-click="handleClick"
      >
        <el-tab-pane label="潜在捐献" :name="1"> </el-tab-pane>
        <el-tab-pane label="医学评估" :name="2"> </el-tab-pane>
        <el-tab-pane :label="activetele" :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-tab-pane label="完成登记" :name="7"> </el-tab-pane> -->
      </el-tabs>
      <div class="pdfimg">
        <div class="box-pdf">
@@ -2248,6 +2252,8 @@
      registerlist: [], //完成附件
      fileList: [],
      fileListto: [],
      donatelist: [], //总
      activetele:'潜在捐献',
      //上传附件路径
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
      //文件上传token
@@ -2267,6 +2273,9 @@
    };
  },
  created() {
    this.infoid = this.$route.query.id;
  },
  mounted() {
    // this.id = this.$route.query.id;
    this.Getbasicinformation();
@@ -2274,7 +2283,7 @@
  },
  methods: {
    // 获取主表数据
    // 获取主表及附属数据
    Getbasicinformation() {
      // 左侧流程数据
      getDonatebaseinfoflow(this.infoid).then(res => {
@@ -2314,14 +2323,17 @@
        this.residenceAddresss.qu = response.data.residencetownname;
        this.registerAddresss.qu = response.data.registertownname;
      });
      // 获取二级表
      this.GetAttacheddata();
    },
    // 获取二级表数据
    GetAttacheddata() {
      let searchParam = {
        infoid: this.form.id
        infoid: this.infoid
      };
      if (this.actives == 1) {
        this.annexfilesList = this.medicinelist;
        this.activetele="医学评估";
        listMedicalevaluation(searchParam).then(response => {
          if (response.code == 200 && response.rows[0]) {
            this.medicineform = response.rows[0];
@@ -2333,6 +2345,7 @@
        });
      } else if (this.actives == 2) {
        this.annexfilesList = this.affirmlist;
        this.activetele="捐献确认";
        listRelativesconfirmation(searchParam).then(response => {
          if (response.code == 200 && response.rows[0]) {
            this.affirmform = response.rows[0];
@@ -2361,6 +2374,7 @@
        });
      } else if (this.actives == 3) {
        this.annexfilesList = this.ethiclist;
        this.activetele="伦理审查";
        listDonateflowchart(searchParam).then(response => {
          if (response.code == 200 && response.rows.length == 1) {
@@ -2391,7 +2405,7 @@
          if (response.code == 200) {
            if (response.data) {
              this.witnessform = response.data;
              this.witnessform.infoid = this.form.id;
              this.witnessform.infoid = this.infoid;
            }
          } else {
            this.$modal.msgError(
@@ -2401,19 +2415,23 @@
        });
      } else if (this.actives == 6) {
        this.annexfilesList = this.registerlist;
        this.activetele="完成登记";
        let accpre = {
          id: searchParam.infoid
        };
        listnewDonatecompletioninfo(accpre).then(response => {
          if (response.code == 200 && response.rows.length) {
            this.accomplishform = response.rows[0];
            this.accomplishform.infoid = this.form.id;
            this.accomplishform.infoid = this.infoid;
          } else {
            this.$modal.msgError("完成登记失败:" + JSON.stringify(response));
          }
        });
      } else if (this.actives == 0) {
        this.annexfilesList = this.registerlist;
        this.activetele="潜在捐献";
      }
    },
    /** 保存主表按钮 */
@@ -2469,10 +2487,16 @@
          }
          if (this.form.id != null) {
            if (this.form.workflow == 0) {
              this.form.workflow = 1;
            }
            updateDonatebaseinfo(this.form).then(response => {
              this.$modal.msgSuccess("保存成功");
              Modifydonationattachment(this.donatelist).then(res => {
                console.log(res);
              });
              this.Getbasicinformation();
              this.Processvalidation();
              // this.Processvalidation();
              this.open = false;
            });
          } else {
@@ -2481,8 +2505,11 @@
            addDonatebaseinfo(this.form).then(response => {
              if (response.code == 200) {
                this.$modal.msgSuccess("新增成功");
                Modifydonationattachment(this.donatelist).then(res => {
                  console.log(res);
                });
                this.Getbasicinformation();
                this.Processvalidation();
                // this.Processvalidation();
                this.open = false;
              } else {
                this.$modal.msgError("新增失败:" + response.msg);
@@ -2496,7 +2523,7 @@
    Savethedetails() {
      console.log(this.actives);
      if (this.actives == 1) {
        this.medicineform.infoid = this.form.id;
        this.medicineform.infoid = this.infoid;
        this.$refs["medicineform"].validate(valid => {
          if (valid) {
            if (this.medicineform.id != null) {
@@ -2508,11 +2535,11 @@
                this.$modal.msgSuccess("医学评估信息新增成功");
              });
            }
            this.submitForm();
            this.Processvalidation();
          }
        });
      } else if (this.actives == 2) {
        this.affirmform.infoid = this.form.id;
        this.affirmform.infoid = this.infoid;
        this.$refs["affirmform"].validate(valid => {
          if (valid) {
            if (this.affirmform.id != null) {
@@ -2527,11 +2554,11 @@
                this.$modal.msgSuccess("捐献确认信息新增成功");
              });
            }
            this.submitForm();
            this.Processvalidation();
          }
        });
      } else if (this.actives == 3) {
        this.ethicform.infoid = this.form.id;
        this.ethicform.infoid = this.infoid;
        this.$refs["ethicform"].validate(valid => {
          if (valid) {
            if (this.ethicform.id != null) {
@@ -2543,11 +2570,11 @@
                this.$modal.msgSuccess("伦理审查信息新增成功");
              });
            }
            this.submitForm();
            this.Processvalidation();
          }
        });
      } else if (this.actives == 4) {
        this.allocationform.infoid = this.form.id;
        this.allocationform.infoid = this.infoid;
        this.$refs["allocationform"].validate(valid => {
          if (valid) {
            let arrallo = [];
@@ -2565,11 +2592,11 @@
                this.$modal.msgSuccess("器官捐献信息新增成功");
              });
            }
            this.submitForm();
            this.Processvalidation();
          }
        });
      } else if (this.actives == 5) {
        this.witnessform.infoid = this.form.id;
        this.witnessform.infoid = this.infoid;
        this.$refs["witnessform"].validate(valid => {
          let coordinatedusernameIndex = this.coordinatorlist1.findIndex(
            item => this.witnessform.coordinateduserido == item.reportNo
@@ -2603,11 +2630,11 @@
                this.$modal.msgSuccess("获取见证信息新增成功");
              });
            }
            this.submitForm();
            this.Processvalidation();
          }
        });
      } else if (this.actives == 6) {
        this.accomplishform.infoid = this.form.id;
        this.accomplishform.infoid = this.infoid;
        this.$refs["accomplishform"].validate(valid => {
          if (valid) {
            if (this.accomplishform.id) {
@@ -2620,7 +2647,7 @@
                this.$modal.msgSuccess("完成登记成功");
              });
            }
            this.submitForm();
            this.Processvalidation();
          }
        });
      }
@@ -2629,9 +2656,13 @@
    on_click(e) {
      console.log(e);
      // if (e != "" || e != null) {
      this.actives = e;
      if (this.form.workflow >= e) {
        this.actives = e;
        this.Processvalidation(e);
      } else {
        this.$modal.msgWarning("请先完成前部步骤");
      }
      // }
      this.Processvalidation();
    },
    // 器官分配栏目控制
    changeorganState(value) {
@@ -2652,7 +2683,7 @@
            organname: temporganname,
            organno: value,
            id: null,
            infoid: this.form.id,
            infoid: this.infoid,
            donorno: this.form.donorno,
            transplanthospitalname: null,
            transplanthospitalno: null,
@@ -2682,7 +2713,7 @@
                  this.$modal.msgSuccess("删除成功");
                });
              } else {
                this.allocationform.splice(deleteIndex, 1);
                this.allocationform.splice(organIndex, 1);
              }
            }
          })
@@ -2705,8 +2736,10 @@
      console.log(this.actives);
      if (this.form.workflow == this.actives) {
        this.form.workflow++;
        this.GetAttacheddata();
        this.submitForm();
        // this.GetAttacheddata();
      } else if (this.form.workflow > this.actives) {
        // this.submitForm();
        this.GetAttacheddata();
      } else {
        this.$modal.msgWarning("请先完成前部步骤");
@@ -2780,12 +2813,16 @@
        this.registerlist = arr;
      }
      // 删除时修改主列delFlag
      console.log(delvalue);
      const index = this.donatelist.indexOf(delvalue);
      console.log(index);
      if (index !== -1) {
        if (delvalue.id) {
          this.donatelist[index].delFlag = 1;
          console.log("修改老数据后", this.donatelist);
        } else {
          this.donatelist.splice(index, 1);
          console.log("删除新数据后", this.donatelist);
        }
      } else {
        console.log("查询不到可能是新数据无id");
@@ -2793,6 +2830,7 @@
      // 新增时修改主列
      if (addvalue.annexurl) {
        this.donatelist.push(addvalue);
        console.log("新增后", this.donatelist);
      }
    },
    //文件上传
@@ -2809,10 +2847,15 @@
        // this.form.filename = file.raw.name;
        this.previewpdf = true;
        this.$modal.msgSuccess(response.msg);
        this.fileListto.push({
        let addvalue = {
          annexname: file.name,
          annexurl: response.fileName
        });
          annexurl: response.fileName,
          delFlag: 0,
          infoid: this.infoid,
          annexfilestype: this.actives
        };
        this.fileListto.push(addvalue);
        this.Newconversion(this.fileListto, "", addvalue);
        this.pdfimgsrcList.push(
          this.Networkheader + "/prod-api" + response.fileName
        );
@@ -2882,7 +2925,9 @@
      );
      this.pdfimgsrcList.splice(indexlist, 1);
      const index = this.getIndexInArray(this.fileListto, row);
      this.Newconversion(this.fileListto, this.fileListto[index], "");
      this.fileListto.splice(index, 1);
      console.log(index);
    },
    // 点击上移
    moveupdowfile(row) {