From fc6bbae5805da6c95fd675210999a03802cd62ad Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 23 十月 2025 15:39:12 +0800
Subject: [PATCH] fix: 数据看板

---
 src/hooks/fourStreams.ts |  189 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 136 insertions(+), 53 deletions(-)

diff --git a/src/hooks/fourStreams.ts b/src/hooks/fourStreams.ts
index b312d80..0ea2acc 100644
--- a/src/hooks/fourStreams.ts
+++ b/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 {
@@ -8,61 +8,93 @@
 } from '@/components/commonView/utils';
 import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
 import * as enterpriseApplyFileServices from '@/services/api/EnterpriseApplyFile';
-import { BaseDeclareEnterpriseTableViewColumns, EnterpriseTypeText } from '@/constants';
+import {
+  BaseDeclareEnterpriseTableViewColumns,
+  EnterpriseTypeText,
+  FinanceStatusEnum,
+  FinanceStatusEnumText,
+  FinanceStatusEnumTextV2,
+  FinanceStatusEnumTextV2Query,
+  FourStreamsExtraMaterialFileSearchType,
+  SearchType,
+  SettleStatusEnumTextV2,
+  TransferToStatusEnum,
+  TransferToStatusEnumText,
+} from '@/constants';
 
-export const rewardGrantRegisterColumns = computed(() =>
-  defineColumns([
-    ...BaseDeclareEnterpriseTableViewColumns,
-    {
-      id: '9',
-      enCode: 'a',
-      name: '璐㈡斂鎷ㄤ粯閲戦',
-    },
-    {
-      id: '10',
-      enCode: 'a',
-      name: '璐㈡斂鎷ㄤ粯宸茬櫥璁�',
-    },
-    {
-      id: '11',
-      enCode: 'a',
-      name: '鏈�杩戠櫥璁版棩鏈�',
-    },
-    {
-      id: '12',
-      enCode: 'a',
-      name: '璐㈡斂鎷ㄤ粯鐧昏鐘舵��',
-    },
-    {
-      id: '13',
-      enCode: 'a',
-      name: '骞冲彴鎷ㄤ粯閲戦',
-    },
-    {
-      id: '14',
-      enCode: 'a',
-      name: '骞冲彴鎷ㄤ粯宸茬櫥璁�',
-    },
-    {
-      id: '15',
-      enCode: 'a',
-      name: '鏈�杩戠櫥璁版棩鏈�',
-    },
-    {
-      id: '16',
-      enCode: 'a',
-      name: '骞冲彴鎷ㄤ粯鐧昏鐘舵��',
-    },
-  ])
-);
+type UseRewardGrantRegisterColumnsOptions = {
+  suportPlatRecharge?: MaybeRef<boolean>;
+  suportFinance?: MaybeRef<boolean>;
+};
+
+export function useRewardGrantRegisterColumns(options: UseRewardGrantRegisterColumnsOptions = {}) {
+  const { suportPlatRecharge, suportFinance } = options;
+
+  const rewardGrantRegisterColumns = computed(() =>
+    defineColumns([
+      ...BaseDeclareEnterpriseTableViewColumns,
+      {
+        id: '9',
+        enCode: 'financeAmount',
+        name: '璐㈡斂鎷ㄤ粯閲戦',
+        width: 160,
+      },
+      {
+        id: '10',
+        enCode: 'financeSumAmount',
+        name: '璐㈡斂鎷ㄤ粯宸茬櫥璁�',
+        width: 160,
+      },
+      {
+        id: '11',
+        enCode: 'financeTime',
+        name: '鏈�杩戠櫥璁版棩鏈�',
+        width: 160,
+      },
+      {
+        id: '12',
+        enCode: 'financeStatus',
+        name: '璐㈡斂鎷ㄤ粯鐧昏鐘舵��',
+        width: 160,
+      },
+      {
+        id: '13',
+        enCode: 'transferAmount',
+        name: '骞冲彴鎷ㄤ粯閲戦',
+        width: 160,
+      },
+      {
+        id: '14',
+        enCode: 'settleSumAmount',
+        name: '骞冲彴鎷ㄤ粯宸茬櫥璁�',
+        width: 160,
+      },
+      {
+        id: '15',
+        enCode: 'settleTime',
+        name: '鏈�杩戠櫥璁版棩鏈�',
+        width: 160,
+      },
+      {
+        id: '16',
+        enCode: 'settleStatus',
+        name: '骞冲彴鎷ㄤ粯鐧昏鐘舵��',
+        width: 160,
+      },
+    ])
+  );
+
+  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,
@@ -73,7 +105,7 @@
   } = useTable(
     async ({ pageIndex, pageSize }, extraParamState) => {
       try {
-        let params: API.GetParkBountyApplyInfoInput = {
+        let params: API.GetParkBountyApplyTransferInfoInput = {
           pageModel: {
             rows: pageSize,
             page: pageIndex,
@@ -81,8 +113,10 @@
           },
           searchKeyWord: extraParamState.searchKeyWord,
           parkBountyApplyId: id.value,
+          transferToStatus: extraParamState.transferToStatus,
+          financeStatus: extraParamState.financeStatus,
         };
-        let res = await parkBountyApplyServices.getOutCheckParkBountyApplyDetailList(params);
+        let res = await parkBountyApplyServices.getParkBountyApplyTransferDetailList(params);
         return res;
       } catch (error) {}
     },
@@ -90,20 +124,31 @@
       defaultExtraParams: {
         orderInput: [{ property: 'parkBountyApplyId', order: OrderInputType.Desc }],
         searchKeyWord: '',
+        transferToStatus: '' as any as TransferToStatusEnum,
+        financeStatus: '' as any as FinanceStatusEnum,
       },
       columnsRenderProps: {
         authType: { type: 'enum', valueEnum: EnterpriseTypeText },
+        financeStatus: { type: 'enum', valueEnum: FinanceStatusEnumTextV2 },
+        settleStatus: { type: 'enum', valueEnum: SettleStatusEnumTextV2 },
         licenseUrl: {
           type: 'urlV2',
           formatter: (row: API.UserCertificationAuditListDto) => setOSSLink(row.licenseUrl),
         },
+        financeTime: { type: 'date', format: 'YYYY-MM-DD' },
+        settleTime: { type: 'date', format: 'YYYY-MM-DD' },
         applyAmount: { type: 'money' },
+        financeAmount: { type: 'money' },
+        financeSumAmount: { type: 'money' },
+        transferAmount: { type: 'money' },
+        settleSumAmount: { type: 'money' },
       },
     }
   );
 
   const queryClient = useQueryClient();
   const { dialogProps, handleAdd, editForm, dialogState } = useFormDialog({
+    onConfirm: handleUpload,
     defaultFormParams: {
       list: [] as CustomerApplyFileTypeListItem[],
       companyId: '',
@@ -125,7 +170,10 @@
         },
       });
       const lastUploadEnterPactFile = await queryClient.ensureQueryData({
-        queryKey: ['enterpriseApplyFileServices/getCustomerUploadApplyFiles', row.enterpriseId],
+        queryKey: [
+          'enterpriseApplyFileServices/getEnterpriseLastUploadEnterPactFileNew',
+          row.enterpriseId,
+        ],
         queryFn: async () => {
           return await parkBountyApplyServices.getEnterpriseLastUploadEnterPactFileNew({
             companyId: row.enterpriseId,
@@ -137,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,
       });
@@ -158,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,

--
Gitblit v1.9.1