add
This commit is contained in:
parent
fa1bbfb02f
commit
11acfad196
41
src/api/oa_financial.ts
Normal file
41
src/api/oa_financial.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 我申请的
|
||||
export function apiExpenseList(params: any) {
|
||||
return request.get({ url: "/works.finance.expense/lists", params });
|
||||
}
|
||||
|
||||
// 我申请的
|
||||
export function apiExpenseDetail(params: any) {
|
||||
return request.get({ url: "/works.finance.expense/detail", params });
|
||||
}
|
||||
|
||||
// 审核
|
||||
export function apiExpenseAdd(params: any) {
|
||||
return request.post({ url: "/works.finance.expense/add", params });
|
||||
}
|
||||
|
||||
// 审核
|
||||
export function apiExpenseCheck(params: any) {
|
||||
return request.post({ url: "/works.finance.expense/check", params });
|
||||
}
|
||||
// 我申请的
|
||||
export function apiExpensedealWithList(params: any) {
|
||||
return request.get({
|
||||
url: "/works.finance.expense/deal_with",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 我申请的
|
||||
export function apiExpenseCopyList(params: any) {
|
||||
return request.get({
|
||||
url: "/works.finance.expense/copy",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 我申请的
|
||||
export function apiExpenseList2(params: any) {
|
||||
return request.get({ url: "/works.finance.expense/lists2", params });
|
||||
}
|
@ -66,7 +66,6 @@ const formRules = reactive({
|
||||
|
||||
});
|
||||
|
||||
|
||||
const showPerDialog = ref(false)
|
||||
const personnel = ref(null)
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
@click="userclick(1)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-else style="max-height: 400px;min-height: 200px;">
|
||||
<el-col v-else style="max-height: 400px;min-height: 200px;margin-left: 30px;">
|
||||
<el-steps direction="vertical" :active="0">
|
||||
<el-step :title="i + 1 + '级审核' + `(${flowTypeToText(items.flow_type)})`"
|
||||
<el-step :title="i + 1 + '级审核' + `(${flowTypeToText(items.flow_type, items)})`"
|
||||
:description="items.flow_user_names" v-for="(items, i) in flowListPer" />
|
||||
</el-steps>
|
||||
</el-col>
|
||||
@ -50,6 +50,12 @@ const props = defineProps({
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
flow_cate: {
|
||||
type: Number,
|
||||
},
|
||||
type: {
|
||||
type: Number,
|
||||
}
|
||||
});
|
||||
|
||||
const showPerDialog = ref(false);
|
||||
@ -76,7 +82,7 @@ const submituser = (e) => {
|
||||
const flowList = ref([]);
|
||||
const getFlowList = async () => {
|
||||
// 根据id筛选审批流程列表
|
||||
const res = await apiOaFlowLists();
|
||||
const res = await apiOaFlowLists({ flow_cate: props.flow_cate, type: props.type });
|
||||
flowList.value = res.lists;
|
||||
};
|
||||
getFlowList();
|
||||
@ -89,17 +95,18 @@ const flowChnage = async (e) => {
|
||||
const flow = flowList.value.find((item) => item.id === e);
|
||||
checkType.value = flow.check_type;
|
||||
if (flow.check_type != 2) {
|
||||
props.formData.check_admin_names = '';
|
||||
props.formData.check_admin_ids = '';
|
||||
let res = await apiOaFlowDetail({ id: flow.id });
|
||||
flowListPer.value = res.flow_list;
|
||||
console.log(res);
|
||||
}
|
||||
};
|
||||
|
||||
const flowTypeToText = (type) => {
|
||||
console.log(type, "type")
|
||||
const flowTypeToText = (type, item) => {
|
||||
if (type == 1) return '当前部门负责人';
|
||||
if (type == 2) return '或签';
|
||||
if (type == 3) return '会签';
|
||||
if (type == 4) return item.flow_name;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -18,16 +18,6 @@
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
@ -39,8 +29,7 @@
|
||||
<el-table-column label="审批状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['works/xzgl.oa_seal_cate/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
<el-button type="primary" link @click="handDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
@ -51,7 +40,8 @@
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" /> -->
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -61,11 +51,12 @@ import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiOaoaApprovelst } from '@/api/oa_Initiate'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
// import EditPopup from './edit.vue'
|
||||
import detailPopup from '@/views/oa_Initiate/detail.vue'
|
||||
import { apiOaoaApproveDetail } from "@/api/oa_Initiate"
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDetail = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
@ -91,27 +82,15 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiOaoaApproveDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiOaSealCateDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -13,12 +13,11 @@
|
||||
<el-card>
|
||||
<template #header>审批流程</template>
|
||||
<el-descriptions :column="3" border>
|
||||
|
||||
<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 }}
|
||||
{{ formData.check_admin_users || "审批结束" }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="抄送人" label-align="left" align="left">
|
||||
{{ formData.copy_users }}
|
||||
@ -26,12 +25,24 @@
|
||||
</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-step :icon="Clock" :title="formData.record[0].check_user_name + '创建'" />
|
||||
<el-step :icon="Clock" :title="flowTypeToText(item.flow_type, item)"
|
||||
v-for="item in formData.steps" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
||||
审批记录
|
||||
<p v-for="item in formData.record">
|
||||
<span>{{ item.check_user_name + item.status_text }} </span>了申请
|
||||
{{ item.check_time }}
|
||||
<span>
|
||||
操作意见:
|
||||
{{ item.content }}
|
||||
</span>
|
||||
</p>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批节点" label-align="left" align="left">
|
||||
<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">
|
||||
<div class="flex" style="position: relative;">
|
||||
<el-radio-group v-model="form.check_node">
|
||||
<el-radio :label="1">审批结束</el-radio>
|
||||
@ -43,17 +54,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批意见" label-align="left" align="left">
|
||||
<el-descriptions-item label="审批意见" label-align="left" align="left" v-if="showTextarea()">
|
||||
<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-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||
<el-button type="primary" @click="form.check = 1, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id">
|
||||
通过
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()">
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type != 3">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()">
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type == 3">
|
||||
回退
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()"
|
||||
v-if="formData.admin_id == userStore.id">
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
@ -71,7 +89,7 @@
|
||||
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'
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
@ -79,6 +97,7 @@ const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
console.log(userStore)
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
@ -93,6 +112,7 @@ const setFormData = async (data: Record<any, any>) => {
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
console.log(formData)
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +126,7 @@ const form = reactive({
|
||||
})
|
||||
|
||||
|
||||
const userclick = async (type) => {
|
||||
const userclick = async () => {
|
||||
showPerDialog.value = true;
|
||||
await nextTick();
|
||||
personnel.value.open();
|
||||
@ -124,11 +144,20 @@ const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
const flowTypeToText = (type, item) => {
|
||||
if (type == 0) return item.user_id_info[0].name;
|
||||
if (type == 1) return "部门负责人";
|
||||
if (type == 2) return "或签";
|
||||
if (type == 3) return "会签";
|
||||
if (type == 4) return item.user_id_info[0].name;
|
||||
}
|
||||
|
||||
|
||||
const findActive = () => {
|
||||
let index = formData.steps.findIndex(item => { return item.sort == formData.check_step_sort })
|
||||
return index
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
@ -137,14 +166,36 @@ const handleClose = () => {
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
console.log(formData.flow_info.check_type != 2)
|
||||
if (formData.flow_info.check_type != 2) delete form.check_node;
|
||||
form.id = formData.id
|
||||
const res = await apiOaoaApproveCheck({ ...form })
|
||||
handleClose()
|
||||
}
|
||||
|
||||
// 显示
|
||||
const showActionList = reactive([4, 3, 2])
|
||||
|
||||
const showTextarea = () => {
|
||||
if (showActionList.includes(formData.check_status)) return false;
|
||||
if (formData.admin_id == userStore.id) return true;
|
||||
if (formData?.check_admin_ids.length > 1) {
|
||||
if (formData.steps[findActive()].check_list.map(item => item.check_user_id).includes(userStore.id)) return false;
|
||||
else return (formData?.check_admin_ids.split(',').map(Number).includes(userStore.id)); // 判断是否是当前用户
|
||||
} else {
|
||||
return (formData?.check_admin_ids == userStore.id)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-step__icon) {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,14 +1,13 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit"
|
||||
@close="handleClose">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-card>
|
||||
<template #header>
|
||||
审批内容
|
||||
</template>
|
||||
<generateForm :config="formData.data" :form-data="formData.extends"></generateForm>
|
||||
</el-card>
|
||||
<oaFlow :form-data="formData"></oaFlow>
|
||||
<oaFlow :form-data="formData" :flow_cate="formData.id"></oaFlow>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
@ -26,11 +25,12 @@ const showDialog = ref(false)
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == "edit" ? "编辑审批类型" : "新增审批类型";
|
||||
return "新增审批"
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
data: [],
|
||||
extends: {}
|
||||
});
|
||||
@ -50,6 +50,8 @@ const formRules = reactive<any>({
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
formData.data = data.data;
|
||||
formData.id = data.id;
|
||||
console.log(formData)
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="flex content">
|
||||
<el-card style="flex:1" class="mr-5">
|
||||
<el-card style="flex:1" class="mr-5 left">
|
||||
<template #header>
|
||||
审批新申请
|
||||
</template>
|
||||
@ -54,7 +54,8 @@
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :deptList="deptList" :dict-data="dictData" @success="getLists"
|
||||
@close="showEdit = false" />
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false" @close="showDetail = false" />
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@ -128,7 +129,6 @@ getLists()
|
||||
|
||||
|
||||
const lists = ref([])
|
||||
|
||||
const getTypeList = async () => {
|
||||
const res = await apiOaFlowTypeLists()
|
||||
lists.value = res
|
||||
@ -145,12 +145,21 @@ getTypeList()
|
||||
height: 82vh;
|
||||
}
|
||||
|
||||
.left {
|
||||
overflow-y: auto;
|
||||
height: 82vh;
|
||||
}
|
||||
|
||||
.left::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tit {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.tit-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.tit-li {
|
||||
@ -161,6 +170,8 @@ getTypeList()
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
cursor: pointer;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 5px;
|
||||
|
||||
}
|
||||
}
|
||||
|
216
src/views/oa_apply/detail.vue
Normal file
216
src/views/oa_apply/detail.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="报销凭证编号" label-align="left" align="left">
|
||||
{{ formData.code }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="原始单据日期" label-align="left" align="left">
|
||||
{{ formData.expense_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入账月份" label-align="left" align="left">
|
||||
{{ formData.income_month }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left">
|
||||
<annexLink :annex="formData.annex || []"></annexLink>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="formData.detail">
|
||||
<el-table-column label="报销金额" show-overflow-tooltip prop="amount">
|
||||
</el-table-column>
|
||||
<el-table-column label="报销项目" show-overflow-tooltip prop="cate_id">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip prop="remark">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>审批流程</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<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-steps class="mb-4" style="max-width: 50vw" :space="200" :active="findActive() + 1" simple>
|
||||
<el-step :icon="Clock" :title="formData.record[0].check_user_name + '创建'" />
|
||||
<el-step :icon="Clock" :title="flowTypeToText(item.flow_type, item)"
|
||||
v-for="item in formData.steps" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
||||
<p v-for="item in formData.record">
|
||||
<span>{{ item.check_user_name + item.status_text }} </span>了申请
|
||||
{{ item.check_time }}
|
||||
<span>
|
||||
操作意见:
|
||||
{{ item.content }}
|
||||
</span>
|
||||
</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">
|
||||
<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" v-if="showTextarea()">
|
||||
<el-input type="textarea" v-model="form.content"></el-input>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||
<el-button type="primary" @click="form.check = 1, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id">
|
||||
通过
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type != 3">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type == 3">
|
||||
回退
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()"
|
||||
v-if="formData.admin_id == userStore.id">
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import annexLink from './../../components/annexLink/index.vue'
|
||||
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 { apiExpenseCheck } from '@/api/oa_financial'
|
||||
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
extends: {}
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
}
|
||||
}
|
||||
console.log(formData)
|
||||
}
|
||||
|
||||
|
||||
const form = reactive({
|
||||
"id": formData.id,
|
||||
"check": '',
|
||||
"content": "",
|
||||
"check_node": 1,
|
||||
"check_admin_ids": '',
|
||||
check_admin_names: ""
|
||||
})
|
||||
|
||||
|
||||
const userclick = async () => {
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const flowTypeToText = (type, item) => {
|
||||
if (type == 0) return item.user_id_info[0].name;
|
||||
if (type == 1) return "部门负责人";
|
||||
if (type == 2) return "或签";
|
||||
if (type == 3) return "会签";
|
||||
if (type == 4) return item.user_id_info[0].name;
|
||||
}
|
||||
|
||||
|
||||
const findActive = () => {
|
||||
let index = formData.steps.findIndex(item => { return item.sort == formData.check_step_sort })
|
||||
return index
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
if (formData.flow_info.check_type != 2) delete form.check_node;
|
||||
form.id = formData.id
|
||||
const res = await apiExpenseCheck({ ...form })
|
||||
handleClose()
|
||||
}
|
||||
|
||||
// 显示
|
||||
const showActionList = reactive([4, 3, 2])
|
||||
|
||||
const showTextarea = () => {
|
||||
if (showActionList.includes(formData.check_status)) return false;
|
||||
if (formData.admin_id == userStore.id) return true;
|
||||
if (formData?.check_admin_ids.length > 1) {
|
||||
if (formData.steps[findActive()].check_list.map(item => item.check_user_id).includes(userStore.id)) return false;
|
||||
else return (formData?.check_admin_ids.split(',').map(Number).includes(userStore.id)); // 判断是否是当前用户
|
||||
} else {
|
||||
return (formData?.check_admin_ids == userStore.id)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-step__icon) {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
</style>
|
171
src/views/oa_apply/edit.vue
Normal file
171
src/views/oa_apply/edit.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-card>
|
||||
<template #header>
|
||||
审批内容
|
||||
</template>
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报销凭证编号" prop="user_name">
|
||||
<el-input v-model="formData.code" clearable placeholder="请输入报销凭证编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="原始单据日期" prop="expense_time">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.expense_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择原始单据日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="入账月份" prop="income_month">
|
||||
<el-date-picker class="flex-1 !flex" v-model="formData.income_month" clearable type="month"
|
||||
value-format="YYYY-MM" placeholder="选择入账月份">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-col>
|
||||
<el-table :data="formData.detail">
|
||||
<el-table-column label="报销金额" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.amount" clearable placeholder="请输入报销金额" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报销项目" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.cate_id" placeholder="请选择报销项目" class="flex-1">
|
||||
<el-option :label="item.name" :value="item.value"
|
||||
v-for="item in dictData.oa_approve_cate">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" clearable placeholder="请输入备注信息" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" prop="lead_admin_name" show-overflow-tooltip>
|
||||
<template #default="{ row, $index }">
|
||||
<el-button type="primary" @click="handAdd">添加选项</el-button>
|
||||
<el-button @click="handDel($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mt-4">
|
||||
<el-form-item label="附件" prop="income_month">
|
||||
<uploadAnnex :form-data="formData"></uploadAnnex>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<oaFlow :form-data="formData" type="5"></oaFlow>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="oaFlowTypeEdit">
|
||||
import uploadAnnex from './../../components/uploadAnnex/index.vue'
|
||||
import Popup from "@/components/popup/index.vue";
|
||||
import { apiExpenseAdd } from '@/api/oa_financial'
|
||||
|
||||
|
||||
const emit = defineEmits(["success", "close"]);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
|
||||
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
},
|
||||
})
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return "新增审批"
|
||||
});
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
"code": "xxx",
|
||||
"income_month": "",
|
||||
"expense_time": "",
|
||||
"detail": [
|
||||
{
|
||||
"amount": '',
|
||||
"cate_id": '',
|
||||
"remark": ""
|
||||
}
|
||||
],
|
||||
"annex": [],
|
||||
"flow_id": 1
|
||||
});
|
||||
|
||||
|
||||
const handAdd = () => {
|
||||
formData.detail.push({
|
||||
"amount": '',
|
||||
"cate_id": '',
|
||||
"remark": ""
|
||||
})
|
||||
}
|
||||
|
||||
const handDel = (i) => {
|
||||
formData.detail.splice(i, 1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入所属分类",
|
||||
trigger: ["blur"],
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
// formData.data = data.data;
|
||||
// formData.id = data.id;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
const data = { ...formData };
|
||||
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>
|
143
src/views/oa_apply/index.vue
Normal file
143
src/views/oa_apply/index.vue
Normal file
@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="开始时间" prop="uid">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.start_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="uid">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.end_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="quit_time">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" class="flex-1">
|
||||
<el-option label="全部" value="0" />
|
||||
<el-option label="待审核" value="1" />
|
||||
<el-option label="审核中" value="2" />
|
||||
<el-option label="审批通过,待打款" value="3" />
|
||||
<el-option label="审核不通过" value="4" />
|
||||
<el-option label="撤销审核" value="5" />
|
||||
<el-option label="审批通过,已打款" value="6" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type=" primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['works.rlzy.oa_personal_quit/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['works.rlzy.oa_personal_quit/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="报销总金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="报销人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="报销部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="报销保证编号" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="原始单据日期" prop="expense_time" show-overflow-tooltip />
|
||||
<el-table-column label="入账月份" prop="income_month" show-overflow-tooltip />
|
||||
<el-table-column label="录入时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="当前审核人" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="打款人" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="打款确认时间" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handDetail(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" :deptList="deptList" :dict-data="dictData" @success="getLists"
|
||||
@close="showEdit = false" />
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="oaPersonalQuitLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiExpenseList, apiExpenseDetail } from '@/api/oa_financial'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import detailPopup from './detail.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
status: '',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('oa_approve_cate')
|
||||
|
||||
// 分页相关
|
||||
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) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiExpenseDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
5
src/views/oa_arrival/index.vue
Normal file
5
src/views/oa_arrival/index.vue
Normal file
@ -0,0 +1,5 @@
|
||||
<tamplate>
|
||||
|
||||
到账管理
|
||||
|
||||
</tamplate>
|
216
src/views/oa_copy_to_me/detail.vue
Normal file
216
src/views/oa_copy_to_me/detail.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="报销凭证编号" label-align="left" align="left">
|
||||
{{ formData.code }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="原始单据日期" label-align="left" align="left">
|
||||
{{ formData.expense_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入账月份" label-align="left" align="left">
|
||||
{{ formData.income_month }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left">
|
||||
<annexLink :annex="formData.annex || []"></annexLink>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="formData.detail">
|
||||
<el-table-column label="报销金额" show-overflow-tooltip prop="amount">
|
||||
</el-table-column>
|
||||
<el-table-column label="报销项目" show-overflow-tooltip prop="cate_id">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip prop="remark">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>审批流程</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<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-steps class="mb-4" style="max-width: 50vw" :space="200" :active="findActive() + 1" simple>
|
||||
<el-step :icon="Clock" :title="formData.record[0].check_user_name + '创建'" />
|
||||
<el-step :icon="Clock" :title="flowTypeToText(item.flow_type, item)"
|
||||
v-for="item in formData.steps" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
||||
<p v-for="item in formData.record">
|
||||
<span>{{ item.check_user_name + item.status_text }} </span>了申请
|
||||
{{ item.check_time }}
|
||||
<span>
|
||||
操作意见:
|
||||
{{ item.content }}
|
||||
</span>
|
||||
</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">
|
||||
<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" v-if="showTextarea()">
|
||||
<el-input type="textarea" v-model="form.content"></el-input>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||
<el-button type="primary" @click="form.check = 1, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id">
|
||||
通过
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type != 3">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type == 3">
|
||||
回退
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()"
|
||||
v-if="formData.admin_id == userStore.id">
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import annexLink from './../../components/annexLink/index.vue'
|
||||
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 { apiExpenseCheck } from '@/api/oa_financial'
|
||||
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
extends: {}
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
}
|
||||
}
|
||||
console.log(formData)
|
||||
}
|
||||
|
||||
|
||||
const form = reactive({
|
||||
"id": formData.id,
|
||||
"check": '',
|
||||
"content": "",
|
||||
"check_node": 1,
|
||||
"check_admin_ids": '',
|
||||
check_admin_names: ""
|
||||
})
|
||||
|
||||
|
||||
const userclick = async () => {
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const flowTypeToText = (type, item) => {
|
||||
if (type == 0) return item.user_id_info[0].name;
|
||||
if (type == 1) return "部门负责人";
|
||||
if (type == 2) return "或签";
|
||||
if (type == 3) return "会签";
|
||||
if (type == 4) return item.user_id_info[0].name;
|
||||
}
|
||||
|
||||
|
||||
const findActive = () => {
|
||||
let index = formData.steps.findIndex(item => { return item.sort == formData.check_step_sort })
|
||||
return index
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
if (formData.flow_info.check_type != 2) delete form.check_node;
|
||||
form.id = formData.id
|
||||
const res = await apiExpenseCheck({ ...form })
|
||||
handleClose()
|
||||
}
|
||||
|
||||
// 显示
|
||||
const showActionList = reactive([4, 3, 2])
|
||||
|
||||
const showTextarea = () => {
|
||||
if (showActionList.includes(formData.check_status)) return false;
|
||||
if (formData.admin_id == userStore.id) return true;
|
||||
if (formData?.check_admin_ids.length > 1) {
|
||||
if (formData.steps[findActive()].check_list.map(item => item.check_user_id).includes(userStore.id)) return false;
|
||||
else return (formData?.check_admin_ids.split(',').map(Number).includes(userStore.id)); // 判断是否是当前用户
|
||||
} else {
|
||||
return (formData?.check_admin_ids == userStore.id)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-step__icon) {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
</style>
|
107
src/views/oa_copy_to_me/index.vue
Normal file
107
src/views/oa_copy_to_me/index.vue
Normal file
@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="开始时间" prop="uid">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.start_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="uid">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.end_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="报销总金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="报销人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="报销部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="报销保证编号" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="原始单据日期" prop="expense_time" show-overflow-tooltip />
|
||||
<el-table-column label="入账月份" prop="income_month" show-overflow-tooltip />
|
||||
<el-table-column label="录入时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="当前审核人" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="打款人" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="打款确认时间" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handDetail(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>
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="oaPersonalQuitLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiExpenseCopyList, apiExpenseDetail } from '@/api/oa_financial'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import detailPopup from './detail.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
status: '0',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('oa_approve_cate')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiExpenseCopyList,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 编辑
|
||||
|
||||
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiExpenseDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -82,7 +82,7 @@
|
||||
<el-row v-if="formData.check_type == 2">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="">
|
||||
<span>无需审批</span>
|
||||
<span style="color:#F19F1C"> 无需配置审批人,审批时,根据实际情况选择审批人即可,自由度最高。</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -99,7 +99,7 @@
|
||||
class="mx-1" closable>
|
||||
{{ tag.name }}
|
||||
</el-tag>
|
||||
<el-button type="primary" @click="openDialog(index)">
|
||||
<el-button type="primary" @click="openDialog(index, 1)">
|
||||
选择人员
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@ -128,7 +128,7 @@
|
||||
<dialogTable :config="oa_flow_type" @customEvent="customEvent" :query="{ type: formData.type }">
|
||||
</dialogTable>
|
||||
</el-dialog>
|
||||
<personnelSelector v-if="showPersonnel" ref="personnel" @confirm="submituser" />
|
||||
<personnelSelector v-if="showPersonnel" ref="personnel" @confirm="submituser" :type="perType" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -157,6 +157,7 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>();
|
||||
const mode = ref("add");
|
||||
const showPersonnel = ref(false)
|
||||
const showDialog = ref(false)
|
||||
const perType = ref(2)
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
@ -270,7 +271,8 @@ const handleSubmit = async () => {
|
||||
|
||||
// 人员选择器,selectIndex为-1时为抄送选择抄送人员,其余为指定人员所在的flow_list的下标
|
||||
let selectIndex: nmber;
|
||||
const openDialog = async (index) => {
|
||||
const openDialog = async (index, type) => {
|
||||
type ? perType.value = type : perType.value = 2;
|
||||
showPersonnel.value = true
|
||||
await nextTick()
|
||||
personnel.value?.open()
|
||||
@ -280,7 +282,11 @@ const submituser = (e) => {
|
||||
if (selectIndex == -1) {
|
||||
formData.copy_uids = e.map(item => ({ id: item.id, name: item.name }))
|
||||
} else {
|
||||
formData.flow_list[selectIndex].flow_uids = e.map(item => ({ id: item.id, name: item.name }))
|
||||
if (perType.value == 2) {
|
||||
formData.flow_list[selectIndex].flow_uids = e.map(item => ({ id: item.id, name: item.name }))
|
||||
} else {
|
||||
formData.flow_list[selectIndex].flow_uids = [{ id: e.id, name: e.name }]
|
||||
}
|
||||
}
|
||||
showPersonnel.value = false
|
||||
}
|
||||
|
216
src/views/oa_myDeal/detail.vue
Normal file
216
src/views/oa_myDeal/detail.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="报销凭证编号" label-align="left" align="left">
|
||||
{{ formData.code }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="原始单据日期" label-align="left" align="left">
|
||||
{{ formData.expense_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入账月份" label-align="left" align="left">
|
||||
{{ formData.income_month }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left">
|
||||
<annexLink :annex="formData.annex || []"></annexLink>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="formData.detail">
|
||||
<el-table-column label="报销金额" show-overflow-tooltip prop="amount">
|
||||
</el-table-column>
|
||||
<el-table-column label="报销项目" show-overflow-tooltip prop="cate_id">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip prop="remark">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>审批流程</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<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-steps class="mb-4" style="max-width: 50vw" :space="200" :active="findActive() + 1" simple>
|
||||
<el-step :icon="Clock" :title="formData.record[0].check_user_name + '创建'" />
|
||||
<el-step :icon="Clock" :title="flowTypeToText(item.flow_type, item)"
|
||||
v-for="item in formData.steps" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
||||
<p v-for="item in formData.record">
|
||||
<span>{{ item.check_user_name + item.status_text }} </span>了申请
|
||||
{{ item.check_time }}
|
||||
<span>
|
||||
操作意见:
|
||||
{{ item.content }}
|
||||
</span>
|
||||
</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">
|
||||
<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" v-if="showTextarea()">
|
||||
<el-input type="textarea" v-model="form.content"></el-input>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||
<el-button type="primary" @click="form.check = 1, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id">
|
||||
通过
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type != 3">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type == 3">
|
||||
回退
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()"
|
||||
v-if="formData.admin_id == userStore.id">
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import annexLink from './../../components/annexLink/index.vue'
|
||||
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 { apiExpenseCheck } from '@/api/oa_financial'
|
||||
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
extends: {}
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
}
|
||||
}
|
||||
console.log(formData)
|
||||
}
|
||||
|
||||
|
||||
const form = reactive({
|
||||
"id": formData.id,
|
||||
"check": '',
|
||||
"content": "",
|
||||
"check_node": 1,
|
||||
"check_admin_ids": '',
|
||||
check_admin_names: ""
|
||||
})
|
||||
|
||||
|
||||
const userclick = async () => {
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const flowTypeToText = (type, item) => {
|
||||
if (type == 0) return item.user_id_info[0].name;
|
||||
if (type == 1) return "部门负责人";
|
||||
if (type == 2) return "或签";
|
||||
if (type == 3) return "会签";
|
||||
if (type == 4) return item.user_id_info[0].name;
|
||||
}
|
||||
|
||||
|
||||
const findActive = () => {
|
||||
let index = formData.steps.findIndex(item => { return item.sort == formData.check_step_sort })
|
||||
return index
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
if (formData.flow_info.check_type != 2) delete form.check_node;
|
||||
form.id = formData.id
|
||||
const res = await apiExpenseCheck({ ...form })
|
||||
handleClose()
|
||||
}
|
||||
|
||||
// 显示
|
||||
const showActionList = reactive([4, 3, 2])
|
||||
|
||||
const showTextarea = () => {
|
||||
if (showActionList.includes(formData.check_status)) return false;
|
||||
if (formData.admin_id == userStore.id) return true;
|
||||
if (formData?.check_admin_ids.length > 1) {
|
||||
if (formData.steps[findActive()].check_list.map(item => item.check_user_id).includes(userStore.id)) return false;
|
||||
else return (formData?.check_admin_ids.split(',').map(Number).includes(userStore.id)); // 判断是否是当前用户
|
||||
} else {
|
||||
return (formData?.check_admin_ids == userStore.id)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-step__icon) {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
</style>
|
105
src/views/oa_myDeal/index.vue
Normal file
105
src/views/oa_myDeal/index.vue
Normal file
@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="状态" prop="quit_time">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" class="flex-1">
|
||||
<el-option label="全部" value="0" />
|
||||
<el-option label="待我审批" value="1" />
|
||||
<el-option label="我已审批" value="2" />
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="报销总金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="报销人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="报销部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="报销保证编号" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="原始单据日期" prop="expense_time" show-overflow-tooltip />
|
||||
<el-table-column label="入账月份" prop="income_month" show-overflow-tooltip />
|
||||
<el-table-column label="录入时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="当前审核人" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="打款人" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="打款确认时间" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handDetail(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>
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="oaPersonalQuitLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiExpensedealWithList, apiExpenseDetail } from '@/api/oa_financial'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import detailPopup from './detail.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
status: '0',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('oa_approve_cate')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiExpensedealWithList,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 编辑
|
||||
|
||||
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiExpenseDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
216
src/views/oa_transfe/detail.vue
Normal file
216
src/views/oa_transfe/detail.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" :showFootBtn="false" title="审批详情" :async="true" width="60vw">
|
||||
<el-card>
|
||||
<template #header>审批内容</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="报销凭证编号" label-align="left" align="left">
|
||||
{{ formData.code }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="原始单据日期" label-align="left" align="left">
|
||||
{{ formData.expense_time }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入账月份" label-align="left" align="left">
|
||||
{{ formData.income_month }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" label-align="left" align="left">
|
||||
<annexLink :annex="formData.annex || []"></annexLink>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="formData.detail">
|
||||
<el-table-column label="报销金额" show-overflow-tooltip prop="amount">
|
||||
</el-table-column>
|
||||
<el-table-column label="报销项目" show-overflow-tooltip prop="cate_id">
|
||||
</el-table-column>
|
||||
<el-table-column label="备注信息" show-overflow-tooltip prop="remark">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card>
|
||||
<template #header>审批流程</template>
|
||||
<el-descriptions :column="3" border>
|
||||
<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-steps class="mb-4" style="max-width: 50vw" :space="200" :active="findActive() + 1" simple>
|
||||
<el-step :icon="Clock" :title="formData.record[0].check_user_name + '创建'" />
|
||||
<el-step :icon="Clock" :title="flowTypeToText(item.flow_type, item)"
|
||||
v-for="item in formData.steps" />
|
||||
</el-steps>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审批记录" label-align="left" align="left">
|
||||
<p v-for="item in formData.record">
|
||||
<span>{{ item.check_user_name + item.status_text }} </span>了申请
|
||||
{{ item.check_time }}
|
||||
<span>
|
||||
操作意见:
|
||||
{{ item.content }}
|
||||
</span>
|
||||
</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">
|
||||
<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" v-if="showTextarea()">
|
||||
<el-input type="textarea" v-model="form.content"></el-input>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="操作" label-align="left" align="left" v-if="showTextarea()">
|
||||
<el-button type="primary" @click="form.check = 1, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id">
|
||||
通过
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type != 3">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button @click="form.check = 2, handCheck()"
|
||||
v-if="formData.admin_id != userStore.id && formData.flow_info.check_type == 3">
|
||||
回退
|
||||
</el-button>
|
||||
<el-button type="info" @click="form.check = 3, handCheck()"
|
||||
v-if="formData.admin_id == userStore.id">
|
||||
撤回
|
||||
</el-button>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<div v-if="showPerDialog">
|
||||
<personnelselector ref="personnel" @confirm="submituser" type="1">
|
||||
</personnelselector>
|
||||
</div>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
import annexLink from './../../components/annexLink/index.vue'
|
||||
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 { apiExpenseCheck } from '@/api/oa_financial'
|
||||
|
||||
|
||||
const emit = defineEmits(['close'])
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const showPerDialog = ref(false);
|
||||
const personnel = ref(null);
|
||||
const userStore = useUserStore().userInfo;
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: 0,
|
||||
extends: {}
|
||||
})
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
}
|
||||
}
|
||||
console.log(formData)
|
||||
}
|
||||
|
||||
|
||||
const form = reactive({
|
||||
"id": formData.id,
|
||||
"check": '',
|
||||
"content": "",
|
||||
"check_node": 1,
|
||||
"check_admin_ids": '',
|
||||
check_admin_names: ""
|
||||
})
|
||||
|
||||
|
||||
const userclick = async () => {
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
const flowTypeToText = (type, item) => {
|
||||
if (type == 0) return item.user_id_info[0].name;
|
||||
if (type == 1) return "部门负责人";
|
||||
if (type == 2) return "或签";
|
||||
if (type == 3) return "会签";
|
||||
if (type == 4) return item.user_id_info[0].name;
|
||||
}
|
||||
|
||||
|
||||
const findActive = () => {
|
||||
let index = formData.steps.findIndex(item => { return item.sort == formData.check_step_sort })
|
||||
return index
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
// 审批
|
||||
const handCheck = async () => {
|
||||
if (formData.flow_info.check_type != 2) delete form.check_node;
|
||||
form.id = formData.id
|
||||
const res = await apiExpenseCheck({ ...form })
|
||||
handleClose()
|
||||
}
|
||||
|
||||
// 显示
|
||||
const showActionList = reactive([4, 3, 2])
|
||||
|
||||
const showTextarea = () => {
|
||||
if (showActionList.includes(formData.check_status)) return false;
|
||||
if (formData.admin_id == userStore.id) return true;
|
||||
if (formData?.check_admin_ids.length > 1) {
|
||||
if (formData.steps[findActive()].check_list.map(item => item.check_user_id).includes(userStore.id)) return false;
|
||||
else return (formData?.check_admin_ids.split(',').map(Number).includes(userStore.id)); // 判断是否是当前用户
|
||||
} else {
|
||||
return (formData?.check_admin_ids == userStore.id)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-step__icon) {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
</style>
|
115
src/views/oa_transfe/index.vue
Normal file
115
src/views/oa_transfe/index.vue
Normal file
@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="开始时间" prop="uid">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.start_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="uid">
|
||||
<el-date-picker class="flex-1 !flex" v-model="queryParams.end_time" clearable type="date"
|
||||
value-format="YYYY-MM-DD" placeholder="选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="quit_time">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" class="flex-1">
|
||||
<el-option label="审批通过,待打款" value="1" />
|
||||
<el-option label="审批通过,已打款" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="报销总金额" prop="total_amount" show-overflow-tooltip />
|
||||
<el-table-column label="状态" prop="check_status_text" show-overflow-tooltip />
|
||||
<el-table-column label="报销人" prop="check_admin_users" show-overflow-tooltip />
|
||||
<el-table-column label="报销部门" prop="dept_name" show-overflow-tooltip />
|
||||
<el-table-column label="报销保证编号" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="原始单据日期" prop="expense_time" show-overflow-tooltip />
|
||||
<el-table-column label="入账月份" prop="income_month" show-overflow-tooltip />
|
||||
<el-table-column label="录入时间" prop="create_time" show-overflow-tooltip />
|
||||
<el-table-column label="当前审核人" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="打款人" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="打款确认时间" prop="" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handDetail(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>
|
||||
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
|
||||
@close="showDetail = false, getLists()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="oaPersonalQuitLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiExpenseList2, apiExpenseDetail } from '@/api/oa_financial'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import detailPopup from './detail.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const detailRef = ref(null)
|
||||
// 是否显示编辑框
|
||||
const showDetail = ref(false)
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
status: '',
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('oa_approve_cate')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiExpenseList2,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 编辑
|
||||
|
||||
|
||||
const handDetail = async (id: any) => {
|
||||
let res = await apiExpenseDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user