|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
<el-form :model="searchForm" inline label-width="0"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="searchForm.peroid" |
|
|
|
|
v-model="searchForm.period" |
|
|
|
|
type="month" |
|
|
|
|
format="YYYY-MM" |
|
|
|
|
value-format="YYYY-MM" |
|
|
|
@ -16,15 +16,17 @@ |
|
|
|
|
<el-button @click="getList" v-hasPermi="['kpi:score:search']"> 搜索</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<el-tabs v-model="searchForm.employeeId" @tab-click="getList"> |
|
|
|
|
<el-tabs v-model="employeeId" @tab-click="getList"> |
|
|
|
|
<el-tab-pane |
|
|
|
|
v-for="item in employeeOptions" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:name="item.id" |
|
|
|
|
:key="item.examinedUser" |
|
|
|
|
:label="item.examinedUserName" |
|
|
|
|
:name="item.examinedUser" |
|
|
|
|
> |
|
|
|
|
<div class="mb-10px"> |
|
|
|
|
<el-tag v-if="peroidSaved" type="danger"> 当前周期已封存,不可修改当月绩效考核 </el-tag> |
|
|
|
|
<el-tag v-if="periodSaved == 1" type="danger"> |
|
|
|
|
当前周期已封存,不可修改当月绩效考核 |
|
|
|
|
</el-tag> |
|
|
|
|
<el-tag v-else type="warning"> |
|
|
|
|
当前周期未封存,可选择修改当月绩效考核,两秒内不操作将自动保存考核结果 |
|
|
|
|
</el-tag> |
|
|
|
@ -37,28 +39,28 @@ |
|
|
|
|
show-summary |
|
|
|
|
:summary-method="getSummaries" |
|
|
|
|
> |
|
|
|
|
<el-table-column prop="name" label="考核指标" width="180" /> |
|
|
|
|
<el-table-column prop="examineTarget" label="考核指标" width="180" /> |
|
|
|
|
<el-table-column prop="type" label="分值模式" width="90" /> |
|
|
|
|
<el-table-column prop="rate" label="权重%" width="90" /> |
|
|
|
|
<el-table-column prop="weight" label="权重%" width="90" /> |
|
|
|
|
<el-table-column label="考核内容"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<div v-dompurify-html="row.kaoheneirong"></div> |
|
|
|
|
<div v-dompurify-html="row.examineContent"></div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="考核规则" prop="kaoheguize"> |
|
|
|
|
<el-table-column label="考核规则" prop="examineRule"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<div v-dompurify-html="row.kaoheguize"></div> |
|
|
|
|
<div v-dompurify-html="row.examineRule"></div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="评分上限" prop="maxScore" width="90" /> |
|
|
|
|
<el-table-column label="评分上限" prop="examineScore" width="90" /> |
|
|
|
|
<el-table-column label="考核评分" width="120"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<div v-if="peroidSaved">{{ row.score }}</div> |
|
|
|
|
<div v-if="periodSaved == 1">{{ row.score }}</div> |
|
|
|
|
<el-input-number |
|
|
|
|
v-else |
|
|
|
|
v-model="row.score" |
|
|
|
|
:min="0" |
|
|
|
|
:max="row.maxScore" |
|
|
|
|
:max="row.examineScore" |
|
|
|
|
:step="1" |
|
|
|
|
:controls="false" |
|
|
|
|
size="small" |
|
|
|
@ -69,7 +71,7 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="评分备注" width="200"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<div v-if="peroidSaved">{{ row.remark }}</div> |
|
|
|
|
<div v-if="periodSaved == 1">{{ row.remark }}</div> |
|
|
|
|
<el-input |
|
|
|
|
v-else |
|
|
|
|
v-model="row.remark" |
|
|
|
@ -81,7 +83,14 @@ |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="加权得分" prop="jiaquandefen" width="90" /> |
|
|
|
|
<el-table-column label="加权得分" prop="weightSocre" width="90" /> |
|
|
|
|
<el-table-column label="操作" fixed="right" width="100"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<el-button style="padding: 0" type="danger" text @click="handleDelete(row)"> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</el-tab-pane> |
|
|
|
|
</el-tabs> |
|
|
|
@ -90,70 +99,52 @@ |
|
|
|
|
|
|
|
|
|
<script setup name="KpiScore"> |
|
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
|
import * as KpiApi from '@/api/kpi/index.js' |
|
|
|
|
import * as KpiApi from '@/api/kpi/score.js' |
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
|
const loading = ref(false) // 列表的加载中 |
|
|
|
|
const list = ref() // 列表的数据 |
|
|
|
|
const list = ref([]) // 列表的数据 |
|
|
|
|
const searchForm = ref({ |
|
|
|
|
peroid: undefined, |
|
|
|
|
employeeId: undefined |
|
|
|
|
period: undefined |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const peroidSaved = ref(true) |
|
|
|
|
const periodSaved = ref(0) |
|
|
|
|
|
|
|
|
|
const employeeOptions = ref([]) |
|
|
|
|
const employeeId = ref('') |
|
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
|
onMounted(() => { |
|
|
|
|
// 默认取上个月 |
|
|
|
|
const today = new Date() |
|
|
|
|
searchForm.value.peroid = formatDate( |
|
|
|
|
searchForm.value.period = formatDate( |
|
|
|
|
new Date(today.getFullYear(), today.getMonth() - 1), |
|
|
|
|
'YYYY-MM' |
|
|
|
|
) |
|
|
|
|
// 获取当前要考核的人员 |
|
|
|
|
const list = await KpiApi.getKpiEmployees() |
|
|
|
|
employeeOptions.value = list || [] |
|
|
|
|
if (employeeOptions.value.length > 0) { |
|
|
|
|
searchForm.value.employeeId = employeeOptions.value[0].id |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
KpiApi.getKpiPeriodStatus({ period: searchForm.value.period }).then((data) => { |
|
|
|
|
periodSaved.value = data.status |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
getList() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
async function getList() { |
|
|
|
|
if (!searchForm.value.employeeId) { |
|
|
|
|
try { |
|
|
|
|
// 获取当前要考核的人员 |
|
|
|
|
const arr = await KpiApi.getKpiEmployees(searchForm.value) |
|
|
|
|
employeeOptions.value = arr || [] |
|
|
|
|
if (employeeOptions.value.length > 0) { |
|
|
|
|
if (!employeeId.value) { |
|
|
|
|
employeeId.value = employeeOptions.value[0].examinedUser |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
message.error('当月无待考核员工!!!') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
loading.value = true |
|
|
|
|
try { |
|
|
|
|
const data = [ |
|
|
|
|
{ |
|
|
|
|
name: '纳税申报', |
|
|
|
|
rate: 40, |
|
|
|
|
kaoheneirong: |
|
|
|
|
'<p>1、每个月13号之前在柠檬云财税把上个月的财务数据录入系统出具财务报表;</p><p>2、社保和公积金及时增减人员,做好核定工作,及时申报缴纳;</p><p>3、按照税务局规定时间把自己所负责的公司增指税、附加税、所得税以及其他税种申报完成</p>', |
|
|
|
|
kaoheguize: `当天处理完今日线索,连续2天未处理完,一次扣2分,最多扣5分`, |
|
|
|
|
maxScore: 20, |
|
|
|
|
score: 10, |
|
|
|
|
checkEmployees: [1, 3, 4], |
|
|
|
|
jiaquandefen: 4 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: '数据统计', |
|
|
|
|
rate: 20, |
|
|
|
|
kaoheneirong: |
|
|
|
|
'<p>1、每个月13号之前在柠檬云财税把上个月的财务数据录入系统出具财务报表;</p><p>2、社保和公积金及时增减人员,做好核定工作,及时申报缴纳;</p><p>3、按照税务局规定时间把自己所负责的公司增指税、附加税、所得税以及其他税种申报完成</p>', |
|
|
|
|
kaoheguize: `当天处理完今日线索,连续2天未处理完,一次扣2分,最多扣5分`, |
|
|
|
|
maxScore: 10, |
|
|
|
|
score: 8, |
|
|
|
|
checkEmployees: [1, 3, 4], |
|
|
|
|
jiaquandefen: 1.6 |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
list.value = data |
|
|
|
|
list.value = |
|
|
|
|
employeeOptions.value.find((it) => it.examinedUser == employeeId.value) |
|
|
|
|
?.examineScoreRespVOList || [] |
|
|
|
|
} finally { |
|
|
|
|
loading.value = false |
|
|
|
|
} |
|
|
|
@ -161,12 +152,37 @@ async function getList() { |
|
|
|
|
|
|
|
|
|
let timer = ref(null) |
|
|
|
|
const lastId = ref('') |
|
|
|
|
function handleSave() { |
|
|
|
|
function handleSave(row) { |
|
|
|
|
try { |
|
|
|
|
lastId.value == row.id && clearTimeout(timer.value) |
|
|
|
|
// clearTimeout(timer.value) |
|
|
|
|
timer.value = setTimeout(() => { |
|
|
|
|
message.success('正在保存数据,请稍后') |
|
|
|
|
timer.value = setTimeout(async () => { |
|
|
|
|
lastId.value = row.id |
|
|
|
|
// message.success('正在保存数据,请稍后') |
|
|
|
|
await KpiApi.saveKpiScore({ |
|
|
|
|
id: row.id, |
|
|
|
|
score: row.score, |
|
|
|
|
remark: row.remark |
|
|
|
|
}) |
|
|
|
|
message.success('修改成功!') |
|
|
|
|
getList() |
|
|
|
|
}, 2000) |
|
|
|
|
} catch (err) { |
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function handleDelete(row) { |
|
|
|
|
try { |
|
|
|
|
// 删除的二次确认 |
|
|
|
|
await message.delConfirm( |
|
|
|
|
`删除后,该员工于${searchForm.value.period}将不再考核此项,是否确认删除?` |
|
|
|
|
) |
|
|
|
|
// 发起删除 |
|
|
|
|
await KpiApi.deleteKpiItem({ id: row.id }) |
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
// 刷新列表 |
|
|
|
|
await getList() |
|
|
|
|
} catch {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getSummaries({ columns, data }) { |
|
|
|
@ -178,7 +194,7 @@ function getSummaries({ columns, data }) { |
|
|
|
|
} |
|
|
|
|
const values = data.map((item) => Number(item[column.property])) |
|
|
|
|
if (!values.every((value) => Number.isNaN(value))) { |
|
|
|
|
if (column.property == 'jiaquandefen') { |
|
|
|
|
if (column.property == 'weightSocre') { |
|
|
|
|
sums[index] = 5.6 |
|
|
|
|
} else { |
|
|
|
|
sums[index] = '' |
|
|
|
|