✨ 完善客商MK审核提交、地区校验与流程实例校验
提交增加 loading,拆分所在地区/详细地址校验,支持 MK 审核跳转,并在已有流程实例时跳过重复提交。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { processDelete, processSubmit } from '@/api/system/business-process';
|
||||
import { hasMkProcessInstance, processDelete, processSubmit } from '@/api/system/business-process';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export const MK_BIZ = {
|
||||
@@ -53,6 +53,12 @@ export function isMkEnabled(list = []) {
|
||||
return String(matched?.dictKey ?? '').trim() === '1';
|
||||
}
|
||||
|
||||
/** 加载业务字典并判断是否开启 MK */
|
||||
export async function loadMkEnabled() {
|
||||
const list = await loadMkTemplateList();
|
||||
return isMkEnabled(list);
|
||||
}
|
||||
|
||||
export async function resolveMkTemplateCode(dictName, list) {
|
||||
const dictList = list || (await loadMkTemplateList());
|
||||
const matched = dictList.find(item => String(item.dictValue || '').trim() === dictName);
|
||||
@@ -78,6 +84,11 @@ export async function submitMkApprovalFlow({
|
||||
if (!isMkEnabled(list)) {
|
||||
return;
|
||||
}
|
||||
// 先查 MK 流程实例:已有数据则不删除、不重新提交
|
||||
const existsRes = await hasMkProcessInstance({ bizId: String(formInstanceId) });
|
||||
if (existsRes?.data?.data) {
|
||||
return;
|
||||
}
|
||||
if ((conf.rejected || []).includes(approvalStatus)) {
|
||||
await processDelete({ formInstanceId: String(formInstanceId) });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user