|
@@ -1,6 +1,24 @@
|
|
|
<template>
|
|
|
<div class="pa-3 white">
|
|
|
<m-search :items="searchItems" v-model="searchValues" class="mb-3" @search="onSearch">
|
|
|
+ <template #button>
|
|
|
+ <m-button
|
|
|
+ :type="isEdit ? 'success' : 'primary'"
|
|
|
+ size="small"
|
|
|
+ :icon="isEdit ? 'el-icon-check' : 'el-icon-edit'"
|
|
|
+ @click="onDistribute"
|
|
|
+ >
|
|
|
+ {{ isEdit ? '保存分配' : '编辑分配'}}
|
|
|
+ </m-button>
|
|
|
+ <m-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-finished"
|
|
|
+ @click="onDistribute"
|
|
|
+ >
|
|
|
+ 确认分配
|
|
|
+ </m-button>
|
|
|
+ </template>
|
|
|
</m-search>
|
|
|
<m-table
|
|
|
:items="items"
|
|
@@ -11,21 +29,54 @@
|
|
|
:page-current="pageInfo.current"
|
|
|
@page-change="onPageChange"
|
|
|
@expand-change="onExpandChange"
|
|
|
- ></m-table>
|
|
|
+ >
|
|
|
+ <template #status="{ row }">
|
|
|
+ <el-tag :type="statusList[row.status].color">{{ statusList[row.status].text }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template #allocationPerformanceSalary="{ row }">
|
|
|
+ <template v-if="isEdit">
|
|
|
+ <el-input-number v-model="values[row.employeePerformanceId]" placeholder="分配绩效" size="small"></el-input-number>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ row.allocationPerformanceSalary }}
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </m-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { dateFormat } from '@/utils/date'
|
|
|
+import {
|
|
|
+ getAllocationPage,
|
|
|
+ saveAllocationGrant
|
|
|
+ // getAllocationEmployeeCategory
|
|
|
+} from '@/api/salary'
|
|
|
export default {
|
|
|
name: 'salary-allocation',
|
|
|
data () {
|
|
|
return {
|
|
|
+ values: {},
|
|
|
+ isEdit: false,
|
|
|
+ statusList: {
|
|
|
+ 0: {
|
|
|
+ text: '未分配',
|
|
|
+ color: 'warning'
|
|
|
+ },
|
|
|
+ 1: {
|
|
|
+ text: '已分配',
|
|
|
+ color: 'success'
|
|
|
+ },
|
|
|
+ 2: {
|
|
|
+ text: '已确认',
|
|
|
+ color: 'info'
|
|
|
+ }
|
|
|
+ },
|
|
|
searchItems: [
|
|
|
{
|
|
|
label: '月份',
|
|
|
prop: 'month',
|
|
|
- type: 'date',
|
|
|
+ type: 'datePicker',
|
|
|
option: {
|
|
|
placeholder: '请选择月份',
|
|
|
type: 'month',
|
|
@@ -37,17 +88,23 @@ export default {
|
|
|
searchValues: {
|
|
|
month: dateFormat('YYYY-mm', new Date())
|
|
|
},
|
|
|
+ query: {
|
|
|
+ month: dateFormat('YYYY-mm', new Date())
|
|
|
+ },
|
|
|
headers: [
|
|
|
{ label: '月份', prop: 'month' },
|
|
|
- { label: '状态', prop: 'state' },
|
|
|
- { label: '机构', prop: 'organizationName' },
|
|
|
- { label: '姓名', prop: 'employeeName' },
|
|
|
- { label: '统一认证号', prop: 'unifiedCertificationNumber' },
|
|
|
- { label: '岗位', prop: 'unifiedCertificationNumber' },
|
|
|
- { label: '当月薪资', prop: 'unifiedCertificationNumber' },
|
|
|
- { label: '可分配绩效金额', prop: 'unifiedCertificationNumber' },
|
|
|
- { label: '已分配绩效金额', prop: 'unifiedCertificationNumber' },
|
|
|
- { label: '操作', prop: 'action', align: 'center', width: 100 }
|
|
|
+ { label: '机构名称', prop: 'organizationName' },
|
|
|
+ { label: '员工姓名', prop: 'employeeName' },
|
|
|
+ { label: '分配状态', prop: 'status' },
|
|
|
+ { label: '员工类型', prop: 'employeeCategory' },
|
|
|
+ { label: '可分配绩效薪资', prop: 'assignablePerformanceSalary', width: 150 },
|
|
|
+ { label: '领导分配绩效薪资', prop: 'allocationPerformanceSalary', width: 150 },
|
|
|
+ { label: '基础绩效薪资', prop: 'basicPerformanceSalary', width: 120 },
|
|
|
+ { label: '总绩效薪资', prop: 'performanceSalary' },
|
|
|
+ { label: '数据来源', prop: 'dataType' },
|
|
|
+ { label: '数据版本', prop: 'version', width: 160 },
|
|
|
+ { label: '创建时间', prop: 'createDate', width: 160 },
|
|
|
+ { label: '操作', prop: 'actions', align: 'center', width: 100, fixed: 'right' }
|
|
|
],
|
|
|
items: [
|
|
|
],
|
|
@@ -57,10 +114,69 @@ export default {
|
|
|
current: 1,
|
|
|
size: 10
|
|
|
},
|
|
|
- method: {
|
|
|
- onExpandChange () {}
|
|
|
+ orders: []
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.onInit()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async onInit () {
|
|
|
+ try {
|
|
|
+ const { data } = await getAllocationPage({
|
|
|
+ page: {
|
|
|
+ ...this.pageInfo,
|
|
|
+ orders: this.orders
|
|
|
+ },
|
|
|
+ entity: {
|
|
|
+ ...this.searchValues
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.items = data.records.map(e => {
|
|
|
+ e.createDate = dateFormat('YYYY-mm-dd HH:MM:SS', new Date(e.createDate))
|
|
|
+ return e
|
|
|
+ })
|
|
|
+ this.total = data.total
|
|
|
+ } catch (error) {
|
|
|
+ this.$snackbar.error(error)
|
|
|
}
|
|
|
+ },
|
|
|
+ onSearch () {
|
|
|
+ this.pageInfo.current = 1
|
|
|
+ this.query = { ...this.searchValues }
|
|
|
+ this.onInit()
|
|
|
+ },
|
|
|
+ // 领导分配绩效薪资
|
|
|
+ onDistribute () {
|
|
|
+ if (this.isEdit) {
|
|
|
+ this.$confirm('确定保存当前数据?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.onSave()
|
|
|
+ }).catch((error) => {
|
|
|
+ this.$message.error(error)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.isEdit = !this.isEdit
|
|
|
+ },
|
|
|
+ async onSave () {
|
|
|
+ try {
|
|
|
+ const { data } = await saveAllocationGrant({
|
|
|
|
|
|
+ })
|
|
|
+ console.log(data)
|
|
|
+ } catch (error) {
|
|
|
+ this.$snackbar.error(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onDetails () {},
|
|
|
+ onExpandChange () {},
|
|
|
+ onPageChange (index) {
|
|
|
+ this.pageInfo.current = index
|
|
|
+ this.onInit()
|
|
|
}
|
|
|
}
|
|
|
}
|