From be47dc22ea72ba989f75419181284dca0021d018 Mon Sep 17 00:00:00 2001
From: heimawl <1785969728@qq.com>
Date: 星期四, 10 八月 2023 11:13:16 +0800
Subject: [PATCH] 11

---
 src/views/project/fund/expertFeeFundApply/index.vue |  267 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 159 insertions(+), 108 deletions(-)

diff --git a/src/views/project/fund/expertFeeFundApply/index.vue b/src/views/project/fund/expertFeeFundApply/index.vue
index 3ece74b..cfeb349 100644
--- a/src/views/project/fund/expertFeeFundApply/index.vue
+++ b/src/views/project/fund/expertFeeFundApply/index.vue
@@ -24,7 +24,7 @@
       </el-row>
     </el-form>
     <el-row>
-      <el-col :span="8">
+      <el-col :span="6">
         <el-card shadow="never">
           <!-- 鎹愮尞妗堜緥鍒楄〃 -->
           <el-row>
@@ -47,7 +47,7 @@
             :limit.sync="queryParams.pageSize" @pagination="getBaseInfoList" />
         </el-card>
       </el-col>
-      <el-col :span="16">
+      <el-col :span="18">
         <el-card shadow="naver">
           <el-form ref="infoform" label-width="100px">
             <el-row :gutter="4" align="right" class="mb8">
@@ -96,10 +96,10 @@
                   <template slot-scope="scope">
                     <el-button v-if="scope.row.recordstatus == -1 ||
                       scope.row.recordstatus == 1
-                      " size="mini" type="text" icon="el-icon-edit" @click="(scope.row)">涓婃姤</el-button>
+                      " size="mini" type="text" icon="el-icon-edit" @click="handleUp(scope.row)">涓婃姤</el-button>
                     <el-button v-if="scope.row.recordstatus == -1 ||
                       scope.row.recordstatus == 1
-                      " size="mini" type="text" icon="el-icon-edit" @click="date(scope.row)">淇敼</el-button>
+                      " size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">淇敼</el-button>
                     <el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)">鏌ョ湅</el-button>
                     <!-- v-hasPermi="['project:expretfund:edit']" -->
                     <el-button v-if="scope.row.recordstatus == -1 ||
@@ -137,6 +137,14 @@
             </el-form-item>
           </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-option v-for="dict in userlist" :key="dict.index" :label="dict.nickname"
+                  :value="dict.nickname"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="5">
             <el-form-item label="鎵�灞炵粍鍒�" prop="deptmentname">
               <el-input v-model="form.deptmentname" placeholder="璇疯緭鍏ユ墍灞炵粍鍒�" clearable />
             </el-form-item>
@@ -144,13 +152,6 @@
           <el-col :span="5">
             <el-form-item label="缁勯暱" prop="managername">
               <el-input v-model="form.managername" placeholder="璇疯緭鍏ョ粍闀�" clearable />
-            </el-form-item>
-          </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-option v-for="dict in userlist" :key="dict.index" :label="dict.nickname"
-                  :value="dict.nickname"></el-option>
-              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -178,25 +179,38 @@
             </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-form-item label="鑱旂郴鐢佃瘽" prop="phone">
+              <el-input v-model="form.phone" placeholder="璇疯緭鍏ヨ仈绯荤數璇�" />
             </el-form-item>
           </el-col>
+
         </el-row>
         <el-row style="text-align: left">
+          <!--
           <el-col :span="5">
             <el-form-item label="鍚堣閲戦" prop="amountrequested">
               <el-input v-model="form.amountrequested" placeholder="鐢宠閲戦" :disabled="true" />
             </el-form-item>
           </el-col>
+          -->
           <el-col :span="5">
-            <el-form-item label="绋庡墠閲戦" prop="pretaxcost">
+            <el-form-item label="鐢宠閲戦" prop="pretaxcost">
               <el-input v-model="form.pretaxcost" placeholder="绋庡墠閲戦鍚堣" :disabled="true" />
             </el-form-item>
           </el-col>
           <el-col :span="5">
+            <el-form-item label="搴旂即绋�" prop="taxcost">
+              <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="5">
+            <el-form-item label="鎹愮尞鑰�" prop="name">
+              <el-input :disabled="true" v-model="form.name" placeholder="璇疯緭鍏ユ崘鐚�呭鍚�" />
             </el-form-item>
           </el-col>
           <el-col :span="5">
@@ -362,7 +376,8 @@
               </template>
             </el-table-column>
           </el-table>
-        </el-row> <!--
+        </el-row>
+        <!--
         <el-row>   
           <el-col :span="7">
             <el-form-item label="棰勬敮閲戦" prop="prepaidamount">
@@ -402,14 +417,14 @@
             </el-form-item>
           </el-col>
         </el-row>
-                  -->
+              -->
         <el-row>
           <el-col :span="12">
             <el-form-item label="璐圭敤鐢宠闄勪欢" align="left" prop="annexbankcard">
               <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileList" multiple
                 :limit="20" :headers="headers" :on-success="(response, file, fileList) =>
                   uploadSccess(response, file, fileList)
-                  " :on-preview="downFile" :disabled='dialogType == "detail"' :on-error="loadError"
+                  " :on-preview="downFile" :disabled='dialogType == "detail"' :on-error="handleUploadError"
                 :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf">
                 <el-button :disabled='dialogType == "detail"' size="small" type="primary">涓婁紶</el-button>
               </el-upload>
@@ -539,6 +554,7 @@
   listDonatebaseinfo,
   getDonatebaseinfo
 } from "@/api/project/donatebaseinfo";
+
 import {
   onelistFund,
   listFund,
@@ -552,9 +568,10 @@
   getdownloadSS,
   getdownloadYX,
   getdownloadBX,
-  batchUploadFund,
+  addorupdateFund,
   getdetailsByItemId
 } from "@/api/project/fund";
+
 import {
   onelistFunds,
   listFunddetails,
@@ -575,13 +592,16 @@
   getTaxationByBeneFiciaryNo,
   getTaxBeforeByAfterMoney
 } from "@/api/project/funddetail";
+
 import { listFundflow } from "@/api/project/fundflow";
+
 import {
   listOrganization,
   getOrganization,
   listReportname,
   listUser
 } from "@/api/project/organization";
+
 import {
   listExternalperson,
   getExternalperson,
@@ -591,6 +611,7 @@
   updateExternalperson,
   exportExternalperson
 } from "@/api/project/externalperson";
+
 import { getUserProfile } from "@/api/system/user";
 import Li_area_select from "@/components/Address";
 import OrgSelecter from "@/views/project/components/orgselect";
@@ -603,6 +624,7 @@
     Li_area_select,
     OrgSelecter,
   },
+
   name: "fundApply",
   dicts: [
     //"sys_consolationfundlevel",
@@ -619,11 +641,12 @@
     "sys_recordstatus",
     "sys_professionaltitle"
   ],
+
   data() {
     //杩欓噷瀛樻斁鏁版嵁
     return {
       // 閬僵灞�
-      loading: true,
+      loading: false,
       // 瀵煎嚭閬僵灞�
       exportLoading: false,
       total: 0,
@@ -729,9 +752,6 @@
 
       //鏄惁鏄笓瀹惰垂鐨凮PO瀹℃壒浜哄憳
       ismanager: false,
-
-
-
       unitList: [],
       dialogType: "edit",
       fundflowList: [],
@@ -795,32 +815,33 @@
   computed: {},
   //鐩戞帶data涓殑鏁版嵁鍙樺寲
   watch: {},
-  // mounted(){
-  //  this.getUsermsg()
-  // },
+  //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛�    
+  created() {
+    this.getList();
+    this.getBaseInfoList();
+    this.getCurFundType();
+    this.getUserList();
+    this.getUnitList();
+
+  },
+
+  //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
+  mounted() {
+    this.selectReporters();
+    this.getUsermsg();
+    this.getExternalpersonList();
+  },
+
+  beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠
+  beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠
+  beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠
+  updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
+  beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
+  destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
+  activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
+
   //鏂规硶闆嗗悎
   methods: {
-    //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛�
-    created() {
-      this.getUnitList();
-      this.getList();
-      this.getBaseInfoList();
-      this.getlistUser();
-      this.getCurFundType();
-    },
-    //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛�
-    mounted() {
-      this.selectReporters();
-      this.getUsermsg();
-      this.getlistExternalperson();
-    },
-    beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠
-    beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠
-    beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠
-    updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗
-    beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓�
-    destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴�
-    activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂
 
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
@@ -835,32 +856,23 @@
       this.handleQuery();
     },
 
-    /** 涓嬭浇鏂囦欢鎸夐挳鎿嶄綔 */
-    downFile(item) {
-      const url = process.env.VUE_APP_BASE_API + item.url
-      var a = document.createElement('a');
-      var event = new MouseEvent('click');
-      a.download = item.name;
-      a.href = url;
-      a.dispatchEvent(event);
-    },
-
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
       if (this.curCase.id) {
         this.istrue += 2;
         this.reset();
         this.queryParams.params = {};
-        this.form.donorno = this.curCase.donorno;
-        this.form.name = this.curCase.name;
         this.form.infoid = this.curCase.id;
+        this.form.donorno = this.curCase.donorno;
+        this.form.donorname = this.curCase.name;
+
         this.form.username = this.defaultperson.nickName;
         this.form.userno = this.defaultperson.userName;
-        // this.form.phone = this.defaultperson.phone;
-
+        this.form.phone = this.defaultperson.phonenumber;
         this.form.deptmentname = this.defaultperson.dept.deptName;
         this.form.deptmentno = this.defaultperson.dept.deptId;
         this.form.managername = this.defaultperson.dept.leader;
+
         // this.form.createTime = nowdate;
         //this.open = true;
         //this.initFundApplyForm();
@@ -882,8 +894,6 @@
       this.isopen = 0;
       this.reset();
       this.queryParams.params = {};
-      this.form.donorno = this.curCase.donorno;
-      this.form.infoid = this.curCase.id;
       this.dialogOpen = true;
       this.title = "淇敼璐圭敤鐢宠";
       this.dialogType = "edit";
@@ -893,7 +903,6 @@
         this.form = response.data;
         // this.form.recordstate =-1;
         // this.form.recordstatus = response.data.recordstatus + "";
-        this.form.name = this.curCase.name;
         //闄勪欢澶勭悊
         this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : []
         getownFundDetail(id).then((res) => {
@@ -936,8 +945,6 @@
       this.isopen = 0;
       this.reset();
       this.queryParams.params = {};
-      this.form.donorno = this.curCase.donorno;
-      this.form.infoid = this.curCase.id;
       this.dialogOpen = true;
       this.title = "鏌ョ湅璐圭敤鐢宠";
       this.dialogType = "detail";
@@ -945,7 +952,6 @@
 
       getFund(id).then((response) => {
         this.form = response.data;
-        this.form.name = this.curCase.name;
         let listFundflowparams = {
           fundid: row.id,
           fundtype: 2,
@@ -999,7 +1005,7 @@
     },
 
     /** 涓婃姤鎸夐挳鎿嶄綔 */
-    handleup(row) {
+    handleUp(row) {
       this.$confirm("鏄惁纭灏嗙櫥璁拌褰曚笂鎶ワ紵", "鎻愮ず", {
         confirmButtonText: "纭畾",
         cancelButtonText: "鍙栨秷",
@@ -1009,17 +1015,17 @@
           //鏌ユ壘鏄惁瀛樺湪鐧昏瀹屾垚璁板綍
           //鍒ゆ柇鏄惁瀛樺湪涓婃姤璁板綍
           row.recordstatus = 0;
-
+          console.log("updateFund", row);
           updateFund(row).then((response) => {
             if (response.code == 200) {
               this.$message({
                 type: "success",
-                message: "鐢宠鎴愬姛",
+                message: "鎻愪氦涓撳璐圭敤鐢宠瀹℃壒鎴愬姛锛�",
               });
             } else {
               this.$message({
                 type: "error",
-                message: "鐢宠澶辫触",
+                message: "鎻愪氦涓撳璐圭敤鐢宠澶辫触锛�",
               });
             }
             this.loading = false;
@@ -1032,7 +1038,7 @@
           });
         });
     },
-    
+
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
       this.$refs["form"].validate((valid) => {
@@ -1158,17 +1164,38 @@
           this.form.serviceFunddetails = this.fundDetails;
 
           if (this.form.id != null) {
-            //鎹愮尞鑰�
-            this.form.donorname = this.curCase.name;
-          }
-          else {
+            // updateFund(this.form).then((response) => {
+            //   if (response.code === 200) {
+            //     this.loading = false;
+            //     for (let m = 0; m < this.fundDetails.length; m++) {
+            //       if (this.fundDetails[m].id > 0) {
+            //         updateFunddetail(this.fundDetails[m]).then((response2) => { if (response.code != 200) { this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐�1锛�" + response.msg); } });
+            //       } else {
+            //         addFunddetail(this.fundDetails[m]).then((response2) => { if (response.code != 200) { this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐�2锛�" + response.msg); } });
+            //       }
+            //     }
+            //     this.$modal.msgSuccess("涓撳鍔冲姟璐逛繚瀛樻垚鍔燂紒");
+            //   } else {
+            //     this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐ワ細" + response.msg);
+            //   }
+            // });
+
+          } else {
             this.form.recordstatus = -1;
+
+            // addorupdateFund(this.form).then((response) => {
+            //   if (response.code === 200) {
+            //     this.selectDonotor(this.curCase);
+            //   } else {
+            //     this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐ワ細" + response.msg);
+            //   }
+            // });
           }
 
-          batchUploadFund(this.form).then((response) => {
+          addorupdateFund(this.form).then((response) => {
             if (response.code === 200) {
-              this.$modal.msgSuccess("涓撳鍔冲姟璐逛繚瀛樻垚鍔燂紒");
               this.selectDonotor(this.curCase);
+              this.$modal.msgSuccess("涓撳鍔冲姟璐逛繚瀛樻垚鍔燂紒");
             } else {
               this.$modal.msgError("涓撳鍔冲姟璐逛繚瀛樺け璐ワ細" + response.msg);
             }
@@ -1177,6 +1204,10 @@
           //鍏抽棴绐楀彛
           this.loading = false;
           this.dialogOpen = false;
+          // this.getfundList();
+          this.getList();
+          this.selectDonotor(this.curCase);
+
         }
       });
     },
@@ -1364,8 +1395,8 @@
     //鑾峰彇褰撳墠鐢ㄦ埛淇℃伅
     getUsermsg() {
       getUserProfile().then((response) => {
+        console.log("getUserProfile", response);
         this.defaultperson = response.data;
-        console.log("this.defaultperson", this.defaultperson);
         this.standardlevel = response.data.standardlevel;
         if (this.defaultperson.createBy == "admin" || this.defaultperson.createBy == "001" || this.defaultperson.createBy == "002") {
           this.ismanager = true;
@@ -1382,9 +1413,11 @@
           row.servicesscopename = item.expensedescribe;
           if (row.servicesscopename.includes("绋庡悗")) {
             row.amount = 0.0;
+            row.taxamount = 0.0;
             row.taxedamount = item.expense;
           } else {
             row.amount = item.expense;
+            row.taxamount = 0.0;
             row.taxedamount = 0.0;
           }
 
@@ -1453,14 +1486,15 @@
         this.queryParams.params["endReporttime"] = this.daterangeReporttime[1];
       }
       // this.queryParams.residencetown = this.$refs.areaSelect.getQu();
+
+      console.log("111", this.queryParams);
       listDonatebaseinfo(this.queryParams).then((response) => {
         this.donatebaseinfoList = response.rows;
-        console.log("this.queryParams", this.queryParams)
-        console.log("this.donatebaseinfoList", this.donatebaseinfoList)
         this.total = response.total;
         this.loading = false;
       });
     },
+
     getUnitList() {
       listOrganization(3).then((response) => {
         for (let i = 0; i < response.rows.length; i++) {
@@ -1472,6 +1506,7 @@
         }
       });
     },
+
     getBaseInfoList() {
       this.loading = true;
       listDonatebaseinfo(this.queryParams).then((response) => {
@@ -1486,6 +1521,7 @@
       this.curCase = row;
       this.getfundList();
     },
+
     getfundList() {
       this.loading = true;
       this.reset();
@@ -1658,10 +1694,10 @@
       //   row.itemArr = res.data;
       //   this.$forceUpdate();
       // });
-    },    
+    },
 
     //鑾峰彇涓撳鍒楄〃
-    getlistExternalperson() {
+    getExternalpersonList() {
       listExternalperson().then((res) => {
         this.personlist = res.rows;
       });
@@ -1705,12 +1741,34 @@
       });
     },
 
-    getlistUser() {
+    getUserList() {
       listUser().then((res) => {
         console.log("listUser", res);
         this.userlist = res.data;
       });
-    },    
+    },
+
+    //绛涙煡鍑哄搴旂殑璐圭敤椤圭洰
+    searchItemType(val, scope) {
+      let result = [];
+      if (val != "") {
+        let tempItemArr = scope.row.itemArr;
+        for (let i = 0; i < tempItemArr.length; i++) {
+          let pym = tempItemArr[i].itempinyin;
+          if (pym != null && pym != undefined && pym != "") {
+            if (pym.indexOf(val) != -1) {
+              result.push(tempItemArr[i]);
+            }
+          }
+        }
+        scope.row.itemArr = result;
+      } else {
+        getItemNames(scope.row.applytype).then((res) => {
+          scope.row.itemArr = res.data;
+          //this.$set(this.fundDetails, rowindex, row);
+        });
+      }
+    },
 
     deleteRows(row, index, rows) {
       this.$confirm("鏄惁纭鍒犻櫎?", "鎻愮ず", {
@@ -1872,36 +1930,29 @@
       });
     },
 
-    //绛涙煡鍑哄搴旂殑璐圭敤椤圭洰
-    searchItemType(val, scope) {
-      let result = [];
-      if (val != "") {
-        let tempItemArr = scope.row.itemArr;
-        for (let i = 0; i < tempItemArr.length; i++) {
-          let pym = tempItemArr[i].itempinyin;
-          if (pym != null && pym != undefined && pym != "") {
-            if (pym.indexOf(val) != -1) {
-              result.push(tempItemArr[i]);
-            }
-          }
-        }
-        scope.row.itemArr = result;
-      } else {
-        getItemNames(scope.row.applytype).then((res) => {
-          scope.row.itemArr = res.data;
-          //this.$set(this.fundDetails, rowindex, row);
-        });
-      }
-    },
+
 
     //鏂囦欢涓婁紶
     handleUploadError() { },
+
+    /** 涓嬭浇鏂囦欢鎸夐挳鎿嶄綔 */
+    downFile(item) {
+      const url = process.env.VUE_APP_BASE_API + item.url
+      var a = document.createElement('a');
+      var event = new MouseEvent('click');
+      a.download = item.name;
+      a.href = url;
+      a.dispatchEvent(event);
+    },
+
     remove(file) {
       this.fileList.splice(this.fileList.indexOf(file), 1)
     },
+
     handleExceed() {
       this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${5} 涓�!`);
     },
+
     //鏂囦欢涓婁紶鎴愬姛鍥炶皟
     uploadSccess(response, file, fileList) {
       //鑾峰彇闄勪欢淇℃伅浣嶇疆
@@ -1910,14 +1961,14 @@
         this.$modal.msgSuccess(response.msg);
         this.fileList.push({ name: response.fileName, url: response.fileName });
       } else {
-        this.$modal.msgError(response.msg);
+        console.log(response.msg);;
       }
-    },    
+    },
 
   },
 
-
 };
+
 </script>
 <style scoped>
 /* @import url(); 寮曞叆鍏叡css绫� */

--
Gitblit v1.9.3