|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <ContentScrollView :paddingH="false"> | 
|---|
|  |  |  | <nut-form :model-value="form" ref="formRef" :rules="rules"> | 
|---|
|  |  |  | <nut-form-item label="期望岗位:" class="bole-form-item" prop="jobIdList" label-position="top"> | 
|---|
|  |  |  | <nut-form-item | 
|---|
|  |  |  | label="期望岗位:" | 
|---|
|  |  |  | class="bole-form-item" | 
|---|
|  |  |  | prop="userExpectJobs" | 
|---|
|  |  |  | label-position="top" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <CommonInputField class="job-common-input-field" @click="goExpectPosition"> | 
|---|
|  |  |  | <JobTagList :jobTagList="jobTagList" /> | 
|---|
|  |  |  | </CommonInputField> | 
|---|
|  |  |  | 
|---|
|  |  |  | <ChooseInputWithPicker | 
|---|
|  |  |  | v-model="form.freeTime" | 
|---|
|  |  |  | placeholder="请选择空闲时间" | 
|---|
|  |  |  | :value-enum="UserResumeFreeTimeEnumText" | 
|---|
|  |  |  | :value-enum="EnumPersonalFreeTimeText" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </nut-form-item> | 
|---|
|  |  |  | <nut-form-item label="求职状态:" class="bole-form-item" prop="jobSeekingStatus"> | 
|---|
|  |  |  | <ChooseInputWithPicker | 
|---|
|  |  |  | v-model="form.jobSeekingStatus" | 
|---|
|  |  |  | placeholder="请选择求职状态" | 
|---|
|  |  |  | :value-enum="UserResumeJobSeekingStatusEnumText" | 
|---|
|  |  |  | :value-enum="EnumPersonalJobSeekingStatusText" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </nut-form-item> | 
|---|
|  |  |  | </nut-form> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types'; | 
|---|
|  |  |  | import { ChooseInputWithPicker, JobTagList, CommonInputField } from '@12333/components'; | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | UserResumeFreeTimeEnumText, | 
|---|
|  |  |  | UserResumeJobSeekingStatusEnumText, | 
|---|
|  |  |  | UserResumeFreeTimeEnum, | 
|---|
|  |  |  | UserResumeJobSeekingStatusEnum, | 
|---|
|  |  |  | SearchType, | 
|---|
|  |  |  | CategoryCode, | 
|---|
|  |  |  | EnumPersonalFreeTime, | 
|---|
|  |  |  | EnumPersonalJobSeekingStatus, | 
|---|
|  |  |  | EnumPersonalFreeTimeText, | 
|---|
|  |  |  | EnumPersonalJobSeekingStatusText, | 
|---|
|  |  |  | } from '@12333/constants'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import * as userResumeServices from '@12333/services/api/userResume'; | 
|---|
|  |  |  | import { useSearchSettingType } from '@12333/hooks'; | 
|---|
|  |  |  | import * as userResumeServices from '@12333/services/apiV2/userResume'; | 
|---|
|  |  |  | import { useDictionaryDataSelect, useUpdateResume } from '@12333/hooks'; | 
|---|
|  |  |  | import { Message } from '@12333/utils'; | 
|---|
|  |  |  | import { goBack } from '@/utils'; | 
|---|
|  |  |  | import { useQuery } from '@tanstack/vue-query'; | 
|---|
|  |  |  | import { goBack } from '@/utils'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InnerPage', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { searchSettingTypeList: positionList } = useSearchSettingType({ | 
|---|
|  |  |  | searchType: SearchType.Position, | 
|---|
|  |  |  | const { updateUserResume } = useUpdateResume(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { dictionaryDataList: positionList } = useDictionaryDataSelect({ | 
|---|
|  |  |  | categoryCode: CategoryCode.Position, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const jobTagList = computed(() => { | 
|---|
|  |  |  | return positionList.value?.filter((x) => form.jobIdList.includes(x.id)).map((x) => x.name) || []; | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | positionList.value?.filter((x) => form.userExpectJobs.includes(x.value)).map((x) => x.label) || | 
|---|
|  |  |  | [] | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const form = reactive({ | 
|---|
|  |  |  | jobIdList: [] as string[], | 
|---|
|  |  |  | freeTime: UserResumeFreeTimeEnum.NoLimit, | 
|---|
|  |  |  | jobSeekingStatus: UserResumeJobSeekingStatusEnum.Activing, | 
|---|
|  |  |  | userExpectJobs: [] as string[], | 
|---|
|  |  |  | freeTime: EnumPersonalFreeTime.NoLimit, | 
|---|
|  |  |  | jobSeekingStatus: EnumPersonalJobSeekingStatus.Active, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | 
|---|
|  |  |  | data: detail, | 
|---|
|  |  |  | refetch, | 
|---|
|  |  |  | } = useQuery({ | 
|---|
|  |  |  | queryKey: ['userResumeServices/getResumeExpectationJob'], | 
|---|
|  |  |  | queryKey: ['userResumeServices/getUserResumeJobSeeking'], | 
|---|
|  |  |  | queryFn: async () => { | 
|---|
|  |  |  | return await userResumeServices.getResumeExpectationJob({ | 
|---|
|  |  |  | showLoading: false, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | return await userResumeServices.getUserResumeJobSeeking( | 
|---|
|  |  |  | {}, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | showLoading: false, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | placeholderData: () => ({} as API.UserResumeExpectationJobOutput), | 
|---|
|  |  |  | placeholderData: () => ({} as API.GetUserResumeJobSeekingQueryResult), | 
|---|
|  |  |  | onSuccess(data) { | 
|---|
|  |  |  | form.jobIdList = data.jobIdList.map((x) => x.id); | 
|---|
|  |  |  | form.freeTime = data.freeTime; | 
|---|
|  |  |  | form.jobSeekingStatus = data.jobSeekingStatus; | 
|---|
|  |  |  | form.userExpectJobs = data.userExpectJobs.map((x) => x.expectJobCode); | 
|---|
|  |  |  | form.freeTime = data.freeTime ?? ('' as any); | 
|---|
|  |  |  | form.jobSeekingStatus = data.jobSeekingStatus ?? ('' as any); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const rules = reactive<FormRules>({ | 
|---|
|  |  |  | jobIdList: [ | 
|---|
|  |  |  | userExpectJobs: [ | 
|---|
|  |  |  | { | 
|---|
|  |  |  | required: true, | 
|---|
|  |  |  | validator() { | 
|---|
|  |  |  | if (form.jobIdList.length) return Promise.resolve(true); | 
|---|
|  |  |  | if (form.userExpectJobs.length) return Promise.resolve(true); | 
|---|
|  |  |  | return Promise.reject('请选择期望岗位'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function confirm() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.SaveUserResumeExpectationJobInput = { | 
|---|
|  |  |  | jobIdList: form.jobIdList, | 
|---|
|  |  |  | let params: API.SaveUserResumeJobSeekingCommand = { | 
|---|
|  |  |  | userExpectJobs: form.userExpectJobs, | 
|---|
|  |  |  | freeTime: form.freeTime, | 
|---|
|  |  |  | jobSeekingStatus: form.jobSeekingStatus, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await userResumeServices.saveUserResumeExpectationJob(params); | 
|---|
|  |  |  | let res = await userResumeServices.saveUserResumeJobSeeking(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.success('保存成功', { | 
|---|
|  |  |  | onClosed() { | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|
|  |  |  | url: `${RouterPath.mineCurriculumVitae}`, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | res.eventChannel.emit('updateResume', { content: true }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | goBack(); | 
|---|
|  |  |  | updateUserResume(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | url: `${RouterPath.expectPosition}`, | 
|---|
|  |  |  | events: { | 
|---|
|  |  |  | addPosition: function (data: { content: string[] }) { | 
|---|
|  |  |  | form.jobIdList = data.content?.length ? data.content : []; | 
|---|
|  |  |  | form.userExpectJobs = data.content?.length ? data.content : []; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | res.eventChannel.emit('updatePosition', { content: form.jobIdList }); | 
|---|
|  |  |  | res.eventChannel.emit('updatePosition', { content: form.userExpectJobs }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|