From bf86c019d654dda98d7bd4bcef32ee525eb62825 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期五, 25 八月 2023 14:54:30 +0800
Subject: [PATCH] yxh

---
 src/views/project/fund/applyDetail/index.vue |  218 +++++++++++++++++++++++++++++++----------------------
 1 files changed, 127 insertions(+), 91 deletions(-)

diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index 98fa41d..cb0d413 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -14,7 +14,8 @@
           </el-col>
           <el-col :span="5">
             <el-form-item label="缁忓姙浜�" prop="username">
-              <el-select v-model="form.username" placeholder="鐢宠浜�" clearable filterable allow-create style="width: 100%">
+              <el-select v-model="form.username" placeholder="鐢宠浜�" clearable filterable allow-create style="width: 100%"
+                @change="getUserAccount">
                 <el-option v-for="dict in userlist" :key="dict.index" :label="dict.nickname"
                   :value="dict.nickname"></el-option>
               </el-select>
@@ -46,9 +47,13 @@
               }}</el-radio>
             </el-form-item>
           </el-col>
-          <el-col :span="10">
-            <el-form-item label="鐢宠璇存槑" prop="remark">
-              <el-input v-model="form.remark" placeholder="鐢宠璇存槑" />
+          <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 label="閾惰璐﹀彿" prop="bankcardno">
+              <el-input v-model="form.bankcardno" placeholder="璇疯緭鍏ラ摱琛岃处鍙�" />
             </el-form-item>
           </el-col>
           <el-col :span="5">
@@ -69,21 +74,25 @@
             <el-form-item label="鐢宠閲戦" prop="pretaxcost">
               <el-input v-model="form.pretaxcost" placeholder="绋庡墠閲戦鍚堣" :disabled="true" />
             </el-form-item>
-          </el-col>
+          </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" />
             </el-form-item>
           </el-col>-->
+          <el-col :span="10">
+            <el-form-item label="鐢宠璇存槑" prop="remark">
+              <el-input v-model="form.remark" placeholder="鐢宠璇存槑" />
+            </el-form-item>
+          </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>
           <!-- 
@@ -117,7 +126,7 @@
             </el-table-column>-->
             <el-table-column prop="applytype" align="center" label="鏈嶅姟绫诲瀷" width="200">
               <template slot-scope="scope">
-                <el-select v-model="scope.row.applytype" placeholder="鏈嶅姟绫诲瀷" @change="loadFeeItems(scope.row)">
+                <el-select v-model="scope.row.applytype" placeholder="鏈嶅姟绫诲瀷" @change="verifyFeeItemType(scope.row)">
                   <el-option v-for="dict in rowfeeItemTypes" :key="dict.index" :label="dict.label"
                     :value="dict.value"></el-option>
                 </el-select>
@@ -135,13 +144,13 @@
             <el-table-column prop="servicesscope" align="center" label="鏈嶅姟璇存槑" v-if="form.applytype == '1'" width="180">
               <template slot-scope="scope">
                 <el-select v-model="scope.row.servicesscope" placeholder="鏈嶅姟璇存槑" clearable allow-create filterable
-                  @change="selectedRemark(scope.row)">
+                  @change="verifyFeeRemark(scope.row)">
                   <el-option v-for="dict in scope.row.rowfeeblocks" :key="dict.servicesscope" :label="dict.remark"
                     :value="dict.servicesscope"></el-option>
                 </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);
@@ -149,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);
@@ -157,8 +166,8 @@
                   " />
               </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
@@ -167,7 +176,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) &
@@ -243,7 +252,7 @@
                 <el-input v-model="scope.row.bankcardno" placeholder="閾惰甯愬彿" />
               </template>
             </el-table-column>
-            <el-table-column prop="remark" align="center" label="澶囨敞" v-if="form.applytype == '4'">
+            <el-table-column prop="remark" align="center" label="澶囨敞">
               <template slot-scope="scope">
                 <el-input v-model="scope.row.remark" placeholder="澶囨敞" />
               </template>
@@ -259,7 +268,7 @@
                 </el-button>
                 <el-button @click.native.prevent="
                   Filepopup(scope.$index, rbDetails, scope.row)
-                  " type="text" size="small">绁ㄦ嵁</el-button>
+                  " type="text" size="small" v-if="businessType == 3 || businessType == 4">绁ㄦ嵁</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -313,18 +322,20 @@
                   uploadSccess(response, file, fileList)
                   " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
                 :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf">
-                <el-button :disabled="operationType == 'detail'" size="small" type="primary">涓婁紶</el-button>
+                <el-button :disabled="operationType == 'detail'" size="small" type="primary">涓婁紶绁ㄦ嵁</el-button>
               </el-upload>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row v-if="operationType == 'detail' || operationType == 'check'">
           <el-table :data="fundflowList" border>
-            <el-table-column label="瀹℃牳浜�" align="center" width="120" prop="checkusername" />
             <el-table-column label="瀹℃牳鏃ユ湡" align="center" width="160" prop="createTime" />
-            <el-table-column label="瀹℃牳缁撴灉" align="center" width="200" prop="flowconclusion"><template
-                slot-scope="scope"><span v-if="scope.row.flowconclusion == 1">閫氳繃</span><span
-                  v-if="scope.row.flowconclusion == 2">涓嶉�氳繃</span></template>
+            <el-table-column label="瀹℃牳浜�" align="center" width="120" prop="checkusername" />
+            <el-table-column label="瀹℃牳缁撴灉" align="center" width="200" prop="flowconclusion">
+              <template slot-scope="scope">
+                <span v-if="scope.row.flowconclusion == 1">閫氳繃</span>
+                <span v-if="scope.row.flowconclusion == 2">涓嶉�氳繃</span>
+              </template>
             </el-table-column>
             <el-table-column label="瀹℃牳澶囨敞" align="center" prop="flowcontent" />
           </el-table>
@@ -464,7 +475,7 @@
                 uploadSccess(response, file, fileList)
                 " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError"
               :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf">
-              <el-button :disabled="operationType == 'detail'" size="small" type="primary">涓婁紶</el-button>
+              <el-button :disabled="operationType == 'detail'" size="small" type="primary">涓婁紶绁ㄦ嵁</el-button>
             </el-upload>
           </div>
           <!-- <div
@@ -654,6 +665,8 @@
       //涓撳/鍗曚綅閫夋嫨锛歟xpert/unit
       selectionType: "",
       showSelectionDialog: false,
+      //绋庡墠閲戦鏍囬锛氫笓瀹惰垂-绋庡墠閲戦锛涘尰瀛︽垚鏈�佸姙鍏垂鐢�-閲戦
+      amountLabel: "绋庡墠閲戦",
 
       // 琛ㄥ崟鏍¢獙
       rules: {
@@ -843,29 +856,32 @@
 
       // if (!this.businessType && !this.operationType) {
       if (this.businessType == "1") {
-        this.curCase = this.$route.query.curCase;
         this.businessName = "涓撳鍔冲姟璐圭敵璇峰崟"
+        this.amountLabel = "绋庡墠閲戦"
         this.getUnitList();
       }
       else if (this.businessType == "2") {
-        this.curCase = this.$route.query.curCase;
         this.businessName = "浼︾悊涓撳鍔冲姟璐圭敵璇峰崟";
+        this.amountLabel = "绋庡墠閲戦"
         this.getUnitList();
       }
       else if (this.businessType == "3") {
-        if (this.operationType != "check") {
-          this.curCase = this.$route.query.curCase;
-        }
         this.businessName = "鍖诲鎴愭湰鎶ラ攢鍗�";
+        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") {
@@ -899,7 +915,6 @@
         this.businessType == "2" ||
         this.businessType == "3"
       ) {
-        console.log("", this.curCase);
         this.form.infoid = this.curCase.id;
         this.form.donorname = this.curCase.name;
         this.form.donorno = this.curCase.donorno;
@@ -925,9 +940,6 @@
         //鏄庣粏澶勭悊
         getownFundDetail(this.curId).then(res => {
           this.rbDetails = res.data;
-          console.log(res);
-
-          console.log(this.curId, res.data);
           if (this.rbDetails.length > 0) {
             for (let m = 0; m < this.rbDetails.length; m++) {
               this.rbDetails[m].itemlist = [];
@@ -959,43 +971,6 @@
         });
       });
     },
-    /** 淇敼鎸夐挳鎿嶄綔 */
-    handleCheck() {
-      this.isopen = 0;
-      this.reset();
-
-      getFund(this.curId).then(response => {
-        this.form = response.data;
-        //闄勪欢澶勭悊
-        // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
-
-        //涓氬姟鏄庣粏
-        getownFundDetail(this.curId).then(res => {
-          this.rbDetails = res.data;
-          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,
-              expensedescribe: this.rbDetails[m].servicesscopename,
-              remark: this.rbDetails[m].servicesscope,
-              servicesscope: this.rbDetails[m].servicesscope
-            });
-          }
-        });
-
-        //涓氬姟娴佺▼        
-        let listFundflowparams = {
-          fundid: this.curId,
-          fundtype: 2
-        };
-        listFundflow(listFundflowparams).then(res => {
-          this.fundflowList = res.rows;
-        });
-      });
-
-    },
 
     /** 鏌ョ湅鎸夐挳鎿嶄綔 */
     handleDetail() {
@@ -1004,22 +979,23 @@
 
       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 })) : []
 
         //涓氬姟鏄庣粏
         getownFundDetail(this.curId).then(res => {
-          console.log(res);
           this.rbDetails = res.data;
           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
             });
           }
 
@@ -1039,6 +1015,50 @@
       });
     },
 
+    /** 淇敼鎸夐挳鎿嶄綔 */
+    handleCheck() {
+      this.isopen = 0;
+      this.reset();
+
+      getFund(this.curId).then(response => {
+        this.form = response.data;
+        //闄勪欢澶勭悊
+        // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
+
+        //涓氬姟鏄庣粏
+        getownFundDetail(this.curId).then(res => {
+          this.rbDetails = res.data;
+          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({
+              servicesscope: this.rbDetails[m].servicesscope,
+              expensedescribe: this.rbDetails[m].servicesscopename,
+              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
+        };
+        listFundflow(listFundflowparams).then(res => {
+          this.fundflowList = res.rows;
+        });
+      });
+
+    },
+
+    /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete() {
       this.$modal
         .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵")
@@ -1277,7 +1297,8 @@
 
           //鍏抽棴绐楀彛
           // this.loading = false;
-          // this.getfundList();
+          // this.getfundList();          
+          this.$store.dispatch('tagsView/delView', this.$route)
           this.$router.go(-1);
         }
       });
@@ -1300,6 +1321,7 @@
     // 鍙栨秷鎸夐挳
     cancel() {
       // this.reset();
+      this.$store.dispatch('tagsView/delView', this.$route)
       this.$router.go(-1);
     },
 
@@ -1308,23 +1330,26 @@
       getUserProfile().then(res => {
         this.userprofile = res.data;
         this.standardlevel = res.data.standardlevel;
-        if (
-          this.userprofile.createBy == "admin" ||
-          this.userprofile.createBy == "001" ||
-          this.userprofile.createBy == "002"
-        ) {
+        if (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.phone = this.userprofile.phonenumber;
-        this.form.deptmentname = this.userprofile.dept.deptName;
-        this.form.deptmentno = this.userprofile.dept.deptId;
-        this.form.managername = this.userprofile.dept.leader;
-        // this.form.applytype = this.businessType;
-        // this.form.createTime = new Date();
+        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();
+          }
+        }
       });
     },
 
@@ -1358,6 +1383,17 @@
               exportName: this.personlist[j].username
             });
           }
+        }
+      });
+    },
+
+    //鑾峰彇缁忓姙浜鸿处鍙蜂俊鎭�
+    getUserAccount() {
+      this.personlist.map(res => {
+        if (res.username == this.form.username) {
+          this.form.bankname = res.depositbank;//res.branchbankname銆乺es.depositbank;
+          this.form.bankcardno = res.bankcardno;
+          this.form.phone = res.telephone;
         }
       });
     },
@@ -1440,7 +1476,7 @@
     },
 
     //鍔犺浇鏈嶅姟椤圭洰
-    loadFeeItems(row) {
+    verifyFeeItemType(row) {
       let list = this.feeItemTypes.filter(r => r.itemType == row.applytype);
       row.itemlist = list[0].itemDetails;
       row.itemid = null;
@@ -1455,7 +1491,7 @@
     },
 
     //鑾峰彇璐圭敤椤圭洰鐨勫娉ㄤ俊鎭�
-    selectedRemark(row) {
+    verifyFeeRemark(row) {
       row.rowfeeblocks.forEach((item, i) => {
         if (item.servicesscope === row.servicesscope) {
           row.servicesscopename = item.expensedescribe;
@@ -2066,13 +2102,13 @@
   created() {
     //鑾峰彇璺敱鍙傛暟
     this.getroute();
-    this.getUserProfile();
-    this.getUserList();
+    this.getExternalList();
   },
 
   //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
   mounted() {
-    this.getExternalList();
+    this.getUserList();
+    this.getUserProfile();
     // this.getFeeUnitList();
   },
 

--
Gitblit v1.9.3