审批流优化
This commit is contained in:
@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="请稍后...">
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
<div class="page-bg-wrap">
|
||||
<!-- <div class="top-toolbar" id="formViewPage"> -->
|
||||
<!-- <a-space :size="10" wrap style="gap: 0">
|
||||
<!-- <div class="top-toolbar" id="formViewPage">
|
||||
<a-space :size="10" wrap style="gap: 0">
|
||||
<a-button style="margin-right: 10px" @click="close">
|
||||
<slot name="icon"><close-outlined /></slot>取消
|
||||
</a-button>
|
||||
<a-button v-if="mode != 'view'" style="margin-right: 10px" type="primary" @click="handleSubmit('save')">
|
||||
<a-button style="margin-right: 10px" @click="handleSubmit('save')">
|
||||
<slot name="icon"><save-outlined /></slot>保存
|
||||
</a-button>
|
||||
<a-button v-if="mode != 'view'" style="margin-right: 10px" type="primary" @click="handleSubmit('submit')">
|
||||
<a-button style="margin-right: 10px" type="primary" @click="handleSubmit('submit')">
|
||||
<slot name="icon"><check-circle-outlined /></slot>保存并提交
|
||||
</a-button>
|
||||
<a-button v-if="mode != 'view'" style="margin-right: 10px" type="primary" @click="handleSubmit">
|
||||
<a-button style="margin-right: 10px" >
|
||||
<slot name="icon"><download-outlined /></slot>下载模板
|
||||
</a-button>
|
||||
<a-button v-if="mode != 'view'" type="primary" @click="handleSubmit">
|
||||
<a-button >
|
||||
<slot name="icon"><upload-outlined /></slot>导入
|
||||
</a-button>
|
||||
</a-space>
|
||||
@ -475,17 +475,23 @@
|
||||
() => props.id,
|
||||
(val) => {
|
||||
if (val) {
|
||||
if (val) {
|
||||
getList(val)
|
||||
}
|
||||
}
|
||||
getList(val)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(val) => {
|
||||
isDisable.value = val
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
isDisable.value = props.disabled || false
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
getList(pageId.value)
|
||||
@ -495,13 +501,15 @@
|
||||
|
||||
});
|
||||
async function getList(id) {
|
||||
spinning.value = true
|
||||
let data = await getLngCustomer(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
formState.lngCustomerAttrPowerList = formState.lngCustomerAttrPowerList || [{}]
|
||||
Object.assign(dataBank, formState.lngCustomerBankList || [])
|
||||
Object.assign(dataCertificate, formState.lngCustomerDocList || [])
|
||||
Object.assign(dataContact, formState.lngCustomerContactList || [])
|
||||
Object.assign(dataUpload, formState.lngFileUploadList || [])
|
||||
Object.assign(dataFile, formState.lngFileUploadList || [])
|
||||
}
|
||||
async function getOption() {
|
||||
optionSelect.cuMcodeList = await getDictionary('LNG_ENT_PR')
|
||||
@ -662,7 +670,9 @@
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute.value, router);
|
||||
}
|
||||
|
||||
async function getFormValue() {
|
||||
return formState
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
@ -761,7 +771,7 @@
|
||||
|
||||
defineExpose({
|
||||
handleSubmit,
|
||||
|
||||
getFormValue
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
</template>
|
||||
</a-space>
|
||||
</div>
|
||||
<component v-if="customFormConfig.codeList.includes(curPageCode)" :is="componentName" :disabled="readonly" />
|
||||
<component v-if="customFormConfig.codeList.includes(curPageCode)" :is="componentName" ref="formInformation" :disabled="true" />
|
||||
<FormInformation
|
||||
v-else
|
||||
:key="renderKey"
|
||||
@ -393,12 +393,16 @@
|
||||
async function onApproveClick(isAutoAgreeBreak = false) {
|
||||
try {
|
||||
openSpinning();
|
||||
if (!isAutoAgreeBreak) {
|
||||
await submit();
|
||||
}
|
||||
if (!validateSuccess.value) {
|
||||
closeSpinning();
|
||||
return;
|
||||
if (!customFormConfig.codeList.includes(curPageCode.value)) {
|
||||
if (!isAutoAgreeBreak) {
|
||||
await submit();
|
||||
}
|
||||
if (!validateSuccess.value) {
|
||||
closeSpinning();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
validateSuccess.value = true
|
||||
}
|
||||
const params = await getApproveParams();
|
||||
const nextNodes = await postGetNextTaskMaybeArrival(params);
|
||||
@ -681,9 +685,20 @@
|
||||
|
||||
async function getApproveParams() {
|
||||
try {
|
||||
let formModels = {}
|
||||
let system = {}
|
||||
let fileFolderIds = []
|
||||
if (!customFormConfig.codeList.includes(curPageCode.value)) {
|
||||
let formModels = await formInformation.value.getFormModels();
|
||||
let system = formInformation.value.getSystemType();
|
||||
let fileFolderIds = getUploadFileFolderIds(formModels);
|
||||
} else {
|
||||
let value = await formInformation.value.getFormValue();
|
||||
let key = data.formInfos[0]?.formConfig?.key
|
||||
formModels[key] = value
|
||||
system[key] = false
|
||||
fileFolderIds = []
|
||||
}
|
||||
return {
|
||||
approvedType: approvalData.approvedType,
|
||||
approvedResult: approvalData.approvedResult, // approvalData.approvedType 审批结果 如果为 4 就需要传buttonCode
|
||||
@ -708,13 +723,16 @@
|
||||
try {
|
||||
if (validateSuccess.value || values === 'reject' || values === 'finish' || values === 'disagree') {
|
||||
let params = await getApproveParams();
|
||||
openSpinning()
|
||||
let response = await postApproval(params);
|
||||
closeSpinning()
|
||||
// 判断返回值是否带有isAutoAgree 来判断中间是否有自动审批的业务,如有再执行判断待审人员是否包含自己,不包含就直接flowSuccess
|
||||
if (checkIsAutoAgree(response)) return;
|
||||
flowSuccess();
|
||||
data.submitLoading = false;
|
||||
}
|
||||
} catch (error) {
|
||||
closeSpinning()
|
||||
flowFail();
|
||||
throw new Error(error);
|
||||
}
|
||||
|
||||
@ -16,7 +16,10 @@
|
||||
</slot>
|
||||
提交
|
||||
</a-button>
|
||||
<a-button :disabled="data.submitLoading" @click="saveDraft">
|
||||
<a-button v-if="customFormConfig.codeList.includes(curPageCode)" @click="onSave">
|
||||
<slot name="icon"><save-outlined /></slot>保存
|
||||
</a-button>
|
||||
<a-button v-else :disabled="data.submitLoading" @click="saveDraft">
|
||||
<slot name="icon">
|
||||
<clock-circle-outlined />
|
||||
</slot>
|
||||
@ -29,6 +32,14 @@
|
||||
</slot>
|
||||
流程图
|
||||
</a-button>
|
||||
<div v-if="customFormConfig.codeList.includes(curPageCode)">
|
||||
<a-button>
|
||||
<slot name="icon"><download-outlined /></slot>下载模板
|
||||
</a-button>
|
||||
<a-button>
|
||||
<slot name="icon"><upload-outlined /></slot>导入
|
||||
</a-button>
|
||||
</div>
|
||||
</a-space>
|
||||
</div>
|
||||
<div class="flow-content">
|
||||
@ -54,7 +65,7 @@
|
||||
import ProcessInformation from '/@/views/workflow/task/components/flow/ProcessInformation.vue';
|
||||
import { getStartProcessInfo, getReStartProcessInfo, reLaunch, postLaunch, postApproval, postGetNextTaskMaybeArrival } from '/@/api/workflow/task';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined } from '@ant-design/icons-vue';
|
||||
import { CloseOutlined, SendOutlined, ClockCircleOutlined, PrinterOutlined, ApartmentOutlined, SaveOutlined, DownloadOutlined, UploadOutlined } from '@ant-design/icons-vue';
|
||||
import { nextTick, onMounted, ref, toRaw, reactive, computed, defineAsyncComponent } from 'vue';
|
||||
import { deleteDraft, postDraft, putDraft } from '/@/api/workflow/process';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -314,7 +325,9 @@
|
||||
draftId: rDraftsId.value
|
||||
};
|
||||
}
|
||||
|
||||
async function onSave() {
|
||||
let value = await formInformation.value.handleSubmit();
|
||||
}
|
||||
async function saveLaunchNew() {
|
||||
if (!taskId.value && rDraftsId.value != '0') {
|
||||
try {
|
||||
@ -340,7 +353,7 @@
|
||||
let obj = {}
|
||||
system[key] = false
|
||||
|
||||
let value = await formInformation.value.handleSubmit(true);
|
||||
let value = await formInformation.value.handleSubmit();
|
||||
obj[key] = value
|
||||
mainFormModels.value = obj
|
||||
console.log(mainFormModels.value, 6666)
|
||||
|
||||
@ -227,7 +227,12 @@
|
||||
id.value = res?.formInfos[0]?.formData?.id
|
||||
initProcessData(res);
|
||||
if (res.buttonConfigs) {
|
||||
approvalData.buttonConfigs = res.buttonConfigs;
|
||||
approvalData.buttonConfigs = res.buttonConfigs || [];
|
||||
// 不显示保存按钮
|
||||
let idx = approvalData.buttonConfigs.findIndex(v => v.buttonCode == 'draft')
|
||||
if (idx >-1) {
|
||||
approvalData.buttonConfigs.splice(idx, 1)
|
||||
}
|
||||
}
|
||||
if (res.relationTasks) {
|
||||
data.predecessorTasks = res.relationTasks;
|
||||
|
||||
@ -26,17 +26,17 @@
|
||||
<div v-show="activeIndex == index">
|
||||
<div class="page-bg-wrap">
|
||||
<div class="top-toolbar" style="display: flex; margin-bottom: 10px">
|
||||
<div id="adminButtons" v-show="activeIndex == index" style="margin-right: 10px">
|
||||
<!-- <div id="adminButtons" v-show="activeIndex == index" style="margin-right: 10px">
|
||||
<a-button @click="handleCancel" v-if="forms.modes[index] == 'edit'">取消</a-button>
|
||||
<a-button @click="handleSave" v-if="forms.modes[index] == 'edit'" type="primary" style="margin-left: 12px">保存</a-button>
|
||||
<a-button @click="handleEdit" v-if="forms.modes[index] == 'view'">编辑</a-button>
|
||||
<a-button @click="handleDelete" type="danger" style="margin-left: 12px">删除</a-button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div id="approveExtendButton"></div>
|
||||
<div id="approveRightButton"></div>
|
||||
</div>
|
||||
<div style="height: 500px;" v-if="customFormConfig.codeList.includes(props.curPageCode)">
|
||||
<component :id="props.id" :is="componentName" :disabled="props.disabled" />
|
||||
<component :id="props.id" :is="componentName" :disabled="true" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<SystemForm class="form-box" v-if="item.formType == FormType.SYSTEM" :systemComponent="item.systemComponent" :isViewProcess="props.disabled" :formModel="item.formModel" :workflowConfig="item" :ref="setItemRef" />
|
||||
@ -534,7 +534,7 @@
|
||||
}
|
||||
|
||||
.top-toolbar {
|
||||
min-height: 44px;
|
||||
// min-height: 44px;
|
||||
margin-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user