From be42af700f901f496db68d97ab46e2c1d4bef85a Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 31 十月 2023 16:35:58 +0800
Subject: [PATCH] 11

---
 src/views/project/donationdetails/index.vue  |   59 +++++++
 src/views/project/fund/applyDetail/index.vue |  297 ++++++++++++++++++++++++------------------
 src/api/project/donateannex.js               |   11 +
 3 files changed, 232 insertions(+), 135 deletions(-)

diff --git a/src/api/project/donateannex.js b/src/api/project/donateannex.js
index 597fc36..a60901d 100644
--- a/src/api/project/donateannex.js
+++ b/src/api/project/donateannex.js
@@ -8,7 +8,14 @@
     params: query
   })
 }
-
+// 淇敼闄勪欢鍒楄〃
+export function Modifydonationattachment(data) {
+  return request({
+    url: '/project/donateannex/editannexfiles',
+    method: 'post',
+    data: data
+  })
+}
 // 鏌ヨ鎹愮尞闄勪欢鍒楄〃
 export function listDonateannex(query) {
   return request({
@@ -29,7 +36,7 @@
 // 鏂板鎹愮尞闄勪欢
 export function addDonateannex(data) {
   return request({
-    url: '/project/donateannex',
+    url: '/project/donateannex/add',
     method: 'post',
     data: data
   })
diff --git a/src/views/project/donationdetails/index.vue b/src/views/project/donationdetails/index.vue
index f94db32..7f5a746 100644
--- a/src/views/project/donationdetails/index.vue
+++ b/src/views/project/donationdetails/index.vue
@@ -4,7 +4,7 @@
       <div class="postfilx">
         <div class="title">宸ヤ綔杩涚▼</div>
         <div style="height: 666px;">
-          <el-steps direction="vertical" :active="actives">
+          <el-steps direction="vertical" :active="workflow">
             <el-step title="娼滃湪鎹愮尞" icon="el-icon-user">
               <template
                 slot="description"
@@ -2225,6 +2225,11 @@
 
 <script>
 import {
+  addDonateannex,
+  listDonateannex,
+  Modifydonationattachment
+} from "@/api/project/donateannex";
+import {
   getDonatebaseinfo,
   addDonatebaseinfo,
   updateDonatebaseinfo,
@@ -2310,6 +2315,7 @@
       accomplishform: {},
       tableData: [],
       actives: 0, //杩涚▼
+      workflow:0,
       loading: false,
       //   淇濆瓨銆佺粓姝㈡寜閽‘璁�
       showSaveBtn: true,
@@ -2422,6 +2428,12 @@
       witnessrules: {},
       accomplishrules: {},
       //闄勪欢鍒楄〃
+      donatelist: [], //闄勪欢鎬荤粍
+      potentiallist: [], //娼滃湪闄勪欢
+      medicinelist: [], //鍖诲闄勪欢
+      affirmlist: [], //纭闄勪欢
+      ethiclist: [], //浼︾悊闄勪欢
+      registerlist: [], //瀹屾垚闄勪欢
       fileList: [],
       fileListto: [],
       invoicefileList: [],
@@ -2452,23 +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(",");
@@ -2578,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 => {
@@ -2880,7 +2927,7 @@
     },
     // 杩斿洖涓婁竴椤�
     cancel() {},
-    // ------------------------绁ㄦ嵁
+    // ----------------------------------鏂囦欢
     // 鑾峰彇璇锋眰澶�
     Getnetworkheader() {
       let string = window.location.href;
@@ -3092,7 +3139,9 @@
         const item = this.invoicefileListto.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
         this.invoicefileListto.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
       }
-    }
+    },
+    // 淇濆瓨
+    saveattachment(stype) {}
   }
 };
 </script>
diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index c4f8e17..2ae752b 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -448,7 +448,13 @@
               v-if="form.applytype == '1' || form.applytype == '2'"
             >
               <template slot-scope="scope">
-                <el-input v-model="scope.row.idcardno" placeholder="韬唤璇佸彿" />
+                <el-form-item :error="scope.row.error" label-width="0">
+                  <el-input
+                    v-model.number="scope.row.idcardno"
+                    @input="tableParValueChange(scope.row)"
+                    placeholder="韬唤璇佸彿"
+                  />
+                </el-form-item>
               </template>
             </el-table-column>
             <el-table-column
@@ -753,7 +759,7 @@
       style="text-align: center"
       v-loading="loading"
     >
-      <el-form ref="funddetailForm" :model="funddetailForm">
+      <el-form ref="funddetailForm" :rules="funddrules" :model="funddetailForm">
         <el-row v-if="businessType != 4 && businessType != 3">
           <el-col
             :span="24"
@@ -1446,6 +1452,14 @@
   ],
 
   data() {
+    var validatePass = (rule, value, callback) => {
+      const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}([0-9]|X)$/;
+      if (regex.test(value)) {
+        callback();
+      } else {
+        callback(new Error("韬唤璇佸彿鐮佹牸寮忛敊璇�"));
+      }
+    };
     //杩欓噷瀛樻斁鏁版嵁
     return {
       // 閬僵灞�
@@ -1557,6 +1571,18 @@
         ],
         deptmentname: [
           { required: true, message: "璇疯緭鍏ユ墍灞炰笟鍔$粍", trigger: "blur" }
+        ]
+      },
+      funddrules: {
+        expertidcardno: [{ validator: validatePass, trigger: "blur" }],
+        expertdepositbank: [
+          { required: true, message: "璇疯緭鍏ュ紑鎴烽摱琛�", trigger: "change" }
+        ],
+        expertbankcardno: [
+          { required: true, message: "璇疯緭鍏ラ摱琛屽崱鍙�", trigger: "change" }
+        ],
+        expertunitno: [
+          { required: true, message: "璇烽�夋嫨鍗曚綅鍚嶇О", trigger: "change" }
         ]
       },
 
@@ -2292,9 +2318,8 @@
         this.$modal.msgError("璇烽�夌‘璁ゆ潗鏂欑姸鎬佸凡鏀跺埌锛�");
         return;
       }
-        this.Savenow();
-        console.log("淇濆瓨骞跺鎵�");
-
+      this.Savenow();
+      console.log("淇濆瓨骞跺鎵�");
     },
 
     // 鍙栨秷鎸夐挳
@@ -3378,145 +3403,161 @@
 
     //涓撳/鍖荤枟鏈烘瀯/璐圭敤鎶ラ攢鏈烘瀯閫夋嫨
     ConfirmDetailDialog() {
-      // if (this.businessType == 4) {
-      //   if (this.experthear == "expert") {
-      //     this.funddetailForm.beneficiaryname = this.unitforname;
-      //   } else {
-      //     this.funddetailForm.beneficiaryname = this.Personnelforname;
-      //   }
-      // }
-      let tempIndex = this.funddetailForm.index;
-      let tempExpertName = this.funddetailForm.beneficiaryname;
-      let tempUnitname = this.funddetailForm.unitname;
-      let singleDetail = this.rbDetails[tempIndex];
+      this.$refs["funddetailForm"].validate(valid => {
+        let tempIndex = this.funddetailForm.index;
+        let tempExpertName = this.funddetailForm.beneficiaryname;
+        let tempUnitname = this.funddetailForm.unitname;
+        let singleDetail = this.rbDetails[tempIndex];
 
-      if (
-        this.selectionType == "expert" ||
-        this.businessType == 4 ||
-        this.businessType == 3
-      ) {
-        if (this.expertfrom == "1" || this.experthear == "unit") {
-          //浠庝笓瀹跺垪琛ㄨ幏鍙栦俊鎭�
-          this.personlist.map(res => {
-            if (tempExpertName == res.username) {
-              singleDetail.beneficiaryno = res.userno;
-              singleDetail.beneficiaryname = res.username;
-              singleDetail.bankcardno = res.bankcardno;
-              singleDetail.branchbankname = res.branchbankname;
-              singleDetail.depositbank = res.depositbank;
-              singleDetail.idcardno = res.idcardno;
-              singleDetail.phone = res.telephone;
-              singleDetail.title = res.title;
-              singleDetail.unitname = res.unitname;
-              singleDetail.unitno = parseInt(res.unitno);
-            }
-          });
-        } else {
-          //淇濆瓨鏂板涓撳
-          this.expertform.id = null;
-          this.expertform.userno =
-            this.personlist[this.personlist.length - 1].id + 1;
-          this.expertform.usertype = "expert";
-          this.expertform.username = this.funddetailForm.expertname;
-          this.expertform.idcardno = this.funddetailForm.expertidcardno;
-          this.expertform.sex = null;
-          this.expertform.telephone = null;
-          this.expertform.address = null;
-          this.expertform.wbm = null;
-          this.expertform.pym = null;
+        if (
+          this.selectionType == "expert" ||
+          this.businessType == 4 ||
+          this.businessType == 3
+        ) {
+          if (this.expertfrom == "1" || this.experthear == "unit") {
+            //浠庝笓瀹跺垪琛ㄨ幏鍙栦俊鎭�
+            this.personlist.map(res => {
+              if (tempExpertName == res.username) {
+                singleDetail.beneficiaryno = res.userno;
+                singleDetail.beneficiaryname = res.username;
+                singleDetail.bankcardno = res.bankcardno;
+                singleDetail.branchbankname = res.branchbankname;
+                singleDetail.depositbank = res.depositbank;
+                singleDetail.idcardno = res.idcardno;
+                singleDetail.phone = res.telephone;
+                singleDetail.title = res.title;
+                singleDetail.unitname = res.unitname;
+                singleDetail.unitno = parseInt(res.unitno);
+              }
+            });
+          } else {
+            //淇濆瓨鏂板涓撳
+            this.expertform.id = null;
+            this.expertform.userno =
+              this.personlist[this.personlist.length - 1].id + 1;
+            this.expertform.usertype = "expert";
+            this.expertform.username = this.funddetailForm.expertname;
+            this.expertform.idcardno = this.funddetailForm.expertidcardno;
+            this.expertform.sex = null;
+            this.expertform.telephone = null;
+            this.expertform.address = null;
+            this.expertform.wbm = null;
+            this.expertform.pym = null;
 
-          this.expertform.unitno = this.funddetailForm.expertunitno;
-          try {
-            let unitIndex = this.unitList.findIndex(
-              item => this.expertform.unitno == item.organizationid
-            );
-            if (unitIndex > -1) {
-              this.expertform.unitname = this.unitList[
-                unitIndex
-              ].organizationname;
-            } else {
+            this.expertform.unitno = this.funddetailForm.expertunitno;
+            try {
+              let unitIndex = this.unitList.findIndex(
+                item => this.expertform.unitno == item.organizationid
+              );
+              if (unitIndex > -1) {
+                this.expertform.unitname = this.unitList[
+                  unitIndex
+                ].organizationname;
+              } else {
+                this.expertform.unitname = this.expertform.unitno;
+              }
+            } catch {
               this.expertform.unitname = this.expertform.unitno;
             }
-          } catch {
-            this.expertform.unitname = this.expertform.unitno;
-          }
-          this.expertform.title = this.funddetailForm.experttitle;
-          this.expertform.personnelunitno = null;
+            this.expertform.title = this.funddetailForm.experttitle;
+            this.expertform.personnelunitno = null;
 
-          this.expertform.depositbank = this.funddetailForm.expertdepositbank;
-          this.expertform.bankcardno = this.funddetailForm.expertbankcardno;
-          this.expertform.branchbankname = null;
-          this.expertform.remark = null;
-          this.expertform.del_flag = "0";
+            this.expertform.depositbank = this.funddetailForm.expertdepositbank;
+            this.expertform.bankcardno = this.funddetailForm.expertbankcardno;
+            this.expertform.branchbankname = null;
+            this.expertform.remark = null;
+            this.expertform.del_flag = "0";
 
-          addExternalperson(this.expertform).then(response => {
-            if (response.code == 200) {
-              this.$modal.msgSuccess("鏂板涓撳淇℃伅鎴愬姛锛�");
+            addExternalperson(this.expertform).then(response => {
+              if (response.code == 200) {
+                this.$modal.msgSuccess("鏂板涓撳淇℃伅鎴愬姛锛�");
 
-              listExternalperson().then(res => {
-                this.personlist = res.rows;
-                //浠庝笓瀹跺垪琛ㄨ幏鍙栦俊鎭�
-                this.personlist.map(res => {
-                  if (res.username == this.funddetailForm.expertname) {
-                    singleDetail.beneficiaryno = res.userno;
-                    singleDetail.beneficiaryname = res.username;
-                    singleDetail.bankcardno = res.bankcardno;
-                    singleDetail.branchbankname = res.branchbankname;
-                    singleDetail.depositbank = res.depositbank;
-                    singleDetail.idcardno = res.idcardno;
-                    singleDetail.phone = res.telephone;
-                    singleDetail.title = res.title;
-                    singleDetail.unitname = res.unitname;
-                    singleDetail.unitno = parseInt(res.unitno);
-                  }
+                listExternalperson().then(res => {
+                  this.personlist = res.rows;
+                  //浠庝笓瀹跺垪琛ㄨ幏鍙栦俊鎭�
+                  this.personlist.map(res => {
+                    if (res.username == this.funddetailForm.expertname) {
+                      singleDetail.beneficiaryno = res.userno;
+                      singleDetail.beneficiaryname = res.username;
+                      singleDetail.bankcardno = res.bankcardno;
+                      singleDetail.branchbankname = res.branchbankname;
+                      singleDetail.depositbank = res.depositbank;
+                      singleDetail.idcardno = res.idcardno;
+                      singleDetail.phone = res.telephone;
+                      singleDetail.title = res.title;
+                      singleDetail.unitname = res.unitname;
+                      singleDetail.unitno = parseInt(res.unitno);
+                    }
+                  });
                 });
-              });
-            }
-          });
-        }
-      } else if (this.selectionType == "unit") {
-        singleDetail.unitno = this.funddetailForm.unitno;
-        if (this.businessType == 1 || this.businessType == 2) {
-          try {
-            let unitIndex = this.unitList.findIndex(
-              item => singleDetail.unitno == item.organizationid
-            );
-            if (unitIndex > -1) {
-              singleDetail.unitname = this.unitList[unitIndex].organizationname;
-            } else {
+              }
+            });
+          }
+        } else if (this.selectionType == "unit") {
+          singleDetail.unitno = this.funddetailForm.unitno;
+          if (this.businessType == 1 || this.businessType == 2) {
+            try {
+              let unitIndex = this.unitList.findIndex(
+                item => singleDetail.unitno == item.organizationid
+              );
+              if (unitIndex > -1) {
+                singleDetail.unitname = this.unitList[
+                  unitIndex
+                ].organizationname;
+              } else {
+                singleDetail.unitname = singleDetail.unitno;
+              }
+            } catch {
               singleDetail.unitname = singleDetail.unitno;
             }
-          } catch {
-            singleDetail.unitname = singleDetail.unitno;
-          }
-        } else if (this.businessType == 3 || this.businessType == 4) {
-          try {
-            let unitIndex = this.feeUnitList.findIndex(
-              item => singleDetail.unitno == item.reportNo
-            );
-            if (unitIndex > -1) {
-              singleDetail.unitname = this.feeUnitList[unitIndex].reportName;
-              singleDetail.depositbank = this.feeUnitList[
-                unitIndex
-              ].depositbank;
-              singleDetail.bankcardno = this.feeUnitList[unitIndex].bankcardno;
-            } else {
+          } else if (this.businessType == 3 || this.businessType == 4) {
+            try {
+              let unitIndex = this.feeUnitList.findIndex(
+                item => singleDetail.unitno == item.reportNo
+              );
+              if (unitIndex > -1) {
+                singleDetail.unitname = this.feeUnitList[unitIndex].reportName;
+                singleDetail.depositbank = this.feeUnitList[
+                  unitIndex
+                ].depositbank;
+                singleDetail.bankcardno = this.feeUnitList[
+                  unitIndex
+                ].bankcardno;
+              } else {
+                singleDetail.unitname = singleDetail.unitno;
+              }
+            } catch {
               singleDetail.unitname = singleDetail.unitno;
             }
-          } catch {
-            singleDetail.unitname = singleDetail.unitno;
           }
         }
-      }
 
-      // if (this.experthear == "unit") {
-      //   singleDetail.unitname = "";
-      // }
-      if (this.businessType == 4 || this.businessType == 3) {
-        singleDetail.beneficiaryname = this.funddetailForm.beneficiaryname;
+        // if (this.experthear == "unit") {
+        //   singleDetail.unitname = "";
+        // }
+        if (this.businessType == 4 || this.businessType == 3) {
+          singleDetail.beneficiaryname = this.funddetailForm.beneficiaryname;
+        }
+        this.rbDetails[tempIndex] = singleDetail;
+        this.showSelectionDialog = false;
+      });
+    },
+    tableParValueChange(row, tto) {
+      const regex = /^[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}([0-9]|X)$/;
+      if (tto) {
+        if (regex.test(funddetailForm.expertidcardno)) {
+          row.error = "";
+        } else {
+          row.error = "韬唤璇佸彿鐮佹牸寮忛敊璇�";
+        }
+        return;
       }
-      this.rbDetails[tempIndex] = singleDetail;
-      this.showSelectionDialog = false;
+      console.log(11);
+      if (regex.test(row.idcardno)) {
+        row.error = "";
+      } else {
+        row.error = "韬唤璇佸彿鐮佹牸寮忛敊璇�";
+      }
     }
   },
 

--
Gitblit v1.9.3