莳松crm管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-crm-manage-web/src/views/Kpi/Appraise/index.vue

157 lines
4.3 KiB

5 months ago
<template>
<div>
<!-- 搜索工作栏 -->
4 months ago
<el-form :model="searchForm" ref="queryFormRef" inline label-width="0">
5 months ago
<el-form-item>
4 months ago
<el-input v-model="searchForm.examineTarget" placeholder="请输入考核指标" clearable />
5 months ago
</el-form-item>
<el-form-item>
<el-button @click="handleQuery" v-hasPermi="['kpi:appraise:search']"> 搜索</el-button>
<el-button @click="resetQuery" v-hasPermi="['kpi:appraise:reset']"> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['kpi:appraise:add']"
>
新增
</el-button>
</el-form-item>
</el-form>
<!-- 列表 -->
<el-table v-loading="loading" :data="list" border>
4 months ago
<el-table-column prop="examineTarget" label="考核指标" width="180" />
<el-table-column prop="typeName" label="分值模式" width="90" :formatter="getKpiModeLabel" />
<el-table-column prop="weight" label="权重%" width="90" />
4 months ago
<el-table-column label="考核内容">
<template #default="{ row }">
4 months ago
<div v-dompurify-html="row.examineContent"></div>
4 months ago
</template>
</el-table-column>
4 months ago
<el-table-column label="考核规则" prop="examineRule">
4 months ago
<template #default="{ row }">
4 months ago
<div v-dompurify-html="row.examineRule"></div>
4 months ago
</template>
</el-table-column>
4 months ago
<el-table-column label="评分上限" prop="examineScore" width="90" />
4 months ago
<el-table-column label="考核人数" width="90">
<template #default="{ row }">
4 months ago
{{ row.examinedUserIdList?.length || 0 }}
4 months ago
</template>
</el-table-column>
4 months ago
<el-table-column label="生效日期" prop="effectiveDate" width="120" />
5 months ago
<el-table-column label="操作" class-name="fixed-width" width="120">
<template #default="{ row }">
<el-button
link
type="primary"
4 months ago
@click="openForm('update', row.id)"
5 months ago
v-hasPermi="['kpi:appraise:update']"
>
修改
</el-button>
<el-button
link
type="danger"
@click="handleDelete(row.id)"
v-hasPermi="['kpi:appraise:remove']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
4 months ago
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="getList"
/>
4 months ago
<DialogAppraise ref="formRef" :kpiModeOoptions="kpiModeOoptions" @success="handleQuery" />
5 months ago
</div>
</template>
<script setup name="KpiContent">
4 months ago
import { removeNullField } from '@/utils'
4 months ago
import DialogAppraise from './Components/DialogAppraise.vue'
4 months ago
import * as KpiApi from '@/api/kpi/index.js'
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
4 months ago
4 months ago
const { t } = useI18n() // 国际化
5 months ago
const message = useMessage() // 消息弹窗
const loading = ref(false) // 列表的加载中
4 months ago
const list = ref([]) // 列表的数据
4 months ago
const searchForm = ref({
4 months ago
examineTarget: undefined,
5 months ago
pageNo: 1,
pageSize: 20
})
4 months ago
const total = ref(0)
5 months ago
/** 初始化 **/
onMounted(() => {
4 months ago
getOptions()
5 months ago
handleQuery()
})
4 months ago
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 () => {
5 months ago
loading.value = true
try {
4 months ago
const data = await KpiApi.getKpiPage(removeNullField(searchForm.value))
list.value = data.list
5 months ago
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
4 months ago
const handleQuery = () => {
4 months ago
searchForm.value.pageNo = 1
4 months ago
getList()
5 months ago
}
/** 重置按钮操作 */
const resetQuery = () => {
4 months ago
searchForm.value = {
examineTarget: undefined,
pageNo: 1,
pageSize: 20
}
5 months ago
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
4 months ago
const openForm = (type, id) => {
formRef.value.open(type, id)
5 months ago
}
/** 删除按钮操作 */
const handleDelete = async (id) => {
try {
// 删除的二次确认
await message.delConfirm()
// 发起删除
4 months ago
await KpiApi.deleteKpi(id)
5 months ago
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
} catch {}
}
</script>
<style lang="scss" scoped></style>