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 |  164 +++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 107 insertions(+), 57 deletions(-)

diff --git a/src/hooks/fourStreams.ts b/src/hooks/fourStreams.ts
index 33182e8..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 {
@@ -15,72 +15,86 @@
   FinanceStatusEnumText,
   FinanceStatusEnumTextV2,
   FinanceStatusEnumTextV2Query,
+  FourStreamsExtraMaterialFileSearchType,
+  SearchType,
   SettleStatusEnumTextV2,
   TransferToStatusEnum,
   TransferToStatusEnumText,
 } from '@/constants';
 
-export 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,
-    },
-  ])
-);
+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,
@@ -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,

--
Gitblit v1.9.1