!81 refactor(xispeak): 默认审批意见改为节点配置 + 新增用户名解析
Merge pull request !81 from wsm/feature/refactor_xispeakbpmform
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="责任人" name="responsiblePerson">
|
<a-form-item label="责任人" name="responsiblePerson">
|
||||||
<j-select-user v-model:value="mainForm.responsiblePerson" :disabled="mainDisabled" allow-clear />
|
<j-select-user v-model:value="mainForm.responsiblePerson" :disabled="mainDisabled" allow-clear @select="selectHandler('responsiblePerson')" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'feedbackAction'">
|
<template v-if="column.key === 'feedbackAction'">
|
||||||
<a-button type="link" size="small" @click="handleEditFeedback(record)">{{ showJiJianFields ? '监察' : '编辑' }}</a-button>
|
<a-button type="link" size="small" @click="handleEditFeedback(record)">{{ showJiJianFields && nonJiJianFieldsReadonly ? '监察' : '编辑' }}</a-button>
|
||||||
<a-popconfirm title="确定删除该反馈吗?" @confirm="handleDeleteFeedback(record)">
|
<a-popconfirm title="确定删除该反馈吗?" @confirm="handleDeleteFeedback(record)">
|
||||||
<a-button type="link" size="small" danger>删除</a-button>
|
<a-button type="link" size="small" danger>删除</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col v-if="showSubApproveUserSelector" :span="12">
|
<a-col v-if="showSubApproveUserSelector" :span="12">
|
||||||
<a-form-item label="部门经办人" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
<a-form-item label="部门经办人" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
||||||
<sz-dept-user-modal v-model:value="subApproveUser" :disabled="savingSubApproveUser" />
|
<sz-dept-user-modal v-model:value="subApproveUser" :disabled="savingSubApproveUser" @confirm="onSubApproveUserConfirm" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -256,7 +256,6 @@
|
|||||||
:claim="claim"
|
:claim="claim"
|
||||||
:showSelnextUser="showSelnextUser"
|
:showSelnextUser="showSelnextUser"
|
||||||
:beforeHandle="saveMainFormBeforeProcessHandle"
|
:beforeHandle="saveMainFormBeforeProcessHandle"
|
||||||
:defaultReason="defaultHandleReason"
|
|
||||||
@success="handleProcessSuccess"
|
@success="handleProcessSuccess"
|
||||||
@claimSuccess="handleClaimSuccess"
|
@claimSuccess="handleClaimSuccess"
|
||||||
/>
|
/>
|
||||||
@@ -285,16 +284,8 @@
|
|||||||
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue';
|
||||||
import DeptRoleUserSelectRadioGroup from '/@/components/semri/userComponent/DeptRoleUserSelectRadioGroup.vue';
|
import DeptRoleUserSelectRadioGroup from '/@/components/semri/userComponent/DeptRoleUserSelectRadioGroup.vue';
|
||||||
import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervision';
|
import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervision';
|
||||||
import {
|
import { normalizeDeptNames } from '/@/composables/useDefaultApprovalReason';
|
||||||
buildApproveReason,
|
import { useSelectNameResolver } from '/@/composables/useSelectNameResolver';
|
||||||
buildDeptHandlerFeedbackReason,
|
|
||||||
buildDeptLeaderAssignReason,
|
|
||||||
buildDeptLeaderDirectFeedbackReason,
|
|
||||||
buildSuperviseConfirmAllReason,
|
|
||||||
buildSuperviseCheckReason,
|
|
||||||
buildJiJianCheckReason,
|
|
||||||
normalizeDeptNames,
|
|
||||||
} from '/@/composables/useDefaultApprovalReason';
|
|
||||||
|
|
||||||
const { isDisabledAuth, hasPermission, initBpmFormData } = usePermission();
|
const { isDisabledAuth, hasPermission, initBpmFormData } = usePermission();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
@@ -329,7 +320,7 @@ import {
|
|||||||
const showFeedbackDetail = ref(true);
|
const showFeedbackDetail = ref(true);
|
||||||
const feedbackList = ref<any[]>([]);
|
const feedbackList = ref<any[]>([]);
|
||||||
const subApproveUser = ref('');
|
const subApproveUser = ref('');
|
||||||
const subApproveUserNameText = ref('');
|
const subApproveUserNames = ref('');
|
||||||
const userResolveVersion = ref(0);
|
const userResolveVersion = ref(0);
|
||||||
const isEnd = ref(0);
|
const isEnd = ref(0);
|
||||||
|
|
||||||
@@ -342,8 +333,10 @@ import {
|
|||||||
status: '',
|
status: '',
|
||||||
secretLevel: '',
|
secretLevel: '',
|
||||||
responsiblePerson: '',
|
responsiblePerson: '',
|
||||||
|
responsiblePersonNames: '',
|
||||||
needSdwApproval: 0,
|
needSdwApproval: 0,
|
||||||
sdwLeaderList: '',
|
sdwLeaderList: '',
|
||||||
|
sdwLeaderListNames: '',
|
||||||
implPlan: '',
|
implPlan: '',
|
||||||
implMeasures: '',
|
implMeasures: '',
|
||||||
numberOfResolutions: undefined,
|
numberOfResolutions: undefined,
|
||||||
@@ -356,12 +349,19 @@ import {
|
|||||||
completionStatus: undefined,
|
completionStatus: undefined,
|
||||||
deadline: '',
|
deadline: '',
|
||||||
implDept: '',
|
implDept: '',
|
||||||
|
implDeptNames: '',
|
||||||
treeDepth: undefined,
|
treeDepth: undefined,
|
||||||
sortOrder: undefined,
|
sortOrder: undefined,
|
||||||
bpmStatus: '',
|
bpmStatus: '',
|
||||||
supervisionCount: undefined,
|
supervisionCount: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { resolveAll, selectHandler } = useSelectNameResolver(mainForm, [
|
||||||
|
{ field: 'responsiblePerson', type: 'user' },
|
||||||
|
{ field: 'implDept', type: 'dept' },
|
||||||
|
{ field: 'sdwLeaderList', type: 'user' },
|
||||||
|
]);
|
||||||
|
|
||||||
const feedbackColumns = computed(() => {
|
const feedbackColumns = computed(() => {
|
||||||
const cols: any[] = [
|
const cols: any[] = [
|
||||||
{ title: '序号', key: 'seq', align: 'center', width: 60 },
|
{ title: '序号', key: 'seq', align: 'center', width: 60 },
|
||||||
@@ -445,59 +445,19 @@ import {
|
|||||||
processTableName: props.formData?.processTableName,
|
processTableName: props.formData?.processTableName,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// ==================== 默认审批意见 ====================
|
|
||||||
const handleReasonTemplateMap: Record<string, () => string> = {
|
|
||||||
// 部门负责人审批 / 所党委审批 / 督办部门负责人审批 / 纪检负责人审批
|
|
||||||
Task_15sm4w5: buildApproveReason,
|
|
||||||
Task_00i7rrp: buildApproveReason,
|
|
||||||
Task_04bazej: buildApproveReason,
|
|
||||||
Task_0bj578x: buildApproveReason,
|
|
||||||
Task_0mf32ge: buildApproveReason,
|
|
||||||
Task_0zmn6ik: buildApproveReason,
|
|
||||||
Task_133caii: buildApproveReason,
|
|
||||||
Task_175afz2: buildApproveReason,
|
|
||||||
Task_1ogk921: buildApproveReason,
|
|
||||||
Task_1w4vxgc: buildApproveReason,
|
|
||||||
Task_1wfkrvj: buildApproveReason,
|
|
||||||
// 反馈流程节点
|
|
||||||
Task_005iiwi: buildApproveReason,
|
|
||||||
Task_06di2wf: buildApproveReason,
|
|
||||||
Task_1l650tz: buildApproveReason,
|
|
||||||
// 部门经办人反馈完成情况 / 收集流程部门经办人填写 / 反馈流程部门经办人填写反馈
|
|
||||||
Task_00v3pcv: buildDeptHandlerFeedbackReason,
|
|
||||||
Task_08zb04x: buildDeptHandlerFeedbackReason,
|
|
||||||
Task_0jrgrzs: buildDeptHandlerFeedbackReason,
|
|
||||||
Task_12vdqzv: buildDeptHandlerFeedbackReason,
|
|
||||||
// 部门负责人接受任务并分配
|
|
||||||
Task_1v9ce78: () => buildDeptLeaderAssignReason(
|
|
||||||
normalizeDeptNames(subApproveUserNameText.value || subApproveUser.value),
|
|
||||||
),
|
|
||||||
// 部门负责人直接反馈
|
|
||||||
Task_0sialna: buildDeptLeaderDirectFeedbackReason,
|
|
||||||
// 督办部门经办人确认全部反馈事项
|
|
||||||
// (暂无映射,预留 buildSuperviseConfirmAllReason)
|
|
||||||
// 督办经办人核查 / 反馈流程督办经办人核查
|
|
||||||
Task_13olnz1: buildSuperviseCheckReason,
|
|
||||||
// 纪检经办人监察
|
|
||||||
Task_0bahwr8: buildJiJianCheckReason,
|
|
||||||
};
|
|
||||||
|
|
||||||
const defaultHandleReason = computed(() => {
|
|
||||||
const builder = handleReasonTemplateMap[String(processInfo.value.taskDefKey || '')];
|
|
||||||
return builder ? builder() : '';
|
|
||||||
});
|
|
||||||
|
|
||||||
// 合并 mainForm + 表单局部变量,供占位符 ${变量名} 解析
|
// 合并 mainForm + 表单局部变量,供占位符 ${变量名} 解析
|
||||||
const formScope = computed(() => ({
|
const formScope = computed(() => ({
|
||||||
...mainForm,
|
...mainForm,
|
||||||
isEnd: isEnd.value,
|
isEnd: isEnd.value,
|
||||||
subApproveUser: subApproveUser.value,
|
subApproveUser: subApproveUser.value,
|
||||||
subApproveUserNameText: subApproveUserNameText.value,
|
subApproveUserNames: subApproveUserNames.value,
|
||||||
|
responsiblePersonNames: mainForm.responsiblePersonNames,
|
||||||
|
implDeptNames: mainForm.implDeptNames,
|
||||||
|
sdwLeaderListNames: mainForm.sdwLeaderListNames,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
provide('extraVars', formScope);
|
provide('extraVars', formScope);
|
||||||
provide('flowVars', computed(() => props.formData?.vars || {}));
|
provide('flowVars', computed(() => props.formData?.vars || {}));
|
||||||
provide('formDefaultReason', defaultHandleReason);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initFormData();
|
initFormData();
|
||||||
@@ -525,6 +485,14 @@ import {
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
// 反向同步:本地切换 isEnd 时更新 formData.vars,使 conditionalDefaultOpinion 响应
|
||||||
|
watch(isEnd, (val) => {
|
||||||
|
const vars = props.formData?.vars;
|
||||||
|
if (vars) {
|
||||||
|
vars.is_end = String(val);
|
||||||
|
vars.isEnd = String(val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
subApproveUser,
|
subApproveUser,
|
||||||
@@ -544,6 +512,7 @@ import {
|
|||||||
try {
|
try {
|
||||||
const data = await defHttp.get({ url: queryByIdUrl, params: { id: dataId } });
|
const data = await defHttp.get({ url: queryByIdUrl, params: { id: dataId } });
|
||||||
setMainForm(data || {});
|
setMainForm(data || {});
|
||||||
|
await resolveAll();
|
||||||
await loadFeedbackList();
|
await loadFeedbackList();
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -771,15 +740,19 @@ import {
|
|||||||
.join(',');
|
.join(',');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSubApproveUserConfirm(userIds: string, realnames: string) {
|
||||||
|
subApproveUserNames.value = normalizeDeptNames(realnames || '');
|
||||||
|
}
|
||||||
|
|
||||||
async function resolveSubApproveUserName(value: any) {
|
async function resolveSubApproveUserName(value: any) {
|
||||||
const resolveVersion = ++userResolveVersion.value;
|
const resolveVersion = ++userResolveVersion.value;
|
||||||
const usernames = normalizeUsernameList(value);
|
const usernames = normalizeUsernameList(value);
|
||||||
if (!usernames) {
|
if (!usernames) {
|
||||||
subApproveUserNameText.value = '';
|
subApproveUserNames.value = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
subApproveUserNameText.value = normalizeDeptNames(usernames);
|
subApproveUserNames.value = normalizeDeptNames(usernames);
|
||||||
try {
|
try {
|
||||||
const res = await getUserList({ username: usernames, isMultiTranslate: 'true', pageNo: 1, pageSize: 999 });
|
const res = await getUserList({ username: usernames, isMultiTranslate: 'true', pageNo: 1, pageSize: 999 });
|
||||||
if (resolveVersion !== userResolveVersion.value) {
|
if (resolveVersion !== userResolveVersion.value) {
|
||||||
@@ -800,10 +773,10 @@ import {
|
|||||||
.split(',')
|
.split(',')
|
||||||
.map((username) => userNameMap[username] || username)
|
.map((username) => userNameMap[username] || username)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
subApproveUserNameText.value = normalizeDeptNames(names.join(','));
|
subApproveUserNames.value = normalizeDeptNames(names.join(','));
|
||||||
} catch {
|
} catch {
|
||||||
if (resolveVersion === userResolveVersion.value) {
|
if (resolveVersion === userResolveVersion.value) {
|
||||||
subApproveUserNameText.value = normalizeDeptNames(usernames);
|
subApproveUserNames.value = normalizeDeptNames(usernames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user