|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <ProTabs | 
|---|
|  |  |  | v-model="queryState.mineHireType" | 
|---|
|  |  |  | v-model="queryState.signContractStatus" | 
|---|
|  |  |  | name="home-tab" | 
|---|
|  |  |  | :showPaneContent="false" | 
|---|
|  |  |  | class="home-tabs" | 
|---|
|  |  |  | 
|---|
|  |  |  | title-gutter="12" | 
|---|
|  |  |  | title-scroll | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <ProTabPane :title="`已签约`" :pane-key="TaskStatus.All"></ProTabPane> | 
|---|
|  |  |  | <ProTabPane :title="`待签约`" :pane-key="TaskStatus.WaitSign"></ProTabPane> | 
|---|
|  |  |  | <ProTabPane :title="`已解约`" :pane-key="TaskStatus.Effect"></ProTabPane> | 
|---|
|  |  |  | <ProTabPane | 
|---|
|  |  |  | :title="`灵工待签约`" | 
|---|
|  |  |  | :pane-key="EnumGetEnterpriseEmployeesQuerySignContractStatus.UserWait" | 
|---|
|  |  |  | ></ProTabPane> | 
|---|
|  |  |  | <ProTabPane | 
|---|
|  |  |  | :title="`企业待签约`" | 
|---|
|  |  |  | :pane-key="EnumGetEnterpriseEmployeesQuerySignContractStatus.EnterpriseWait" | 
|---|
|  |  |  | ></ProTabPane> | 
|---|
|  |  |  | <ProTabPane | 
|---|
|  |  |  | :title="`已签约`" | 
|---|
|  |  |  | :pane-key="EnumGetEnterpriseEmployeesQuerySignContractStatus.Pass" | 
|---|
|  |  |  | ></ProTabPane> | 
|---|
|  |  |  | <!-- <ProTabPane :title="`已解约`" :pane-key="EnumTaskUserSignContractStatus.Stop"></ProTabPane> --> | 
|---|
|  |  |  | </ProTabs> | 
|---|
|  |  |  | <InfiniteLoading | 
|---|
|  |  |  | scrollViewClassName="common-infinite-scroll-list home-list" | 
|---|
|  |  |  | v-bind="infiniteLoadingProps" | 
|---|
|  |  |  | :key="queryState.signContractStatus" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #renderItem="{ item }"> | 
|---|
|  |  |  | <FlexJobCard :show-done-detail="false" :show-footer-left="false" @click="goDetail(item)"> | 
|---|
|  |  |  | <FlexJobCard | 
|---|
|  |  |  | :show-done-detail="false" | 
|---|
|  |  |  | :show-footer-left="false" | 
|---|
|  |  |  | :name="item.name" | 
|---|
|  |  |  | :gender="item.gender" | 
|---|
|  |  |  | :age="item.age" | 
|---|
|  |  |  | :isReal="item.userIsReal" | 
|---|
|  |  |  | :personalIdentityContent="item.personalIdentityContent" | 
|---|
|  |  |  | :educationalBackgroundContent="item.educationalBackgroundContent" | 
|---|
|  |  |  | :taskCount="item.taskCount" | 
|---|
|  |  |  | :avatar="item.avatar" | 
|---|
|  |  |  | :workExperience="item.workExperience" | 
|---|
|  |  |  | :workSeniority="item.workSeniority" | 
|---|
|  |  |  | @click="goDetail(item)" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #footerRight> | 
|---|
|  |  |  | <template v-if="Number(queryState.mineHireType) === TaskStatus.All"> | 
|---|
|  |  |  | <template | 
|---|
|  |  |  | v-if="item.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Pass" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <nut-button | 
|---|
|  |  |  | class="flexJobManage-card-plain-button" | 
|---|
|  |  |  | type="default" | 
|---|
|  |  |  | plain | 
|---|
|  |  |  | @click.stop="handleUnContract" | 
|---|
|  |  |  | @click.stop="handleUnsign(item)" | 
|---|
|  |  |  | >解约</nut-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <nut-button type="primary" @click.stop="checkContract">查看合约</nut-button> | 
|---|
|  |  |  | <nut-button type="primary" @click.stop="checkContract(item)">查看合约</nut-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <nut-button v-else type="primary" @click.stop="goSignContract(item)">签约</nut-button> | 
|---|
|  |  |  | <nut-button | 
|---|
|  |  |  | v-if=" | 
|---|
|  |  |  | item.userSignContractStatus === EnumTaskUserSignContractStatus.Wait || | 
|---|
|  |  |  | !item.userSignContractStatus | 
|---|
|  |  |  | " | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click.stop="goFlexJobSign(item)" | 
|---|
|  |  |  | >邀请签约</nut-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <nut-button | 
|---|
|  |  |  | v-if="item.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait" | 
|---|
|  |  |  | type="primary" | 
|---|
|  |  |  | @click.stop="goEnterpriseSign(item)" | 
|---|
|  |  |  | >企业签约</nut-button | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </FlexJobCard> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { FlexJobCard, ProTabs, ProTabPane } from '@12333/components'; | 
|---|
|  |  |  | import { RouterPath } from '@/constants'; | 
|---|
|  |  |  | import { useInfiniteLoading } from '@12333/hooks'; | 
|---|
|  |  |  | import { OrderInputType } from '@12333/constants'; | 
|---|
|  |  |  | import * as orderServices from '@12333/services/api/Order'; | 
|---|
|  |  |  | import { TaskStatus } from '@/constants/task'; | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | EnumTaskUserHireStatus, | 
|---|
|  |  |  | EnumTaskUserSignContractStatus, | 
|---|
|  |  |  | EnumPagedListOrder, | 
|---|
|  |  |  | EnumGetEnterpriseEmployeesQuerySignContractStatus, | 
|---|
|  |  |  | } from '@12333/constants'; | 
|---|
|  |  |  | import * as enterpriseEmployeeServices from '@12333/services/apiV2/enterpriseEmployee'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  | import { Message, openDocument, setOSSLink } from '@12333/utils'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'InnerPage', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const queryState = reactive({ | 
|---|
|  |  |  | mineHireType: TaskStatus.All, | 
|---|
|  |  |  | signContractStatus: EnumGetEnterpriseEmployeesQuerySignContractStatus.UserWait, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { infiniteLoadingProps } = useInfiniteLoading( | 
|---|
|  |  |  | const { infiniteLoadingProps, invalidateQueries } = useInfiniteLoading( | 
|---|
|  |  |  | ({ pageParam }) => { | 
|---|
|  |  |  | let params: API.FrontOrderListInput = { | 
|---|
|  |  |  | let params: API.GetEnterpriseEmployeesQuery = { | 
|---|
|  |  |  | pageModel: { | 
|---|
|  |  |  | rows: 20, | 
|---|
|  |  |  | page: pageParam, | 
|---|
|  |  |  | orderInput: [{ property: 'isRecommend', order: OrderInputType.Desc }], | 
|---|
|  |  |  | orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | hireStatus: EnumTaskUserHireStatus.Pass, | 
|---|
|  |  |  | signContractStatus: queryState.signContractStatus, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return orderServices.getFrontOrderList(params, { | 
|---|
|  |  |  | return enterpriseEmployeeServices.getEnterpriseEmployees(params, { | 
|---|
|  |  |  | showLoading: false, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | queryKey: ['orderServices/getFrontOrderList'], | 
|---|
|  |  |  | queryKey: ['enterpriseEmployeeServices/getEnterpriseEmployees', queryState], | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function goDetail(item: API.FrontOrderList) { | 
|---|
|  |  |  | function checkContract(item: API.GetEnterpriseEmployeesQueryResultItem) { | 
|---|
|  |  |  | if (!item.contractUrl) { | 
|---|
|  |  |  | Message.warning('协议无法查看,请稍后再试'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | openDocument(setOSSLink(item.contractUrl)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function goDetail(item: API.GetEnterpriseEmployeesQueryResultItem) { | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|
|  |  |  | url: `${RouterPath.flexJobDetailFromManage}?id=${item.id}`, | 
|---|
|  |  |  | url: `${RouterPath.flexJobDetailFromManage}?enterpriseEmployeeId=${item.id}`, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function checkContract() {} | 
|---|
|  |  |  | function handleUnContract() {} | 
|---|
|  |  |  | function goSignContract(item: API.FrontOrderList) { | 
|---|
|  |  |  | async function handleUnsign(item: API.GetEnterpriseEmployeesQueryResultItem) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | await Message.confirm({ message: '确定要解约吗?' }); | 
|---|
|  |  |  | let params: API.StopElectronSignCommand = { | 
|---|
|  |  |  | ids: [item.id], | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await enterpriseEmployeeServices.stopElectronSign(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.success('解约成功'); | 
|---|
|  |  |  | invalidateQueries(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | function goFlexJobSign(item: API.GetEnterpriseEmployeesQueryResultItem) { | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|
|  |  |  | url: `${RouterPath.flexJobSign}`, | 
|---|
|  |  |  | url: `${RouterPath.flexJobSign}?enterpriseEmployeeId=${item.id}`, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function goEnterpriseSign(item: API.GetEnterpriseEmployeesQueryResultItem) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let res = await enterpriseEmployeeServices.enterpriseUserElectronSign({ id: item.id }); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
|---|
|  |  |  | Taro.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style lang="scss"> | 
|---|