wupengfei
5 天以前 157ccc5dd9df9358f62a2f753668f21bec1c90ee
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"
@@ -18,27 +18,43 @@
    :key="queryState.userSignContractStatus"
  >
    <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>
          <span></span>
          <!-- <template
            v-if="queryState.userSignContractStatus === EnumTaskUserSignContractStatus.Pass"
          <template
            v-if="Number(queryState.userSignContractStatus) === 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>
          </template>
          <nut-button
            v-else-if="queryState.userSignContractStatus === EnumTaskUserSignContractStatus.Wait"
            v-else-if="
              Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Wait ||
              Number(queryState.userSignContractStatus) === EnumTaskUserSignContractStatus.Stop
            "
            type="primary"
            @click.stop="goSignContract(item)"
            @click.stop="goFlexJobSign(item)"
            >签约</nut-button
          > -->
          >
        </template>
      </FlexJobCard>
    </template>
@@ -56,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',
@@ -65,7 +82,7 @@
  userSignContractStatus: EnumTaskUserSignContractStatus.Pass,
});
const { infiniteLoadingProps } = useInfiniteLoading(
const { infiniteLoadingProps, invalidateQueries } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.GetEnterpriseEmployeesQuery = {
      pageModel: {
@@ -86,17 +103,30 @@
  }
);
function checkContract() {}
function goDetail(item: API.GetEnterpriseEmployeesQueryResultItem) {
  Taro.navigateTo({
    url: `${RouterPath.flexJobDetailFromManage}?userId=${item.id}`,
    url: `${RouterPath.flexJobDetailFromManage}?enterpriseEmployeeId=${item.id}`,
  });
}
function checkContract() {}
function handleUnContract() {}
function goSignContract(item: API.GetNewestWorkerListOutput) {
async function handleUnsign(item: API.GetEnterpriseEmployeesQueryResultItem) {
  try {
    await Message.confirm({ message: '确定要解约吗?' });
    let params: API.StopElectronSignCommand = {
      id: 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}`,
  });
}
</script>