|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <LoadingLayout :loading="isLoading" :error="isError" :loadError="refetch"> | 
|---|
|  |  |  | <JobDetailContent :isCollapse="true"> | 
|---|
|  |  |  | <JobDetailContent | 
|---|
|  |  |  | :avatar="userResumeInfo.avatar" | 
|---|
|  |  |  | :name="userResumeInfo.name" | 
|---|
|  |  |  | :age="userResumeInfo.age" | 
|---|
|  |  |  | :isReal="userResumeInfo.isReal" | 
|---|
|  |  |  | :gender="userResumeInfo.gender" | 
|---|
|  |  |  | :personalIdentityContent="userResumeInfo.personalIdentityContent" | 
|---|
|  |  |  | :educationalBackgroundContent="userResumeInfo.educationalBackgroundContent" | 
|---|
|  |  |  | :taskCount="userResumeInfo.taskCount" | 
|---|
|  |  |  | :contactPhoneNumber="userResumeInfo.contactPhoneNumber" | 
|---|
|  |  |  | :identity="userResumeInfo.identity" | 
|---|
|  |  |  | :userExpectJobs="userResumeInfo.userExpectJobs" | 
|---|
|  |  |  | :freeTime="userResumeInfo.freeTime" | 
|---|
|  |  |  | :jobSeekingStatus="userResumeInfo.jobSeekingStatus" | 
|---|
|  |  |  | :userCredentials="userResumeInfo.userCredentials" | 
|---|
|  |  |  | :workSeniority="userResumeInfo.workSeniority" | 
|---|
|  |  |  | :workExperience="userResumeInfo.workExperience" | 
|---|
|  |  |  | :photos="userResumeInfo.photos" | 
|---|
|  |  |  | :height="userResumeInfo.height" | 
|---|
|  |  |  | :weight="userResumeInfo.weight" | 
|---|
|  |  |  | :videos="userResumeInfo.videos" | 
|---|
|  |  |  | :taskInfoUsers="userResumeInfo.taskInfoUsers" | 
|---|
|  |  |  | :isCollapse="true" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #footer> | 
|---|
|  |  |  | <PageFooterBtn type="primary" plain @click="taskWorkerHireRefuse(10)">谢绝</PageFooterBtn> | 
|---|
|  |  |  | <PageFooterBtn type="primary" @click="taskWorkerHireRefuse(20)">录用</PageFooterBtn> | 
|---|
|  |  |  | <PageFooterBtn | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | plain | 
|---|
|  |  |  | @click="setTaskUserHire(EnumTaskUserHireStatus.Refuse)" | 
|---|
|  |  |  | v-if="taskUserHireStatusResult.hireStatus === EnumTaskUserHireStatus.Wait" | 
|---|
|  |  |  | >谢绝</PageFooterBtn | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <PageFooterBtn | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click="setTaskUserHire(EnumTaskUserHireStatus.Pass)" | 
|---|
|  |  |  | v-if=" | 
|---|
|  |  |  | taskUserHireStatusResult.hireStatus === EnumTaskUserHireStatus.Wait || | 
|---|
|  |  |  | taskUserHireStatusResult.hireStatus === EnumTaskUserHireStatus.Refuse | 
|---|
|  |  |  | " | 
|---|
|  |  |  | >录用</PageFooterBtn | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </JobDetailContent> | 
|---|
|  |  |  | </LoadingLayout> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { useQuery } from '@tanstack/vue-query'; | 
|---|
|  |  |  | import * as taskUserServices from '@12333/services/apiV2/taskUser'; | 
|---|
|  |  |  | import { Message } from '@12333/utils'; | 
|---|
|  |  |  | import { useUserResume } from '@12333/hooks'; | 
|---|
|  |  |  | import { EnumTaskUserHireStatus } from '@12333/constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InnerPage', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const router = Taro.useRouter(); | 
|---|
|  |  |  | const enterpriseEmployeeId = router.params?.enterpriseEmployeeId ?? ''; | 
|---|
|  |  |  | const id = router.params?.id ?? ''; | 
|---|
|  |  |  | const taskInfoId = router.params?.taskInfoId ?? ''; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | isLoading, | 
|---|
|  |  |  | isError, | 
|---|
|  |  |  | data: detail, | 
|---|
|  |  |  | refetch, | 
|---|
|  |  |  | } = useQuery({ | 
|---|
|  |  |  | queryKey: ['taskServices/getTaskInfo', id], | 
|---|
|  |  |  | queryFn: async () => { | 
|---|
|  |  |  | return await taskServices.getTaskInfo( | 
|---|
|  |  |  | { id: id }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | showLoading: false, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | placeholderData: () => ({} as API.GetTaskInfoQueryResult), | 
|---|
|  |  |  | const { isLoading, isError, userResumeInfo, refetch } = useUserResume({ | 
|---|
|  |  |  | enterpriseEmployeeId: enterpriseEmployeeId, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function taskWorkerHireRefuse(hireStatus: FlexTaskWorkerHireEnum) { | 
|---|
|  |  |  | const { data: taskUserHireStatusResult, refetch: taskUserHireStatusRefetch } = useQuery({ | 
|---|
|  |  |  | queryKey: ['taskUserServices/getTaskUserHireStatus', taskInfoId, userResumeInfo.value.id], | 
|---|
|  |  |  | queryFn: () => { | 
|---|
|  |  |  | let params: API.APIgetTaskUserHireStatusParams = { | 
|---|
|  |  |  | taskInfoId: taskInfoId, | 
|---|
|  |  |  | userId: userResumeInfo.value.id, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | return taskUserServices.getTaskUserHireStatus(params, { showLoading: false }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | enabled: computed(() => !!userResumeInfo.value.id && !!taskInfoId), | 
|---|
|  |  |  | placeholderData: () => ({} as API.GetTaskUserHireStatusQueryResult), | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function setTaskUserHire(hireStatus: EnumTaskUserHireStatus) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.SetTaskUserHireCommand = { | 
|---|
|  |  |  | id: id, | 
|---|
|  |  |  | 
|---|
|  |  |  | let res = await taskUserServices.setTaskUserHire(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.success('操作成功'); | 
|---|
|  |  |  | refetch({ | 
|---|
|  |  |  | taskUserHireStatusRefetch({ | 
|---|
|  |  |  | type: 'inactive', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss"> | 
|---|
|  |  |  | @import '@/styles/common.scss'; | 
|---|
|  |  |  | </style> | 
|---|