From 3873d3c350c8c1edd7bfdc8afe08c9e78f56d968 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 22 十月 2026 23:24:20 +0800
Subject: [PATCH] 调整费用申请模式

---
 src/views/project/donationdetails/index.vue |  158 +++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 117 insertions(+), 41 deletions(-)

diff --git a/src/views/project/donationdetails/index.vue b/src/views/project/donationdetails/index.vue
index 8715e59..be05831 100644
--- a/src/views/project/donationdetails/index.vue
+++ b/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"
@@ -3485,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) {
@@ -3495,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;
 
@@ -3584,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;
@@ -3594,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) {
@@ -3621,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) {
@@ -3644,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) {
@@ -3672,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();
@@ -3720,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();
@@ -3729,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));
@@ -3747,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();
@@ -3782,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);
@@ -3792,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 {
@@ -4130,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) {
@@ -4137,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;
       }
     },
@@ -4462,21 +4534,21 @@
 <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;
 
-  // 宸︿晶宸ヤ綔杩涚▼鏍�
+  // 宸︿晶宸ヤ綔杩涚▼鏍忥紙2026-10-22锛氬幓鎺夊簳鑹诧紝鍙暀涓�鏉″垎闅旂嚎锛涙爣棰樻枃瀛楁敼鍝佺墝闈掞級
   .left-course {
-    background: #fff;
+    background: transparent;
     width: 220px;
     min-width: 220px;
     text-align: center;
     margin: 0;
     padding: 0;
     height: 100%;
-    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
+    border-right: 1px solid var(--opo-border-base, #e5e7eb);
     transition: all 0.3s ease;
     position: relative;
     z-index: 100;
@@ -4511,10 +4583,10 @@
       flex-direction: column;
 
       .title {
-        background: #22a2c3;
+        background: transparent;
         margin-bottom: 0;
         padding: 15px 10px;
-        color: #fff;
+        color: var(--opo-primary, #0e768f);
         font-size: 16px;
         font-weight: 600;
         display: flex;
@@ -4524,11 +4596,13 @@
         transition: all 0.3s ease;
         min-height: 54px; // 纭繚鏍囬鍖哄煙鏈夊浐瀹氶珮搴�
         box-sizing: border-box;
+        border-bottom: 1px solid var(--opo-border-base, #e5e7eb);
 
         .collapse-btn {
-          background: rgba(255, 255, 255, 0.2);
-          border: none;
-          color: #fff;
+          // 鏍囬搴曡壊鍘绘帀鍚庯紝鎸夐挳鏀逛负娴呴潚鎻忚竟椋庢牸锛岄伩鍏嶇櫧搴曠櫧瀛楃湅涓嶈
+          background: var(--opo-primary-light-9, #e7f1f4);
+          border: 1px solid var(--opo-primary-light-7, #b7d6dd);
+          color: var(--opo-primary, #0e768f);
           width: 32px; // 绋嶅井澧炲ぇ纭繚鍙偣鍑诲尯鍩�
           height: 32px;
           padding: 0;
@@ -4540,7 +4614,8 @@
           flex-shrink: 0; // 闃叉鎸夐挳琚帇缂�
 
           &:hover {
-            background: rgba(255, 255, 255, 0.3);
+            background: var(--opo-primary-light-7, #b7d6dd);
+            border-color: var(--opo-primary, #0e768f);
             transform: scale(1.1);
           }
 
@@ -4608,7 +4683,7 @@
   }
 }
 
-// 姝ラ鏍峰紡浼樺寲
+// 姝ラ鏍峰紡浼樺寲锛堥厤鑹茬粺涓�鍒扮郴缁熷搧鐗岃壊锛歵eal #0E768F锛�
 ::v-deep .el-steps {
   &.el-steps--vertical {
     height: 100%;
@@ -4618,27 +4693,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 {

--
Gitblit v1.9.3