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/coalCalculate/index.vue |   64 +++++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 14 deletions(-)

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();

--
Gitblit v1.9.2