<template>
|
<div class="app-container">
|
<div>
|
<el-date-picker
|
v-model="queryParams.year"
|
type="year"
|
style="width: 200px"
|
value-format="yyyy"
|
placeholder="选择年">
|
</el-date-picker>
|
<el-select v-model="queryParams.quarter" placeholder="请选择季度" style="width: 200px;margin-left: 5px" clearable>
|
<el-option
|
v-for="item in quarterList"
|
:key="item.id"
|
:label="item.label"
|
:value="item.id">
|
</el-option>
|
</el-select>
|
<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
|
type="primary"
|
style="margin-left: 20px"
|
@click="handleQuery()"
|
>查询
|
</el-button>
|
<el-button
|
type="primary"
|
@click="resetQuery()"
|
>重置
|
</el-button>
|
<!-- <el-select v-model="queryParams.districtCode" placeholder="所辖行政区划" style="width: 100%;">-->
|
<!-- <el-option-->
|
<!-- v-for="item in areaList"-->
|
<!-- :key="item.id"-->
|
<!-- :label="item.name"-->
|
<!-- :value="item.code">-->
|
<!-- </el-option>-->
|
<!-- </el-select>-->
|
</div>
|
|
<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">
|
<template #default="scope">
|
{{ scope.row.amount }}元/人次
|
</template>
|
</el-table-column>
|
<el-table-column label="总额" align="center" prop="totalMoney"/>
|
<el-table-column label="上缴费中央" align="center" prop="turnContent"/>
|
<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"-->
|
<!-- />-->
|
</div>
|
</template>
|
|
<script>
|
import {
|
coalCount
|
} from '@/api/specialOperationsPay/coalPay'
|
import Cookies from 'js-cookie'
|
import {listDept} from "@/api/system/dept";
|
import store from "@/store";
|
|
export default {
|
name: "coalCalculate",
|
dicts: [],
|
components: {},
|
data() {
|
return {
|
loading: false,
|
single: true,
|
multiple: true,
|
showSearch: true,
|
dataList: [],
|
deptOptions: [],
|
queryParams: {
|
pageNum: 1,
|
pageSize: 999,
|
year: '',
|
quarter: null,
|
deptId: null
|
},
|
total: 0,
|
quarterList: [
|
{
|
id: 1,
|
label: '第一季度'
|
},
|
{
|
id: 2,
|
label: '第二季度'
|
},
|
{
|
id: 3,
|
label: '第三季度'
|
},
|
{
|
id: 4,
|
label: '第四季度'
|
}
|
],
|
roles: [],
|
isExam: false
|
};
|
},
|
created() {
|
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() {
|
this.loading = true;
|
coalCount(this.queryParams).then((res) => {
|
if (res.code == 200) {
|
this.dataList = res.rows
|
this.total = res.total
|
this.loading = false
|
}
|
})
|
},
|
getDeptTree() {
|
listDept({
|
deptName: undefined,
|
status: undefined
|
}).then(response => {
|
this.deptOptions = this.handleTree(response.data, "deptId")
|
})
|
},
|
changeStatus(val) {
|
this.getList()
|
},
|
tableAddClass({row, rowIndex}) {
|
if (row.difference < row.duration) {
|
return "tr-red";
|
}
|
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();
|
},
|
resetQuery() {
|
this.queryParams = {
|
pageNum: 1,
|
pageSize: 10,
|
year: '',
|
quarter: null,
|
deptId: null
|
}
|
this.getList()
|
},
|
}
|
};
|
</script>
|
|
<style scoped>
|
.app-container /deep/ .el-table .tr-red {
|
color: red !important;
|
}
|
</style>
|