zhengyiming
5 天以前 0b73bba28e2a8473ab71f5c8b4760c1995ff4fc1
src/hooks/fourStreams.ts
@@ -1,5 +1,5 @@
import { defineColumns, defineOperationBtns, useFormDialog, useTable } from '@bole-core/components';
import { OrderInputType } from '@bole-core/core';
import { Message, OrderInputType } from '@bole-core/core';
import { useQueryClient } from '@tanstack/vue-query';
import { setOSSLink } from '@/utils';
import {
@@ -15,12 +15,22 @@
  FinanceStatusEnumText,
  FinanceStatusEnumTextV2,
  FinanceStatusEnumTextV2Query,
  FourStreamsExtraMaterialFileSearchType,
  SearchType,
  SettleStatusEnumTextV2,
  TransferToStatusEnum,
  TransferToStatusEnumText,
} from '@/constants';
export const rewardGrantRegisterColumns = computed(() =>
type UseRewardGrantRegisterColumnsOptions = {
  suportPlatRecharge?: MaybeRef<boolean>;
  suportFinance?: MaybeRef<boolean>;
};
export function useRewardGrantRegisterColumns(options: UseRewardGrantRegisterColumnsOptions = {}) {
  const { suportPlatRecharge, suportFinance } = options;
  const rewardGrantRegisterColumns = computed(() =>
  defineColumns([
    ...BaseDeclareEnterpriseTableViewColumns,
    {
@@ -74,13 +84,17 @@
  ])
);
  return { rewardGrantRegisterColumns };
}
type UseDeclareEnterpriseTableOptions = {
  id?: Ref<string>;
  applyMonth?: Ref<string>;
  enableUploadExtraFiles?: boolean;
};
export function useDeclareEnterpriseTable(options: UseDeclareEnterpriseTableOptions = {}) {
  const { id, applyMonth } = options;
  const { id, applyMonth, enableUploadExtraFiles = false } = options;
  const {
    getDataSource: getList,
@@ -134,6 +148,7 @@
  const queryClient = useQueryClient();
  const { dialogProps, handleAdd, editForm, dialogState } = useFormDialog({
    onConfirm: handleUpload,
    defaultFormParams: {
      list: [] as CustomerApplyFileTypeListItem[],
      companyId: '',
@@ -170,11 +185,18 @@
        companyId: row.enterpriseId,
        parkBountyApplyId: id.value,
      });
      const applyUploadExtraFiles =
        await parkBountyApplyServices.getEnterpriseParkApplyUploadExtraFiles({
          companyId: row.enterpriseId,
          parkBountyApplyId: id.value,
        });
      handleAdd({
        list: EnterpriseApplyFileUtils.initParkCollectFileListApplyFiles(
          applyUploadFiles,
          applyFilesRes.items,
          lastUploadEnterPactFile
          lastUploadEnterPactFile,
          applyUploadExtraFiles
        ),
        companyId: row.enterpriseId,
      });
@@ -191,7 +213,35 @@
        onClick: (row) => openDialog(row),
      },
    },
  ]);
    enableUploadExtraFiles && {
      data: {
        enCode: 'uploadBtn',
        name: '补充材料',
      },
      emits: {
        onClick: (row) => openDialog(row),
      },
    },
  ]).filter(Boolean);
  async function handleUpload() {
    try {
      if (!enableUploadExtraFiles) return;
      let params: API.UploadParkApplyCustomerFilesInput = {
        parkBountyApplyId: id.value,
        companyId: editForm.companyId,
        fileTypes: EnterpriseApplyFileUtils.convertFileTableListToApplyCompanyFile(
          editForm.list.filter((x) =>
            EnterpriseApplyFileUtils.isApplyUploadExtraFileSearchTypeId(x.fileSearchTypeId)
          )
        ),
      };
      let res = await parkBountyApplyServices.uploadParkBountyApplyCompanyExtraFile(params);
      if (res) {
        Message.successMessage('操作成功');
      }
    } catch (error) {}
  }
  return {
    getList,