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/officeExpenseCheck/index.vue |  282 ++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 174 insertions(+), 108 deletions(-)

diff --git a/src/views/project/fundcheck/officeExpenseCheck/index.vue b/src/views/project/fundcheck/officeExpenseCheck/index.vue
index e1eca67..245cc2b 100644
--- a/src/views/project/fundcheck/officeExpenseCheck/index.vue
+++ b/src/views/project/fundcheck/officeExpenseCheck/index.vue
@@ -8,42 +8,37 @@
       label-width="120px"
     >
       <el-row align="left">
-        <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-width="120px"
+            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">
@@ -63,13 +58,47 @@
             </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-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-form-item>
+        </el-col>
       </el-row>
       <el-row>
-        <el-col :span="4">
+        <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"
@@ -93,7 +122,7 @@
           :data="donateconsolationfundList"
           @selection-change="handleSelectionChange"
         >
-          <!-- 
+          <!--
           <el-table-column label="瀹℃壒鐘舵��" width="120" align="center" prop="checkFlag">
             <template slot-scope="scope">
               <span v-if="scope.row.checkFlag == 0"><i class="el-icon-check"
@@ -102,22 +131,23 @@
             </template>
           </el-table-column>
            -->
+
+          <el-table-column
+            label="鎶ラ攢鍗曞彿"
+            align="center"
+            prop="bh"
+            width="150px"
+          />
           <el-table-column
             label="鐢宠鏃ユ湡"
             width="180"
             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"
@@ -125,15 +155,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="donorno" />-->
@@ -149,11 +173,18 @@
           <el-table-column label="璐㈠姟瀹℃牳" align="center" prop="financechecher" width="140" />
           -->
           <el-table-column
-            label="鎹愮尞鑰�"
+            label="鐢宠鏉愭枡鐘舵��"
+            width="140"
             align="center"
-            prop="donorname"
-            width="150px"
-          />
+            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"
@@ -168,18 +199,23 @@
             </template>
           </el-table-column>
           <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"
+            label="鎵�灞炵粍鍒�"
+            align="center"
+            prop="deptmentname"
+            width="200px"
           />
-        </template>
-      </el-table-column>
+          <el-table-column
+            label="缁勯暱"
+            align="center"
+            prop="managername"
+            width="150px"
+          />
+          <el-table-column
+            label="鎹愮尞鑰�"
+            align="center"
+            prop="donorname"
+            width="150px"
+          />
           <el-table-column label="澶囨敞" align="center" prop="remark" />
           <el-table-column
             label="鎿嶄綔"
@@ -197,14 +233,7 @@
                 @click="handleDetail(scope.row)"
                 >璇︽儏</el-button
               >
-              <el-button
-                v-if="scope.row.checkFlag == 1"
-                size="mini"
-                type="text"
-                icon="el-icon-edit"
-                @click="beforehandCheck(scope.row)"
-                >棰勫鏍�</el-button
-              >
+
               <el-button
                 v-if="scope.row.checkFlag == 1"
                 size="mini"
@@ -219,9 +248,9 @@
                 type="text"
                 icon="el-icon-download"
                 @click="totaldayin(scope.row.id)"
-                v-hasPermi="['project:donateconsolationfund:download']"
                 >涓嬭浇</el-button
               >
+              <!-- v-hasPermi="['project:donateconsolationfund:download']" -->
 
               <!-- 鏂板瀹℃牳椤甸潰 -->
               <!-- <el-button
@@ -345,12 +374,12 @@
               />
             </el-form-item>
           </el-col>
-          <!--    
+          <!--
           <el-col :span="8">
             <el-form-item label="鎹愮尞缂栧彿" prop="donorno">
               <el-input disabled v-model="form.donorno" placeholder="璇疯緭鍏ユ崘鐚紪鍙�" clearable />
             </el-form-item>
-          </el-col>          
+          </el-col>
           <el-col :span="8">
             <el-form-item label="鑱旂郴鐢佃瘽" prop="phone">
               <el-input v-model="form.phone" placeholder="璇疯緭鍏ョ敵璇疯�呯殑鑱旂郴鏂瑰紡" clearable />
@@ -893,8 +922,7 @@
 import OrgSelecter from "@/views/project/components/orgselect";
 import { getUserProfile } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
-import { setItem,grtItem,removeItem } from '@/utils/storage.js';
-
+import { setItem, grtItem, removeItem } from "@/utils/storage.js";
 
 export default {
   components: {
@@ -989,6 +1017,20 @@
           label: "鍏ㄩ儴"
         }
       ],
+      checkmaterials: [
+        {
+          value: 1,
+          label: "鏉愭枡寰呭鏍�"
+        },
+        {
+          value: 2,
+          label: "瀹℃煡閫氳繃绛夊緟閭瘎绾歌川鏉愭枡"
+        },
+        {
+          value: 3,
+          label: "宸叉敹鍒扮焊璐ㄦ潗鏂�"
+        }
+      ],
       // 鏌ヨ鍙傛暟
       queryParams: {
         pageNum: 1,
@@ -998,6 +1040,7 @@
         APPLICATIONENDTIME: null,
         CHECKFLAG: 1,
         APPLYTYPE: 4,
+
         money: null
       },
       // 琛ㄥ崟鍙傛暟
@@ -1087,7 +1130,9 @@
   mounted() {
     if (grtItem("officeExpenseCheck")) {
       this.queryParams = grtItem("officeExpenseCheck");
-    };
+      this.queryParams.APPLICATIONBEGTIME = "";
+      this.queryParams.APPLICATIONENDTIME = "";
+    }
     this.selectReporters();
     this.getlistOrganization();
     //his.getlistUser();
@@ -1121,9 +1166,17 @@
         fundid: this.newobj.fundid
       };
       checkfund(checkfundobj).then(res => {
-        this.reset();
-        this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
-        this.getlistbypower();
+        if (res.code == 200) {
+          this.reset();
+          this.$modal.msgSuccess("瀹℃牳瀹屾垚!");
+          this.getlistbypower();
+        } else {
+          if (res.msg) {
+            this.$modal.msgError("鎿嶄綔澶辫");
+          } else {
+            this.$modal.msgError(res.msg);
+          }
+        }
       });
     },
     getlistUser() {
@@ -1165,23 +1218,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);
           });
-        }
       });
     },
 
@@ -1364,14 +1430,14 @@
         });
       }
     },
-    beforehandCheck(row){
+    beforehandCheck(row) {
       this.$router.push({
         path: "/finance/applyDetail/",
         query: {
           id: row.id,
-          businessType: "2",
-          beforehandType:'1',
-          operationType: "check",
+          businessType: "4",
+          beforehandType: "1",
+          operationType: "check"
         }
       });
     },

--
Gitblit v1.9.3