From 0ac2d43fce4d74f6eea5a51a2e16af4e6a536c7c Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 14 八月 2024 14:19:24 +0800
Subject: [PATCH] 11

---
 src/views/project/fundcheck/expertFeeCheck/index.vue |  388 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 203 insertions(+), 185 deletions(-)

diff --git a/src/views/project/fundcheck/expertFeeCheck/index.vue b/src/views/project/fundcheck/expertFeeCheck/index.vue
index 555b24f..ab5dac4 100644
--- a/src/views/project/fundcheck/expertFeeCheck/index.vue
+++ b/src/views/project/fundcheck/expertFeeCheck/index.vue
@@ -8,42 +8,32 @@
       label-width="80px"
     >
       <el-row>
-        <el-col :span="8">
-          <el-form-item label="鐢宠鏃ユ湡" prop="createTime">
-            <el-date-picker
-              format="yyyy-MM-dd"
-              @change="selectapplication"
-              value-format="yyyy-MM-dd"
-              v-model="createTime"
-              type="daterange"
-              range-separator="鑷�"
-              start-placeholder="鐢宠寮�濮嬫棩鏈�"
-              end-placeholder="鐢宠缁撴潫鏃ユ湡"
+        <el-col :span="5">
+          <el-form-item label="鎹愮尞妗堜緥" prop="donorname" style="float: left">
+            <el-input
+              v-model="queryParams.donorname"
+              placeholder="璇疯緭鍏ョ敵璇蜂汉鎹愮尞鑰�"
+              clearable
+              size="small"
               @keyup.enter.native="flowconclusion"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="5">
+          <el-form-item label="棰勫鐘舵��" prop="checkstatus" style="float: left">
+            <el-select
+              v-model="queryParams.checkstatus"
+              placeholder="璇烽�夋嫨"
+              style="width: 100%"
             >
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-        <el-col :span="5">
-          <el-form-item label="閲戦" prop="money" style="float: left">
-            <el-input
-              v-model="queryParams.money"
-              placeholder="璇疯緭鍏ョ敵璇蜂汉閲戦"
-              clearable
-              size="small"
-              @keyup.enter.native="flowconclusion"
-            />
-          </el-form-item>
-        </el-col>
-        <el-col :span="5">
-          <el-form-item label="缁忓姙浜�" prop="APPLICANT" style="float: left">
-            <el-input
-              v-model="queryParams.APPLICANT"
-              placeholder="璇疯緭鍏ョ敵璇蜂汉濮撳悕"
-              clearable
-              size="small"
-              @keyup.enter.native="flowconclusion"
-            />
+              <el-option
+                v-for="item in checkmaterials"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :span="5">
@@ -61,48 +51,48 @@
               >
               </el-option>
             </el-select>
-          </el-form-item>
-        </el-col>
-        <!-- <el-col :span="6">
-          <el-button type="primary" icon="el-icon-search" size="mini" @click="flowconclusion">鎼滅储</el-button>
-          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
-        </el-col> -->
-      </el-row>
-      <el-row>
-        <el-col :span="5">
-          <el-form-item
-            label-width="120px"
-            label="鐢宠鏉愭枡鐘舵��"
-            prop="checkstatus"
-            style="float: left"
-          >
-            <el-select
-              v-model="queryParams.checkstatus"
-              placeholder="璇烽�夋嫨"
-              style="width: 100%"
-            >
-              <el-option
-                v-for="item in checkmaterials"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="5">
-          <el-form-item label="鎹愮尞鑰�" prop="donorname" style="float: left">
+          </el-form-item> </el-col
+        ><el-col :span="5">
+          <el-form-item label="缁忓姙浜�" prop="APPLICANT" style="float: left">
             <el-input
-              v-model="queryParams.donorname"
-              placeholder="璇疯緭鍏ョ敵璇蜂汉鎹愮尞鑰�"
+              v-model="queryParams.APPLICANT"
+              placeholder="璇疯緭鍏ョ敵璇蜂汉濮撳悕"
               clearable
               size="small"
               @keyup.enter.native="flowconclusion"
             />
           </el-form-item>
         </el-col>
-        <el-col :span="3">
+      </el-row>
+      <el-row>
+        <el-col :span="5">
+          <el-form-item label="鎶ラ攢閲戦" prop="money" style="float: left">
+            <el-input
+              v-model="queryParams.money"
+              placeholder="璇疯緭鍏ョ敵璇蜂汉閲戦"
+              clearable
+              size="small"
+              @keyup.enter.native="flowconclusion"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="鐢宠鏃ユ湡" prop="createTime">
+            <el-date-picker
+              format="yyyy-MM-dd"
+              @change="selectapplication"
+              value-format="yyyy-MM-dd"
+              v-model="createTime"
+              type="daterange"
+              range-separator="鑷�"
+              start-placeholder="鐢宠寮�濮嬫棩鏈�"
+              end-placeholder="鐢宠缁撴潫鏃ユ湡"
+              @keyup.enter.native="flowconclusion"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
           <div style="margin-bottom: 15px;">
             <el-button
               type="primary"
@@ -122,20 +112,21 @@
       <el-col :span="8">
         <div style="margin-bottom: 15px;">
           <el-button
+            icon="el-icon-remove-outline"
+            type="success"
+            plain
+            size="mini"
+            :disabled="true"
+            @click="Totalcalculation(0)"
+            >涓◣鍓嶆眹鎬�</el-button
+          >
+          <el-button
             type="primary"
             plain
             icon="el-icon-circle-check"
             size="mini"
             @click="Totalcalculation(1)"
-            >璁$◣鍚庡悎璁�</el-button
-          >
-          <el-button
-            icon="el-icon-remove-outline"
-            type="success"
-            plain
-            size="mini"
-            @click="Totalcalculation(0)"
-            >璁$◣鍓嶅悎璁�</el-button
+            >涓◣鍚庢眹鎬�</el-button
           >
         </div>
       </el-col>
@@ -159,8 +150,8 @@
           </el-table-column>
           -->
           <el-table-column type="selection" width="45"> </el-table-column>
-          <el-table-column
-            label="涓◣璁$畻鎯呭喌"
+          <!-- <el-table-column
+            label="涓◣璁$畻"
             align="center"
             prop="recordstatus"
             width="200"
@@ -168,23 +159,23 @@
             <template slot-scope="scope">
               <dict-tag :options="dict.type.sys_tax" :value="scope.row.istax" />
             </template>
-          </el-table-column>
+          </el-table-column> -->
+          <el-table-column
+            label="鎶ラ攢鍗曞彿"
+            align="center"
+            prop="bh"
+            width="150px"
+          />
           <el-table-column
             label="鐢宠鏃ユ湡"
             width="120"
             align="center"
-            prop="createTime"
+            prop="applyTime"
           >
             <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
+              <span>{{ parseTime(scope.row.applyTime, "{y}-{m}-{d}") }}</span>
             </template>
           </el-table-column>
-          <el-table-column
-            label="缁忓姙浜�"
-            align="center"
-            prop="username"
-            width="150px"
-          />
           <el-table-column
             label="鐢宠閲戦"
             align="center"
@@ -192,15 +183,9 @@
             width="200px"
           />
           <el-table-column
-            label="鎵�灞炵粍鍒�"
+            label="缁忓姙浜�"
             align="center"
-            prop="deptmentname"
-            width="200px"
-          />
-          <el-table-column
-            label="缁勯暱"
-            align="center"
-            prop="managername"
+            prop="username"
             width="150px"
           />
           <!-- <el-table-column label="宸ヤ綔鍗曚綅" align="center"  prop="unitname" width="230px" /> -->
@@ -208,6 +193,19 @@
           <!-- <el-table-column label="绋庡悗閲戦" align="center" prop="taxedcost" width="120px" />
           <el-table-column label="鐢宠閲戦" align="center" prop="amountrequested" width="120px" />
           <el-table-column label="棰勬敮璐圭敤" align="center" prop="prepaidamount" width="120px" /> -->
+          <el-table-column
+            label="鐢宠鏉愭枡鐘舵��"
+            width="140"
+            align="center"
+            prop="checkstatus"
+          >
+            <template slot-scope="scope">
+              <dict-tag
+                :options="dict.type.sys_stage_type"
+                :value="scope.row.checkstatus"
+              />
+            </template>
+          </el-table-column>
           <el-table-column
             label="瀹℃牳鐘舵��"
             align="center"
@@ -222,18 +220,27 @@
             </template>
           </el-table-column>
           <el-table-column
-            label="鐢宠鏉愭枡鐘舵��"
-            width="140"
+            label="涓◣璁$畻鏃ユ湡"
+            width="120"
             align="center"
-            prop="checkstatus"
+            prop="fundtaxtime"
           >
             <template slot-scope="scope">
-              <dict-tag
-                :options="dict.type.sys_stage_type"
-                :value="scope.row.checkstatus"
-              />
+              <span>{{ parseTime(scope.row.fundtaxtime, "{y}-{m}-{d}") }}</span>
             </template>
           </el-table-column>
+          <el-table-column
+            label="鎵�灞炵粍鍒�"
+            align="center"
+            prop="deptmentname"
+            width="200px"
+          />
+          <el-table-column
+            label="缁勯暱"
+            align="center"
+            prop="managername"
+            width="150px"
+          />
           <el-table-column
             label="鎹愮尞鑰�"
             align="center"
@@ -273,7 +280,7 @@
                 size="mini"
                 type="text"
                 icon="el-icon-download"
-                @click="dayin(scope.row.id)"
+                @click="totaldayin(scope.row.id)"
                 >涓嬭浇</el-button
               >
             </template>
@@ -430,7 +437,7 @@
                 <el-option v-for="dict in dict.type.sys_recordstatus" :key="dict.value" :label="dict.label"
                   :value="dict.value" />
               </el-select>
-            </el-form-item> 
+            </el-form-item>
           </el-col>-->
         </el-row>
         <el-row>
@@ -821,6 +828,7 @@
 import Li_area_select from "@/components/Address";
 import OrgSelecter from "@/views/project/components/orgselect";
 import { setItem, grtItem, removeItem } from "@/utils/storage.js";
+import { getToken } from "@/utils/auth";
 
 export default {
   components: {
@@ -1004,7 +1012,10 @@
       approveLevel: 5,
       show: 0,
       fundtypeArrAll: [],
-      dialogType: "show"
+      dialogType: "show",
+      headers: {
+        Authorization: "Bearer " + getToken()
+      }
     };
   },
   watch: {},
@@ -1030,9 +1041,6 @@
   methods: {
     getUsermsg() {
       getUserProfile().then(response => {
-        console.log("鐧诲綍鐢ㄦ埛淇℃伅", response.data);
-        // this.defaultperson = response.data;
-        // this.standardlevel = response.data.standardlevel;
         if (
           response.data.userName === "001" ||
           response.data.userName === "002" ||
@@ -1043,18 +1051,15 @@
         } else {
           this.show = 3;
         }
-        console.log(response.data.userName, this.show);
       });
     },
     selectapplication() {
-      console.log("鏃堕棿", this.createTime);
       this.queryParams.APPLICATIONBEGTIME = this.createTime[0];
       this.queryParams.APPLICATIONENDTIME = this.createTime[1];
     },
     getlistbypower() {
       this.loading = true;
       listbypower(this.queryParams).then(res => {
-        console.log("鏍规嵁鏉冮檺鏄剧ず鍒楄〃", res);
         removeItem("expertFeeCheck");
         setItem("expertFeeCheck", this.queryParams);
         this.loading = false;
@@ -1082,11 +1087,18 @@
         return;
       }
       checkfund(checkfundobj).then(res => {
-        console.log("瀹℃牳璐圭敤", res);
-        this.reset();
-        this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
-        this.getlistbypower();
-        this.dialogOpen = false;
+        if (res.code == 200) {
+          this.reset();
+          this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
+          this.getlistbypower();
+          this.dialogOpen = false;
+        } else {
+          if (res.msg) {
+            this.$modal.msgError("鎿嶄綔澶辫");
+          } else {
+            this.$modal.msgError(res.msg);
+          }
+        }
       });
     },
     getlistUser() {
@@ -1128,23 +1140,36 @@
 
     totaldayin(e) {
       // const id =this.row.id
-      getdownloadBX(e).then(res => {
-        if (res.downloadUrl) {
-          var fileUrl = res;
-          //鑾峰彇褰撳墠缃戝潃
-          var urlBase = process.env.VUE_APP_BASE_API;
-          var curWWWPath = window.document.location.href;
-          var pos = curWWWPath.indexOf(window.document.location.pathname);
-          // 鍒涘缓a鏍囩
-          var aEle = document.createElement("a");
-          aEle.href =
-            curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
-          aEle.click();
-          this.$alert("涓嬭浇鎴愬姛", "鎻愮ず", {
-            confirmButtonText: "纭畾",
-            type: "success"
+      getdownloadLW(e).then(res => {
+        var fileUrl = res;
+        //鑾峰彇褰撳墠缃戝潃
+        var urlBase = process.env.VUE_APP_BASE_API;
+        var curWWWPath = window.document.location.href;
+        var pos = curWWWPath.indexOf(window.document.location.pathname);
+        // 鍒涘缓a鏍囩
+        var aEle = document.createElement("a");
+        aEle.href =
+          curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
+        console.log(aEle.href);
+        // 娣诲姞Authorization澶撮儴
+        fetch(aEle.href, {
+          headers: this.headers
+        })
+          .then(response => {
+            // 灏嗘枃浠朵笅杞介摼鎺ヤ綔涓篵lob瀵硅薄杩涜涓嬭浇
+            return response.blob();
+          })
+          .then(blob => {
+            const url = window.URL.createObjectURL(new Blob([blob]));
+            console.log(url);
+            const link = document.createElement("a");
+            link.href = url;
+            const name = fileUrl["downloadName"];
+            link.setAttribute("download", name); // 鏇挎崲file.pdf涓哄疄闄呯殑鏂囦欢鍚�
+            document.body.appendChild(link);
+            link.click();
+            link.parentNode.removeChild(link);
           });
-        }
       });
     },
 
@@ -1219,14 +1244,10 @@
     change(scope) {},
     autodonorno() {
       listDonatebaseinfo().then(res => {
-        // console.log("鎵�鏈夋崘鐚�呭垪琛細",res);
         res.rows.forEach(data => {
-          // console.log("data:",data);
           if (this.form.doname === data.name) {
             this.form.donorno = data.donorno;
-            console.log(this.form.donorno);
           } else {
-            // this.$modal.alertWarning("瀵逛笉璧凤紝鏃犺鎹愮尞浜�");
           }
         });
       });
@@ -1316,45 +1337,49 @@
         this.ids.forEach(item => {
           if (xuanzlist.includes(item)) {
           } else {
+            if (this.overallids.length == 1) {
+              this.overallids = [];
+            } else {
+              this.overallids.splice(this.overallids.indexOf(item), 1);
+            }
+            if (this.overallidsvalue.length == 1) {
+              this.overallidsvalue = [];
+            } else {
+              this.overallidsvalue.splice(
+                this.overallidsvalue.indexOf(item),
+                1
+              );
+            }
             this.ids.splice(this.ids.indexOf(item), 1);
-            this.overallids.splice(this.overallids.indexOf(item), 1);
-            this.overallidsvalue.splice(this.overallidsvalue.indexOf(item), 1);
           }
         });
       }
-      console.log(this.ids);
+
       this.ids.forEach(item => {
         if (this.overallids.includes(item)) {
-          console.log("3 is in the array");
         } else {
           this.overallids.push(item);
           const obj = selection.find(obj => obj.id === item);
           this.overallidsvalue.push(obj);
         }
       });
-      console.log(this.overallids);
     },
     // 鍒囨崲椤靛悗鎭㈠閫変腑
     Restorecheck() {
-      console.log(this.donateconsolationfundList);
-      console.log(this.overallids);
       const overlap = this.donateconsolationfundList.filter(value => {
         return this.overallids.includes(value.id);
       });
       // 淇濇寔ids鍜屽綋鍓嶉〉闈㈢殑鍚屾鎬�
       this.ids = overlap.map(item => item.id);
-      console.log(overlap, "褰撳墠椤甸�変腑鏁版嵁");
+
       this.toggleSelection(overlap);
     },
     // 鎸傝浇閫夋嫨鐘舵��
     toggleSelection(rows) {
-      console.log(rows);
       if (rows) {
         this.$nextTick(() => {
           rows.forEach(row => {
-            console.log(row);
             this.$refs.multipleTable.toggleRowSelection(row, true);
-            console.log(1);
           });
         });
       } else {
@@ -1362,29 +1387,44 @@
       }
     },
     Totalcalculation(tot) {
-      console.log(tot);
+      if (this.overallids.length == 0) {
+        this.$message({
+          type: "info",
+          message: "褰撳墠娌℃湁閫夋嫨瑕佹眹鎬荤殑涓撳璐圭敵璇峰崟锛屼笉鑳芥眹鎬伙紒"
+        });
+        return;
+      }
+
       let bojite = {
         fundids: this.overallids,
         isTaxAfter: tot
       };
       if (tot == 0) {
-        TotalcalculationFn(bojite).then(row => {
-          if ((row.code = 200)) {
-            this.$modal.msgSuccess(row.msg);
-          } else {
-            this.$modal.msgError(row.msg);
-          }
-        });
-      } else {
-        const hasValue = this.overallidsvalue.every(obj => obj.istax == 1);
-        if (hasValue) {
-          TotalcalculationFn(bojite).then(row => {
-            if ((row.code = 200)) {
+        TotalcalculationFn(bojite)
+          .then(row => {
+            if (row.code == 200) {
               this.$modal.msgSuccess(row.msg);
             } else {
               this.$modal.msgError(row.msg);
             }
+          })
+          .catch(error => {
+            this.$modal.msgError(error);
           });
+      } else {
+        const hasValue = this.overallidsvalue.every(obj => obj.istax == 1);
+        if (hasValue) {
+          TotalcalculationFn(bojite)
+            .then(row => {
+              if (row.code == 200) {
+                this.$modal.msgSuccess(row.msg);
+              } else {
+                this.$modal.msgError(row.msg);
+              }
+            })
+            .catch(error => {
+              this.$modal.msgError(error);
+            });
         } else {
           this.$modal.msgError("璇烽�夋嫨绠楃◣鍚庣殑鏁版嵁杩涜鍚堝苟璁$畻");
         }
@@ -1392,7 +1432,6 @@
     },
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
-      console.log("222", this.curCase);
       if (this.curCase.id) {
         this.istrue += 2;
         this.reset();
@@ -1452,7 +1491,6 @@
         this.loading = false;
         this.form = response.data;
         this.form.name = this.curCase.name;
-        console.log("wdadwadwadaw", this.form);
         this.loading = true;
         getownFundDetail(this.form.id).then(res => {
           this.loading = false;
@@ -1469,7 +1507,6 @@
         fundtype: 2
       };
       listFundflow(listFundflowparams).then(res => {
-        console.log("聽fundtype:聽1", res);
         this.fundflowList = res.rows;
       });
       this.dialogOpen = true;
@@ -1507,7 +1544,6 @@
       getFund(row.id).then(response => {
         this.form = response.data;
         this.form.name = this.curCase.name;
-        console.log("applytype", this.form.applytype);
         getownFundDetail(row.id).then(res => {
           this.fundDetailArr = res.data;
           for (let m = 0; m < this.fundDetailArr.length; m++) {
@@ -1632,16 +1668,9 @@
                   this.$set(rows, rows.splice(index, 1));
                   getownFundDetail(this.form.id).then(res => {
                     this.$set(this.fundDetailArr, res.data);
-                    // this.fundDetailArr = res.data
-                    // console.log('鍒犻櫎鍚�',this.fundDetailArr)
                   });
                 });
               }
-              // getownFundDetail(this.form.id).then(res=>{
-              // this.$set(this.fundDetailArr,res.data)
-              // this.fundDetailArr = res.data
-              // console.log('鍒犻櫎鍚�',this.fundDetailArr)
-              // })
             });
           } else {
             rows.splice(index, 1);
@@ -1719,9 +1748,7 @@
         type: "warning"
       })
         .then(() => {
-          updateFunddetail(this.fundDetailArr).then(res => {
-            console.log("鐗涗父鐗涘晩", res);
-          });
+          updateFunddetail(this.fundDetailArr).then(res => {});
         })
         .catch(() => {
           //鍑犵偣鍙栨秷鐨勬彁绀�
@@ -1733,10 +1760,8 @@
       //鍒ゆ柇鏁版嵁鏄庣粏鏁版嵁鏄惁姝g‘
       let detailDataCorrect = true;
       for (let i = 0; i < this.applicationDetailArr.length; i++) {
-        // console.log('qqq',this.applicationDetailArr[i]);
         let tempData = this.applicationDetailArr[i];
         Object.keys(tempData).forEach(function(key) {
-          // console.log('iii',key, tempData[key]);
           if (
             tempData[key] == null ||
             tempData[key] == undefined ||
@@ -1774,7 +1799,6 @@
     //鑾峰彇璐圭敤绫诲瀷
     getCurFundType() {
       getFundTypeAll(1).then(res => {
-        console.log("璐圭敤绫诲瀷", res.data);
         let dataList = res.data;
         this.fundtypeArrAll = dataList;
         this.fundtypeArr = [];
@@ -1808,7 +1832,6 @@
         listReportname(arr[i]).then(res => {
           this.arrr2 = res.data;
           this.arrr3 = this.arrr3.concat(this.arrr2);
-          console.log("adadadadasdsad", this.arrr3, this.userlist);
         });
       }
     },
@@ -1891,7 +1914,6 @@
     dayin0() {
       if (this.form.id) {
         const id = this.form.id;
-        console.log(id);
         getdownloadLW(id).then(res => {
           if (res.downloadUrl) {
             var fileUrl = res;
@@ -2006,9 +2028,6 @@
     },
     dayin4() {
       const id = this.form.id;
-      // getdownloadLL(id).then(res=>{
-      //   console.log('鍔冲姟涓嬭浇',res);
-      // })
     },
     // 鎹愮尞鑰呭灞炰氦閫氶瀹挎墦鍗�
     dayin5() {
@@ -2031,7 +2050,6 @@
               type: "success"
             });
           }
-          console.log("瀹跺睘浼欓浜ら�氳垂", res);
         });
       } else {
         this.$alert("璇风‘璁ゆ偍瑕佷笅杞界殑涓撳鍔冲姟琛�", "鎻愰啋", {

--
Gitblit v1.9.3