|  |  |  | 
|---|
|  |  |  | ></MineAgreementSignDetailItem> | 
|---|
|  |  |  | <MineAgreementSignDetailItem | 
|---|
|  |  |  | label="协议状态" | 
|---|
|  |  |  | :detail="EnumTaskUserSignContractStatusText[detail?.userSignContractStatus]" | 
|---|
|  |  |  | :detail="EnumTaskUserSignContractStatusSignText[detail?.userSignContractStatus]" | 
|---|
|  |  |  | ></MineAgreementSignDetailItem> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </MineAgreementSignDetailCard> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | EnumElectronSignAccess, | 
|---|
|  |  |  | EnumTaskUserSignContractStatus, | 
|---|
|  |  |  | EnumTaskUserSignContractStatusText, | 
|---|
|  |  |  | EnumTaskUserSignContractStatusSignText, | 
|---|
|  |  |  | } from '@12333/constants'; | 
|---|
|  |  |  | import { format, hiddenPhone, Message, setOSSLink } from '@12333/utils'; | 
|---|
|  |  |  | import { format, hiddenPhone, Message, setOSSLink, openDocument } from '@12333/utils'; | 
|---|
|  |  |  | import Taro from '@tarojs/taro'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { userDetail } = useUser(); | 
|---|
|  |  |  | const router = Taro.useRouter(); | 
|---|
|  |  |  | const options = Taro.getLaunchOptionsSync(); | 
|---|
|  |  |  | //灵工Id | 
|---|
|  |  |  | const id = router.params?.id; | 
|---|
|  |  |  | const code = router.params?.code; | 
|---|
|  |  |  | const code = router.params?.code || options?.query?.scene; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | isLoading, | 
|---|
|  |  |  | 
|---|
|  |  |  | detail?.value?.userSignContractStatus === EnumTaskUserSignContractStatus.Stop || | 
|---|
|  |  |  | detail?.value?.userSignContractStatus === EnumTaskUserSignContractStatus.Pass | 
|---|
|  |  |  | ) { | 
|---|
|  |  |  | const encodedUrl = encodeURIComponent(setOSSLink(detail?.value?.contractUrl)); | 
|---|
|  |  |  | Taro.navigateTo({ | 
|---|
|  |  |  | url: `${RouterPath.mineAgreementSignExtraPage}?url=${encodedUrl}`, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (!detail?.value?.contractUrl) { | 
|---|
|  |  |  | Message.warning('协议无法查看,请稍后再试'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | openDocument(setOSSLink(detail?.value?.contractUrl)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const goToSign = useAccessReal(async () => { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | // if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.BestSign) { | 
|---|
|  |  |  | let params: API.PersonalUserElectronSignCommand = { | 
|---|
|  |  |  | id: id, | 
|---|
|  |  |  | id: detail.value?.id, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await enterpriseEmployeeServices.personalUserElectronSign(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
|---|
|  |  |  | Taro.navigateTo({ url: `${RouterPath.mineAgreementSignExtraPage}?url=${encodedUrl}` }); | 
|---|
|  |  |  | if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.AlipaySign) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | await Message.confirm({ | 
|---|
|  |  |  | message: `签约短信已发送至您${hiddenPhone( | 
|---|
|  |  |  | detail.value?.contactPhoneNumber | 
|---|
|  |  |  | )}的手机,请及时查看并签约`, | 
|---|
|  |  |  | cancelText: '未收到短信', | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } catch (error) { | 
|---|
|  |  |  | goToSign(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | const encodedUrl = encodeURIComponent(res.signContractLongUrl); | 
|---|
|  |  |  | Taro.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | // if (detail.value?.contractTemplateAccess === EnumElectronSignAccess.AlipaySign) { | 
|---|
|  |  |  | //   Message.confirm({ | 
|---|
|  |  |  | //     message: `签约短信已发送至您${hiddenPhone( | 
|---|
|  |  |  | //       detail.value?.contactPhoneNumber | 
|---|
|  |  |  | //     )}的手机,请及时查看并签约`, | 
|---|
|  |  |  | //     showCancelBtn: false, | 
|---|
|  |  |  | //   }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | Taro.useDidShow(() => { | 
|---|