wupengfei
2025-03-11 286f1b727856d6b32a8d237f353ae008f3076deb
apps/bMiniApp/src/subpackages/task/taskManage/InnerPage.vue
@@ -8,8 +8,8 @@
    title-gutter="8"
    title-scroll
  >
    <ProTabPane :title="`待安排(10)`" :pane-key="10"></ProTabPane>
    <ProTabPane :title="`已安排(11)`" :pane-key="20"></ProTabPane>
    <ProTabPane :title="`待安排(${notCount})`" pane-key="10"></ProTabPane>
    <ProTabPane :title="`已安排(${hasCount})`" pane-key="20"></ProTabPane>
  </ProTabs>
  <InfiniteLoading
    scrollViewClassName="common-infinite-scroll-list"
@@ -17,10 +17,27 @@
    :key="queryState.status"
  >
    <template #renderItem="{ item }">
      <JobApplicationCard @click="goSubmitTaskDetail(item)" mode="taskManage">
      <JobApplicationCard
        :taskName="item.taskName"
        :startDate="item.startDate"
        :endDate="item.endDate"
        :address="item.address"
        :creationTime="item.creationTime"
        :fee="item.fee"
        :unit="SalaryTimeTypeEnumUnit[item.feeType]"
        @click="goSubmitTaskDetail(item)"
        mode="taskManage"
      >
        <template #footer-actions>
          <!-- <nut-button type="primary">人员安排</nut-button> -->
          <nut-button type="primary" :color="Colors.Info" class="dark-btn">详情</nut-button>
          <nut-button
            v-if="item.isArrange"
            type="primary"
            :color="Colors.Info"
            class="dark-btn"
            @click="goSubmitTaskDetail(item)"
            >详情</nut-button
          >
          <nut-button type="primary" v-else @click="goBatchTaskList(item)">人员安排</nut-button>
        </template>
      </JobApplicationCard>
    </template>
@@ -33,22 +50,24 @@
import { useInfiniteLoading } from '@12333/hooks';
import { OrderInputType, Colors } from '@12333/constants';
import * as flexWorkerServices from '@12333/services/api/FlexWorker';
import { SalaryTimeTypeEnumUnit } from '@/constants/task';
defineOptions({
  name: 'InnerPage',
});
const queryState = reactive({
  status: 10,
  status: '10',
});
const { infiniteLoadingProps } = useInfiniteLoading(
  ({ pageParam }) => {
    let params: API.GetFlexTaskListInput = {
      isArrange: queryState.status === '20',
      pageModel: {
        rows: 20,
        page: pageParam,
        orderInput: [{ property: 'lastShelfTime', order: OrderInputType.Desc }],
        orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
      },
    };
@@ -61,9 +80,22 @@
  }
);
const hasCount = computed(() => {
  return infiniteLoadingProps.value?.listData?.pages?.[0]?.objectData?.hasCount ?? 0;
});
const notCount = computed(() => {
  return infiniteLoadingProps.value?.listData?.pages?.[0]?.objectData?.notCount ?? 0;
});
function goSubmitTaskDetail(item: API.GetFlexTaskListOutput) {
  Taro.navigateTo({
    url: `${RouterPath.batchTaskList}?id=${item.id}`,
    url: `${RouterPath.flexJobDetail}?taskId=${item.taskId}`,
  });
}
function goBatchTaskList(item: API.GetFlexTaskListOutput) {
  Taro.navigateTo({
    url: `${RouterPath.batchTaskList}?taskId=${item.taskId}`,
  });
}
</script>