diff --git a/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue b/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue index 90e8801..76f313c 100644 --- a/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue +++ b/src/views/bg/bgpartymatter/components/BgPartymatterBPMForm.vue @@ -237,6 +237,7 @@ :claim="claim" :beforeHandle="saveMainFormBeforeProcessHandle" :defaultReason="defaultHandleReason" + :defaultCc="defaultCcUsers" @success="handleProcessSuccess" @claimSuccess="handleClaimSuccess" /> @@ -261,8 +262,10 @@ import SzDeptUserModal from '/@/components/semri/deptUserComponent/SzDeptUserModal.vue'; import DeptRoleUserSelectDropDown from '/@/components/semri/userComponent/DeptRoleUserSelectDropDown.vue'; import { + PARTY_COMMITTEE_DEPT_ID, PARTY_COMMITTEE_DEPT_ID as CHARGE_LEADER_DEPT_ID, CHARGE_LEADER_ROLE_ID, + SDW_LEADER_ROLE_ID, } from '/@/constant/supervision'; const { isDisabledAuth, hasPermission, initBpmFormData} = usePermission(); @@ -312,6 +315,7 @@ const userResolveVersion = ref(0); const isEnd = ref(0); const isFinish = ref('0'); + const defaultCcUsers = ref>([]); const lastGeneratedNumber = ref(''); const mainForm = reactive>({ @@ -451,6 +455,37 @@ } ); + 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; + } catch { + defaultCcUsers.value = []; + } + } + + watch( + () => processInfo.value.taskDefKey, + (key) => { + if (key === 'Task_137y5vq') { + fetchDefaultCcUsers(); + } else { + defaultCcUsers.value = []; + } + }, + { immediate: true } + ); + async function initFormData() { const dataId = props.formData?.dataId; if (!dataId) { diff --git a/src/views/bg/bqtakepulse/components/BgTakepulseBPMForm.vue b/src/views/bg/bqtakepulse/components/BgTakepulseBPMForm.vue index d2885bc..68e13d6 100644 --- a/src/views/bg/bqtakepulse/components/BgTakepulseBPMForm.vue +++ b/src/views/bg/bqtakepulse/components/BgTakepulseBPMForm.vue @@ -262,6 +262,7 @@ :claim="claim" :beforeHandle="saveMainFormBeforeProcessHandle" :defaultReason="defaultHandleReason" + :defaultCc="defaultCcUsers" @success="handleProcessSuccess" @claimSuccess="handleClaimSuccess" /> @@ -288,8 +289,10 @@ import SzDeptUserModal from "@/components/semri/deptUserComponent/SzDeptUserModal.vue"; import DeptRoleUserSelectDropDown from '/@/components/semri/userComponent/DeptRoleUserSelectDropDown.vue'; import { + PARTY_COMMITTEE_DEPT_ID, PARTY_COMMITTEE_DEPT_ID as CHARGE_LEADER_DEPT_ID, CHARGE_LEADER_ROLE_ID, + SDW_LEADER_ROLE_ID, } from '/@/constant/supervision'; const { initBpmFormData } = usePermission(); @@ -337,6 +340,7 @@ const userResolveVersion = ref(0); const isEnd = ref(0); const isFinish = ref('0'); + const defaultCcUsers = ref>([]); const mainForm = reactive>({ id: '', @@ -442,6 +446,37 @@ watch([() => props.formData?.dataId, () => processInfo.value.processInstanceId], () => initFormData()); + 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; + } catch { + defaultCcUsers.value = []; + } + } + + watch( + () => processInfo.value.taskDefKey, + (key) => { + if (key === 'Task_137y5vq') { + fetchDefaultCcUsers(); + } else { + defaultCcUsers.value = []; + } + }, + { immediate: true } + ); + watch( () => props.formData?.vars?.isEnd, (value) => {