add
This commit is contained in:
parent
4622d6dd1b
commit
0a701defe0
@ -44,6 +44,8 @@
|
||||
<script setup>
|
||||
import { ref, defineProps } from "vue";
|
||||
import { apiOaFlowLists, apiOaFlowDetail } from "@/api/oa_flow";
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import feedback from './../../utils/feedback'
|
||||
|
||||
const props = defineProps({
|
||||
formData: {
|
||||
@ -55,12 +57,14 @@ const props = defineProps({
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const perType = ref(2); //人员选择器1为单选2为多选
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
const userclick = async (type) => {
|
||||
perType.value = type;
|
||||
@ -70,9 +74,17 @@ const userclick = async (type) => {
|
||||
};
|
||||
const submituser = (e) => {
|
||||
if (perType.value == 1) {
|
||||
if (e.id == userStore.id) {
|
||||
showPerDialog.value = false;
|
||||
return feedback.msgError("审核人不能为自己")
|
||||
}
|
||||
props.formData.check_admin_names = e.name;
|
||||
props.formData.check_admin_ids = e.id;
|
||||
} else {
|
||||
if (e.map((item) => item.id).includes(userStore.id)) {
|
||||
showPerDialog.value = false;
|
||||
return feedback.msgError("抄送人不能包含自己")
|
||||
}
|
||||
props.formData.copy_names = e.map((item) => item.name).join(",");
|
||||
props.formData.copy_uids = e.map((item) => item.id).join(",");
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="审批流程" label-align="left" align="left">
|
||||
<el-steps class="mb-4" style="max-width: 50vw" :space="200" :active="findActive() + 1" simple>
|
||||
<el-steps class="mb-4" style="max-width: 50vw" :space="200" :active="findActive() + 2" simple>
|
||||
<el-step :icon="Clock"
|
||||
:title="formData.record[formData.record.length - 1].check_user_name + '创建'" />
|
||||
<el-step :icon="Clock" :title="flowTypeToText(item.flow_type, item)"
|
||||
@ -43,7 +43,7 @@
|
||||
</p>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批节点" label-align="left" align="left"
|
||||
v-if="formData.flow_info.check_type == 2 && formData.check_status != 3 && formData.check_status != 2 && formData.admin_id != userStore.id">
|
||||
v-if="formData.flow_info.check_type == 2 && formData.check_status != 3 && formData.check_status != 2 && formData.admin_id != userStore.id && showTextarea()">
|
||||
<div class="flex" style="position: relative;">
|
||||
<el-radio-group v-model="form.check_node">
|
||||
<el-radio :label="1">审批结束</el-radio>
|
||||
@ -76,6 +76,12 @@
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left"
|
||||
v-if="formData.check_status == 3 && formData.record[formData.record.length - 1].check_user_id == userStore.id">
|
||||
<el-button type="info" @click="reEdit">
|
||||
重新编辑
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<div v-if="showPerDialog">
|
||||
@ -91,14 +97,15 @@ import Popup from '@/components/popup/index.vue'
|
||||
import { apiOaoaApproveCheck } from "@/api/oa_initiate"
|
||||
import useUserStore from "@/stores/modules/user";
|
||||
import { Clock } from '@element-plus/icons-vue'
|
||||
import feedback from './../../utils/feedback'
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
const emit = defineEmits(['close', 'reEdit'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
console.log(userStore)
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
@ -113,7 +120,6 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
console.log(formData)
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +173,10 @@ const handleClose = () => {
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
console.log(formData.flow_info.check_type != 2)
|
||||
if (formData.check_admin_ids && formData.record[formData.record.length - 1].check_user_id == form.check_admin_ids) {
|
||||
feedback.msgError("下一级审批人不能是发起审批人")
|
||||
return
|
||||
}
|
||||
if (formData.flow_info.check_type != 2) delete form.check_node;
|
||||
form.id = formData.id
|
||||
const res = await apiOaoaApproveCheck({ ...form })
|
||||
@ -186,8 +195,13 @@ const showTextarea = () => {
|
||||
} else {
|
||||
return (formData?.check_admin_ids == userStore.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//重新编辑
|
||||
|
||||
const reEdit = () => {
|
||||
emit('reEdit', { extends: formData.extends, flow_info: formData.flow_info })
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
@ -17,6 +17,8 @@ import generateForm from './../../components/generateForm/index.vue'
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiOaoaApproveAdd } from "@/api/oa_Initiate"
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
@ -59,12 +61,10 @@ const formRules = reactive<any>({
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
formData.data = data.data;
|
||||
formData.id = data.id;
|
||||
console.log(formData)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
|
@ -55,7 +55,7 @@
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :deptList="deptList" :dict-data="dictData" @success="getLists"
|
||||
:type="type" @close="showEdit = false" />
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @reEdit="reEdit" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
|
||||
</div>
|
||||
@ -86,7 +86,7 @@ const queryParams = reactive({
|
||||
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (id: any, cate) => {
|
||||
const handleEdit = async (id: any, cate = '') => {
|
||||
type.value = cate
|
||||
let res = await apiOaFlowTypeDetail({ id })
|
||||
showEdit.value = true
|
||||
@ -95,7 +95,7 @@ const handleEdit = async (id: any, cate) => {
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
const handDetail = async (id: any) => {
|
||||
const handDetail = async (id: any, data = {}) => {
|
||||
let res = await apiOaoaApproveDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
@ -103,7 +103,12 @@ const handDetail = async (id: any) => {
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
const reEdit = async (data) => {
|
||||
showDetail.value = false
|
||||
console.log(data)
|
||||
await nextTick()
|
||||
handleEdit(data?.flow_info?.flow_cate)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number) => {
|
||||
@ -125,21 +130,15 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
params: queryParams
|
||||
})
|
||||
const activeName = ref('first')
|
||||
|
||||
getLists()
|
||||
|
||||
|
||||
|
||||
const lists = ref([])
|
||||
const getTypeList = async () => {
|
||||
const res = await apiOaFlowTypeLists()
|
||||
lists.value = res
|
||||
}
|
||||
getTypeList()
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
Loading…
x
Reference in New Issue
Block a user