审批流优化

This commit is contained in:
‘huanghaiixia’
2025-11-28 14:44:37 +08:00
parent 9b3d1f0c8e
commit e9f08e4100
5 changed files with 77 additions and 31 deletions

View File

@ -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);
}

View File

@ -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)