From 71521b48a25f9288b5187b78884feef5d559b2ff Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期四, 06 三月 2025 11:04:24 +0800
Subject: [PATCH] 修改

---
 src/views/specialOperationsPay/notCoalCalculate/index.vue |   67 +++++++++++++++++-----
 src/views/specialOperationsPay/coalCalculate/index.vue    |   64 ++++++++++++++++----
 src/views/specialOperationsPay/singlePage/index.vue       |   21 ++++++
 src/views/commonMod/examApply/index.vue                   |    1 
 4 files changed, 121 insertions(+), 32 deletions(-)

diff --git a/src/views/commonMod/examApply/index.vue b/src/views/commonMod/examApply/index.vue
index 846e025..e129276 100644
--- a/src/views/commonMod/examApply/index.vue
+++ b/src/views/commonMod/examApply/index.vue
@@ -181,7 +181,6 @@
   },
   created() {
     this.roles = store.getters && store.getters.roles
-    console.log(this.roles,'role')
     // if (roles.includes('mk')) {
     //   this.form.isCm = 1
     // }
diff --git a/src/views/specialOperationsPay/coalCalculate/index.vue b/src/views/specialOperationsPay/coalCalculate/index.vue
index 19fa9bb..f7356a7 100644
--- a/src/views/specialOperationsPay/coalCalculate/index.vue
+++ b/src/views/specialOperationsPay/coalCalculate/index.vue
@@ -4,11 +4,11 @@
       <el-date-picker
         v-model="queryParams.year"
         type="year"
-        style="width: 300px"
+        style="width: 200px"
         value-format="yyyy"
         placeholder="选择年">
       </el-date-picker>
-      <el-select v-model="queryParams.quarter" placeholder="请选择季度" style="width: 300px;margin-left: 5px" clearable>
+      <el-select v-model="queryParams.quarter" placeholder="请选择季度" style="width: 200px;margin-left: 5px" clearable>
         <el-option
           v-for="item in quarterList"
           :key="item.id"
@@ -16,7 +16,7 @@
           :value="item.id">
         </el-option>
       </el-select>
-      <el-cascader v-model="queryParams.deptId" :show-all-levels="false" style="margin-left: 10px" filterable :options="deptOptions"
+      <el-cascader v-model="queryParams.deptId" :disabled="isExam" :show-all-levels="false" style="margin-left: 10px" filterable :options="deptOptions"
                    placeholder="组织架构"
                    :props="{ emitPath: false,value:'deptId',label: 'deptName' }"></el-cascader>
       <el-button
@@ -40,7 +40,7 @@
       <!--      </el-select>-->
     </div>
 
-    <el-table v-loading="loading" :data="dataList" style="margin-top: 20px" :row-class-name="tableAddClass">
+    <el-table v-loading="loading" :data="dataList" style="margin-top: 20px" :row-class-name="tableAddClass" show-summary :summary-method="getSummaries">
       <el-table-column label="工种类别" align="center" prop="subjectName"></el-table-column>
       <el-table-column label="缴费人次" align="center" prop="num" :show-overflow-tooltip="true"/>
       <el-table-column label="缴费标准" align="center" prop="amount">
@@ -53,13 +53,13 @@
       <el-table-column label="自治区级" align="center" prop="autonomy"/>
       <!--      <el-table-column label="地(州、市级)" align="center" prop="describe" />-->
     </el-table>
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+<!--    <pagination-->
+<!--      v-show="total>0"-->
+<!--      :total="total"-->
+<!--      :page.sync="queryParams.pageNum"-->
+<!--      :limit.sync="queryParams.pageSize"-->
+<!--      @pagination="getList"-->
+<!--    />-->
   </div>
 </template>
 
@@ -69,6 +69,7 @@
 } from '@/api/specialOperationsPay/coalPay'
 import Cookies from 'js-cookie'
 import {listDept} from "@/api/system/dept";
+import store from "@/store";
 
 export default {
   name: "coalCalculate",
@@ -84,7 +85,7 @@
       deptOptions: [],
       queryParams: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 999,
         year: '',
         quarter: null,
         deptId: null
@@ -107,12 +108,20 @@
           id: 4,
           label: '第四季度'
         }
-      ]
+      ],
+      roles: [],
+      isExam: false
     };
   },
   created() {
-    this.getList()
     this.getDeptTree()
+    this.roles = store.getters && store.getters.roles
+    if (this.roles.includes('feimeiexam') || this.roles.includes('mkexam')) {
+      const userInfo = store.getters && store.getters.userInfo
+      this.queryParams.deptId = userInfo.deptId
+      this.isExam = true
+    }
+    this.getList()
   },
   methods: {
     getList() {
@@ -142,6 +151,33 @@
       }
       return "";
     },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0)
+          if(index == 2){
+            sums[index] += '元/人次';
+          }
+        } else {
+          sums[index] = '--';
+        }
+      })
+      return sums;
+    },
 
     handleQuery() {
       this.getList();
diff --git a/src/views/specialOperationsPay/notCoalCalculate/index.vue b/src/views/specialOperationsPay/notCoalCalculate/index.vue
index b3a1a5d..fdd90da 100644
--- a/src/views/specialOperationsPay/notCoalCalculate/index.vue
+++ b/src/views/specialOperationsPay/notCoalCalculate/index.vue
@@ -4,11 +4,11 @@
       <el-date-picker
         v-model="queryParams.year"
         type="year"
-        style="width: 300px"
+        style="width: 200px"
         value-format="yyyy"
         placeholder="选择年">
       </el-date-picker>
-      <el-select v-model="queryParams.quarter" placeholder="请选择季度" style="width: 300px;margin-left: 5px" clearable>
+      <el-select v-model="queryParams.quarter" placeholder="请选择季度" style="width: 200px;margin-left: 5px" clearable>
         <el-option
           v-for="item in quarterList"
           :key="item.id"
@@ -16,7 +16,7 @@
           :value="item.id">
         </el-option>
       </el-select>
-      <el-select v-model="queryParams.districtCode" placeholder="所辖行政区划" @change="changeDeptList" style="width: 300px;margin-left: 5px">
+      <el-select v-model="queryParams.districtCode" :disabled="isExam" placeholder="所辖行政区划" @change="changeDeptList" style="width: 200px;margin-left: 5px">
         <el-option
           v-for="item in areaList"
           :key="item.id"
@@ -24,7 +24,7 @@
           :value="item.code">
         </el-option>
       </el-select>
-      <el-cascader v-model="queryParams.deptId" style="margin-left: 10px" :show-all-levels="false" filterable :options="deptList" placeholder="组织架构"
+      <el-cascader v-model="queryParams.deptId" :disabled="isExam" style="margin-left: 10px" :show-all-levels="false" filterable :options="deptList" placeholder="组织架构"
                    :props="{ emitPath: false,value:'deptId',label: 'deptName' }"></el-cascader>
       <el-button
         type="primary"
@@ -39,7 +39,7 @@
       </el-button>
     </div>
 
-    <el-table v-loading="loading" :data="dataList" style="margin-top: 20px" :row-class-name="tableAddClass">
+    <el-table v-loading="loading" :data="dataList" style="margin-top: 20px" :row-class-name="tableAddClass" show-summary :summary-method="getSummaries">
       <el-table-column label="工种类别" align="center" prop="subjectName"></el-table-column>
       <el-table-column label="缴费人次" align="center" prop="num" :show-overflow-tooltip="true"/>
       <el-table-column label="缴费标准" align="center" prop="amount">
@@ -52,13 +52,13 @@
       <el-table-column label="自治区级" align="center" prop="autonomy"/>
       <el-table-column label="地(州、市级)" align="center" prop="prefecuture"/>
     </el-table>
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+<!--    <pagination-->
+<!--      v-show="total>0"-->
+<!--      :total="total"-->
+<!--      :page.sync="queryParams.pageNum"-->
+<!--      :limit.sync="queryParams.pageSize"-->
+<!--      @pagination="getList"-->
+<!--    />-->
   </div>
 </template>
 
@@ -70,6 +70,7 @@
 import {getAreaList} from "@/api/coalMine/placeManage/train";
 import {deptTreeSelect} from "@/api/system/user";
 import {listDept} from "@/api/system/dept";
+import store from "@/store";
 
 export default {
   name: "notCoalCalculate",
@@ -87,7 +88,7 @@
       deptList: [],
       queryParams: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 999,
         year: '',
         quarter: null,
         districtCode: '',
@@ -111,13 +112,22 @@
           id: 4,
           label: '第四季度'
         }
-      ]
+      ],
+      roles: [],
+      isExam: false
     };
   },
   created() {
-    this.getList()
     this.getArea()
     this.getDeptTree()
+    this.roles = store.getters && store.getters.roles
+    if (this.roles.includes('feimeiexam') || this.roles.includes('mkexam')) {
+      const userInfo = store.getters && store.getters.userInfo
+      this.queryParams.districtCode = userInfo.district.districtCode
+      this.queryParams.deptId = userInfo.deptId
+      this.isExam = true
+    }
+    this.getList()
   },
   methods: {
     getList() {
@@ -190,6 +200,33 @@
         }
       }
       return null
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0)
+          if(index == 2){
+            sums[index] += '元/人次';
+          }
+        } else {
+          sums[index] = '--';
+        }
+      })
+      return sums;
     }
   }
 };
diff --git a/src/views/specialOperationsPay/singlePage/index.vue b/src/views/specialOperationsPay/singlePage/index.vue
index 010e7df..ad8256c 100644
--- a/src/views/specialOperationsPay/singlePage/index.vue
+++ b/src/views/specialOperationsPay/singlePage/index.vue
@@ -51,6 +51,7 @@
             <div>批次名称:<span class="cardCont">{{item.batchName }}</span></div>
             <div>所属地区:<span class="cardCont">{{item.districtName }}</span></div>
             <div>填报时间:<span class="cardCont">{{item.createTime}}</span></div>
+            <div v-if="item.payCode">财政缴款码:<span class="cardCont">{{item.payCode}}</span><el-button type="text" style="padding: 0;margin-left: 10px" @click="copyCode(item.payCode)">复制</el-button></div>
             <div>状态状态:
               <el-tag v-if="item.payStatus == 0" type="danger" size="small">待缴费</el-tag>
               <el-tag v-if="item.payStatus == 1" type="success" size="small">已缴费</el-tag>
@@ -70,9 +71,10 @@
         </div>
         <div v-else class="feeList">
           <div v-for="(item,index) in info.list" class="infoCard" :key="index">
-            <div>批次名称:<span class="cardCont" v-if="item.coalPays">{{item.coalPays.batchName }}</span></div>
+            <div>批次名称:<span class="cardCont" v-if="item.coalPays">{{item.coalPays.batchName}}</span></div>
 <!--            <div>所属地区:<span class="cardCont">{{item.districtName }}</span></div>-->
             <div>填报时间:<span class="cardCont" v-if="item.coalPays">{{item.coalPays.createTime}}</span></div>
+            <div v-if="item.payCode">财政缴款码:<span class="cardCont">{{item.payCode}}</span><el-button type="text" style="padding: 0;margin-left: 10px" @click="copyCode(item.payCode)">复制</el-button></div>
             <div>状态状态:
               <el-tag v-if="item.payStatus == 0" type="danger" size="small">待缴费</el-tag>
               <el-tag v-if="item.payStatus == 1" type="success" size="small">已缴费</el-tag>
@@ -271,7 +273,22 @@
           }
         }
       })
-
+    },
+    copyCode(code){
+      navigator.clipboard
+        .writeText(code)
+        .then(() => {
+          this.$message({
+            type:'success',
+            message: '缴款码已复制到剪贴板'
+          })
+        })
+        .catch((error) => {
+          this.$message({
+            type:'warning',
+            message: '缴款码复制失败'
+          })
+        });
     },
     goPay(item){
       this.detailInfo = item

--
Gitblit v1.9.2