From c8a804e84c59153ae84a2a848bd03686cf9dfd04 Mon Sep 17 00:00:00 2001 From: zhengyiming <540361168@qq.com> Date: 星期五, 29 八月 2025 13:49:41 +0800 Subject: [PATCH] Merge branch 'master' of http://120.26.58.240:8888/r/flexJobMiniApp --- apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue | 35 +++++++++++++++-- packages/components/src/Card/TaskCard.vue | 4 - packages/hooks/user.ts | 30 +++++++++++++++ apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue | 17 ++++++-- packages/services/apiV2/typings.d.ts | 1 apps/cMiniApp/src/pages/task/InnerPage.vue | 1 apps/cMiniApp/src/pages/mine/index.vue | 2 - 7 files changed, 75 insertions(+), 15 deletions(-) diff --git a/apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue b/apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue index 0ef1f73..b915d25 100644 --- a/apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue +++ b/apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue @@ -24,8 +24,24 @@ :isCollapse="true" > <template #footer> - <PageFooterBtn v-if="userResumeInfo" type="primary" plain>瑙g害</PageFooterBtn> - <PageFooterBtn type="primary" @click="goToSign">绛剧害</PageFooterBtn> + <PageFooterBtn + v-if=" + enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Pass + " + type="primary" + plain + @click="handleUnsign" + >瑙g害</PageFooterBtn + > + <PageFooterBtn + type="primary" + @click="goToSign" + v-if=" + enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Wait || + enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Refuse + " + >绛剧害</PageFooterBtn + > </template> </JobDetailContent> </LoadingLayout> @@ -33,8 +49,9 @@ <script setup lang="ts"> import Taro from '@tarojs/taro'; -import { useQuery } from '@tanstack/vue-query'; -import { useUserResume } from '@12333/hooks'; +import { EnumTaskUserSignContractStatus } from '@12333/constants'; +import { useGetEnterpriseEmployee, useUserResume } from '@12333/hooks'; +import { Message } from '@12333/utils'; defineOptions({ name: 'InnerPage', @@ -47,11 +64,21 @@ enterpriseEmployeeId: enterpriseEmployeeId, }); +const { enterpriseEmployeeInfo } = useGetEnterpriseEmployee({ + id: enterpriseEmployeeId, +}); + function goToSign() { Taro.navigateTo({ url: `${RouterPath.flexJobSign}?enterpriseEmployeeId=${enterpriseEmployeeId}`, }); } + +async function handleUnsign() { + try { + await Message.confirm({ message: '纭畾瑕佽В绾﹀悧锛�' }); + } catch (error) {} +} </script> <style lang="scss"> diff --git a/apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue b/apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue index fa18638..46982c2 100644 --- a/apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue +++ b/apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue @@ -41,7 +41,7 @@ class="flexJobManage-card-plain-button" type="default" plain - @click.stop="goDetail(item)" + @click.stop="handleUnsign(item)" >瑙g害</nut-button > <nut-button type="primary" @click.stop="checkContract">鏌ョ湅鍚堢害</nut-button> @@ -52,7 +52,7 @@ Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Refuse " type="primary" - @click.stop="goDetail(item)" + @click.stop="goFlexJobSign(item)" >绛剧害</nut-button > </template> @@ -72,6 +72,7 @@ } from '@12333/constants'; import * as enterpriseEmployeeServices from '@12333/services/apiV2/enterpriseEmployee'; import Taro from '@tarojs/taro'; +import { Message } from '@12333/utils'; defineOptions({ name: 'InnerPage', @@ -102,16 +103,22 @@ } ); +function checkContract() {} + function goDetail(item: API.GetEnterpriseEmployeesQueryResultItem) { Taro.navigateTo({ url: `${RouterPath.flexJobDetailFromManage}?enterpriseEmployeeId=${item.id}`, }); } -function checkContract() {} -function goSignContract(item: API.GetNewestWorkerListOutput) { +async function handleUnsign(item: API.GetEnterpriseEmployeesQueryResultItem) { + try { + await Message.confirm({ message: '纭畾瑕佽В绾﹀悧锛�' }); + } catch (error) {} +} +function goFlexJobSign(item: API.GetEnterpriseEmployeesQueryResultItem) { Taro.navigateTo({ - url: `${RouterPath.flexJobSign}`, + url: `${RouterPath.flexJobSign}?enterpriseEmployeeId=${item.id}`, }); } </script> diff --git a/apps/cMiniApp/src/pages/mine/index.vue b/apps/cMiniApp/src/pages/mine/index.vue index 167e50a..74f192b 100644 --- a/apps/cMiniApp/src/pages/mine/index.vue +++ b/apps/cMiniApp/src/pages/mine/index.vue @@ -112,8 +112,6 @@ import { useSystemStore } from '@/stores/modules/system'; import PageLayoutWithBg from '@/components/Layout/PageLayoutWithBg.vue'; import { toThousand } from '@12333/utils'; -import { useQuery } from '@tanstack/vue-query'; -import * as authServices from '@12333/services/apiV2/auth'; const { userDetail, isCertified, updateUserInfo } = useUser(); const isLogin = useIsLogin(); diff --git a/apps/cMiniApp/src/pages/task/InnerPage.vue b/apps/cMiniApp/src/pages/task/InnerPage.vue index ecbd722..052f54a 100644 --- a/apps/cMiniApp/src/pages/task/InnerPage.vue +++ b/apps/cMiniApp/src/pages/task/InnerPage.vue @@ -48,7 +48,6 @@ const { queryState, infiniteLoadingProps } = useCheckReceiveTasks(); function goSubmitTaskDetail(item: API.GetCheckReceiveTasksQueryResultItem) { - console.log('queryState.date: ', queryState.date); if (Number(queryState.checkReceiveStatus) === EnumTaskCheckReceiveStatus.WaitSubmit) { Taro.navigateTo({ url: `${RouterPath.taskSubmitCheck}?id=${item.id}&date=${queryState.date}`, diff --git a/packages/components/src/Card/TaskCard.vue b/packages/components/src/Card/TaskCard.vue index edbd5fb..b983916 100644 --- a/packages/components/src/Card/TaskCard.vue +++ b/packages/components/src/Card/TaskCard.vue @@ -25,9 +25,7 @@ </div> </div> <div class="task-card-time"> - {{ dayjs(beginTime).format('YYYY骞碝M鏈圖D鏃�') }}鑷硔{ - dayjs(endTime).format('YYYY骞碝M鏈圖D鏃�') - }} + {{ dayjs(beginTime).format('YYYY骞碝M鏈圖鏃�') }}鑷硔{ dayjs(endTime).format('YYYY骞碝M鏈圖鏃�') }} </div> </slot> <div class="task-card-footer"> diff --git a/packages/hooks/user.ts b/packages/hooks/user.ts index 190eaf1..1c703a5 100644 --- a/packages/hooks/user.ts +++ b/packages/hooks/user.ts @@ -1,5 +1,6 @@ import { MaybeRef, computed, unref } from 'vue'; import * as userResumeServices from '@12333/services/apiV2/userResume'; +import * as enterpriseEmployeeServices from '@12333//services/apiV2/enterpriseEmployee'; import { useQuery, useQueryClient } from '@tanstack/vue-query'; type UseUserResumeOptions = { @@ -52,3 +53,32 @@ updateUserResume, }; } + +type UseGetEnterpriseEmployeeOptions = { + id?: MaybeRef<string>; +}; + +export function useGetEnterpriseEmployee(options: UseGetEnterpriseEmployeeOptions = {}) { + const { id } = options; + + const { data, refetch, isLoading, isError } = useQuery({ + queryKey: ['enterpriseEmployeeServices/getEnterpriseEmployee', id], + queryFn: async () => { + return await enterpriseEmployeeServices.getEnterpriseEmployee( + { id: unref(id) }, + { + showLoading: false, + } + ); + }, + placeholderData: () => ({} as API.GetEnterpriseEmployeeQueryResult), + enabled: computed(() => !!unref(id)), + }); + + return { + enterpriseEmployeeInfo: data, + refetch, + isLoading, + isError, + }; +} diff --git a/packages/services/apiV2/typings.d.ts b/packages/services/apiV2/typings.d.ts index 2884491..0b8e9b4 100644 --- a/packages/services/apiV2/typings.d.ts +++ b/packages/services/apiV2/typings.d.ts @@ -2593,6 +2593,7 @@ enterpriseSignContractTime?: string; /** 鐢靛瓙鍚堝悓 */ contractUrl?: string; + userSignContractStatus?: EnumTaskUserSignContractStatus; } interface GetEnterpriseEmployeesQuery { -- Gitblit v1.9.1