From 0b73bba28e2a8473ab71f5c8b4760c1995ff4fc1 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 21 十月 2025 18:29:07 +0800
Subject: [PATCH] fix: s
---
src/hooks/fourStreams.ts | 169 +++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 111 insertions(+), 58 deletions(-)
diff --git a/src/hooks/fourStreams.ts b/src/hooks/fourStreams.ts
index 07feccd..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: '',
@@ -155,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,
@@ -167,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,
});
@@ -188,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