wupengfei
2 天以前 8d973d050ba66a497ca763f9670aab457a74e2b1
feat: 签约
14个文件已修改
293 ■■■■ 已修改文件
apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/flexJobManage/flexJobSign/InnerPage.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/hooks/authentication.ts 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationResult/InnerPage.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/authentication/authenticationResult/authenticationResult.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/mine/mineAgreementSign/InnerPage.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/mine/mineAgreementSignDetail/InnerPage.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/constants/apiEnum.ts 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/constants/enterpriseEmployee.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/enterprise.ts 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/enterpriseEmployee.ts 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packages/services/apiV2/typings.d.ts 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apps/bMiniApp/src/subpackages/flexJobManage/flexJobDetailFromManage/InnerPage.vue
@@ -38,7 +38,9 @@
          @click="goToSign"
          v-if="
            enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Wait ||
            enterpriseEmployeeInfo.userSignContractStatus === EnumTaskUserSignContractStatus.Refuse
            enterpriseEmployeeInfo.userSignContractStatus ===
              EnumTaskUserSignContractStatus.Refuse ||
            !enterpriseEmployeeInfo.userSignContractStatus
          "
          >签约</PageFooterBtn
        >
@@ -51,6 +53,7 @@
import Taro from '@tarojs/taro';
import { EnumTaskUserSignContractStatus } from '@12333/constants';
import { useGetEnterpriseEmployee, useUserResume } from '@12333/hooks';
import * as enterpriseEmployeeServices from '@12333/services/apiV2/enterpriseEmployee';
import { Message } from '@12333/utils';
defineOptions({
@@ -77,6 +80,14 @@
async function handleUnsign() {
  try {
    await Message.confirm({ message: '确定要解约吗?' });
    let params: API.StopElectronSignCommand = {
      id: enterpriseEmployeeInfo.value?.id,
    };
    let res = await enterpriseEmployeeServices.stopElectronSign(params);
    if (res) {
      Message.success('解约成功');
      refetch();
    }
  } catch (error) {}
}
</script>
apps/bMiniApp/src/subpackages/flexJobManage/flexJobManage/InnerPage.vue
@@ -10,7 +10,7 @@
  >
    <ProTabPane :title="`已签约`" :pane-key="EnumTaskUserSignContractStatus.Pass"></ProTabPane>
    <ProTabPane :title="`待签约`" :pane-key="EnumTaskUserSignContractStatus.Wait"></ProTabPane>
    <ProTabPane :title="`已解约`" :pane-key="EnumTaskUserSignContractStatus.Refuse"></ProTabPane>
    <ProTabPane :title="`已解约`" :pane-key="EnumTaskUserSignContractStatus.Stop"></ProTabPane>
  </ProTabs>
  <InfiniteLoading
    scrollViewClassName="common-infinite-scroll-list home-list"
@@ -49,7 +49,7 @@
          <nut-button
            v-else-if="
              Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Wait ||
              Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Refuse
              Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Stop
            "
            type="primary"
            @click.stop="goFlexJobSign(item)"
apps/bMiniApp/src/subpackages/flexJobManage/flexJobSign/InnerPage.vue
@@ -74,7 +74,7 @@
    });
  },
  {
    queryKey: ['flexWorkerServices/getFlexTaskByArrange'],
    queryKey: ['flexWorkerServices/getFlexTaskByArrange', queryState],
  }
);
apps/cMiniApp/src/hooks/authentication.ts
@@ -1,11 +1,11 @@
import * as userServices from '@12333/services/api/User';
import * as electronSignServices from '@12333/services/apiV2/electronSign';
import { useQuery, useQueryClient } from '@tanstack/vue-query';
import { getUserCertificationFrontStatusAdapter } from '@12333/utils';
import { UserCertificationFrontStatus } from '@12333/constants';
import { useUser } from './user';
type UseMyCertificationAuditInfoOptions = {
  onSuccess?: (data: API.MyCertificationAuditDto) => void;
  onSuccess?: (data: API.GetPersonalUserRealResultQueryResult) => void;
};
export function useMyCertificationAuditInfo(options: UseMyCertificationAuditInfoOptions = {}) {
@@ -16,15 +16,12 @@
  const queryClient = useQueryClient();
  const { data, isLoading } = useQuery({
    queryKey: ['userServices/getMyCertificationAuditInfo'],
    queryKey: ['electronSignServices/getPersonalUserRealResult'],
    queryFn: async () => {
      return await userServices.getMyCertificationAuditInfo({ showLoading: false });
      return await electronSignServices.getPersonalUserRealResult({}, { showLoading: false });
    },
    placeholderData: () => null as API.MyCertificationAuditDto,
    placeholderData: () => null as API.GetPersonalUserRealResultQueryResult,
    select(data) {
      if (data) {
        data.frontStatus = getUserCertificationFrontStatusAdapter(data.status, data.auditStatus);
      }
      return data;
    },
    onSuccess(data) {
@@ -32,40 +29,23 @@
    },
  });
  /**
   * 是否有审核单
   */
  const hasAduit = computed(() => {
    return data && !!data.value?.currentUserCertificationAuditId;
  });
  const isCertified = computed(
    () => data?.value?.frontStatus === UserCertificationFrontStatus.Certified
  );
  const isExpired = computed(
    () => data?.value?.frontStatus === UserCertificationFrontStatus.Expired
  );
  function invalidateCertificationAuditInfo() {
    updateUserInfo();
    return queryClient.invalidateQueries({
      queryKey: ['userServices/getMyCertificationAuditInfo'],
      queryKey: ['electronSignServices/getPersonalUserRealResult'],
    });
  }
  function ensureCertificationAuditInfo() {
    return queryClient.ensureQueryData({
      queryKey: ['userServices/getMyCertificationAuditInfo'],
      queryKey: ['electronSignServices/getPersonalUserRealResult'],
    });
  }
  return {
    myCertificationAuditInfo: data,
    isLoading,
    hasAduit,
    invalidateCertificationAuditInfo,
    isCertified,
    isExpired,
    ensureCertificationAuditInfo,
  };
}
apps/cMiniApp/src/subpackages/authentication/authenticationResult/InnerPage.vue
@@ -1,15 +1,9 @@
<template>
  <LoadingLayout :loading="isLoading">
    <div
      class="result-wrapper"
      v-if="myCertificationAuditInfo?.frontStatus === UserCertificationFrontStatus.NotCertified"
    >
    <!-- <div class="result-wrapper" v-if="!myCertificationAuditInfo?.isReal">
      <div class="result-title">未认证</div>
    </div>
    <div
      class="result-wrapper"
      v-else-if="myCertificationAuditInfo?.frontStatus === UserCertificationFrontStatus.Certified"
    >
    </div> -->
    <div class="result-wrapper" v-if="myCertificationAuditInfo?.isReal">
      <img class="result-icon" :src="IconSuccess" />
      <div class="result-title">认证成功</div>
      <div class="result-subtitle">您的实名已认证成功</div>
@@ -17,14 +11,13 @@
        >返回个人中心</PageFooterBtn
      >
    </div>
    <div
      class="result-wrapper"
      v-else-if="myCertificationAuditInfo?.frontStatus === UserCertificationFrontStatus.Rejected"
    >
    <div class="result-wrapper" v-else>
      <img class="result-icon" :src="IconError" />
      <div class="result-title">认证失败</div>
      <div class="result-subtitle">您的实名认证失败</div>
      <div class="result-subtitle">失败原因:{{ myCertificationAuditInfo?.auditNote ?? '' }}</div>
      <div class="result-subtitle">
        失败原因:{{ myCertificationAuditInfo?.realFailMessage ?? '' }}
      </div>
      <PageFooterBtn type="primary" class="result-btn" @click="goBack()"
        >重新提交认证</PageFooterBtn
      >
@@ -34,11 +27,9 @@
<script setup lang="ts">
import { useMyCertificationAuditInfo, useSwitchTab } from '@/hooks';
import Taro from '@tarojs/taro';
import { goBack } from '@/utils';
import IconSuccess from '@/assets/authentication/icon-result-success.png';
import IconError from '@/assets/authentication/icon-result-error.png';
import { UserCertificationFrontStatus } from '@12333/constants';
defineOptions({
  name: 'InnerPage',
apps/cMiniApp/src/subpackages/authentication/authenticationResult/authenticationResult.vue
@@ -4,7 +4,6 @@
    class="authenticationResult-page-wrapper"
    hasBorder
    :backFn="handleBack"
    developing
  >
    <InnerPage />
  </PageLayout>
apps/cMiniApp/src/subpackages/mine/mineAgreementSign/InnerPage.vue
@@ -10,7 +10,7 @@
  >
    <ProTabPane :title="`全部`" :pane-key="0"></ProTabPane>
    <ProTabPane :title="`待签约`" :pane-key="EnumTaskUserSignContractStatus.Wait"></ProTabPane>
    <ProTabPane :title="`生效中`" :pane-key="EnumTaskUserSignContractStatus.Effect"></ProTabPane>
    <ProTabPane :title="`生效中`" :pane-key="EnumTaskUserSignContractStatus.Pass"></ProTabPane>
    <ProTabPane :title="`已终止`" :pane-key="EnumTaskUserSignContractStatus.Stop"></ProTabPane>
  </ProTabs>
  <InfiniteLoading
apps/cMiniApp/src/subpackages/mine/mineAgreementSignDetail/InnerPage.vue
@@ -83,6 +83,7 @@
  name: 'InnerPage',
});
const { userDetail } = useUser();
const router = Taro.useRouter();
const id = router.params?.id;
const code = router.params?.code;
@@ -93,7 +94,7 @@
  data: detail,
  refetch,
} = useQuery({
  queryKey: ['enterpriseEmployeeServices/getTaskInfo', id, code],
  queryKey: ['enterpriseEmployeeServices/getPersonalUserElectronSign', id, code],
  queryFn: async () => {
    return await enterpriseEmployeeServices.getPersonalUserElectronSign(
      { id: id, code: code },
@@ -115,7 +116,18 @@
  });
}
const goToSign = useAccessReal(() => {});
const goToSign = useAccessReal(async () => {
  try {
    let params: API.PersonalUserElectronSignCommand = {
      id: id,
    };
    let res = await enterpriseEmployeeServices.personalUserElectronSign(params);
    if (res) {
      const encodedUrl = encodeURIComponent(res.signContractLongUrl);
      Taro.navigateTo({ url: `${RouterPath.extraPage}?url=${encodedUrl}` });
    }
  } catch (error) {}
});
</script>
<style lang="scss">
apps/cMiniApp/src/subpackages/task/taskDetail/InnerPage.vue
@@ -159,6 +159,7 @@
import { useQuery } from '@tanstack/vue-query';
import * as taskServices from '@12333/services/apiV2/task';
import * as taskUserServices from '@12333/services/apiV2/taskUser';
import * as enterpriseEmployeeServices from '@12333/services/apiV2/enterpriseEmployee';
import { useToggle } from 'senin-mini/hooks';
import { TaskPrice, TaskDetailWelfareItem } from '@12333/components';
import IconAttention from '@/assets/task/icon-attention.png';
@@ -192,7 +193,7 @@
/**
 * TODO 缺少 投诉举报接口
 */
const { userDetail } = useUser();
const router = Taro.useRouter();
const id = router.params?.id ?? '';
const from = router.params?.from ?? '';
@@ -281,11 +282,11 @@
    url: `${RouterPath.taskSubmitCheck}?id=${id}`,
  });
}
function handleSign() {
  // Taro.navigateTo({
  //   url: `${RouterPath}?id=${id}`,
  // });
}
const handleSign = useAccessReal(() => {
  Taro.navigateTo({
    url: `${RouterPath.mineAgreementSignDetail}?id=${detail.value?.enterpriseEmployeeId}`,
  });
});
function goMap() {
  Taro.openLocation({
packages/constants/apiEnum.ts
@@ -71,6 +71,22 @@
  AlipaySign = 20,
}
/** 企业用量扣费状态 */
export enum EnumEnterpriseCostStatus {
  /**扣费成功 */
  Success = 10,
  /**扣费失败 */
  Fail = 20,
}
/** 企业用量类型 */
export enum EnumEnterpriseCostType {
  /**短信 */
  SMS = 10,
  /**电子签 */
  ElectronSign = 20,
}
/** 企业实名方式 */
export enum EnumEnterpriseRealMethod {
  /**企业三要素 */
@@ -331,8 +347,6 @@
  Pass = 20,
  /**已拒签 */
  Refuse = 30,
  /**生效中 */
  Effect = 40,
  /**已终止 */
  Stop = 50,
}
packages/constants/enterpriseEmployee.ts
@@ -23,6 +23,5 @@
  [EnumTaskUserSignContractStatus.Wait]: '待签约',
  [EnumTaskUserSignContractStatus.Pass]: '已签约',
  [EnumTaskUserSignContractStatus.Refuse]: '已拒签',
  [EnumTaskUserSignContractStatus.Effect]: '生效中',
  [EnumTaskUserSignContractStatus.Stop]: '已终止',
  [EnumTaskUserSignContractStatus.Stop]: '已解约',
};
packages/services/apiV2/enterprise.ts
@@ -80,6 +80,21 @@
  });
}
/** 保存企业费用 POST /api/user/enterprise/saveEnterpriseCost */
export async function saveEnterpriseCost(
  body: API.SaveEnterpriseCostCommand,
  options?: API.RequestConfig
) {
  return request<string>('/api/user/enterprise/saveEnterpriseCost', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 设置企业电子签配置 PUT /api/user/enterprise/setEnterpriseElectronSignSetting */
export async function setEnterpriseElectronSignSetting(
  body: API.SetEnterpriseElectronSignSettingCommand,
packages/services/apiV2/enterpriseEmployee.ts
@@ -17,6 +17,24 @@
  });
}
/** 企业用户签约 POST /api/user/enterpriseEmployee/enterpriseUserElectronSign */
export async function enterpriseUserElectronSign(
  body: API.EnterpriseUserElectronSignCommand,
  options?: API.RequestConfig
) {
  return request<API.EnterpriseUserElectronSignCommandResult>(
    '/api/user/enterpriseEmployee/enterpriseUserElectronSign',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 查询灵工详情 GET /api/user/enterpriseEmployee/getEnterpriseEmployee */
export async function getEnterpriseEmployee(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
@@ -121,3 +139,36 @@
    ...(options || {}),
  });
}
/** 个人用户签约 POST /api/user/enterpriseEmployee/personalUserElectronSign */
export async function personalUserElectronSign(
  body: API.PersonalUserElectronSignCommand,
  options?: API.RequestConfig
) {
  return request<API.PersonalUserElectronSignCommandResult>(
    '/api/user/enterpriseEmployee/personalUserElectronSign',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 灵工解约 POST /api/user/enterpriseEmployee/stopElectronSign */
export async function stopElectronSign(
  body: API.StopElectronSignCommand,
  options?: API.RequestConfig
) {
  return request<string>('/api/user/enterpriseEmployee/stopElectronSign', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json-patch+json',
    },
    data: body,
    ...(options || {}),
  });
}
packages/services/apiV2/typings.d.ts
@@ -389,6 +389,18 @@
    data?: any;
  }
  interface EnterpriseUserElectronSignCommand {
    /** 灵工Id */
    id?: string;
  }
  interface EnterpriseUserElectronSignCommandResult {
    /** 签署合同短链接 */
    signContractShortUrl?: string;
    /** 签署合同长链接 */
    signContractLongUrl?: string;
  }
  enum EnumBillingMethod {
    /**按月 */
    Month = 10,
@@ -449,6 +461,20 @@
    BestSign = 10,
    /**支付宝信任签 */
    AlipaySign = 20,
  }
  enum EnumEnterpriseCostStatus {
    /**扣费成功 */
    Success = 10,
    /**扣费失败 */
    Fail = 20,
  }
  enum EnumEnterpriseCostType {
    /**短信 */
    SMS = 10,
    /**电子签 */
    ElectronSign = 20,
  }
  enum EnumEnterpriseRealMethod {
@@ -687,8 +713,6 @@
    Pass = 20,
    /**已拒签 */
    Refuse = 30,
    /**生效中 */
    Effect = 40,
    /**已终止 */
    Stop = 50,
  }
@@ -750,6 +774,24 @@
    errorCode?: string;
    /** 数据 */
    data?: boolean;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultEnterpriseUserElectronSignCommandResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: EnterpriseUserElectronSignCommandResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
@@ -1961,6 +2003,24 @@
    timestamp?: number;
  }
  interface FriendlyResultPersonalUserElectronSignCommandResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: PersonalUserElectronSignCommandResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultString {
    /** 跟踪Id */
    traceId?: string;
@@ -2182,6 +2242,8 @@
    /** 提交Id */
    id?: string;
    enterpriseEmployeeUser?: GetCheckReceiveTaskUserSubmitsQueryResultObjectDataEnterpriseEmployeeUser;
    /** 验收时间 */
    date?: string;
    /** 提交时间 */
    createdTime?: string;
    /** 验收照片 */
@@ -2206,6 +2268,8 @@
  interface GetCheckReceiveTaskUserSubmitsQueryResultItem {
    /** 提交Id */
    id?: string;
    /** 验收时间 */
    date?: string;
    /** 提交时间 */
    createdTime?: string;
    /** 验收照片 */
@@ -3564,6 +3628,8 @@
    status?: EnumTaskStatus;
    releaseStatus?: EnumTaskReleaseStatus;
    hireStatus?: EnumTaskUserHireStatus;
    /** 灵工Id */
    enterpriseEmployeeId?: string;
    applyButton?: GetTaskInfoQueryResultApplyButton;
    hireButton?: GetTaskInfoQueryResultHireButton;
  }
@@ -4147,6 +4213,18 @@
    clientType?: EnumClientType;
  }
  interface PersonalUserElectronSignCommand {
    /** 灵工Id */
    id?: string;
  }
  interface PersonalUserElectronSignCommandResult {
    /** 签署合同短链接 */
    signContractShortUrl?: string;
    /** 签署合同长链接 */
    signContractLongUrl?: string;
  }
  interface PersonalUserFaceRealCommand {
    /** 姓名 */
    name: string;
@@ -4299,6 +4377,17 @@
    password?: string;
    /** Id */
    id?: string;
  }
  interface SaveEnterpriseCostCommand {
    /** 企业Id */
    enterpriseId?: string;
    type?: EnumEnterpriseCostType;
    /** 合同模板Id */
    contractTemplateId?: string;
    /** 灵工合同Id */
    enterpriseEmployeeContractId?: string;
    status?: EnumEnterpriseCostStatus;
  }
  interface SaveMenuButtonCommand {
@@ -4673,6 +4762,11 @@
    clientType?: EnumClientType;
  }
  interface StopElectronSignCommand {
    /** 灵工Id */
    id?: string;
  }
  interface SubmitCheckReceiveTaskCommand {
    /** 任务Id */
    taskInfoId?: string;