qsh 4 weeks ago
parent 4726770e3f
commit d39ea3270e
  1. 42
      src/api/kpi/index.js
  2. 103
      src/views/Kpi/Appraise/Components/DialogAppraise.vue
  3. 56
      src/views/Kpi/Appraise/index.vue
  4. 28
      src/views/Kpi/Score/index.vue
  5. 8
      src/views/Pers/Employee/Comp/DialogEmployee.vue
  6. 2
      src/views/Pers/Employee/index.vue

@ -0,0 +1,42 @@
import request from '@/config/axios'
// 创建
export const createKpi = (data) => {
return request.post({
url: '/admin-api/oa/examine-configuration/create',
data,
isSubmitForm: true
})
}
// 修改
export const updateKpi = (data) => {
return request.put({ url: '/admin-api/oa/examine-configuration/update', data })
}
// 修改状态
export const updateKpiStatus = (data) => {
return request.put({ url: '/admin-api/oa/examine-configuration/status/update', data })
}
// 分页
export const getKpiPage = (params) => {
return request.get({ url: '/admin-api/oa/examine-configuration/page', params })
}
// 详情
export const getKpiDetail = (id) => {
return request.get({ url: '/admin-api/oa/examine-configuration/get', params: { id } })
}
// 删除
export const deleteKpi = (id) => {
return request.delete({ url: '/admin-api/oa/examine-configuration/delete', params: { id } })
}
//
export const getKpiEmployees = () => {
return request.get({
url: '/admin-api/oa/employee/examinedEmployees'
})
}

@ -1,31 +1,55 @@
<template> <template>
<Dialog :title="title" v-model="show" width="800px"> <Dialog :title="title" v-model="show" width="800px">
<el-form v-loading="formLoading" :model="form" ref="formRef" :rules="rules" label-width="80px"> <el-form v-loading="formLoading" :model="form" ref="formRef" :rules="rules" label-width="80px">
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="考核指标" prop="examineTarget">
<el-input v-model="form.examineTarget" placeholder="请输入" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="生效日期" prop="effectiveDate">
<el-date-picker
v-model="form.effectiveDate"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期时间"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<el-form-item label="考核指标" prop="name"> <el-form-item label="模式" prop="type">
<el-input v-model="form.name" placeholder="请输入" /> <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 :label="4"> 减权重分 </el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="权重" prop="rate"> <el-form-item label="权重" prop="weight">
<el-input-number v-model="form.rate" :min="0" :step="1" :controls="false" /> <el-input-number v-model="form.weight" :min="0" :step="1" :controls="false" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" :offset="0"> <el-col :span="12" :offset="0">
<el-form-item label="评分上限" prop="maxScore"> <el-form-item label="评分上限" prop="examineScore">
<el-input-number v-model="form.maxScore" :min="0" :step="1" :controls="false" /> <el-input-number v-model="form.examineScore" :min="0" :step="1" :controls="false" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<el-form-item label="考核内容" prop="kaoheneirong"> <el-form-item label="考核内容" prop="examineContent">
<Editor <Editor
v-model:modelValue="form.kaoheneirong" v-model:modelValue="form.examineContent"
height="150px" height="150px"
:toolbarConfig="{ :toolbarConfig="{
toolbarKeys: [] toolbarKeys: []
@ -37,9 +61,9 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<el-form-item label="考核规则" prop="kaoheguize"> <el-form-item label="考核规则" prop="examineRule">
<Editor <Editor
v-model:modelValue="form.kaoheguize" v-model:modelValue="form.examineRule"
height="150px" height="150px"
:toolbarConfig="{ toolbarKeys: [] }" :toolbarConfig="{ toolbarKeys: [] }"
style="width: 100%" style="width: 100%"
@ -49,7 +73,7 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24" :offset="0"> <el-col :span="24" :offset="0">
<el-form-item label="考核员工" prop="checkEmployees"> <el-form-item label="考核员工" prop="examinedUserIdList">
<div> <div>
<el-checkbox <el-checkbox
v-model="checkAll" v-model="checkAll"
@ -58,10 +82,11 @@
> >
全选 全选
</el-checkbox> </el-checkbox>
<el-checkbox-group v-model="form.checkEmployees" @change="handleCheckedChange"> <el-checkbox-group v-model="form.examinedUserIdList" @change="handleCheckedChange">
<el-checkbox <el-checkbox
v-for="item in employeeOptions" v-for="item in employeeOptions"
:key="item.id" :key="item.id"
:disabled="item.status == 1"
:label="item.id" :label="item.id"
:value="item.id" :value="item.id"
> >
@ -83,7 +108,7 @@
</template> </template>
<script setup name="DialogAppraise"> <script setup name="DialogAppraise">
// import * as ResourceApi from '@/api/system/library/resource' import * as KpiApi from '@/api/kpi/index.js'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -95,9 +120,10 @@ const formType = ref('create')
const form = ref({}) const form = ref({})
const formLoading = ref(false) const formLoading = ref(false)
const rules = ref({ const rules = ref({
name: { required: true, message: '标题不可为空', trigger: 'blur' }, examineTarget: { required: true, message: '标题不可为空', trigger: 'blur' },
kaoheneirong: { required: true, message: '标题不可为空', trigger: 'blur' }, effectiveDate: { required: true, message: '生效日期不可为空', trigger: 'blur,change' },
kaoheguize: { required: true, message: '标题不可为空', trigger: 'blur' } examineContent: { required: true, message: '标题不可为空', trigger: 'blur' },
examineRule: { required: true, message: '标题不可为空', trigger: 'blur' }
}) })
async function open(type, val) { async function open(type, val) {
@ -105,28 +131,36 @@ async function open(type, val) {
title.value = type == 'update' ? '修改考核项' : '新增考核项' title.value = type == 'update' ? '修改考核项' : '新增考核项'
formType.value = type formType.value = type
resetForm() resetForm()
if (val?.id) { if (val) {
formLoading.value = true formLoading.value = true
try { try {
// form.value = await ResourceApi.getResource(id) form.value = await KpiApi.getKpiDetail(val)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} else if (val.name) {
form.value = { ...val }
} }
const checkedCount = form.value.checkEmployees?.length || 0 getOptions()
const checkedCount = form.value.examinedUserIdList?.length || 0
isIndeterminate.value = checkedCount > 0 && checkedCount < employeeOptions.value.length isIndeterminate.value = checkedCount > 0 && checkedCount < employeeOptions.value.length
} }
function getOptions() {
KpiApi.getKpiEmployees().then((data) => {
employeeOptions.value = data
handleCheckAllChange(true)
checkAll.value = true
})
}
function resetForm() { function resetForm() {
form.value = { form.value = {
name: '', examineTarget: '',
rate: 0, type: 4,
kaoheneirong: ``, weight: 0,
kaoheguize: ``, examineContent: ``,
maxScore: 5, examineRule: ``,
checkEmployees: [] examineScore: 5,
examinedUserIdList: []
} }
} }
@ -145,15 +179,15 @@ async function handleSave() {
formLoading.value = true formLoading.value = true
try { try {
if (formType.value === 'create') { if (formType.value === 'create') {
// await ResourceApi.createResource(form.value) await KpiApi.createKpi(form.value)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
// await ResourceApi.updateResource(form.value) await KpiApi.updateKpi(form.value)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
show.value = false show.value = false
// //
emit('success', form.value) emit('success')
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -161,15 +195,10 @@ async function handleSave() {
const checkAll = ref(false) const checkAll = ref(false)
const isIndeterminate = ref(false) const isIndeterminate = ref(false)
const employeeOptions = ref([ const employeeOptions = ref([])
{ id: 1, name: '武大郎' },
{ id: 2, name: '李二郎' },
{ id: 3, name: '拼命三郎' },
{ id: 4, name: '杨四郎' }
])
function handleCheckAllChange(val) { function handleCheckAllChange(val) {
form.value.checkEmployees = val ? employeeOptions.value.map((it) => it.id) : [] form.value.examinedUserIdList = val ? employeeOptions.value.map((it) => it.id) : []
isIndeterminate.value = false isIndeterminate.value = false
} }

@ -3,7 +3,7 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="searchForm" ref="queryFormRef" inline label-width="0"> <el-form :model="searchForm" ref="queryFormRef" inline label-width="0">
<el-form-item> <el-form-item>
<el-input v-model="searchForm.name" placeholder="请输入考核指标" clearable /> <el-input v-model="searchForm.examineTarget" placeholder="请输入考核指标" clearable />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery" v-hasPermi="['kpi:appraise:search']"> 搜索</el-button> <el-button @click="handleQuery" v-hasPermi="['kpi:appraise:search']"> 搜索</el-button>
@ -21,30 +21,32 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" :data="list" border> <el-table v-loading="loading" :data="list" border>
<el-table-column prop="name" label="考核指标" width="180" /> <el-table-column prop="examineTarget" label="考核指标" width="180" />
<el-table-column prop="rate" label="权重%" width="90" /> <el-table-column prop="type" label="分值模式" width="90" />
<el-table-column prop="weight" label="权重%" width="90" />
<el-table-column label="考核内容"> <el-table-column label="考核内容">
<template #default="{ row }"> <template #default="{ row }">
<div v-dompurify-html="row.kaoheneirong"></div> <div v-dompurify-html="row.examineContent"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="考核规则" prop="kaoheguize"> <el-table-column label="考核规则" prop="examineRule">
<template #default="{ row }"> <template #default="{ row }">
<div v-dompurify-html="row.kaoheguize"></div> <div v-dompurify-html="row.examineRule"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="评分上限" prop="maxScore" width="90" /> <el-table-column label="评分上限" prop="examineScore" width="90" />
<el-table-column label="考核人数" width="90"> <el-table-column label="考核人数" width="90">
<template #default="{ row }"> <template #default="{ row }">
{{ row.checkEmployees?.length || 0 }} {{ row.examinedUserIdList?.length || 0 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生效日期" prop="effectiveDate" width="120" />
<el-table-column label="操作" class-name="fixed-width" width="120"> <el-table-column label="操作" class-name="fixed-width" width="120">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
link link
type="primary" type="primary"
@click="openForm('update', row)" @click="openForm('update', row.id)"
v-hasPermi="['kpi:appraise:update']" v-hasPermi="['kpi:appraise:update']"
> >
修改 修改
@ -72,13 +74,16 @@
</template> </template>
<script setup name="KpiContent"> <script setup name="KpiContent">
import { removeNullField } from '@/utils'
import DialogAppraise from './Components/DialogAppraise.vue' import DialogAppraise from './Components/DialogAppraise.vue'
import * as KpiApi from '@/api/kpi/index.js'
const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const loading = ref(false) // const loading = ref(false) //
const list = ref() // const list = ref([]) //
const searchForm = ref({ const searchForm = ref({
name: undefined, examineTarget: undefined,
pageNo: 1, pageNo: 1,
pageSize: 20 pageSize: 20
}) })
@ -89,33 +94,20 @@ onMounted(() => {
handleQuery() handleQuery()
}) })
const getList = async (info) => { const getList = async () => {
loading.value = true loading.value = true
try { try {
const data = [ const data = await KpiApi.getKpiPage(removeNullField(searchForm.value))
{ list.value = data.list
name: '纳税申报',
rate: 35,
kaoheneirong:
'<p>1、每个月13号之前在柠檬云财税把上个月的财务数据录入系统出具财务报表;</p><p>2、社保和公积金及时增减人员,做好核定工作,及时申报缴纳;</p><p>3、按照税务局规定时间把自己所负责的公司增指税、附加税、所得税以及其他税种申报完成</p>',
kaoheguize: `当天处理完今日线索,连续2天未处理完,一次扣2分,最多扣5分`,
maxScore: 5,
checkEmployees: [1, 3, 4]
}
]
if (info) {
data.push(info)
}
list.value = data
} finally { } finally {
loading.value = false loading.value = false
} }
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = (info) => { const handleQuery = () => {
searchForm.value.pageNo = 1 searchForm.value.pageNo = 1
getList(info) getList()
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
@ -126,8 +118,8 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = (type, row) => { const openForm = (type, id) => {
formRef.value.open(type, row) formRef.value.open(type, id)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -136,7 +128,7 @@ const handleDelete = async (id) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await DeptApi.deleteDept(id) await KpiApi.deleteKpi(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

@ -38,6 +38,7 @@
:summary-method="getSummaries" :summary-method="getSummaries"
> >
<el-table-column prop="name" label="考核指标" width="180" /> <el-table-column prop="name" label="考核指标" width="180" />
<el-table-column prop="type" label="分值模式" width="90" />
<el-table-column prop="rate" label="权重%" width="90" /> <el-table-column prop="rate" label="权重%" width="90" />
<el-table-column label="考核内容"> <el-table-column label="考核内容">
<template #default="{ row }"> <template #default="{ row }">
@ -89,6 +90,7 @@
<script setup name="KpiScore"> <script setup name="KpiScore">
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as KpiApi from '@/api/kpi/index.js'
const message = useMessage() // const message = useMessage() //
const loading = ref(false) // const loading = ref(false) //
@ -100,32 +102,18 @@ const searchForm = ref({
const peroidSaved = ref(true) const peroidSaved = ref(true)
const employeeOptions = ref([ const employeeOptions = ref([])
{ id: 1, name: '武大郎' },
{ id: 2, name: '李二郎' },
{ id: 3, name: '拼命三郎' },
{ id: 4, name: '杨四郎' }
// { id: 11, name: '' },
// { id: 21, name: '' },
// { id: 31, name: '' },
// { id: 41, name: '' },
// { id: 12, name: '' },
// { id: 22, name: '' },
// { id: 32, name: '' },
// { id: 42, name: '' },
// { id: 13, name: '' },
// { id: 23, name: '' },
// { id: 33, name: '' },
// { id: 43, name: '' }
])
onMounted(() => { onMounted(async () => {
// //
const today = new Date() const today = new Date()
searchForm.value.peroid = formatDate( searchForm.value.peroid = formatDate(
new Date(today.getFullYear(), today.getMonth() - 1), new Date(today.getFullYear(), today.getMonth() - 1),
'YYYY-MM' 'YYYY-MM'
) )
//
const list = await KpiApi.getKpiEmployees()
employeeOptions.value = list || []
if (employeeOptions.value.length > 0) { if (employeeOptions.value.length > 0) {
searchForm.value.employeeId = employeeOptions.value[0].id searchForm.value.employeeId = employeeOptions.value[0].id
} }

@ -151,9 +151,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="绩效考核人" prop="jixiaokaoheren"> <el-form-item label="绩效考核人" prop="meritsExamineUserList">
<el-select <el-select
v-model="formData.jixiaokaoheren" v-model="formData.meritsExamineUserList"
placeholder="选择绩效考核人" placeholder="选择绩效考核人"
clearable clearable
filterable filterable
@ -163,6 +163,7 @@
<el-option <el-option
v-for="item in employeeOptions" v-for="item in employeeOptions"
:key="item.id" :key="item.id"
:disabled="item.status == 1"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
/> />
@ -293,7 +294,8 @@ const resetForm = () => {
retireDate: undefined, retireDate: undefined,
attendanceSettingId: undefined, attendanceSettingId: undefined,
instanceIds: [], instanceIds: [],
wxAlias: '' wxAlias: '',
meritsExamineUserList: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }

@ -36,7 +36,7 @@
<el-table-column label="微信号" prop="wxAlias" min-width="120" /> <el-table-column label="微信号" prop="wxAlias" min-width="120" />
<el-table-column label="钉钉号" prop="dingUserId" min-width="120" /> <el-table-column label="钉钉号" prop="dingUserId" min-width="120" />
<el-table-column label="考勤方案" prop="attendanceSettingName" width="100" /> <el-table-column label="考勤方案" prop="attendanceSettingName" width="100" />
<el-table-column label="绩效考核人" prop="" width="120" /> <el-table-column label="绩效考核人" prop="meritsExamineUserNames" width="120" />
<el-table-column label="已开通系统" prop="instanceName" min-width="120" /> <el-table-column label="已开通系统" prop="instanceName" min-width="120" />
<el-table-column label="在职状态" key="status" width="150"> <el-table-column label="在职状态" key="status" width="150">
<template #default="scope"> <template #default="scope">

Loading…
Cancel
Save