2024-05-25 20:59:42 +08:00
|
|
|
<template>
|
|
|
|
<div class="detail-popup">
|
2024-05-26 22:20:31 +08:00
|
|
|
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
|
|
|
<el-card>
|
|
|
|
<template #header>审批内容</template>
|
|
|
|
<el-descriptions :column="3" border>
|
|
|
|
<el-descriptions-item v-for="item in formData.extends" :label="item.label" label-align="left"
|
|
|
|
align="left">
|
|
|
|
{{ item.text || item.value }}
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions>
|
|
|
|
</el-card>
|
|
|
|
<el-card>
|
|
|
|
<template #header>审批流程</template>
|
|
|
|
<el-descriptions :column="3" border>
|
2024-05-26 22:23:14 +08:00
|
|
|
|
2024-05-26 22:20:31 +08:00
|
|
|
<el-descriptions-item label="审批状态" label-align="left" align="left">
|
|
|
|
{{ formData.check_status_text }}
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="当前审核人" label-align="left" align="left">
|
|
|
|
{{ formData.check_admin_users }}
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="抄送人" label-align="left" align="left">
|
|
|
|
{{ formData.copy_users }}
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions>
|
|
|
|
<el-descriptions :column="1" border>
|
|
|
|
<el-descriptions-item label="审批流程" label-align="left" align="left">
|
|
|
|
审批流程
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
|
|
|
审批记录
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="审批节点" label-align="left" align="left">
|
|
|
|
<div class="flex" style="position: relative;">
|
|
|
|
<el-radio-group v-model="form.check_node">
|
|
|
|
<el-radio :label="1">审批结束</el-radio>
|
|
|
|
<el-radio :label="2">下一审批人</el-radio>
|
|
|
|
</el-radio-group>
|
|
|
|
<div class="w-280[px]" style="position: absolute;left:250px">
|
|
|
|
<el-input v-show="form.check_node == 2" v-model="form.check_admin_names"
|
|
|
|
placeholder="点击选择下一审批人" clearable readonly @click="userclick" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="审批意见" label-align="left" align="left">
|
|
|
|
<el-input type="textarea" v-model="form.content"></el-input>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="操作" label-align="left" align="left">
|
|
|
|
<el-button type="primary" @click="form.check = 1, handCheck()">
|
|
|
|
通过
|
|
|
|
</el-button>
|
|
|
|
<el-button @click="form.check = 2, handCheck()">
|
|
|
|
拒绝
|
|
|
|
</el-button>
|
|
|
|
<el-button type="info" @click="form.check = 3, handCheck()">
|
|
|
|
撤回
|
|
|
|
</el-button>
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions>
|
|
|
|
</el-card>
|
|
|
|
<div v-if="showPerDialog">
|
|
|
|
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
|
|
|
</personnelselector>
|
|
|
|
</div>
|
2024-05-25 20:59:42 +08:00
|
|
|
</popup>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup name="customdetail">
|
|
|
|
import Popup from '@/components/popup/index.vue'
|
2024-05-26 22:20:31 +08:00
|
|
|
import { apiOaoaApproveCheck } from "@/api/oa_initiate"
|
|
|
|
import useUserStore from "@/stores/modules/user";
|
|
|
|
|
2024-05-25 20:59:42 +08:00
|
|
|
|
|
|
|
const emit = defineEmits(['close'])
|
|
|
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
2024-05-26 22:20:31 +08:00
|
|
|
const showPerDialog = ref(false);
|
|
|
|
const personnel = ref(null);
|
|
|
|
const userStore = useUserStore().userInfo;
|
2024-05-25 20:59:42 +08:00
|
|
|
|
|
|
|
// 表单数据
|
|
|
|
const formData = reactive({
|
2024-05-26 22:20:31 +08:00
|
|
|
id: 0,
|
|
|
|
extends: {}
|
2024-05-25 20:59:42 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
// 获取详情
|
|
|
|
const setFormData = async (data: Record<any, any>) => {
|
|
|
|
for (const key in data) {
|
|
|
|
if (data[key] != null && data[key] != undefined) {
|
|
|
|
//@ts-ignore
|
|
|
|
formData[key] = data[key]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-26 22:20:31 +08:00
|
|
|
const form = reactive({
|
|
|
|
"id": formData.id,
|
|
|
|
"check": '',
|
|
|
|
"content": "",
|
|
|
|
"check_node": 1,
|
|
|
|
"check_admin_ids": '',
|
|
|
|
check_admin_names: ""
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const userclick = async (type) => {
|
|
|
|
showPerDialog.value = true;
|
|
|
|
await nextTick();
|
|
|
|
personnel.value.open();
|
|
|
|
};
|
|
|
|
|
|
|
|
const submituser = (e) => {
|
|
|
|
form.check_admin_names = e.name;
|
|
|
|
form.check_admin_ids = e.id;
|
|
|
|
showPerDialog.value = false;
|
|
|
|
};
|
2024-05-25 20:59:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
//打开弹窗
|
|
|
|
const open = () => {
|
|
|
|
popupRef.value?.open()
|
|
|
|
}
|
|
|
|
|
2024-05-26 22:20:31 +08:00
|
|
|
|
|
|
|
// 提交按钮
|
|
|
|
const handleSubmit = async () => {
|
|
|
|
popupRef.value?.close()
|
|
|
|
}
|
2024-05-25 20:59:42 +08:00
|
|
|
// 关闭回调
|
|
|
|
const handleClose = () => {
|
|
|
|
emit('close')
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-26 22:20:31 +08:00
|
|
|
// 审批
|
|
|
|
const handCheck = async () => {
|
|
|
|
const res = await apiOaoaApproveCheck({ ...form })
|
|
|
|
handleClose()
|
|
|
|
}
|
|
|
|
|
2024-05-25 20:59:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
open,
|
|
|
|
setFormData,
|
|
|
|
})
|
|
|
|
</script>
|