From ae671e401db4b158b6bd4292fb99fab58e40844c Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期五, 11 四月 2025 09:14:04 +0800 Subject: [PATCH] feat: 接口 --- src/views/EnterpriseInfo/components/RewardGrantRecordView.vue | 2 src/services/api/typings.d.ts | 11 + src/utils/oss/index.ts | 4 src/hooks/index.ts | 1 src/hooks/industrialPark.ts | 34 +++ src/components/commonView/BatchInfoView.vue | 2 src/views/Reward/RewardGrant.vue | 27 ++ src/components/commonView/DeclareEnterpriseTableView.vue | 19 - src/views/EnterpriseInfo/components/EnterpriseBasicInfoView.vue | 1 src/components/commonView/types.ts | 37 +++ src/components/commonView/utils/index.ts | 67 +++++++ src/components/commonView/FourStreamsMaterialFileTable.vue | 145 ++++++++------- src/views/Reward/RewardDeclareDetail.vue | 96 +++++++++ src/views/Reward/components/RewardGrantDialog.vue | 5 src/services/api/ParkBountyApply.ts | 6 src/hooks/table.ts | 12 + src/views/MaterialReview/MaterialReviewDetail.vue | 36 +++ 17 files changed, 392 insertions(+), 113 deletions(-) diff --git a/src/components/commonView/BatchInfoView.vue b/src/components/commonView/BatchInfoView.vue index ee26f52..b7fc1ca 100644 --- a/src/components/commonView/BatchInfoView.vue +++ b/src/components/commonView/BatchInfoView.vue @@ -7,7 +7,7 @@ </ProFormColItem> <ProFormColItem :span="12"> <ProFormItemV2 label="鐢宠濂栧姳閲戞湀浠�:" prop="applyMonth"> - <ProFormDatePicker v-model="form.applyMonth" format="YYYY-MM" type="month" /> + <ProFormDatePicker v-model="form.applyMonth" format="YYYY骞碝M鏈�" type="month" /> </ProFormItemV2> </ProFormColItem> <ProFormColItem :span="12"> diff --git a/src/components/commonView/DeclareEnterpriseTableView.vue b/src/components/commonView/DeclareEnterpriseTableView.vue index d952ab8..da0b2cc 100644 --- a/src/components/commonView/DeclareEnterpriseTableView.vue +++ b/src/components/commonView/DeclareEnterpriseTableView.vue @@ -22,7 +22,6 @@ }" > </ProTableV2> - <MateriaDetailDialog v-bind="dialogProps"></MateriaDetailDialog> </template> <script setup lang="ts"> @@ -31,12 +30,9 @@ QueryFilterItem, ProTableV2, SearchInput, - useFormDialog, defineOperationBtns, defineColumns, } from '@bole-core/components'; -import MateriaDetailDialog from './MateriaDetailDialog.vue'; -import { FourStreamsMaterialFileTableItem } from './types'; defineOptions({ name: 'DeclareEnterpriseTableView', @@ -49,6 +45,7 @@ extraParamState: { searchKeyWord: string; }; + openDialog?: (row) => void; }; const props = withDefaults(defineProps<Props>(), {}); @@ -98,22 +95,10 @@ name: '璇︽儏', }, emits: { - onClick: (role) => openDialog(role), + onClick: (role) => props.openDialog(role), }, }, ]); - -const { dialogProps, handleEdit, editForm } = useFormDialog({ - defaultFormParams: { - list: [] as FourStreamsMaterialFileTableItem[], - }, -}); - -function openDialog(row?: API.ParkBountyApplyDetailInfo) { - handleEdit({ - list: [], - }); -} </script> <style lang="scss" scoped> diff --git a/src/components/commonView/FourStreamsMaterialFileTable.vue b/src/components/commonView/FourStreamsMaterialFileTable.vue index c109630..e51d00d 100644 --- a/src/components/commonView/FourStreamsMaterialFileTable.vue +++ b/src/components/commonView/FourStreamsMaterialFileTable.vue @@ -4,12 +4,12 @@ :tableData="list" :columns="columns" :autoHeight="false" - :operationBtns="operationBtns" + :operationBtns="columnsProps.operationBtns" :operationColumnWidth="240" :showTableColumnSetting="false" > <template #fileBusinessType="{ row }"> - {{ AllEnterpriseMaterialFileBusinessTypeEnumText[row.fileBusinessType] }} + {{ FourStreamsMaterialFileBusinessTypeEnumText[row.fileBusinessType] }} </template> <template #operationBtn-uploadBtn="{ data, row }"> <BlFileUpload @@ -29,7 +29,11 @@ </template> <script setup lang="ts"> -import { FourStreamsMaterialFileTableProps, FourStreamsMaterialFileTableItem } from './types'; +import { + FourStreamsMaterialFileTableProps, + FourStreamsMaterialFileTableItem, + FourStreamsMaterialFileBusinessTypeEnumText, +} from './types'; import { ProTableV2, defineColumns, @@ -37,9 +41,9 @@ BlFileUpload, bolePreview, } from '@bole-core/components'; -import { AllEnterpriseMaterialFileBusinessTypeEnumText } from '@/constants'; import { downloadFileByUrl } from '@/utils'; import { Message, isFileCanPreview } from '@bole-core/core'; +import { useDefineColumns } from '@/hooks'; defineOptions({ name: 'FourStreamsMaterialFileTable', @@ -50,6 +54,7 @@ showCheckBtn: true, showDownloadBtn: true, showDeleteBtn: true, + downloadBtnText: '涓嬭浇', }); const list = defineModel<FourStreamsMaterialFileTableItem[]>('list'); @@ -62,81 +67,83 @@ }, ]); -const operationBtns = defineOperationBtns([ - { - data: { - enCode: 'uploadBtn', - name: '涓婁紶', - }, - extraProps: { - hide: (row: FourStreamsMaterialFileTableItem) => { - if (!props.showUploadBtn) return true; - let fileList = row?.fileList?.filter?.((item) => item.status === 'success'); - return fileList?.length > 0; +const columnsProps = useDefineColumns({ + operationBtns: [ + { + data: { + enCode: 'uploadBtn', + name: '涓婁紶', + }, + extraProps: { + hide: (row: FourStreamsMaterialFileTableItem) => { + if (!props.showUploadBtn) return true; + let fileList = row?.fileList?.filter?.((item) => item.status === 'success'); + return fileList?.length > 0; + }, }, }, - }, - { - data: { - enCode: 'detailBtn', - name: '鏌ョ湅', - }, - emits: { - onClick: (row) => handlePreview(row), - }, - extraProps: { - hide: (row: FourStreamsMaterialFileTableItem) => { - if (!props.showCheckBtn) return true; - let fileList = row?.fileList?.filter?.((item) => item.status === 'success'); - if (!fileList?.length) { - return true; - } else { - if (fileList.length > 1) { - return false; + { + data: { + enCode: 'detailBtn', + name: '鏌ョ湅', + }, + emits: { + onClick: (row) => handlePreview(row), + }, + extraProps: { + hide: (row: FourStreamsMaterialFileTableItem) => { + if (!props.showCheckBtn) return true; + let fileList = row?.fileList?.filter?.((item) => item.status === 'success'); + if (!fileList?.length) { + return true; } else { - return !isFileCanPreview(fileList[0].path); + if (fileList.length > 1) { + return false; + } else { + return !isFileCanPreview(fileList[0].path); + } } - } + }, }, }, - }, - { - data: { - enCode: 'downloadBtn', - name: '涓嬭浇', - }, - emits: { - onClick: (row) => handleBatchDownload(row), - }, - extraProps: { - hide: (row: FourStreamsMaterialFileTableItem) => { - return ( - !props.showDownloadBtn || - !row?.fileList?.filter?.((item) => item.status === 'success')?.length - ); + { + data: { + enCode: 'downloadBtn', + name: props.downloadBtnText, + }, + emits: { + onClick: (row) => handleBatchDownload(row), + }, + extraProps: { + hide: (row: FourStreamsMaterialFileTableItem) => { + return ( + !props.showDownloadBtn || + !row?.fileList?.filter?.((item) => item.status === 'success')?.length + ); + }, }, }, - }, - { - data: { - enCode: 'delBtn', - name: '鍒犻櫎', - }, - props: { - type: 'danger', - }, - emits: { - onClick: (row) => handleDelete(row), - }, - extraProps: { - hide: (row: FourStreamsMaterialFileTableItem) => { - if (!props.showDeleteBtn) return true; - let fileList = row?.fileList?.filter?.((item) => item.status === 'success'); - return !fileList?.length; + { + data: { + enCode: 'delBtn', + name: '鍒犻櫎', + }, + props: { + type: 'danger', + }, + emits: { + onClick: (row) => handleDelete(row), + }, + extraProps: { + hide: (row: FourStreamsMaterialFileTableItem) => { + if (!props.showDeleteBtn) return true; + let fileList = row?.fileList?.filter?.((item) => item.status === 'success'); + return !fileList?.length; + }, }, }, - }, -]); + ], +}); async function handleDelete(row: FourStreamsMaterialFileTableItem) { try { diff --git a/src/components/commonView/types.ts b/src/components/commonView/types.ts index 24c9b2e..dee3565 100644 --- a/src/components/commonView/types.ts +++ b/src/components/commonView/types.ts @@ -6,11 +6,12 @@ showCheckBtn?: boolean; showDownloadBtn?: boolean; showDeleteBtn?: boolean; + downloadBtnText?: string; }; export type FourStreamsMaterialFileTableItem = { - fileBusinessType: EnterpriseMaterialFileBusinessTypeEnum; - fileList: (API.AddEnterpriseMaterialFileInput & UploadUserFile)[]; + fileBusinessType: FourStreamsMaterialFileBusinessTypeEnum; + fileList: UploadUserFile[]; }; export enum EnterpriseTypeEnum { @@ -38,3 +39,35 @@ [EnterpriseTypeEnum.IndustryMating]: '琛屼笟閰嶅', [EnterpriseTypeEnum.IndustryBody]: '琛屼笟鏈烘瀯', }; + +export enum FourStreamsMaterialFileBusinessTypeEnum { + /** 鍥尯鍏ラ┗鍗忚 */ + ParkEnterPactUrl = 10, + /** 浼佷笟瀹岀◣璇佹槑锛堢洊绔狅級 */ + RatePaymentFileUrl = 20, + /** 浼佷笟缂寸◣鏄庣粏姹囨�昏〃锛堢洊绔狅級 */ + TaxSubFileUrl = 30, + /** 浼佷笟钀ユ敹鍒╂鼎琛� */ + OperateProfitesUrl = 40, + /** 鍏ラ┗鍏宠仈璇存槑 */ + EnterRelateUrl = 50, + /** C绔釜绋庡畬绋庢儏鍐佃鏄� */ + PersonTaxRatePayUrl = 60, +} +export const FourStreamsMaterialFileBusinessTypeEnumText = { + [FourStreamsMaterialFileBusinessTypeEnum.ParkEnterPactUrl]: '鍥尯鍏ラ┗鍗忚', + [FourStreamsMaterialFileBusinessTypeEnum.RatePaymentFileUrl]: '浼佷笟瀹岀◣璇佹槑(鐩栫珷)', + [FourStreamsMaterialFileBusinessTypeEnum.TaxSubFileUrl]: '浼佷笟缂寸◣鏄庣粏姹囨�昏〃(鐩栫珷)', + [FourStreamsMaterialFileBusinessTypeEnum.OperateProfitesUrl]: '浼佷笟钀ユ敹鍒╂鼎琛�', + [FourStreamsMaterialFileBusinessTypeEnum.EnterRelateUrl]: '鍏ラ┗鍏宠仈璇存槑', + [FourStreamsMaterialFileBusinessTypeEnum.PersonTaxRatePayUrl]: 'C绔釜绋庡畬绋庢儏鍐佃鏄�', +}; + +export const FourStreamsMaterialFileBusinessTypeEnumKey = { + [FourStreamsMaterialFileBusinessTypeEnum.ParkEnterPactUrl]: 'parkEnterPactUrl', + [FourStreamsMaterialFileBusinessTypeEnum.RatePaymentFileUrl]: 'ratePaymentFileUrl', + [FourStreamsMaterialFileBusinessTypeEnum.TaxSubFileUrl]: 'taxSubFileUrl', + [FourStreamsMaterialFileBusinessTypeEnum.OperateProfitesUrl]: 'operateProfitesUrl', + [FourStreamsMaterialFileBusinessTypeEnum.EnterRelateUrl]: 'enterRelateUrl', + [FourStreamsMaterialFileBusinessTypeEnum.PersonTaxRatePayUrl]: 'personTaxRatePayUrl', +} as const; diff --git a/src/components/commonView/utils/index.ts b/src/components/commonView/utils/index.ts new file mode 100644 index 0000000..b18bb98 --- /dev/null +++ b/src/components/commonView/utils/index.ts @@ -0,0 +1,67 @@ +import { convertApi2FormUrlOnlyOne } from '@/utils'; +import { + FourStreamsMaterialFileBusinessTypeEnum, + FourStreamsMaterialFileBusinessTypeEnumKey, + FourStreamsMaterialFileTableItem, +} from '../types'; + +export class FourStreamsMaterialUtils { + /**瀹炰綋浜т笟鍥潗鏂� */ + static PhysicalIndustrialParkMaterialFile = [ + FourStreamsMaterialFileBusinessTypeEnum.ParkEnterPactUrl, + FourStreamsMaterialFileBusinessTypeEnum.RatePaymentFileUrl, + FourStreamsMaterialFileBusinessTypeEnum.TaxSubFileUrl, + FourStreamsMaterialFileBusinessTypeEnum.OperateProfitesUrl, + ]; + + /**鏁板瓧缁忔祹鍥潗鏂� */ + static DigitIndustrialParkMaterialFile = [ + FourStreamsMaterialFileBusinessTypeEnum.ParkEnterPactUrl, + FourStreamsMaterialFileBusinessTypeEnum.EnterRelateUrl, + FourStreamsMaterialFileBusinessTypeEnum.RatePaymentFileUrl, + FourStreamsMaterialFileBusinessTypeEnum.TaxSubFileUrl, + FourStreamsMaterialFileBusinessTypeEnum.OperateProfitesUrl, + FourStreamsMaterialFileBusinessTypeEnum.PersonTaxRatePayUrl, + ]; + + static isFourStreamsParkType(parkTypeName) { + return ( + ParkTypeUtils.isPhysicalIndustrialPark(parkTypeName) || + ParkTypeUtils.isDigitIndustrialPark(parkTypeName) + ); + } + + static initFourStreamsMaterialFileList( + data: API.ParkBountyApplyDetailInfo, + parkTypeName: string + ) { + if (!this.isFourStreamsParkType(parkTypeName)) return []; + const list = ParkTypeUtils.isPhysicalIndustrialPark(parkTypeName) + ? this.PhysicalIndustrialParkMaterialFile + : this.DigitIndustrialParkMaterialFile; + return list.map((item) => { + return { + fileBusinessType: item, + fileList: convertApi2FormUrlOnlyOne(data[FourStreamsMaterialFileBusinessTypeEnumKey[item]]), + } as FourStreamsMaterialFileTableItem; + }); + } + + static fourStreamsMaterialFileList2Api(list: FourStreamsMaterialFileTableItem[]) { + return Object.fromEntries( + list.map((item) => [ + FourStreamsMaterialFileBusinessTypeEnumKey[item.fileBusinessType], + item.fileList[0]?.path ?? '', + ]) + ); + } +} + +export class ParkTypeUtils { + static isPhysicalIndustrialPark(parkTypeName: string) { + return parkTypeName === '瀹炰綋浜т笟鍥�'; + } + static isDigitIndustrialPark(parkTypeName: string) { + return parkTypeName === '鏁板瓧缁忔祹鍥�'; + } +} diff --git a/src/hooks/index.ts b/src/hooks/index.ts index bc2b519..efd8b4b 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -7,3 +7,4 @@ export * from './useUser'; export * from './help'; export * from './dic'; +export * from './table'; diff --git a/src/hooks/industrialPark.ts b/src/hooks/industrialPark.ts new file mode 100644 index 0000000..6c0fde9 --- /dev/null +++ b/src/hooks/industrialPark.ts @@ -0,0 +1,34 @@ +import * as industrialParkServices from '@/services/api/IndustrialPark'; +import { useQuery, useQueryClient } from '@tanstack/vue-query'; + +export function useIndustrialParkDropDownList() { + const { data: industrialParkList } = useQuery({ + queryKey: ['industrialParkServices/getIndustrialParkDropDownList'], + queryFn: async () => { + return await industrialParkServices.getIndustrialParkDropDownList({ showLoading: false }); + }, + placeholderData: () => [] as API.IndustrialParkDropDownOutput[], + }); + + function getIndustrialParkById(industrialParkId: string) { + const industrialPark = industrialParkList.value.find((item) => item.id === industrialParkId); + return industrialPark; + } + + function getIndustrialParkTypeNameById(industrialParkId: string) { + const industrialPark = getIndustrialParkById(industrialParkId); + return industrialPark?.parkTypeName ?? ''; + } + + function getIndustrialParkNameById(industrialParkId: string) { + const industrialPark = getIndustrialParkById(industrialParkId); + return industrialPark?.parkName ?? ''; + } + + return { + industrialParkList, + getIndustrialParkNameById, + getIndustrialParkById, + getIndustrialParkTypeNameById, + }; +} diff --git a/src/hooks/table.ts b/src/hooks/table.ts new file mode 100644 index 0000000..79e20bb --- /dev/null +++ b/src/hooks/table.ts @@ -0,0 +1,12 @@ +type DefineColumnsOptions = { + columns?: API.ModuleColumnDto[]; + operationBtns?: OperationBtnType[]; +}; + +export function useDefineColumns(options: DefineColumnsOptions = {}) { + const { columns, operationBtns } = options; + return computed(() => ({ + columns, + operationBtns, + })); +} diff --git a/src/services/api/ParkBountyApply.ts b/src/services/api/ParkBountyApply.ts index 0950200..96d1b8a 100644 --- a/src/services/api/ParkBountyApply.ts +++ b/src/services/api/ParkBountyApply.ts @@ -202,7 +202,7 @@ params: API.APIgetParkBountyApplyBatchTransferEnterpriseParams, options?: API.RequestConfig ) { - return request<API.GetCompanyNameListOutput[]>( + return request<API.GetNotTransferCompanyNameListOutput[]>( '/api/ParkBountyApply/GetParkBountyApplyBatchTransferEnterprise', { method: 'GET', @@ -454,7 +454,7 @@ }); } -/** 杩愯惀绔�斿叆璐︹�斾笂浼犲嚟璇� POST /api/ParkBountyApply/ParkBountyApplySettle */ +/** 鏀垮姟绔�斿鍔遍噾鍙戞斁鈥斾笂浼犲嚟璇� POST /api/ParkBountyApply/ParkBountyApplySettle */ export async function parkBountyApplySettle( body: API.ParkBountyApplySettleInput, options?: API.RequestConfig @@ -499,7 +499,7 @@ }); } -/** 鏀垮姟绔�斿鍔遍噾涓婁紶鍑瘉 POST /api/ParkBountyApply/ParkBountyApplyTransferFile */ +/** 杩愯惀绔�斿鍔遍噾鍏ヨ处鈥斾笂浼犲嚟璇� POST /api/ParkBountyApply/ParkBountyApplyTransferFile */ export async function parkBountyApplyTransferFile( body: API.ParkBountyApplyTransferFileInput, options?: API.RequestConfig diff --git a/src/services/api/typings.d.ts b/src/services/api/typings.d.ts index e6d6ec9..0baf8f4 100644 --- a/src/services/api/typings.d.ts +++ b/src/services/api/typings.d.ts @@ -7771,6 +7771,12 @@ endDate?: string; } + interface GetNotTransferCompanyNameListOutput { + companyId?: string; + name?: string; + parkBountyApplyDetailId?: string; + } + interface GetOperateHistoryInput { pageModel?: Pagination; relationId?: string; @@ -7928,6 +7934,8 @@ outCheckStatus?: BountyCheckStatusEnum; /** 澶栭儴瀹℃牳鏃ユ湡 */ outCheckTime?: string; + /** 鍙戞斁鍑瘉 */ + settleFileUrl?: string; } interface GetParkBountyApplyListOutputPageOutput { @@ -14210,6 +14218,9 @@ outCheckStatus?: BountyCheckStatusEnum; /** 澶栭儴瀹℃牳鍘熷洜 */ outCheckRemark?: string; + /** 鍐呴儴瀹℃牳鍘熷洜 */ + inCheckRemark?: string; + inCheckStatus?: BountyCheckStatusEnum; } interface OutcheckParkBountyApplyInput { diff --git a/src/utils/oss/index.ts b/src/utils/oss/index.ts index 9501e36..2dd5d98 100644 --- a/src/utils/oss/index.ts +++ b/src/utils/oss/index.ts @@ -1,13 +1,13 @@ import { BoleOss } from '@bole-core/core'; import { loadEnv } from '@build/index'; import AliOSS from 'ali-oss'; -import * as userServices from '@/services/api/User'; +import * as accountServices from '@/services/api/Account'; export class OssManager { private static OssInstance: BoleOss; private static async getOssSTS() { - return await userServices.getOssSTS({ + return await accountServices.getOssSTS({ showLoading: false, }); } diff --git a/src/views/EnterpriseInfo/components/EnterpriseBasicInfoView.vue b/src/views/EnterpriseInfo/components/EnterpriseBasicInfoView.vue index a8defb8..d37acb0 100644 --- a/src/views/EnterpriseInfo/components/EnterpriseBasicInfoView.vue +++ b/src/views/EnterpriseInfo/components/EnterpriseBasicInfoView.vue @@ -68,6 +68,7 @@ ProFormItemV2, ProFormText, ProFormUpload, + ProFormRadio, } from '@bole-core/components'; import { useQuery } from '@tanstack/vue-query'; import * as customerServices from '@/services/api/Customer'; diff --git a/src/views/EnterpriseInfo/components/RewardGrantRecordView.vue b/src/views/EnterpriseInfo/components/RewardGrantRecordView.vue index 1d086d5..10fc28f 100644 --- a/src/views/EnterpriseInfo/components/RewardGrantRecordView.vue +++ b/src/views/EnterpriseInfo/components/RewardGrantRecordView.vue @@ -91,7 +91,7 @@ }, { defaultExtraParams: { - orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }], + orderInput: [{ property: 'id', order: OrderInputType.Desc }], }, columnsRenderProps: { settleTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' }, diff --git a/src/views/MaterialReview/MaterialReviewDetail.vue b/src/views/MaterialReview/MaterialReviewDetail.vue index cc0fb29..d63cedd 100644 --- a/src/views/MaterialReview/MaterialReviewDetail.vue +++ b/src/views/MaterialReview/MaterialReviewDetail.vue @@ -23,11 +23,19 @@ :extra-param-state="extraParamState" :pro-table-props="proTableProps" :reset="reset" + :open-dialog="openDialog" ></DeclareEnterpriseTableView> + <MateriaDetailDialog + v-bind="dialogProps" + :show-upload-btn="false" + :show-delete-btn="false" + :show-check-btn="false" + downloadBtnText="鏌ョ湅" + /> </ChunkCellV2> </DetailView> <template #footer> - <el-button @click="handleBack">鍏抽棴</el-button> + <el-button @click="handleBack" type="primary">纭</el-button> </template> </PageFormLayout> </AppContainer> @@ -41,9 +49,11 @@ UploadUserFile, PageFormLayout, useTable, + useFormDialog, } from '@bole-core/components'; import ChunkCellV2 from '@/components/Layout/ChunkCellV2.vue'; import DetailView from '@/components/commonView/DetailView.vue'; +import MateriaDetailDialog from '@/components/commonView/MateriaDetailDialog.vue'; import DeclareEnterpriseTableView from '@/components/commonView/DeclareEnterpriseTableView.vue'; import { useQuery } from '@tanstack/vue-query'; import * as parkBountyApplyServices from '@/services/api/ParkBountyApply'; @@ -51,6 +61,9 @@ import { useRouteView } from '@/hooks'; import { OrderInputType } from '@bole-core/core'; import { AuthTypeText, BountyCheckStatusEnum, BountyCheckStatusEnumText } from '@/constants'; +import { FourStreamsMaterialFileTableItem } from '@/components/commonView/types'; +import { FourStreamsMaterialUtils } from '@/components/commonView/utils'; +import { useIndustrialParkDropDownList } from '@/hooks/industrialPark'; defineOptions({ name: 'MaterialReviewDetail', @@ -128,7 +141,7 @@ }, { defaultExtraParams: { - orderInput: [{ property: 'enterpriseId', order: OrderInputType.Desc }], + orderInput: [{ property: 'parkBountyApplyId', order: OrderInputType.Desc }], searchKeyWord: '', }, columnsRenderProps: { @@ -143,6 +156,25 @@ } ); +const { dialogProps, handleAdd, editForm } = useFormDialog({ + defaultFormParams: { + list: [] as FourStreamsMaterialFileTableItem[], + companyId: '', + }, +}); + +const { getIndustrialParkTypeNameById } = useIndustrialParkDropDownList(); + +function openDialog(row: API.ParkBountyApplyDetailInfo) { + handleAdd({ + list: FourStreamsMaterialUtils.initFourStreamsMaterialFileList( + row, + getIndustrialParkTypeNameById(detail.value?.parkId) + ), + companyId: row.enterpriseId, + }); +} + function handleBack() { closeViewPush(route, { name: 'MaterialReviewList', diff --git a/src/views/Reward/RewardDeclareDetail.vue b/src/views/Reward/RewardDeclareDetail.vue index f93d4e7..81638f8 100644 --- a/src/views/Reward/RewardDeclareDetail.vue +++ b/src/views/Reward/RewardDeclareDetail.vue @@ -4,11 +4,24 @@ <PageFormLayout title="鐢虫姤璇︽儏"> <DetailView :form="form"> <ChunkCellV2 title="鐢虫姤浼佷笟鍚嶅崟"> - <DeclareEnterpriseTableView ref="tableRef"></DeclareEnterpriseTableView> + <DeclareEnterpriseTableView + :getList="getList" + :extra-param-state="extraParamState" + :pro-table-props="proTableProps" + :reset="reset" + :open-dialog="openDialog" + ></DeclareEnterpriseTableView> + <MateriaDetailDialog + v-bind="dialogProps" + :show-upload-btn="false" + :show-delete-btn="false" + :show-check-btn="false" + downloadBtnText="鏌ョ湅" + /> </ChunkCellV2> </DetailView> <template #footer> - <el-button @click="handleBack">鍏抽棴</el-button> + <el-button @click="handleBack" type="primary">纭</el-button> </template> </PageFormLayout> </AppContainer> @@ -16,14 +29,27 @@ </template> <script setup lang="ts"> -import { AppContainer, LoadingLayout, UploadUserFile, PageFormLayout } from '@bole-core/components'; +import { + AppContainer, + LoadingLayout, + UploadUserFile, + PageFormLayout, + useTable, + useFormDialog, +} from '@bole-core/components'; import DetailView from '@/components/commonView/DetailView.vue'; import ChunkCellV2 from '@/components/Layout/ChunkCellV2.vue'; +import MateriaDetailDialog from '@/components/commonView/MateriaDetailDialog.vue'; import DeclareEnterpriseTableView from '@/components/commonView/DeclareEnterpriseTableView.vue'; import { useQuery } from '@tanstack/vue-query'; import * as parkBountyApplyServices from '@/services/api/ParkBountyApply'; -import { convertApi2FormUrlOnlyOne } from '@/utils'; +import { convertApi2FormUrlOnlyOne, setOSSLink } from '@/utils'; import { useRouteView } from '@/hooks'; +import { OrderInputType } from '@bole-core/core'; +import { AuthTypeText } from '@/constants'; +import { FourStreamsMaterialFileTableItem } from '@/components/commonView/types'; +import { useIndustrialParkDropDownList } from '@/hooks/industrialPark'; +import { FourStreamsMaterialUtils } from '@/components/commonView/utils'; defineOptions({ name: 'RewardDeclareDetail', @@ -43,8 +69,6 @@ bountyAssignFileUlr: [] as UploadUserFile[], bountyCollectFileUrl: [] as UploadUserFile[], }); - -const tableRef = ref<InstanceType<typeof DeclareEnterpriseTableView>>(); const { data: detail, isLoading } = useQuery({ queryKey: ['parkBountyApplyServices/getParkBountyApplyDetail', id], @@ -68,10 +92,68 @@ form.bountyAssignFileUlr = convertApi2FormUrlOnlyOne(data?.bountyAssignFileUlr); form.bountyCollectFileUrl = convertApi2FormUrlOnlyOne(data?.bountyCollectFileUrl); - tableRef.value?.getList(); + getList(); }, }); +const { + getDataSource: getList, + proTableProps, + paginationState, + extraParamState, + reset, +} = useTable( + async ({ pageIndex, pageSize }, extraParamState) => { + try { + let params: API.GetParkBountyApplyInfoInput = { + pageModel: { + rows: pageSize, + page: pageIndex, + orderInput: extraParamState.orderInput, + }, + searchKeyWord: extraParamState.searchKeyWord, + parkBountyApplyId: id, + }; + let res = await parkBountyApplyServices.getOutCheckParkBountyApplyDetailList(params); + return res; + } catch (error) {} + }, + { + defaultExtraParams: { + orderInput: [{ property: 'parkBountyApplyId', order: OrderInputType.Desc }], + searchKeyWord: '', + }, + columnsRenderProps: { + authType: { type: 'enum', valueEnum: AuthTypeText }, + licenseUrl: { + type: 'url', + formatter: (row: API.UserCertificationAuditListDto) => setOSSLink(row.licenseUrl), + modal: true, + showDownloadBtn: false, + }, + }, + } +); + +const { dialogProps, handleEdit, editForm } = useFormDialog({ + defaultFormParams: { + list: [] as FourStreamsMaterialFileTableItem[], + companyId: '', + }, +}); + +const { getIndustrialParkTypeNameById } = useIndustrialParkDropDownList(); + +function openDialog(row: API.ParkBountyApplyDetailInfo) { + handleEdit({ + list: FourStreamsMaterialUtils.initFourStreamsMaterialFileList( + row, + getIndustrialParkTypeNameById(detail.value?.parkId) + ), + companyId: row.enterpriseId, + }); +} + function handleBack() { closeViewPush(route, { name: 'RewardGrant', diff --git a/src/views/Reward/RewardGrant.vue b/src/views/Reward/RewardGrant.vue index 2fe06d7..18093e7 100644 --- a/src/views/Reward/RewardGrant.vue +++ b/src/views/Reward/RewardGrant.vue @@ -69,8 +69,8 @@ UploadUserFile, bolePreview, } from '@bole-core/components'; -import { OrderInputType } from '@bole-core/core'; -import { convertApi2FormUrlOnlyOne, format } from '@/utils'; +import { Message, OrderInputType } from '@bole-core/core'; +import { convertApi2FormUrl, convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils'; import { SettleStatusEnum, SettleStatusEnumText } from '@/constants'; import * as parkBountyApplyServices from '@/services/api/ParkBountyApply'; import RewardGrantDialog from './components/RewardGrantDialog.vue'; @@ -142,6 +142,10 @@ emits: { onClick: (role) => openDialog(role), }, + extraProps: { + hide: (row: API.GetParkBountyApplyListOutput) => + row.settleStatus === SettleStatusEnum.HasSettle, + }, }, { data: { @@ -150,6 +154,10 @@ }, emits: { onClick: (role) => handlePreview(role), + }, + extraProps: { + hide: (row: API.GetParkBountyApplyListOutput) => + row.settleStatus === SettleStatusEnum.WaitForSettle, }, }, ]); @@ -240,16 +248,23 @@ try { let params: API.ParkBountyApplySettleInput = { parkBountyApplyId: editForm.parkBountyApplyId, - settleFileUrl: editForm.settleFileUrl[0].path, + settleFileUrl: editForm.settleFileUrl.map((x) => x.path).join('|'), }; let res = await parkBountyApplyServices.parkBountyApplySettle(params); + if (res) { + Message.successMessage('鎿嶄綔鎴愬姛'); + getList(paginationState.pageIndex); + } } catch (error) {} } function handlePreview(row?: API.GetParkBountyApplyListOutput) { - bolePreview({ - fileUrl: row.parkName, - }); + const fileList = row.settleFileUrl?.split('|').map((x) => convertApi2FormUrl(x)) ?? []; + if (fileList.length > 1) { + console.log('fileList: ', fileList); + } else { + downloadFileByUrl(fileList[0]); + } } </script> diff --git a/src/views/Reward/components/RewardGrantDialog.vue b/src/views/Reward/components/RewardGrantDialog.vue index ca8c963..5aa24df 100644 --- a/src/views/Reward/components/RewardGrantDialog.vue +++ b/src/views/Reward/components/RewardGrantDialog.vue @@ -16,9 +16,8 @@ > <ProFormUpload v-model:file-url="innerForm.settleFileUrl" - :limit="1" - :limitFileSize="10" - accept="doc,docx,pdf" + :limitFileSize="50" + accept="doc,docx,pdf,xls,xlsx,jpg/jpeg,png" > </ProFormUpload> </ProFormItemV2> -- Gitblit v1.9.1