diff --git a/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue b/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue index 8869d7d..ec9d744 100644 --- a/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue +++ b/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue @@ -257,6 +257,7 @@ :showSelnextUser="showSelnextUser" :beforeHandle="saveMainFormBeforeProcessHandle" :defaultReason="defaultHandleReason" + :defaultCc="defaultCcUsers" @success="handleProcessSuccess" @claimSuccess="handleClaimSuccess" /> @@ -330,6 +331,7 @@ import { const feedbackList = ref([]); const { usernames: subApproveUser, displayNames: subApproveUserNameText, setDisplayNames, initFromData } = useSubApproveUserResolver(); const isEnd = ref(0); + const defaultCcUsers = ref>([]); const mainForm = reactive>({ id: '', @@ -427,6 +429,7 @@ import { () => String(props.formData?.extendUrlParams?.showSubApproveUser ?? props.formData?.extendUrlParams?.selectuser ?? '') === '1' ); const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1'); + const showDefaultCc = computed(() => String(props.formData?.extendUrlParams?.defaultCc ?? '') === '1'); const processInfo = computed(() => ({ taskId: props.formData?.taskId, @@ -532,6 +535,31 @@ import { } }); + async function fetchDefaultCcUsers() { + try { + const res = await defHttp.get({ + url: '/sys/user/queryUserRoleComponentData', + params: { departId: PARTY_COMMITTEE_DEPT_ID, roleId: SDW_LEADER_ROLE_ID, searchSecurityLevel: 5, pageNo: 1, pageSize: 999 }, + }); + const records = res?.records || res?.result?.records || []; + defaultCcUsers.value = records.sort((a, b) => (a.sortno ?? Infinity) - (b.sortno ?? Infinity)); + } catch { + defaultCcUsers.value = []; + } + } + + watch( + () => showDefaultCc.value, + () => { + if (showDefaultCc.value) { + fetchDefaultCcUsers(); + } else { + defaultCcUsers.value = []; + } + }, + { immediate: true } + ); + async function initFormData() { const dataId = props.formData?.dataId; if (!dataId) {