Commit 22ed45b6 authored by 谢子梦's avatar 谢子梦

stage:统计时间处理

parent 89da18f6
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
</el-row> </el-row>
</el-form> </el-form>
<!-- 列表内容部分 --> <!-- 列表内容部分 -->
<el-table :data="statisticsMothList" style="width: 100%" :header-cell-style="{ textAlign: 'center' }" <el-table :data="statisticsMothList" style="width: 100%" :key="statisticsMothKey"
:cell-style="{ textAlign: 'center' }" height="calc(100vh - 300px)" show-summary :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
:summary-method="getSummariesMonth"> height="calc(100vh - 300px)" show-summary :summary-method="getSummariesMonth">
<el-table-column label="序号" type="index" :index="indexMonthFN" width="50"> <el-table-column label="序号" type="index" :index="indexMonthFN" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="companyName" label="单位名称"> <el-table-column prop="companyName" label="单位名称">
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<el-table-column prop="actualPayable" label="实发工资"> <el-table-column prop="actualPayable" label="实发工资">
</el-table-column> </el-table-column>
<el-table-column prop="timeVal" label="时间"> <el-table-column prop="timeVal" label="时间">
<template slot-scope="{row}">
{{ statisticsMothTime(row.timeVal) }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="公司承担部分"> <el-table-column label="公司承担部分">
<el-table-column prop="gsbxCompanyMoney" label="工商保险"> <el-table-column prop="gsbxCompanyMoney" label="工商保险">
...@@ -90,9 +93,9 @@ ...@@ -90,9 +93,9 @@
</el-row> </el-row>
</el-form> </el-form>
<!-- 列表内容部分 --> <!-- 列表内容部分 -->
<el-table :data="statisticsYearList" style="width: 100%" :header-cell-style="{ textAlign: 'center' }" <el-table :data="statisticsYearList" style="width: 100%" :key="statisticsYearKey"
:cell-style="{ textAlign: 'center' }" height="calc(100vh - 300px)" show-summary :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
:summary-method="getSummariesYear"> height="calc(100vh - 300px)" show-summary :summary-method="getSummariesYear">
<el-table-column label="序号" type="index" :index="indexYearFN" width="50"> <el-table-column label="序号" type="index" :index="indexYearFN" width="50">
</el-table-column> </el-table-column>
<el-table-column prop="companyName" label="单位名称"> <el-table-column prop="companyName" label="单位名称">
...@@ -100,6 +103,9 @@ ...@@ -100,6 +103,9 @@
<el-table-column prop="actualPayable" label="实发工资"> <el-table-column prop="actualPayable" label="实发工资">
</el-table-column> </el-table-column>
<el-table-column prop="timeVal" label="时间"> <el-table-column prop="timeVal" label="时间">
<template slot-scope="{row}">
{{ statisticsYearTime(row.timeVal) }}
</template>
</el-table-column> </el-table-column>
<el-table-column label="公司承担部分"> <el-table-column label="公司承担部分">
<el-table-column prop="gsbxCompanyMoney" label="工商保险"> <el-table-column prop="gsbxCompanyMoney" label="工商保险">
...@@ -143,6 +149,7 @@ export default { ...@@ -143,6 +149,7 @@ export default {
}, },
totalMonth: 0, totalMonth: 0,
statisticsMothList: [], statisticsMothList: [],
statisticsMothKey: 1,
/** 按年统计参数 */ /** 按年统计参数 */
paramsYear: { paramsYear: {
pageNum: 1, pageNum: 1,
...@@ -153,6 +160,7 @@ export default { ...@@ -153,6 +160,7 @@ export default {
}, },
totalYear: 0, totalYear: 0,
statisticsYearList: [], statisticsYearList: [],
statisticsYearKey: 1,
activeName: 'first' activeName: 'first'
} }
}, },
...@@ -161,6 +169,14 @@ export default { ...@@ -161,6 +169,14 @@ export default {
this.getStatisticsListMonth() this.getStatisticsListMonth()
}, },
methods: { methods: {
/** 年份时间处理 */
statisticsYearTime(val) {
return val.substring(0, 4)
},
/** 月份时间处理 */
statisticsMothTime(val) {
return val.substring(0, 7)
},
/** 按年统计-总计方法 */ /** 按年统计-总计方法 */
getSummariesYear(param) { getSummariesYear(param) {
const { columns, data } = param; const { columns, data } = param;
...@@ -204,7 +220,6 @@ export default { ...@@ -204,7 +220,6 @@ export default {
} }
}) })
this.$forceUpdate()
return arrAY; return arrAY;
}, },
/** 按月统计-总计方法 */ /** 按月统计-总计方法 */
...@@ -250,7 +265,6 @@ export default { ...@@ -250,7 +265,6 @@ export default {
} }
}) })
this.$forceUpdate()
return arrAY; return arrAY;
}, },
/** 按年统计-重置方法 */ /** 按年统计-重置方法 */
...@@ -318,7 +332,7 @@ export default { ...@@ -318,7 +332,7 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.statisticsMothList = res.rows this.statisticsMothList = res.rows
this.totalMonth = res.total this.totalMonth = res.total
this.$forceUpdate() this.statisticsMothKey += 12
} }
}).finally(() => { }).finally(() => {
this.$modal.closeLoading() this.$modal.closeLoading()
...@@ -331,7 +345,7 @@ export default { ...@@ -331,7 +345,7 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.statisticsYearList = res.rows this.statisticsYearList = res.rows
this.totalYear = res.total this.totalYear = res.total
this.$forceUpdate() this.statisticsYearKey += 12
} }
}).finally(() => { }).finally(() => {
this.$modal.closeLoading() this.$modal.closeLoading()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment