qsh 4 weeks ago
parent ca10366398
commit e5e141fb84
  1. 31
      src/api/kpi/score.js
  2. 24
      src/views/Kpi/Appraise/Components/DialogAppraise.vue
  3. 17
      src/views/Kpi/Appraise/index.vue
  4. 6
      src/views/Kpi/Record/index.vue
  5. 148
      src/views/Kpi/Score/index.vue

@ -0,0 +1,31 @@
import request from '@/config/axios'
// 打分数据
export const getKpiEmployees = (params) => {
return request.get({ url: '/admin-api/oa/examine-score/getExamineUserExamineScore', params })
}
// 保存考勤打分数据
export const saveKpiScore = (data) => {
return request.put({ url: '/admin-api/oa/examine-score/update', data })
}
// 删除考核项
export const deleteKpiItem = (params) => {
return request.delete({ url: '/admin-api/oa/examine-score/delete', params })
}
// 考评分页数据
export const getScorePage = (params) => {
return request.get({ url: '/admin-api/oa/examine-period/page', params })
}
// 封存
export const saveScoreRecord = (params) => {
return request.get({ url: '/admin-api/oa/examine-period/confirm', params })
}
// 查询周期是否已封存
export const getKpiPeriodStatus = (params) => {
return request.get({ url: '/admin-api/oa/examine-period/getExaminePeriodByPeriod', params })
}

@ -23,9 +23,13 @@
<el-col :span="24" :offset="0">
<el-form-item label="模式" prop="type">
<el-radio-group v-model="form.type">
<el-radio :label="1"> 加总分 </el-radio>
<el-radio :label="2"> 减总分 </el-radio>
<el-radio :label="3"> 权重分 </el-radio>
<el-radio
v-for="(item, index) in prop.kpiModeOoptions"
:key="index"
:label="item.value"
>
{{ item.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -108,7 +112,13 @@
<script setup name="DialogAppraise">
import * as KpiApi from '@/api/kpi/index.js'
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
const prop = defineProps({
kpiModeOoptions: {
type: Array,
default: () => []
}
})
const { t } = useI18n() //
const message = useMessage() //
@ -144,22 +154,18 @@ async function open(type, val) {
isIndeterminate.value = checkedCount > 0 && checkedCount < employeeOptions.value.length
}
const kpiModeOoptions = ref([])
function getOptions() {
KpiApi.getKpiEmployees().then((data) => {
employeeOptions.value = data
handleCheckAllChange(true)
checkAll.value = true
})
getGeneralSysDictData('message_type').then((data) => {
kpiModeOoptions.value = data
})
}
function resetForm() {
form.value = {
examineTarget: '',
type: 4,
type: '3',
weight: 0,
examineContent: ``,
examineRule: ``,

@ -22,7 +22,7 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list" border>
<el-table-column prop="examineTarget" label="考核指标" width="180" />
<el-table-column prop="type" label="分值模式" width="90" />
<el-table-column prop="type" label="分值模式" width="90" :formatter="getKpiModeLabel" />
<el-table-column prop="weight" label="权重%" width="90" />
<el-table-column label="考核内容">
<template #default="{ row }">
@ -69,7 +69,7 @@
@pagination="getList"
/>
<DialogAppraise ref="formRef" @success="handleQuery" />
<DialogAppraise ref="formRef" :kpiModeOoptions="kpiModeOoptions" @success="handleQuery" />
</div>
</template>
@ -77,6 +77,7 @@
import { removeNullField } from '@/utils'
import DialogAppraise from './Components/DialogAppraise.vue'
import * as KpiApi from '@/api/kpi/index.js'
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
const { t } = useI18n() //
const message = useMessage() //
@ -91,9 +92,21 @@ const total = ref(0)
/** 初始化 **/
onMounted(() => {
getOptions()
handleQuery()
})
const kpiModeOoptions = ref([])
function getOptions() {
getGeneralSysDictData('examine_type').then((data) => {
kpiModeOoptions.value = data
})
}
function getKpiModeLabel(row) {
return kpiModeOoptions.value.find((it) => it.value == row.type)?.label
}
const getList = async () => {
loading.value = true
try {

@ -96,7 +96,7 @@
<script setup name="KpiRecord">
import { removeNullField } from '@/utils'
import * as FalseDiligenceApi from '@/api/home/falseDiligence.js'
import * as KpiApi from '@/api/kpi/score.js'
const message = useMessage() //
@ -133,7 +133,7 @@ async function getList() {
month: new Date(params.period).getMonth() + 1
}
}
const data = await FalseDiligenceApi.getPage(removeNullField(params))
const data = await KpiApi.getScorePage(removeNullField(params))
if (searchForm.value.name) {
tableList.value = data.list.reduce((pre, cur) => {
return pre.concat(cur.userDingAttendanceRespVOList)
@ -176,7 +176,7 @@ async function handleSealup(row) {
//
await message.confirm('确认要封存"' + row.period + '"假勤吗?')
//
await FalseDiligenceApi.saveFalseDiligence({
await KpiApi.saveFalseDiligence({
period: row.period
})
message.success('封存成功!')

@ -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) {
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
//
const arr = await KpiApi.getKpiEmployees(searchForm.value)
employeeOptions.value = arr || []
if (employeeOptions.value.length > 0) {
if (!employeeId.value) {
employeeId.value = employeeOptions.value[0].examinedUser
}
]
list.value = data
} else {
message.error('当月无待考核员工!!!')
return
}
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() {
lastId.value == row.id && clearTimeout(timer.value)
// clearTimeout(timer.value)
timer.value = setTimeout(() => {
message.success('正在保存数据,请稍后')
}, 2000)
function handleSave(row) {
try {
lastId.value == row.id && clearTimeout(timer.value)
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] = ''

Loading…
Cancel
Save