From a58cbd391aa2b58d59c0970f74edf006a03da1d7 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 28 八月 2023 14:10:36 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/opo-web

---
 src/views/project/fund/applyDetail/index.vue |  200 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 124 insertions(+), 76 deletions(-)

diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index 12b70ee..09b6479 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -50,8 +50,7 @@
           <el-col :span="5">
             <el-form-item label="閾惰鍚嶇О" prop="bankname">
               <el-input v-model="form.bankname" placeholder="璇疯緭鍏ラ摱琛屽悕绉�" />
-            </el-form-item>
-          </el-col><el-col :span="5">
+            </el-form-item> </el-col><el-col :span="5">
             <el-form-item label="閾惰璐﹀彿" prop="bankcardno">
               <el-input v-model="form.bankcardno" placeholder="璇疯緭鍏ラ摱琛岃处鍙�" />
             </el-form-item>
@@ -75,12 +74,12 @@
               <el-input v-model="form.pretaxcost" placeholder="绋庡墠閲戦鍚堣" :disabled="true" />
             </el-form-item>
           </el-col>
+          <!--
           <el-col :span="5">
             <el-form-item label="搴旂即绋�" prop="taxcost" v-if="businessType == '1' || businessType == '2'">
               <el-input v-model="form.taxcost" placeholder="搴旂即绋庨噾棰濆悎璁�" :disabled="true" />
             </el-form-item>
           </el-col>
-          <!--
           <el-col :span="5">
             <el-form-item label="绋庡悗閲戦" prop="pretaxcost">
               <el-input v-model="form.taxedcost" placeholder="绋庡悗閲戦鍚堣" :disabled="true" />
@@ -93,7 +92,7 @@
           </el-col>
           <el-col :span="5">
             <el-form-item label="鎹愮尞鑰�" prop="name">
-              <el-input :disabled="true" v-model="form.name" placeholder="璇疯緭鍏ユ崘鐚�呭鍚�" />
+              <el-input :disabled="true" v-model="form.donorname" placeholder="璇疯緭鍏ユ崘鐚�呭鍚�" />
             </el-form-item>
           </el-col>
           <!-- 
@@ -151,7 +150,7 @@
                 </el-select>
               </template>
             </el-table-column>
-            <el-table-column prop="price" align="center" label="鍗曚环" width="120" v-if="0">
+            <el-table-column prop="price" align="center" label="鍗曚环" width="120" v-if="businessType == 4">
               <template slot-scope="scope">
                 <el-input v-model="scope.row.price" placeholder="鍗曚环" @blur="val => {
                   sumTotalFee(scope.row);
@@ -159,7 +158,7 @@
                   " />
               </template>
             </el-table-column>
-            <el-table-column prop="quantity" align="center" label="鏁伴噺" width="120" v-if="0">
+            <el-table-column prop="quantity" align="center" label="鏁伴噺" width="120" v-if="businessType == 4">
               <template slot-scope="scope">
                 <el-input v-model="scope.row.quantity" placeholder="鏁伴噺" @blur="val => {
                   sumTotalFee(scope.row);
@@ -167,8 +166,11 @@
                   " />
               </template>
             </el-table-column>
-            <el-table-column v-if="businessType == 3 || businessType == 4 || ismanager == true" prop="amount"
-              align="center" label="绋庡墠閲戦" width="120">
+            <el-table-column v-if="businessType == 2 ||
+              businessType == 3 ||
+              businessType == 4 ||
+              ismanager == true
+              " prop="amount" align="center" :label="amountLabel" width="120">
               <template slot-scope="scope">
                 <!--
                   <el-select v-model="scope.row.amount" placeholder="绋庡墠閲戦" clearable filterable allow-create
@@ -177,7 +179,7 @@
                     :value="dict.expense"></el-option>
                 </el-select>
               -->
-                <el-input v-model="scope.row.amount" placeholder="绋庡墠閲戦" />
+                <el-input v-model="scope.row.amount" placeholder="閲戦" />
               </template>
             </el-table-column>
             <el-table-column prop="taxedamount" align="center" label="绋庡悗閲戦" width="120" v-if="(this.ismanager == true) &
@@ -490,7 +492,9 @@
         </div>
 
         <div v-if="this.previewpdf" class="pdfimgmin">
-          <img :src="pdfimg" />
+          <!-- <img :src="pdfimg" /> -->
+          <el-image style="width: 100px; height: 100px" :src="pdfimg" :preview-src-list="pdfimgsrcList">
+          </el-image>
         </div>
         <div v-else class="pdfimgmins">{{ hintitle }}</div>
       </div>
@@ -651,7 +655,6 @@
       totalAfterTaxAmount: 0.0,
       totalAmount: 0.0,
 
-
       //璐圭敤绫诲瀷鏁扮粍
       feeItemTypes: [],
 
@@ -666,6 +669,8 @@
       //涓撳/鍗曚綅閫夋嫨锛歟xpert/unit
       selectionType: "",
       showSelectionDialog: false,
+      //绋庡墠閲戦鏍囬锛氫笓瀹惰垂-绋庡墠閲戦锛涘尰瀛︽垚鏈�佸姙鍏垂鐢�-閲戦
+      amountLabel: "绋庡墠閲戦",
 
       // 琛ㄥ崟鏍¢獙
       rules: {
@@ -726,7 +731,7 @@
       checkObj: {
         flowlevelone: null,
         flowconclusion: null,
-        fundid: null,
+        fundid: null
       },
 
       // 鏌ヨ鍙傛暟
@@ -782,6 +787,7 @@
       //绁ㄦ嵁鏂囦欢
       pdftitle: "",
       pdfimg: "",
+      pdfimgsrcList: [],
       pdfVisible: false,
       previewpdf: false,
       hintitle: "閫変腑宸︿晶宸蹭笂浼犳枃浠堕瑙堟煡鐪�",
@@ -855,40 +861,37 @@
 
       // if (!this.businessType && !this.operationType) {
       if (this.businessType == "1") {
-        this.curCase = this.$route.query.curCase;
-        this.businessName = "涓撳鍔冲姟璐圭敵璇峰崟"
+        this.businessName = "涓撳鍔冲姟璐圭敵璇峰崟";
+        this.amountLabel = "绋庡墠閲戦";
         this.getUnitList();
-      }
-      else if (this.businessType == "2") {
-        this.curCase = this.$route.query.curCase;
+      } else if (this.businessType == "2") {
         this.businessName = "浼︾悊涓撳鍔冲姟璐圭敵璇峰崟";
+        this.amountLabel = "绋庡墠閲戦";
         this.getUnitList();
-      }
-      else if (this.businessType == "3") {
-        if (this.operationType != "check") {
-          this.curCase = this.$route.query.curCase;
-        }
+      } else if (this.businessType == "3") {
         this.businessName = "鍖诲鎴愭湰鎶ラ攢鍗�";
-      }
-      else if (this.businessType == "4") {
+        this.amountLabel = "閲戦";
+      } else if (this.businessType == "4") {
         this.businessName = "鍔炲叕璐圭敤鎶ラ攢鍗�";
+        this.amountLabel = "閲戦";
 
         // this.getBaseInfoList();
       }
 
       if (this.operationType == "add") {
         this.title = this.businessName + "鏂板缓";
+        if (this.operationType != "4") {
+          this.curCase = this.$route.query.curCase;
+          console.log("this.curCase", this.curCase);
+        }
         this.handleAdd();
-      }
-      else if (this.operationType == "update") {
+      } else if (this.operationType == "update") {
         this.title = this.businessName + "淇敼";
         this.handleUpdate();
-      }
-      else if (this.operationType == "detail") {
+      } else if (this.operationType == "detail") {
         this.title = this.businessName + "鏌ョ湅";
         this.handleDetail();
-      }
-      else if (this.operationType == "check") {
+      } else if (this.operationType == "check") {
         this.title = this.businessName + "瀹℃牳";
         this.handleCheck();
       }
@@ -975,6 +978,7 @@
 
       getFund(this.curId).then(response => {
         this.form = response.data;
+        console.log("response.data", response.data);
         //闄勪欢澶勭悊
         // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
 
@@ -999,7 +1003,7 @@
           }
         });
 
-        //涓氬姟娴佺▼        
+        //涓氬姟娴佺▼
         let listFundflowparams = {
           fundid: this.curId,
           fundtype: 2
@@ -1026,17 +1030,22 @@
           for (let m = 0; m < this.rbDetails.length; m++) {
             this.rbDetails[m].itemlist = [];
             this.getFeeItems(m, this.rbDetails[m]);
+
             this.rbDetails[m].rowfeeblocks = [];
             this.rbDetails[m].rowfeeblocks.push({
-              expense: this.rbDetails[m].expense,
+              servicesscope: this.rbDetails[m].servicesscope,
               expensedescribe: this.rbDetails[m].servicesscopename,
-              remark: this.rbDetails[m].servicesscope,
-              servicesscope: this.rbDetails[m].servicesscope
+              expense: this.rbDetails[m].expense,
+              remark: this.rbDetails[m].servicesscopename
             });
+          }
+
+          if (this.rbDetails.length == 0) {
+            this.addRow(0);
           }
         });
 
-        //涓氬姟娴佺▼        
+        //涓氬姟娴佺▼
         let listFundflowparams = {
           fundid: this.curId,
           fundtype: 2
@@ -1045,7 +1054,6 @@
           this.fundflowList = res.rows;
         });
       });
-
     },
 
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -1136,7 +1144,10 @@
                 return;
               }
 
-              if (tempDetail.beneficiaryno == null || tempDetail.beneficiaryno == "鐐瑰嚮閫夋嫨") {
+              if (
+                tempDetail.beneficiaryno == null ||
+                tempDetail.beneficiaryno == "鐐瑰嚮閫夋嫨"
+              ) {
                 this.$modal.msgWarning(
                   "鏈嶅姟椤圭洰琛ㄤ腑锛岀" +
                   (k + 1).toString() +
@@ -1167,7 +1178,7 @@
           //   this.form.annexfiles = list.map(item => item.url).join(",");
           // }
 
-          //澶勭悊鏄庣粏
+          //澶勭悊鏄庣粏          
           for (let i = 0; i < this.rbDetails.length; i++) {
             let tempDetail = this.rbDetails[i];
             //鑾峰彇鏈嶅姟椤圭洰鏄庣粏
@@ -1185,15 +1196,9 @@
               item => tempDetail.applytype == item.value
             );
             if (applytypeIndex > -1) {
-              tempDetail.applytypename = this.rowfeeItemTypes[
-                applytypeIndex
-              ].label;
-              tempDetail.subjecttype = this.rowfeeItemTypes[
-                applytypeIndex
-              ].subjecttype;
-              tempDetail.subjecttypename = this.rowfeeItemTypes[
-                applytypeIndex
-              ].subjecttypename;
+              tempDetail.applytypename = this.rowfeeItemTypes[applytypeIndex].label;
+              tempDetail.subjecttype = this.rowfeeItemTypes[applytypeIndex].subjecttype;
+              tempDetail.subjecttypename = this.rowfeeItemTypes[applytypeIndex].subjecttypename;
             }
             this.rbDetails[i] = tempDetail;
             /*
@@ -1218,7 +1223,7 @@
               });
             }
            
-            // 璁$畻绋庡墠閲戦
+            // 璁$畻绋庡墠銆佺◣璐广�佺◣鍚庨噾棰�
             if (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') {
               //鑾峰彇鍙傛暟
               this.taxParam.money = tempDetail.taxedamount.toString();
@@ -1234,7 +1239,32 @@
               });
             }
             */
+
           }
+          //璁$畻褰撳墠琛屾姤閿�鍐呭璐圭敤鍚堣锛岀◣鍓嶉噾棰濓紙amount锛夈�佹墸绋庨噾棰濓紙taxamount锛夈�佺◣鍚庨噾棰濓紙taxedamount锛� 
+          if (this.businessType == '2') {
+            for (let j = 0; j < this.rbDetails.length; j++) {
+              let tempDetail = this.rbDetails[j];
+              if (isNaN(parseFloat(tempDetail.amount)) || parseFloat(tempDetail.amount) == 0) {
+                this.$modal.msgWarning("鏈嶅姟椤圭洰琛ㄤ腑锛岀" + (j + 1).toString() + "琛岀殑閲戦鏈緭鍏ワ紝璇峰厛杈撳叆閲戦鍚庡啀鎻愪氦淇濆瓨锛�");
+                return;
+              }
+            }
+          } else if (this.businessType == '3' || this.businessType == '4') {
+            for (let j = 0; j < this.rbDetails.length; j++) {
+              let tempDetail = this.rbDetails[j];
+              if (isNaN(parseFloat(tempDetail.amount)) || parseFloat(tempDetail.amount) == 0) {
+                this.$modal.msgWarning("鏈嶅姟椤圭洰琛ㄤ腑锛岀" + (j + 1).toString() + "琛岀殑閲戦鏈緭鍏ワ紝璇峰厛杈撳叆閲戦鍚庡啀鎻愪氦淇濆瓨锛�");
+                return;
+              }
+              if (isNaN(parseFloat(tempDetail.taxamount)) || parseFloat(tempDetail.taxamount) == 0) {
+                tempDetail.taxedamount = tempDetail.amount
+              } else {
+                tempDetail.taxedamount = tempDetail.amount + tempDetail.taxamount
+              }
+            }
+          }
+
           //璐圭敤鍚堣
           // this.form.pretaxcost = parseFloat(this.totalPreTaxAmount).toFixed(2);
           // this.form.taxedcost = parseFloat(this.totalAfterTaxAmount).toFixed(2);
@@ -1286,8 +1316,9 @@
           });
 
           //鍏抽棴绐楀彛
-          // this.loading = false;
-          // this.getfundList();
+          this.loading = false;
+          // this.getfundList();          
+          this.$store.dispatch('tagsView/delView', this.$route)
           this.$router.go(-1);
         }
       });
@@ -1299,17 +1330,21 @@
         // fundid: this.checkObj.fundid,
         fundid: this.curId,
         flowconclusion: this.checkObj.flowlevelone,
-        flowcontent: this.checkObj.flowconclusion,
+        flowcontent: this.checkObj.flowconclusion
       };
-      checkfund(checkFundObj).then((res) => {
+      checkfund(checkFundObj).then(res => {
+        //鍏抽棴绐楀彛
         this.reset();
         this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
+        this.$store.dispatch("tagsView/delView", this.$route);
+        this.$router.go(-1);
       });
     },
 
     // 鍙栨秷鎸夐挳
     cancel() {
       // this.reset();
+      this.$store.dispatch("tagsView/delView", this.$route);
       this.$router.go(-1);
     },
 
@@ -1319,23 +1354,29 @@
         this.userprofile = res.data;
         this.standardlevel = res.data.standardlevel;
         if (
-          this.userprofile.createBy == "admin" ||
-          this.userprofile.createBy == "001" ||
-          this.userprofile.createBy == "002"
+          this.userprofile.userName == "admin" ||
+          this.userprofile.userName == "001" ||
+          this.userprofile.userName == "047"
         ) {
           this.ismanager = true;
         } else {
           this.ismanager = false;
         }
-        this.form.username = this.userprofile.nickName;
-        this.form.userno = this.userprofile.userName;
-        this.form.deptmentname = this.userprofile.dept.deptName;
-        this.form.deptmentno = this.userprofile.dept.deptId;
-        this.form.managername = this.userprofile.dept.leader;
-        this.form.phone = this.userprofile.phonenumber;
-        // this.form.applytype = this.businessType;
-        // this.form.createTime = new Date();
-        this.getUserAccount();
+        console.log(this.userprofile, this.ismanager);
+        if (this.operationType == "add") {
+          this.form.username = this.userprofile.nickName;
+          this.form.userno = this.userprofile.userName;
+          this.form.deptmentname = this.userprofile.dept.deptName;
+          this.form.deptmentno = this.userprofile.dept.deptId;
+          this.form.managername = this.userprofile.dept.leader;
+          this.form.phone = this.userprofile.phonenumber;
+          // this.form.applytype = this.businessType;
+          // this.form.createTime = new Date();
+
+          if (this.businessType == "4") {
+            this.getUserAccount();
+          }
+        }
       });
     },
 
@@ -1377,7 +1418,7 @@
     getUserAccount() {
       this.personlist.map(res => {
         if (res.username == this.form.username) {
-          this.form.bankname = res.depositbank;//res.branchbankname銆乺es.depositbank;
+          this.form.bankname = res.depositbank; //res.branchbankname銆乺es.depositbank;
           this.form.bankcardno = res.bankcardno;
           this.form.phone = res.telephone;
         }
@@ -1499,7 +1540,7 @@
       });
     },
 
-    //鏍¢獙鏀惰垂椤圭洰鏄惁閲嶅
+    //鏍¢獙鏀惰垂椤圭洰
     verifyFeeItem(row) {
       row.itemlist.map(res => {
         if (row.itemid === res.id) {
@@ -1507,14 +1548,18 @@
           row.itemcode = res.itemCode;
         }
       });
-      var repeatNum = 0;
-      this.rbDetails.map(res => {
-        if (res.applytype === row.applytype && res.itemid == row.itemid) {
-          repeatNum++;
+
+      //鍒ゆ柇鏀惰垂椤圭洰鏄惁閲嶅
+      if (this.businessType == "1") {
+        var repeatNum = 0;
+        this.rbDetails.map(res => {
+          if (res.applytype === row.applytype && res.itemid == row.itemid) {
+            repeatNum++;
+          }
+        });
+        if (repeatNum > 1) {
+          this.$modal.msgWarning("鎮ㄥ凡缁忔彁浜よ繃璇ユ湇鍔¢」鐩簡");
         }
-      });
-      if (repeatNum > 1) {
-        this.$modal.msgWarning("鎮ㄥ凡缁忔彁浜よ繃璇ユ湇鍔¢」鐩簡");
       }
 
       //鑾峰彇璐圭敤椤圭洰鐨勮缁嗕俊鎭�
@@ -1926,6 +1971,8 @@
         this.previewpdf = true;
         if (item.url) {
           this.pdfimg = item.url;
+          this.pdfimgsrcList = [];
+          this.pdfimgsrcList.push(item.url);
         } else {
           this.pdfimg = item.response.url;
         }
@@ -1984,7 +2031,8 @@
         } else {
           //淇濆瓨鏂板涓撳
           this.expertform.id = null;
-          this.expertform.userno = this.personlist[this.personlist.length - 1].id + 1;
+          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;
@@ -2081,7 +2129,7 @@
 
       this.rbDetails[tempIndex] = singleDetail;
       this.showSelectionDialog = false;
-    },
+    }
   },
 
   //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛�
@@ -2104,7 +2152,7 @@
   updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
   beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
   destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
-  activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
+  activated() { } //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
 };
 </script>
 

--
Gitblit v1.9.3