|
@@ -12,6 +12,7 @@
|
|
|
:total="total"
|
|
|
:default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
@page-change="pageChange"
|
|
|
+ @sort-change="sortChange"
|
|
|
>
|
|
|
<template #card-tools v-if="!$attrs.panorama">
|
|
|
<m-button type="orange" size="small" icon="el-icon-plus" @click="onAdd">新增</m-button>
|
|
@@ -43,6 +44,9 @@ import {
|
|
|
exportRoster,
|
|
|
downloadRosterTemplate
|
|
|
} from '@/api/system'
|
|
|
+import {
|
|
|
+ dateFormat
|
|
|
+} from '@/utils/date'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
export default {
|
|
|
name: 'sys-roster',
|
|
@@ -112,7 +116,7 @@ export default {
|
|
|
{ label: '岗位类别', prop: 'positionCategory' },
|
|
|
{ label: '职务层级', prop: 'jobLevel' },
|
|
|
{ label: '通行证号', prop: 'passes' },
|
|
|
- { label: '工行时间', prop: 'tradeUnionsTimeText' },
|
|
|
+ { label: '工行时间', prop: 'tradeUnionsTime' },
|
|
|
{ label: '薪酬档次', align: 'center', prop: 'salaryCategory' },
|
|
|
{ label: '薪酬级别', align: 'center', prop: 'salaryLevel' }
|
|
|
]
|
|
@@ -170,14 +174,9 @@ export default {
|
|
|
...query
|
|
|
})
|
|
|
this.items = data.records.map(e => {
|
|
|
- const date = new Date(e.tradeUnionsTime)
|
|
|
- // 获取年、月、日
|
|
|
- const year = date.getFullYear()
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,所以要加1
|
|
|
- const day = String(date.getDate()).padStart(2, '0')
|
|
|
return {
|
|
|
...e,
|
|
|
- tradeUnionsTimeText: `${year}年${month}月${day}日`
|
|
|
+ tradeUnionsTime: dateFormat('YYYY-mm-dd', new Date(e.tradeUnionsTime))
|
|
|
}
|
|
|
})
|
|
|
this.total = data.total
|
|
@@ -250,6 +249,10 @@ export default {
|
|
|
this.pageInfo.current = index
|
|
|
this.init()
|
|
|
},
|
|
|
+ sortChange (v) {
|
|
|
+ this.orders = v
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
onChange () {
|
|
|
this.$refs.rosterVersionRefs.open(this.headers.slice(0, -1))
|
|
|
}
|