变更申请-审批流程设置人员选择修改

This commit is contained in:
2026-10-08 14:52:19 +08:00
parent 214409e4be
commit 37a2b3a61f
3 changed files with 25 additions and 4 deletions
+20 -1
View File
@@ -8,7 +8,7 @@ import { localStg } from '@/utils/storage';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useChangeStore } from '@/store/modules/change'; import { useChangeStore } from '@/store/modules/change';
import { queryUnsavedApi, saveChangeApi, submitChangeApi, getChangeDetailApi } from '@/service/api/change'; import { queryUnsavedApi, saveChangeApi, submitChangeApi, getChangeDetailApi } from '@/service/api/change';
import { systemConfigApi, templateListApi, } from '@/service/api/system'; import { systemConfigApi, templateListApi, peopleListApi } from '@/service/api/system';
import { orgListApi } from '@/service/api/user'; import { orgListApi } from '@/service/api/user';
import { formatTimestamp, anyToTimestamp } from "@/utils/common"; import { formatTimestamp, anyToTimestamp } from "@/utils/common";
import ChangePre from "./modules/changePre.vue"; import ChangePre from "./modules/changePre.vue";
@@ -35,6 +35,8 @@ const changeTrainingRef = ref<any>(null);
const pssrRef = ref<any>(null); const pssrRef = ref<any>(null);
const evaluationRef = ref<any>(null); const evaluationRef = ref<any>(null);
const closeConfirmRef = ref<any>(null); const closeConfirmRef = ref<any>(null);
// 所有人员
const memberList = ref<any>([]);
// 表单数据 // 表单数据
const changePreForm = ref<any>(null) const changePreForm = ref<any>(null)
const changeApplyForm = ref<any>(null) const changeApplyForm = ref<any>(null)
@@ -324,7 +326,23 @@ const getOrgList = async () => {
} }
} }
// 获取所有人员
const getAllMembers = async () => {
const {data,error} = await peopleListApi();
if(!error){
const transformed = data.map((item:any) => ({
user_id: item.id,
user_name: item.realname,
full_name: item.realname + (`(${item.user_departments.map((d:any) => d.label).join(';')})`),
org_id: item.user_departments.map((d:any) => d.organization_id).join(';'),
org_name: item.user_departments.map((d:any) => d.label).join(';')
}));
memberList.value = transformed;
}
}
onMounted(() => { onMounted(() => {
getAllMembers();
getOrgList(); getOrgList();
getConfig(); getConfig();
getTemplateConfig(); getTemplateConfig();
@@ -397,6 +415,7 @@ onMounted(() => {
:formInfo="changePreForm" :formInfo="changePreForm"
:currentForm="changeApplyForm" :currentForm="changeApplyForm"
:confirmed="confirmed[tab]" :confirmed="confirmed[tab]"
:members="memberList"
@save="saveDraft" @save="saveDraft"
@submit="submitConfirm" @submit="submitConfirm"
@confirmTab="confirmTab" @confirmTab="confirmTab"
@@ -14,7 +14,7 @@ import previewComponent from '@/components/previewFile/index.vue'
const themeStore = useThemeStore(); const themeStore = useThemeStore();
const changeStore = useChangeStore(); const changeStore = useChangeStore();
const props = defineProps(['type','orgTree','templateList','typeList','levelList','isAiOpen','title','currentId','formInfo', 'currentForm', 'confirmed']) const props = defineProps(['type','orgTree','templateList','typeList','levelList','isAiOpen','title','currentId','formInfo', 'currentForm', 'confirmed','members'])
const emit = defineEmits(['save','submit','confirmTab','update:title']); const emit = defineEmits(['save','submit','confirmTab','update:title']);
watch(() => props.currentForm, (newVal:any) => { watch(() => props.currentForm, (newVal:any) => {
@@ -663,6 +663,7 @@ defineExpose({form, questions, applyAiResult, generateLevel: useAiLevel})
:isAiOpen="props.isAiOpen" :isAiOpen="props.isAiOpen"
:currentForm="form" :currentForm="form"
:confirmed="props.confirmed" :confirmed="props.confirmed"
:members="props.members"
@save="saveDraft" @save="saveDraft"
@submit="submitConfirm" @submit="submitConfirm"
@confirmTab="confirmTab" @confirmTab="confirmTab"
@@ -15,7 +15,8 @@ const props = defineProps([
'title', 'title',
'isAiOpen', 'isAiOpen',
'currentForm', 'currentForm',
'confirmed' 'confirmed',
'members',
]) ])
const emit = defineEmits(['save','submit','confirmTab','regenerate']); const emit = defineEmits(['save','submit','confirmTab','regenerate']);
@@ -243,7 +244,7 @@ defineExpose({clearApprovers, setRegenerateLoading})
<div class="mb-2 flex items-center gap-2 text-sm font-semibold text-slate-700"> <div class="mb-2 flex items-center gap-2 text-sm font-semibold text-slate-700">
<NTag type="info" size="small">{{Number(index)+1}}</NTag> {{item.name}} {{item.countersign ? '(专业会签)' : ''}} <NTag type="info" size="small">{{Number(index)+1}}</NTag> {{item.name}} {{item.countersign ? '(专业会签)' : ''}}
</div> </div>
<NSelect :value="approvers[item.id]" multiple :options="item.members" label-field="user_name" value-field="user_id" <NSelect :value="approvers[item.id]" multiple :options="props.members" label-field="full_name" value-field="user_id"
@update:value="(v) => updateApprover(item.id, v)" /> @update:value="(v) => updateApprover(item.id, v)" />
</div> </div>
<NButton v-if="flowList.length" type="primary" class="w-full" @click="finishApprover">完成设置</NButton> <NButton v-if="flowList.length" type="primary" class="w-full" @click="finishApprover">完成设置</NButton>