| | |
| | | import EducationList from './education-list.vue'; |
| | | import WorkHistoryList from './work-history-list.vue'; |
| | | import EmergencyContactList from './emergency-contact-list.vue'; |
| | | import SocialSecurityList from './social-security-list.vue'; |
| | | import EmployeeDetail from './detail.vue'; |
| | | |
| | | const emit = defineEmits(['success']); |
| | |
| | | const educationListRef = ref<InstanceType<typeof EducationList>>(); |
| | | const workHistoryListRef = ref<InstanceType<typeof WorkHistoryList>>(); |
| | | const emergencyContactListRef = ref<InstanceType<typeof EmergencyContactList>>(); |
| | | const socialSecurityListRef = ref<InstanceType<typeof SocialSecurityList>>(); |
| | | |
| | | const isDetail = computed(() => formType.value === 'detail'); |
| | | const getTitle = computed(() => { |
| | |
| | | // 提交表单 |
| | | const data = (await formApi.getValues()) as HrmEmployeeApi.Employee; |
| | | data.remark = remark.value; |
| | | // 附件:把 FileUpload 的值转成 blobId 数组 |
| | | if (Array.isArray(data.blobIds)) { |
| | | data.blobIds = (data.blobIds as any[]).map((item) => item?.id ?? item); |
| | | } |
| | | // 获取子表数据 |
| | | data.educations = educationListRef.value?.getData(); |
| | | data.workHistories = workHistoryListRef.value?.getData(); |
| | |
| | | employeeData.value = formData; |
| | | remark.value = formData.remark; |
| | | if (data.formType !== 'detail') { |
| | | await formApi.setValues(formData); |
| | | const blobIds = (formData.attachmentList || []).map((item) => ({ |
| | | uid: String(item.id), |
| | | name: item.name || '', |
| | | url: item.url || '', |
| | | status: 'done', |
| | | id: item.id, |
| | | })); |
| | | await formApi.setValues({ ...formData, blobIds }); |
| | | } |
| | | } finally { |
| | | modalApi.unlock(); |
| | |
| | | ref="emergencyContactListRef" |
| | | :form-type="formType" |
| | | :employee-id="employeeId" |
| | | /> |
| | | </Tabs.TabPane> |
| | | <Tabs.TabPane key="socialSecurity" tab="社保公积金档案" v-if="employeeId"> |
| | | <SocialSecurityList |
| | | ref="socialSecurityListRef" |
| | | :form-type="formType" |
| | | :employee-id="employeeId" |
| | | :user-id="employeeData?.userId" |
| | | /> |
| | | </Tabs.TabPane> |
| | | </Tabs> |