From bd40ad4a3feb70acef5103a18ecad23f35a67f70 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 10 四月 2024 09:45:08 +0800
Subject: [PATCH] 11

---
 src/views/project/donationdetails/index.vue |   96 +++++++++++++++++++++++++++++-------------------
 1 files changed, 58 insertions(+), 38 deletions(-)

diff --git a/src/views/project/donationdetails/index.vue b/src/views/project/donationdetails/index.vue
index 3a681b3..a7a164c 100644
--- a/src/views/project/donationdetails/index.vue
+++ b/src/views/project/donationdetails/index.vue
@@ -2401,7 +2401,8 @@
   addDonatebaseinfo,
   updateDonatebaseinfo,
   getDonatebaseinfoflow,
-  fileCase
+  fileCase,
+  getDonationNumber
 } from "@/api/project/donatebaseinfo";
 import {
   listMedicalevaluation,
@@ -2911,6 +2912,8 @@
                 obj =>
                   obj.organname !== "宸﹀崐鑲�" &&
                   obj.organname !== "鍙冲崐鑲�" &&
+                  obj.organname !== "宸﹀鍙�" &&
+                  obj.organname !== "鍙充笁鍙�" &&
                   obj.organname !== "宸﹁倽" &&
                   obj.organname !== "鍙宠倽"
               );
@@ -2951,38 +2954,38 @@
           return;
         }
 
-          listDonatecomporgan(searchParam).then(res => {
-            if (res.code == 200) {
-              if (res.rows[0]) {
-                this.transplantdata = res.rows;
-                this.transplantdata.infoid = this.infoid;
-              } else {
-                this.transplantdata = this.allocateddata;
-                this.transplantdata = this.transplantdata.map(obj => {
-                  obj.id = null;
-                  if (
-                    obj.organname == "宸︾溂瑙掕啘" ||
-                    obj.organname == "鍙崇溂瑙掕啘"
-                  ) {
-                    obj.transplantstate = 2;
-                  }
-                  return obj;
-                });
-
-                this.transplantdata.infoid = this.infoid;
-              }
-              for (let i = 0; i < this.transplantdata.length; i++) {
-                this.organList.organtransplant.push(
-                  this.transplantdata[i].organno
-                );
-              }
+        listDonatecomporgan(searchParam).then(res => {
+          if (res.code == 200) {
+            if (res.rows[0]) {
+              this.transplantdata = res.rows;
+              this.transplantdata.infoid = this.infoid;
             } else {
-              // this.$modal.msgError(
-              //   "鍣ㄥ畼鍒楄〃鑾峰彇澶辫触锛�" + JSON.stringify(resall)
-              // );
+              this.transplantdata = this.allocateddata;
+              this.transplantdata = this.transplantdata.map(obj => {
+                obj.id = null;
+                if (
+                  obj.organname == "宸︾溂瑙掕啘" ||
+                  obj.organname == "鍙崇溂瑙掕啘"
+                ) {
+                  obj.transplantstate = 2;
+                }
+                return obj;
+              });
+
+              this.transplantdata.infoid = this.infoid;
             }
-          });
-        
+            for (let i = 0; i < this.transplantdata.length; i++) {
+              this.organList.organtransplant.push(
+                this.transplantdata[i].organno
+              );
+            }
+          } else {
+            // this.$modal.msgError(
+            //   "鍣ㄥ畼鍒楄〃鑾峰彇澶辫触锛�" + JSON.stringify(resall)
+            // );
+          }
+        });
+
         // 鑾峰彇瀹屾垚鐧昏淇℃伅
         listDonatecompletioninfo(searchParam).then(response => {
           if (response.code == 200 && response.rows.length) {
@@ -3021,7 +3024,9 @@
           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(",");
@@ -3231,13 +3236,32 @@
             if (this.witnessform.id != null) {
               updateDonationwitness(this.witnessform).then(response => {
                 this.$modal.msgSuccess("鑾峰彇瑙佽瘉淇℃伅淇敼鎴愬姛");
+                this.form.donationcategory = this.witnessform.donationcategory;
+                this.Processvalidation();
                 this.$modal.closeLoading();
               });
             } else {
               addDonationwitness(this.witnessform).then(response => {
-                this.$modal.msgSuccess("鑾峰彇瑙佽瘉淇℃伅鏂板鎴愬姛");
-                this.istb = true;
-                this.$modal.closeLoading();
+                if (response.code === 200) {
+                  this.$modal.msgSuccess("鑾峰彇瑙佽瘉淇℃伅鏂板鎴愬姛");
+                  this.form.donationcategory = this.witnessform.donationcategory;
+                  let data = JSON.parse(JSON.stringify(this.form));
+                  data.diseasetype = "";
+                  data.infectious = data.infectious.join(",");
+                  data.selfwill = data.selfwill.join(",");
+                  data.othercases = data.othercases.join(",");
+                  data.infosources = data.infosources.join(",");
+                  data.kinship = data.kinship.join(",");
+                  data.patientstate = data.patientstate.join(",");
+                  getDonationNumber(data).then(res => {
+                    this.form.donorno = res.msg;
+                    this.istb = true;
+                    this.Processvalidation();
+                  });
+                  this.$modal.closeLoading();
+                } else {
+                  this.$modal.msgError("鑾峰彇瑙佽瘉淇℃伅鏂板澶辫触");
+                }
               });
             }
 
@@ -3248,9 +3272,6 @@
                 this.$modal.msgSuccess("鎹愮尞鍣ㄥ畼鑾峰彇淇℃伅淇濆瓨鎴愬姛锛�");
               }
             });
-
-            //this.form.donationcategory = this.witnessform.donationcategory;
-            this.Processvalidation();
           }
         });
       } else if (this.actives == 6) {
@@ -3271,7 +3292,6 @@
                 if (res.rows[0]) {
                   let objfn = res.rows[0];
                   console.log(objfn, "sass");
-
                   objfn.caseno = item.caseno;
                   objfn.hospitalno = item.hospitalno;
                   objfn.name = item.name;

--
Gitblit v1.9.3