|
@@ -1,70 +1,34 @@
|
|
|
<template>
|
|
|
<div class="white pa-3">
|
|
|
<m-search :items="searchItems" v-model="searchValues" class="mb-3" @search="onSearch"></m-search>
|
|
|
- <BonusTable ref="bonusTableRefs">
|
|
|
+ <BonusTable ref="bonusTableRefs" :filter-header="auditStatus !== 0 && auditStatus !== 1 ? [] : ['actions']">
|
|
|
<template #header="{ items }">
|
|
|
- <div class="content">
|
|
|
+ <div class="content mb-3">
|
|
|
<div>
|
|
|
- 可发放绩效:<el-tag>{{ totalAllocationPerformanceSalary }}</el-tag>
|
|
|
- 总绩效: <el-tag>{{ totalGrantPerformanceSalary }}</el-tag>
|
|
|
<template v-if="auditStatusList[auditStatus]">
|
|
|
- 审批状态:<el-tag :type="auditStatusList[auditStatus]?.type ?? 'info'">{{ auditStatusList[auditStatus]?.label ?? '未知状态' }}</el-tag>
|
|
|
+ 审批状态:
|
|
|
+ <el-tag :type="auditStatusList[auditStatus]?.type ?? 'info'" class="mr-3">
|
|
|
+ {{ auditStatusList[auditStatus]?.label ?? '未知状态' }}
|
|
|
+ </el-tag>
|
|
|
</template>
|
|
|
- <el-button
|
|
|
- class="ml-3"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- :loading="auditStatusLoading"
|
|
|
- :disabled="auditStatus === 0 || auditStatus === 1 || !items.length"
|
|
|
- @click="onSave">
|
|
|
- 确认分配
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #actions="{ row }">
|
|
|
- <el-input :disabled="auditStatusLoading" v-model="values[row.employeePerformanceId]" placeholder="请输入绩效" size="small"></el-input>
|
|
|
- </template>
|
|
|
- </BonusTable>
|
|
|
- <!-- <m-table
|
|
|
- :items="items"
|
|
|
- :headers="headers"
|
|
|
- v-loading="loading"
|
|
|
- :total="total"
|
|
|
- :page-size="pageInfo.size"
|
|
|
- :page-current="pageInfo.current"
|
|
|
- @page-change="onPageChange"
|
|
|
- >
|
|
|
- <template #header>
|
|
|
- <div class="content">
|
|
|
- <div>
|
|
|
可发放绩效:<el-tag>{{ totalAllocationPerformanceSalary }}</el-tag>
|
|
|
总绩效: <el-tag>{{ totalGrantPerformanceSalary }}</el-tag>
|
|
|
- <template v-if="auditStatusList[auditStatus]">
|
|
|
- 审批状态:<el-tag :type="auditStatusList[auditStatus]?.type ?? 'info'">{{ auditStatusList[auditStatus]?.label ?? '未知状态' }}</el-tag>
|
|
|
- </template>
|
|
|
<el-button
|
|
|
class="ml-3"
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
:loading="auditStatusLoading"
|
|
|
- :disabled="auditStatus === 0 || auditStatus === 1 || !items.length"
|
|
|
+ v-show="auditStatus !== 0 && auditStatus !== 1 && items.length"
|
|
|
@click="onSave">
|
|
|
确认分配
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #status="{ row }">
|
|
|
- <el-tag :type="statusList[row.status].color">{{ statusList[row.status].text }}</el-tag>
|
|
|
- </template>
|
|
|
- <template #dataType="{row}">
|
|
|
- {{ row.dataType === 1 ? '手工数据' : '系统数据' }}
|
|
|
+ <template #actions="{ row, items }">
|
|
|
+ <el-input v-show="auditStatus !== 0 && auditStatus !== 1 && items.length" v-model="values[row.employeePerformanceId]" placeholder="请输入绩效" size="small"></el-input>
|
|
|
</template>
|
|
|
- <template #actions="{ row }">
|
|
|
- <el-input :disabled="auditStatusLoading" v-model="values[row.employeePerformanceId]" placeholder="请输入绩效" size="small"></el-input>
|
|
|
- </template>
|
|
|
- </m-table> -->
|
|
|
+ </BonusTable>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -95,20 +59,6 @@ export default {
|
|
|
auditStatus: null,
|
|
|
auditStatusLoading: true,
|
|
|
values: {},
|
|
|
- statusList: {
|
|
|
- 0: {
|
|
|
- text: '未分配',
|
|
|
- color: 'warning'
|
|
|
- },
|
|
|
- 1: {
|
|
|
- text: '已分配',
|
|
|
- color: 'success'
|
|
|
- },
|
|
|
- 2: {
|
|
|
- text: '已确认',
|
|
|
- color: 'info'
|
|
|
- }
|
|
|
- },
|
|
|
searchValues: {
|
|
|
month: dateFormat('YYYY-mm', new Date()),
|
|
|
organizationNo: null,
|
|
@@ -117,32 +67,10 @@ export default {
|
|
|
query: {
|
|
|
month: dateFormat('YYYY-mm', new Date())
|
|
|
},
|
|
|
- // headers: [
|
|
|
- // { label: '月份', prop: 'month' },
|
|
|
- // { label: '机构名称', prop: 'organizationName', width: 150 },
|
|
|
- // { label: '员工姓名', prop: 'employeeName' },
|
|
|
- // { label: '分配状态', prop: 'status', align: 'center' },
|
|
|
- // { label: '员工类型', prop: 'employeeCategory', align: 'center' },
|
|
|
- // { label: '可分配绩效薪资', prop: 'assignablePerformanceSalary', align: 'center', width: 150 },
|
|
|
- // { label: '领导分配绩效薪资', prop: 'allocationPerformanceSalary', align: 'center', width: 150 },
|
|
|
- // { label: '基础绩效薪资', prop: 'basicPerformanceSalary', align: 'center', width: 120 },
|
|
|
- // { label: '总绩效薪资', prop: 'performanceSalary', align: 'center', width: 120 },
|
|
|
- // { label: '数据来源', prop: 'dataType', align: 'center' },
|
|
|
- // { label: '数据版本', prop: 'version', width: 160 },
|
|
|
- // { label: '创建时间', prop: 'createDate', width: 160 },
|
|
|
- // { label: '操作', prop: 'actions', width: 160, fixed: 'right' }
|
|
|
- // ],
|
|
|
- // items: [],
|
|
|
- // loading: false,
|
|
|
- // total: 0,
|
|
|
- // pageInfo: {
|
|
|
- // current: 1,
|
|
|
- // size: 50
|
|
|
- // },
|
|
|
- // orders: [],
|
|
|
employeeCategoryItems: [],
|
|
|
totalGrantPerformanceSalary: 0,
|
|
|
- deptItems: []
|
|
|
+ deptItems: [],
|
|
|
+ loading: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -206,40 +134,27 @@ export default {
|
|
|
this.loading = true
|
|
|
this.onGetDept()
|
|
|
await this.getEmployeeCategoryItems()
|
|
|
- this.onInit()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.onInit()
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
- // async onInit () {
|
|
|
- // this.loading = true
|
|
|
- // try {
|
|
|
- // const { data } = await getAllocationPage({
|
|
|
- // page: {
|
|
|
- // ...this.pageInfo,
|
|
|
- // orders: this.orders
|
|
|
- // },
|
|
|
- // entity: {
|
|
|
- // ...this.searchValues
|
|
|
- // }
|
|
|
- // })
|
|
|
- // await this.onCheckStatus()
|
|
|
- // await this.onStatistics()
|
|
|
- // data.records.forEach(e => {
|
|
|
- // if (Object.prototype.hasOwnProperty.call(this.values, e.employeePerformanceId)) {
|
|
|
- // return
|
|
|
- // }
|
|
|
- // this.$set(this.values, e.employeePerformanceId, e.allocationPerformanceSalary || null)
|
|
|
- // })
|
|
|
- // 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.$message.error(error)
|
|
|
- // } finally {
|
|
|
- // this.loading = false
|
|
|
- // }
|
|
|
- // },
|
|
|
+ async onInit (pageInfo) {
|
|
|
+ this.loading = true
|
|
|
+ await this.onCheckStatus()
|
|
|
+ await this.onStatistics()
|
|
|
+ const data = await this.$refs.bonusTableRefs.onInit(this.query, pageInfo)
|
|
|
+ this.loading = false
|
|
|
+ if (!data) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ data.records.forEach(e => {
|
|
|
+ if (Object.prototype.hasOwnProperty.call(this.values, e.employeePerformanceId)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$set(this.values, e.employeePerformanceId, e.allocationPerformanceSalary || null)
|
|
|
+ })
|
|
|
+ },
|
|
|
async onGetDept () {
|
|
|
const data = await getOrganizationTree()
|
|
|
if (!data) {
|
|
@@ -269,16 +184,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onSearch () {
|
|
|
- this.pageInfo.current = 1
|
|
|
this.query = { ...this.searchValues }
|
|
|
- this.onInit()
|
|
|
+ this.onInit({ current: 1 })
|
|
|
},
|
|
|
// 领导分配绩效薪资
|
|
|
onSave () {
|
|
|
const h = this.$createElement
|
|
|
const _el = [
|
|
|
- h('p', undefined, `更新月份:${this.query.month}`),
|
|
|
- h('p', undefined, `更新物业线:${this.query.category ?? null}`)
|
|
|
+ h('p', undefined, `提交月份:${this.query.month}`),
|
|
|
+ h('p', undefined, `提交员工类型:${this.query.employeeCategory ?? null}`)
|
|
|
]
|
|
|
try {
|
|
|
if (this.totalGrantPerformanceSalary !== this.totalAllocationPerformanceSalary) {
|
|
@@ -292,9 +206,7 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.onSaveAll(true)
|
|
|
- }).catch(_ => {
|
|
|
- this.onSaveAll(false)
|
|
|
- })
|
|
|
+ }).catch(_ => {})
|
|
|
return
|
|
|
}
|
|
|
const el = h('div', [
|