更新了审批流程显示方式及多个视图页面,优化了审批体验。

This commit is contained in:
zmj 2024-05-30 11:27:40 +08:00
parent d8b7ba1905
commit c007c5c74b
5 changed files with 225 additions and 21 deletions

View File

@ -106,3 +106,10 @@ export function apiInvlicevAdd(params: any) {
params,
});
}
export function apiInvlicevFdz(params: any) {
return request.post({
url: "/works.finance.income/fdz",
params,
});
}

View File

@ -0,0 +1,190 @@
<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() + 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)" 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 && showTextarea()">
<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() && formData.admin_id != userStore.id">
<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=" showBackDialog = true" v-if="formData.admin_id == userStore.id">
撤回
</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>
<div v-if="showPerDialog">
<personnelselector ref="personnel" @confirm="submituser" type="1">
</personnelselector>
</div>
<el-dialog v-model="showBackDialog" title="撤回审批" width="550px">
<el-form-item label="撤回原因">
<el-input v-model="form.content" type="textarea"> </el-input>
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="backFn">撤回</el-button>
<el-button @click="showBackDialog = false">取消</el-button>
</el-form-item>
</el-dialog>
</template>
<script setup lang="ts">
import { apiOaoaApproveCheck } from "@/api/oa_initiate"
import useUserStore from "@/stores/modules/user";
import { Clock } from '@element-plus/icons-vue'
import feedback from '@/utils/feedback'
import { defineProps } from "vue"
let props = defineProps({
formData: {
type: Object,
}
})
const emit = defineEmits(["success", "close", "reEdit"]);
const showPerDialog = ref(false);
const personnel = ref(null);
const userStore = useUserStore().userInfo;
const showBackDialog = ref(false)
const form = reactive({
"id": props.formData.id,
"check": '',
"content": "",
"check_node": 1,
"check_admin_ids": '',
check_admin_names: ""
})
const backFn = () => {
if (!form.content) return feedback.msgError("请填写撤回原因");
form.check = 3
handCheck()
}
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 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 = props.formData.steps.findIndex(item => { return item.sort == props.formData.check_step_sort })
return index
}
//
const handleClose = () => {
emit('close')
}
const hdClose = () => {
emit('close')
}
//
const handCheck = async () => {
if (props.formData.check_admin_ids && props.formData.record[props.formData.record.length - 1].check_user_id == form.check_admin_ids) {
return feedback.msgError("下一级审批人不能是发起审批人")
}
if (props.formData.flow_info.check_type != 2) delete form.check_node;
form.id = props.formData.id
const res = await apiOaoaApproveCheck({ ...form })
handleClose()
}
//
const showActionList = reactive([4, 3, 2])
const showTextarea = () => {
if (showActionList.includes(props.formData.check_status)) return false;
if (props.formData.admin_id == userStore.id) return true;
if (props.formData?.check_admin_ids.length > 1) {
if (props.formData.steps[findActive()].check_list.map(item => item.check_user_id).includes(userStore.id)) return false;
else return (props.formData?.check_admin_ids.split(',').map(Number).includes(userStore.id)); //
} else {
return (props.formData?.check_admin_ids == userStore.id)
}
}
//
const reEdit = () => {
emit('reEdit')
}
</script>
<style lang="scss" scoped>
:deep(.el-step__icon) {
margin-top: 10px !important;
}
</style>

View File

@ -51,14 +51,15 @@
<el-card>
<template #header> 到账信息 </template>
<el-descriptions :column="3" border>
<el-descriptions-item label="到账状态" label-align="left" align="left">
{{ formData.is_cash_text }}
<el-descriptions-item label="到账状45态" label-align="left" align="left">
{{ formData.is_cash }}
</el-descriptions-item>
<el-descriptions-item label="未到账金额(元)" label-align="left" align="left">
{{ (+formData.amount) - (+formData.enter_amount) }}
</el-descriptions-item>
<el-descriptions-item label="已到账金额(元)" label-align="left" align="left">
{{ formData.enter_amount }}
<!-- {{ formData.enter_amount }} -->
{{ formData.is_cash_text }}
</el-descriptions-item>
</el-descriptions>
<el-table :data="detail" class="mt-4">
@ -91,12 +92,12 @@
</el-table>
<div class="mt-4 mb-4">
<span style="float:right">
<el-button type="primary" @click="submit">保存到账记录</el-button>
<el-button @click="reset">重置</el-button>
<el-button @click="showDialog = true" v-if='formData.is_cash==1'>剩余部分全到账</el-button>
<el-button @click="showDialog = true" v-else>全部到账</el-button>
<el-button @click="fdz" v-if='formData.is_cash==1'>全部反到账</el-button>
<el-button type="primary" @click="submit"
v-if="bcdzList.includes(formData.is_cash)">保存到账记录</el-button>
<el-button @click="reset" v-if="czList.includes(formData.is_cash)">重置</el-button>
<el-button @click="showDialog = true" v-if="sybfist.includes(formData.is_cash)">剩余部分全到账</el-button>
<el-button @click="showDialog = true" v-if="bqdzList.includes(formData.is_cash)">全部到账</el-button>
<el-button @click="fdz" v-if="qbfdzList.includes(formData.is_cash)">全部反到账</el-button>
</span>
</div>
</el-card>
@ -119,7 +120,7 @@
<script lang="ts" setup name="customdetail">
import annexLink from "./../../components/annexLink/index.vue";
import Popup from "@/components/popup/index.vue";
import { apiInvliceLists, apiInvlicevAdd } from '@/api/oa_financial'
import { apiInvliceLists, apiInvlicevAdd, apiInvlicevFdz } from '@/api/oa_financial'
import { defineEmits } from "vue"
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const emit = defineEmits(["success", "close"]);
@ -127,6 +128,13 @@ const times = ref('')
const showDialog = ref(false)
const bcdzList = reactive([0, 1])
const czList = reactive([0, 1])
const sybfist = reactive([1])
const bqdzList = reactive([0])
const qbfdzList = reactive([1, 2])
//
const formData = reactive({
id: 0,
@ -175,9 +183,8 @@ const handDel = (i) => {
detail.value.splice(i, 1)
}
const submit = async () => {
if(detail.value.length){
if (detail.value.length) {
await apiInvlicevAdd({ invoice_id: formData.id, detail: detail.value })
}
emit("success");
@ -194,10 +201,10 @@ const reset = () => {
}
const allSubmits = async () => {
let data= { invoice_id: formData.id, detail: [{ amount:formData.amount, enter_time: times.value, remarks: '' }]}
if(formData.is_cash==1){
detail.value.push({ amount:(+formData.amount) - (+formData.enter_amount), enter_time: times.value, remarks: '' })
data.detail=detail.value
let data = { invoice_id: formData.id, detail: [{ amount: formData.amount, enter_time: times.value, remarks: '' }] }
if (formData.is_cash == 1) {
detail.value.push({ amount: (+formData.amount) - (+formData.enter_amount), enter_time: times.value, remarks: '' })
data.detail = detail.value
}
await apiInvlicevAdd(
{
@ -208,9 +215,10 @@ const allSubmits = async () => {
}
const fdz=()=>{
// console.log()
alert("饭到账")
const fdz = async () => {
await apiInvlicevFdz({ invoice_id: formData.id })
emit("success");
}
//

View File

@ -28,7 +28,7 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="抬头" prop="type">
<el-form-item label="开票抬头" prop="type">
<el-select v-model="formData.type" placeholder="请选择抬头类型" class="flex-1">
<el-option label="企业" value="1" />
<el-option label="个人" value="2" />

View File

@ -31,7 +31,6 @@
</el-button>
</div>
<el-table class="mt-4" size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="组织名称" prop="name" min-width="100" />
<el-table-column label="状态" prop="status" min-width="100">
<template #default="{ row }">