update:更新任务提交审批的模板选择逻辑

This commit is contained in:
2026-04-02 20:00:04 +08:00
parent 720b663293
commit 65a4526f1a
2 changed files with 53 additions and 2 deletions

View File

@@ -379,6 +379,7 @@ const systemApproveQueryApproveFlowTempalteFun = async () => {
if (res && res.code === 200) {
templateList.value = res.data;
const str = getTaskImportLevelFun();
const plNames = getTaskInfoPlNames();
if (str) {
if (str === '高') {
@@ -397,7 +398,23 @@ const systemApproveQueryApproveFlowTempalteFun = async () => {
isDisabledApproval.value = true;
}
} else {
isDisabledApproval.value = false;
if (plNames?.length) {
templateList.value = res.data.filter((item: any) => {
let result: any = false;
for (let i = 0; i < plNames.length; i++) {
if (item.templateName.includes(plNames[i])) {
result = true;
}
}
return result;
});
if (templateList.value?.length) {
approvalFormData.templateId = templateList.value[0].templateId;
isDisabledApproval.value = true;
}
} else {
isDisabledApproval.value = false;
}
}
} else {
templateList.value = [];
@@ -417,6 +434,14 @@ const getTaskImportLevelFun = () => {
return null;
}
};
const getTaskInfoPlNames = () => {
const { pMemberList } = props.taskInfo;
const names =
pMemberList.map((item: any) => {
return item.nickname;
}) || [];
return names;
};
// 刷新报告列表
const reportChangeFun = () => {

View File

@@ -478,6 +478,7 @@ const systemApproveQueryApproveFlowTempalteFun = async () => {
templateList.value = res.data;
const str = getTaskImportLevelFun();
const plNames = getTaskInfoPlNames();
if (str) {
if (str === '高') {
@@ -496,7 +497,23 @@ const systemApproveQueryApproveFlowTempalteFun = async () => {
isDisabledApproval.value = true;
}
} else {
isDisabledApproval.value = false;
if (plNames?.length) {
templateList.value = res.data.filter((item: any) => {
let result: any = false;
for (let i = 0; i < plNames.length; i++) {
if (item.templateName.includes(plNames[i])) {
result = true;
}
}
return result;
});
if (templateList.value?.length) {
approvalFormData.templateId = templateList.value[0].templateId;
isDisabledApproval.value = true;
}
} else {
isDisabledApproval.value = false;
}
}
console.log(props.currentTaskInfo, 'currentTaskInfo');
@@ -523,6 +540,15 @@ const getTaskImportLevelFun = () => {
}
};
const getTaskInfoPlNames = () => {
const { pMemberList } = props.taskInfo;
const names =
pMemberList.map((item: any) => {
return item.nickname;
}) || [];
return names;
};
const skipRunFun = async (data: any) => {
let projectType = 'self_develop';
try {