From db905ecd14f63dba9337b4f4715584ef2d7e8c7e Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Fri, 07 Mar 2025 14:45:00 +0800
Subject: [PATCH] 修改
---
src/views/specialOperationsPay/notCoalCalculate/index.vue | 68 ++++++++++++++++++++++++++-------
1 files changed, 53 insertions(+), 15 deletions(-)
diff --git a/src/views/specialOperationsPay/notCoalCalculate/index.vue b/src/views/specialOperationsPay/notCoalCalculate/index.vue
index b3a1a5d..26ad777 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,34 @@
}
}
return null
+ },
+ getSummaries(param) {
+ const { columns, data } = param
+ const sums = [];
+ columns.forEach((column, index) => {
+ if (index === 0) {
+ sums[index] = '合计';
+ return
+ }
+ if (index === 2) {
+ 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)
+ } else {
+ sums[index] = '--';
+ }
+ })
+ return sums;
}
}
};
--
Gitblit v1.9.2