|
@@ -8,12 +8,13 @@
|
|
|
:page-size="pageInfo.size"
|
|
|
:page-current="pageInfo.current"
|
|
|
:total="total"
|
|
|
+ :fit="true"
|
|
|
@page-change="onPageChange"
|
|
|
@sort-change="onSortChange"
|
|
|
>
|
|
|
- <!-- <template #card-tools>
|
|
|
- <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
|
|
|
- </template> -->
|
|
|
+ <template #card-tools>
|
|
|
+ <m-button type="orange" icon="el-icon-download" :loading="exportLoading" @click="onExport">导出</m-button>
|
|
|
+ </template>
|
|
|
<!-- <template #actions="{ row }">
|
|
|
<m-button type="primary" text @click="onEdit(row)">编辑</m-button>
|
|
|
<m-button type="danger" text @click="onDelete(row)">删除</m-button>
|
|
@@ -35,27 +36,36 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getSalaryFixedList
|
|
|
+ getSalaryFixedList,
|
|
|
+ exportSalaryFixedList
|
|
|
} from '@/api/salary'
|
|
|
+import {
|
|
|
+ downloadFile
|
|
|
+} from '@/utils'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
export default {
|
|
|
name: 'salaryFixedCalculation',
|
|
|
data () {
|
|
|
return {
|
|
|
+ exportLoading: false,
|
|
|
searchValues: {
|
|
|
- employeeName: null
|
|
|
+ employeeName: null,
|
|
|
+ month: null,
|
|
|
+ organizationNo: null
|
|
|
},
|
|
|
headers: [
|
|
|
+ { label: '月份', prop: 'month' },
|
|
|
+ { label: '员工编码', prop: 'passes' },
|
|
|
{ label: '姓名', prop: 'employeeName' },
|
|
|
- { label: '所在部门名称', prop: 'deptName' },
|
|
|
- { label: '岗位名称', prop: 'postName' },
|
|
|
+ { label: '所在部门名称', prop: 'deptName', width: 150 },
|
|
|
+ { label: '岗位名称', prop: 'postName', width: 150 },
|
|
|
{ label: '人员类别', prop: 'personnelCategory' },
|
|
|
- { label: '职务层级', prop: 'jobLevel' },
|
|
|
+ { label: '职务层级', prop: 'jobLevel', width: 150 },
|
|
|
{ label: '工资系数', prop: 'coefficient' },
|
|
|
- { label: '基础工资系数', prop: 'basicSalary' },
|
|
|
+ { label: '基础工资系数', prop: 'basicSalary', width: 150 },
|
|
|
{ label: '薪酬档次', prop: 'salaryCategory', align: 'center' },
|
|
|
{ label: '薪酬等级', prop: 'salaryLevel', align: 'center' },
|
|
|
- { label: '固定薪资', prop: 'salaryAmount', align: 'center' }
|
|
|
+ { label: '固定薪资', prop: 'salaryAmount', align: 'center', fixed: 'right', width: 130 }
|
|
|
// { label: '操作', prop: 'actions', fixed: 'right', width: 150 }
|
|
|
],
|
|
|
items: [],
|
|
@@ -65,13 +75,24 @@ export default {
|
|
|
size: 10
|
|
|
},
|
|
|
orders: [],
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ exportOption: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['organizationTree']),
|
|
|
searchItems () {
|
|
|
return [
|
|
|
+ {
|
|
|
+ label: '月份',
|
|
|
+ type: 'datePicker',
|
|
|
+ prop: 'month',
|
|
|
+ options: {
|
|
|
+ placeholder: '请选择月份',
|
|
|
+ type: 'month',
|
|
|
+ valueFormat: 'yyyy-MM'
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '姓名',
|
|
|
prop: 'employeeName',
|
|
@@ -108,7 +129,7 @@ export default {
|
|
|
async onInit () {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- const { organizationNo, ...param } = this.searchValues
|
|
|
+ const { organizationNo, month, ...param } = this.searchValues
|
|
|
const { data } = await getSalaryFixedList({
|
|
|
page: {
|
|
|
...this.pageInfo,
|
|
@@ -117,8 +138,12 @@ export default {
|
|
|
entity: {
|
|
|
...param
|
|
|
},
|
|
|
- organizationNo
|
|
|
+ organizationNo,
|
|
|
+ month
|
|
|
})
|
|
|
+ this.exportOption = {
|
|
|
+ ...this.searchValues
|
|
|
+ }
|
|
|
this.items = data.records
|
|
|
this.total = data.total
|
|
|
} catch (error) {
|
|
@@ -127,24 +152,35 @@ export default {
|
|
|
this.loading = false
|
|
|
}
|
|
|
},
|
|
|
- onAdd () {
|
|
|
- this.$refs.fixedSalaryCalculationRefs.open()
|
|
|
- },
|
|
|
- onEdit (item) {
|
|
|
- this.$refs.fixedSalaryCalculationRefs.open(item)
|
|
|
- },
|
|
|
- onDelete (row) {
|
|
|
- this.$confirm('确定删除吗?', '提示')
|
|
|
- .then(async () => {
|
|
|
- try {
|
|
|
- // await ApiName({ id: row.id })
|
|
|
- this.$message.success('删除成功')
|
|
|
- this.onInit()
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(_ => {})
|
|
|
+ // onAdd () {
|
|
|
+ // this.$refs.fixedSalaryCalculationRefs.open()
|
|
|
+ // },
|
|
|
+ // onEdit (item) {
|
|
|
+ // this.$refs.fixedSalaryCalculationRefs.open(item)
|
|
|
+ // },
|
|
|
+ // onDelete (row) {
|
|
|
+ // this.$confirm('确定删除吗?', '提示')
|
|
|
+ // .then(async () => {
|
|
|
+ // try {
|
|
|
+ // // await ApiName({ id: row.id })
|
|
|
+ // this.$message.success('删除成功')
|
|
|
+ // this.onInit()
|
|
|
+ // } catch (error) {
|
|
|
+ // this.$message.error(error)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(_ => {})
|
|
|
+ // },
|
|
|
+ async onExport () {
|
|
|
+ this.exportLoading = true
|
|
|
+ try {
|
|
|
+ const { data, name } = await exportSalaryFixedList(this.exportOption)
|
|
|
+ downloadFile(data, name)
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ } finally {
|
|
|
+ this.exportLoading = false
|
|
|
+ }
|
|
|
},
|
|
|
onSearch () {
|
|
|
this.pageInfo.current = 1
|