This commit is contained in:
zmj 2024-06-05 18:06:32 +08:00
parent a7afb19925
commit 62918cd6e0
8 changed files with 490 additions and 14 deletions

32
src/api/oa_examine.ts Normal file
View File

@ -0,0 +1,32 @@
import request from "@/utils/request";
// 我申请的
export function apiExpenseList(params: any) {
return request.get({ url: "/jxgl.oa_examine/lists", params });
}
// 我申请的
export function apiExpenseDetail(params: any) {
return request.get({ url: "/jxgl.oa_examine/detail", params });
}
// 审核
export function apiExpenseAdd(params: any) {
return request.post({ url: "/jxgl.oa_examine/add", params });
}
// 审核
export function apiExpenseDelete(params: any) {
return request.post({ url: "/jxgl.oa_examine/delete", params });
}
export function apiExpenseEdit(params: any) {
return request.post({ url: "/jxgl.oa_examine/edit", params });
}
export function apiExpensedelete_detail(params: any) {
return request.post({
url: "/jxgl.oa_examine/delete_detail",
params,
});
}

View File

@ -1102,3 +1102,26 @@ export const oa_examine_temp_item: Iconfig = {
{ create_time: "创建时间" },
],
};
import { apiOaSelfExamineLists } from "@/api/oaSelfExamine";
export const oa_self_examine: Iconfig = {
fetchFn: apiOaSelfExamineLists,
dictData: "jxgl_check_type",
serchList: [
{
label: "考核类别",
value: "examine_type",
select: "jxgl_check_type",
},
],
tableList: [
{ user_name: "自评人" },
{ examine_type_text: "考核类别" },
{ temp_name: "考核模版" },
{ examine_month: "考核月份" },
{ total_score: "考核总分" },
{ total_self_score: "自评得分" },
{ create_time: "自评时间" },
],
};

View File

@ -1,8 +1,7 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit"
@close="handleClose">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="auto" :rules="formRules">
@ -58,15 +57,15 @@
<el-col :span="8">
<el-form-item label="合同类型" prop="contract_type">
<el-select v-model="contract_type" clearable disabled placeholder="系统自动填写">
<el-option v-for="(item, index) in dictData.contract_type" :key="index"
:label="item.name" :value="parseInt(item.value)" />
<el-option v-for="(item, index) in dictData.contract_type" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item></el-col>
<el-col :span="8">
<el-form-item label="收票日期" prop="receipt_date"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-date-picker class="flex-1 !flex" v-model="formData.receipt_date" clearable
value-format="YYYY-MM-DD " placeholder="选择收票日期">
value-format="YYYY-MM-DD" placeholder="选择收票日期">
</el-date-picker>
</el-form-item>
</el-col>
@ -134,8 +133,7 @@
<el-col :span="8">
<el-form-item label="收款金额大写" prop="receipt_amount_daxie"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
<el-input v-model="formData.receipt_amount_daxie" readonly clearable
placeholder="请输入收款金额大写" />
<el-input v-model="formData.receipt_amount_daxie" readonly clearable placeholder="请输入收款金额大写" />
</el-form-item>
</el-col>
@ -162,8 +160,8 @@
<div>
<div v-for="(item, index) in formDataannex" style="margin-left: 5px;display: block;">
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start"
:href="item.uri" target="_blank">{{ item.name }}</a>
<a style="margin-left: 10px; color: #4a5dff; align-self: flex-start" :href="item.uri"
target="_blank">{{ item.name }}</a>
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>

View File

@ -39,7 +39,6 @@
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table border :data="pager.lists">
<el-table-column type="selection" width="55" />
<el-table-column label="考核总分" prop="total_score" show-overflow-tooltip />
<el-table-column label="最终得分" prop="final_score" show-overflow-tooltip />
<el-table-column label="自评得分" prop="total_self_score" show-overflow-tooltip />

View File

@ -0,0 +1,302 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-card>
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="被考核人">
<el-input v-model="formData.bkh_user_name" readonly placeholder="点击选择被考核人"
@click="userclick" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="考核类别" prop="type">
<el-select class="flex-1" v-model="formData.examine_type" clearable placeholder="请选择考核类别">
<el-option v-for="(item, index) in dictData.jxgl_check_type" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="考核月份" prop="self_examine_id">
<el-input v-model="formData.examine_month" clearable placeholder="点击选择考核月份" readonly
:disabled="!formData.examine_type" @click="showDialog = true" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="考核评语" prop="content">
<el-input v-model="formData.content" clearable placeholder="请输入考核评语" type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card>
<el-row>
<el-table :data="formData.detail">
<template #empty>
暂无数据点击 <el-button @click="handleAdd" size="small">添加</el-button>
</template>
<el-table-column label="考核项" prop="progress" show-overflow-tooltip>
<template #default="{ row }">
<el-input v-model="row.examine_item" placeholder="请输入考核项" />
</template>
</el-table-column>
<el-table-column label="分数" prop="progress" show-overflow-tooltip>
<template #default="{ row }">
<el-input v-model="row.score" placeholder="请输入分数" @change="updateScore2" />
</template>
</el-table-column>
<el-table-column label="考核说明" prop="progress" show-overflow-tooltip>
<template #default="{ row }">
<el-input v-model="row.examine_desc" placeholder="请输入考核说明" />
</template>
</el-table-column>
<el-table-column label="自评得分" prop="progress" show-overflow-tooltip>
<template #default="{ row }">
<el-input v-model="row.self_score" placeholder="请输入自评得分" type="number"
@change="updateScore" />
</template>
</el-table-column>
<el-table-column label="上评得分" prop="progress" show-overflow-tooltip>
<template #default="{ row }">
<el-input v-model="row.superior_score" placeholder="请输入上评得分" type="number"
@change="updateScore1" />
</template>
</el-table-column>
<el-table-column label="操作" prop="progress" show-overflow-tooltip>
<template #default="{ row, $index }">
<el-button @click="handleAdd" size="small">+</el-button>
<el-button @click="handDelete(row, $index)" size="small">-</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-card>
<el-card>
<el-descriptions :column="3" border>
<el-descriptions-item label="考核总分" label-align="left" align="left">
{{ formData.total_score }}
</el-descriptions-item>
<el-descriptions-item label="自评得分" label-align="left" align="left">
{{ formData.total_self_score }}
</el-descriptions-item>
<el-descriptions-item label="上评得分" label-align="left" align="left">
{{ formData.total_superior_score }}
</el-descriptions-item>
<el-descriptions-item label="最终得分" label-align="left" align="left">
{{ formData.final_score }}
</el-descriptions-item>
</el-descriptions>
</el-card>
<div v-if="showDialog">
<el-dialog v-model="showDialog" title="选择考核模版" width="60%">
<dialogTable :config="oa_self_examine"
:query="{ examine_type: formData.examine_type, user_id: formData.bkh_user_id }"
@customEvent="customEvent">
</dialogTable>
</el-dialog>
</div>
<div v-if="showPerDialog">
<personnelselector ref="personnel" @confirm="submituser" type="1">
</personnelselector>
</div>
</popup>
</div>
</template>
<script lang="ts" setup name="manageProjectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import type { PropType } from 'vue'
import { timeFormat } from '@/utils/util'
import { oa_self_examine } from "@/components/dialogTable/dialogTableConfig";
import { apiExpenseAdd, apiExpenseEdit, apiExpensedelete_detail } from '@/api/oa_examine'
import useUserStore from "@/stores/modules/user";
import { apiOaSelfExamineDetail } from '@/api/oaSelfExamine'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const userStore = useUserStore().userInfo;
const showPerDialog = ref(false)
const personnel = ref(null)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑考核模版' : '新增考核模版'
})
//
const formData = reactive({
id: '',
"bkh_user_id": '',
"bkh_user_name": "",
"examine_type": '',
"self_examine_id": '',
examine_month: "",
total_superior_score: 0,
final_score: 0,
total_score: 0,
total_self_score: 0,
"content": "",
"detail": [
{
"examine_item": "",
"score": '',
"examine_desc": "",
"self_score": 0,
"superior_score": 0,
},
]
})
const userclick = async () => {
showPerDialog.value = true;
await nextTick();
personnel.value.open();
};
const submituser = (e) => {
formData.bkh_user_name = e.name;
formData.bkh_user_id = e.id;
showPerDialog.value = false;
};
const handleAdd = () => {
formData.detail.push({})
}
const handDelete = async (row, index) => {
if (row.id) { await apiExpensedelete_detail({ id: row.id }) }
formData.detail.splice(index, 1)
updateScore()
updateScore1()
updateScore2()
}
const updateScore = () => {
formData.total_self_scor = 0
formData.detail.forEach((item, index) => {
formData.total_self_score += (Number(item.self_score) || 0)
})
}
const updateScore1 = () => {
formData.total_superior_score = 0
formData.detail.forEach((item, index) => {
formData.total_superior_score += (Number(item.superior_score) || 0)
})
updateScore3()
}
const updateScore2 = () => {
formData.total_score = 0
formData.detail.forEach((item, index) => {
formData.total_score += (Number(item.score) || 0)
})
updateScore3()
}
const updateScore3 = () => {
formData.final_score = ((formData.total_self_score + formData.total_superior_score) / 2) || 0
}
const customEvent = async (e) => {
formData.examine_month = e.examine_month
formData.self_examine_id = e.id
showDialog.value = false
let res = await apiOaSelfExamineDetail({ id: e.id })
formData.total_score = res.total_score
formData.total_self_score = res.total_self_score
formData.detail = res.detail.map(item => { return { examine_item: item.examine_item, score: item.score, examine_desc: item.examine_desc, self_score: item.self_score } })
}
//
const formRules = reactive<any>({
project_name: [{
required: true,
message: '请输入项目名称',
trigger: ['blur']
}]
})
const setRules = () => {
let lists = ['project_name']
lists.forEach((item) => {
formRules[item] = [{
required: true,
message: '不能为空',
trigger: ['blur']
}]
})
}
setRules()
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiExpenseEdit(data)
: await apiExpenseAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
})
</script>

View File

@ -0,0 +1,119 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="考核类别">
<el-select class="flex-1" v-model="queryParams.examine_type" clearable placeholder="请选择考核类别">
<el-option v-for="(item, index) in dictData.jxgl_check_type" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="考核月份">
<el-date-picker v-model="queryParams.examine_month" type="month" value-format="YYYY-MM"
placeholder="请选择考核月份" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<div class="mt-4">
<el-table border :data="pager.lists">
<el-table-column label="考核人" prop="kh_user_name" show-overflow-tooltip />
<el-table-column label="被考核人" prop="bkh_user_name" show-overflow-tooltip />
<el-table-column label="考核类型" prop="examine_type_text" show-overflow-tooltip />
<el-table-column label="考核月份" prop="examine_month" show-overflow-tooltip />
<el-table-column label="考核总分" prop="total_score" show-overflow-tooltip />
<el-table-column label="最终得分" prop="final_score" show-overflow-tooltip />
<el-table-column label="自评得分" prop="total_self_score" show-overflow-tooltip />
<el-table-column label="上评得分" prop="total_superior_score" show-overflow-tooltip />
<el-table-column label="考核评语" prop="content" show-overflow-tooltip />
<el-table-column label="考核时间" prop="create_time" show-overflow-tooltip />
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiExpenseList, apiExpenseDelete, apiExpenseDetail } from '@/api/oa_examine'
import { useDictData } from '@/hooks/useDictOptions'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const { dictData } = useDictData('jxgl_check_type')
//
const queryParams = reactive({
examine_type: "",
examine_month: ""
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiExpenseList,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
let res = await apiExpenseDetail({ id: data.id })
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(res)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiOaSelfExamineDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -72,6 +72,12 @@
<el-descriptions-item label="自评得分" label-align="left" align="left">
{{ formData.total_self_score }}
</el-descriptions-item>
<el-descriptions-item label="上评得分" label-align="left" align="left">
{{ formData.total_superior_score }}
</el-descriptions-item>
<el-descriptions-item label="最终得分" label-align="left" align="left">
{{ formData.final_score }}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-dialog v-model="showDialog" title="选择考核模版" width="60%">
@ -121,6 +127,7 @@ const formData = reactive({
"examine_month": "",
total_score: 0,
total_self_score: 0,
total_superior_score: 0,
"detail": []
})

View File

@ -77,13 +77,9 @@ import EditPopup from './edit.vue'
import { apiOaSelfExamineLists, apiOaSelfExamineDelete, apiOaSelfExamineDetail } from '@/api/oaSelfExamine'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDetail = ref(false)
//