MK公开页、预结算体验优化、地图选址与认证密码规则完善

This commit is contained in:
2026-09-22 12:06:48 +08:00
parent 57368f0179
commit ac87208ba9
41 changed files with 1882 additions and 391 deletions
+20 -4
View File
@@ -40,10 +40,22 @@ export const MK_BIZ = {
},
};
export async function resolveMkTemplateCode(dictName) {
const MK_SWITCH_NAME = '开启MK';
async function loadMkTemplateList() {
const res = await getDictionary({ code: 'mk_template' });
const list = res?.data?.data || [];
const matched = list.find(item => String(item.dictValue || '').trim() === dictName);
return res?.data?.data || [];
}
/** 业务字典 mk_template:名称「开启MK」且键值为 1 时才请求 MK */
export function isMkEnabled(list = []) {
const matched = list.find(item => String(item.dictValue || '').trim() === MK_SWITCH_NAME);
return String(matched?.dictKey ?? '').trim() === '1';
}
export async function resolveMkTemplateCode(dictName, list) {
const dictList = list || (await loadMkTemplateList());
const matched = dictList.find(item => String(item.dictValue || '').trim() === dictName);
const templateCode = matched?.dictKey;
if (!templateCode) {
ElMessage.warning(`未配置业务字典 mk_template「${dictName}」,无法提交审核流`);
@@ -62,10 +74,14 @@ export async function submitMkApprovalFlow({
if (!conf) {
return Promise.reject(new Error(`不支持的MK业务类型:${bizType}`));
}
const list = await loadMkTemplateList();
if (!isMkEnabled(list)) {
return;
}
if ((conf.rejected || []).includes(approvalStatus)) {
await processDelete({ formInstanceId: String(formInstanceId) });
}
const templateCode = await resolveMkTemplateCode(conf.dictName);
const templateCode = await resolveMkTemplateCode(conf.dictName, list);
const subject = subjectName
? `${conf.subjectPrefix}${subjectName}`
: `${conf.subjectPrefix}${formInstanceId}`;