|  |  |  | 
|---|
|  |  |  | :reset="reset" | 
|---|
|  |  |  | :operationBtns="registerOperationBtns" | 
|---|
|  |  |  | :column="rewardGrantRegisterColumns" | 
|---|
|  |  |  | :showFinanceStatus="true" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <template #btn> | 
|---|
|  |  |  | <el-button type="primary" link @click="downloadTemp()">下载模板</el-button> | 
|---|
|  |  |  | 
|---|
|  |  |  | v-bind="dialogMaterialFileProps" | 
|---|
|  |  |  | :show-upload-btn="false" | 
|---|
|  |  |  | :show-delete-btn="false" | 
|---|
|  |  |  | :show-check-btn="false" | 
|---|
|  |  |  | downloadBtnText="查看" | 
|---|
|  |  |  | title="查看凭证" | 
|---|
|  |  |  | :BusinessTypeEnumText="TransferFileEnumInRewardGrandText" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </ChunkCellV2> | 
|---|
|  |  |  | </DetailView> | 
|---|
|  |  |  | <template #footer> | 
|---|
|  |  |  | <el-button @click="handleBack">取消</el-button> | 
|---|
|  |  |  | <el-button @click="handleBack" type="primary">确认</el-button> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </PageFormLayout> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { useQuery } from '@tanstack/vue-query'; | 
|---|
|  |  |  | import * as parkBountyApplyServices from '@/services/api/ParkBountyApply'; | 
|---|
|  |  |  | import { useRouteView } from '@/hooks'; | 
|---|
|  |  |  | import { useIndustrialParkDropDownList } from '@/hooks/industrialPark'; | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | CustomerApplyFileTypeListItem, | 
|---|
|  |  |  | EnterpriseApplyFileUtils, | 
|---|
|  |  |  | 
|---|
|  |  |  | import RegisterGrantDialog from './components/RegisterGrantDialog.vue'; | 
|---|
|  |  |  | import BatchRegisterDialog from './components/BatchRegisterDialog.vue'; | 
|---|
|  |  |  | import UploadFileDialog from './components/UploadFileDialog.vue'; | 
|---|
|  |  |  | import { downloadFileByUrl } from '@/utils'; | 
|---|
|  |  |  | import { convertFormUrl2ApiBySeparator, downloadFileByUrl } from '@/utils'; | 
|---|
|  |  |  | import { Message } from '@bole-core/core'; | 
|---|
|  |  |  | import { ImportParkBountyDataHeaderMap } from './constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | parkTypeName: '', | 
|---|
|  |  |  | applyMonth: '', | 
|---|
|  |  |  | applySumAmount: 0, | 
|---|
|  |  |  | financeSumAmount: 0, | 
|---|
|  |  |  | settleSumAmount: 0, | 
|---|
|  |  |  | parkCollectFileList: [] as CustomerApplyFileTypeListItem[], | 
|---|
|  |  |  | calculationFileList: [] as CustomerApplyFileTypeListItem[], | 
|---|
|  |  |  | suportEnterpriseUpload: false, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | suportPlatRecharge: false, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { extraParamState, paginationState, getList, reset, proTableProps } = | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | emits: { | 
|---|
|  |  |  | onClick: (row) => openRegisterGrantDialog(row), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | extraProps: { | 
|---|
|  |  |  | hide: (row: API.ParkBountyApplyTransferDetailInfo) => | 
|---|
|  |  |  | !( | 
|---|
|  |  |  | row.settleStatus === SettleStatusEnum.WaitForSettle || | 
|---|
|  |  |  | row.financeStatus === FinanceStatusEnum.WaitForIncome | 
|---|
|  |  |  | ), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | form.parkTypeName = data.parkTypeName; | 
|---|
|  |  |  | form.applyMonth = data.applyMonth; | 
|---|
|  |  |  | form.applySumAmount = data.applySumAmount; | 
|---|
|  |  |  | form.financeSumAmount = data.financeSumAmount; | 
|---|
|  |  |  | form.settleSumAmount = data.settleSumAmount; | 
|---|
|  |  |  | form.parkCollectFileList = EnterpriseApplyFileUtils.convertApiFileToParkCollectFileList( | 
|---|
|  |  |  | data.listFiles | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | form.calculationFileList = EnterpriseApplyFileUtils.convertApiFileToParkCollectFileList( | 
|---|
|  |  |  | data.collectCountListFiles | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | form.suportEnterpriseUpload = data.suportEnterpriseUpload; | 
|---|
|  |  |  | form.suportPlatRecharge = data.suportPlatRecharge; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | getList(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { getIndustrialParkTypeNameById } = useIndustrialParkDropDownList(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { dialogProps: dialogMaterialFileProps, handleAdd: handleMaterialFileAdd } = useFormDialog({ | 
|---|
|  |  |  | defaultFormParams: { | 
|---|
|  |  |  | list: [] as TransferFileEnumInRewardGrandTableItem[], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | function openMaterialFileDialog(row: API.GetParkBountyApplyListOutput) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function openMaterialFileDialog(row: API.ParkBountyApplyTransferDetailInfo) { | 
|---|
|  |  |  | handleMaterialFileAdd({ | 
|---|
|  |  |  | list: FourStreamsMaterialUtils.initApplyRewardGrandFileList(row), | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | defaultFormParams: { | 
|---|
|  |  |  | incomeType: '' as any as IncomeTypeEnum, | 
|---|
|  |  |  | parkBountyApplyId: '', | 
|---|
|  |  |  | parkBountyApplyDetailId: '', | 
|---|
|  |  |  | fileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | financeSumAmount: 0, | 
|---|
|  |  |  | amount: 0, | 
|---|
|  |  |  | showSuportPlatRecharge: false, | 
|---|
|  |  |  | showSuportFiscalRecharge: false, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function openRegisterGrantDialog(row?: API.GetParkBountyApplyListOutput) { | 
|---|
|  |  |  | function openRegisterGrantDialog(row?: API.ParkBountyApplyTransferDetailInfo) { | 
|---|
|  |  |  | handleRegisterGrantEdit({ | 
|---|
|  |  |  | incomeType: '' as any as IncomeTypeEnum, | 
|---|
|  |  |  | fileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | showSuportPlatRecharge: row.settleStatus === SettleStatusEnum.WaitForSettle, | 
|---|
|  |  |  | showSuportFiscalRecharge: row.financeStatus === FinanceStatusEnum.WaitForIncome, | 
|---|
|  |  |  | parkBountyApplyId: row.id, | 
|---|
|  |  |  | financeSumAmount: 0, | 
|---|
|  |  |  | parkBountyApplyId: row.parkBountyApplyId, | 
|---|
|  |  |  | parkBountyApplyDetailId: row.parkBountyApplyDetailId, | 
|---|
|  |  |  | amount: 0, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function handleRegisterGrant() {} | 
|---|
|  |  |  | async function handleRegisterGrant() { | 
|---|
|  |  |  | if (editRegisterForm.incomeType === IncomeTypeEnum.Fiscal) { | 
|---|
|  |  |  | await parkBountyApplyFinanceReg(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | await parkBountyApplyTransferReg(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { dialogProps: dialogUploadFileProps, handleAdd: handleUploadFileAdd } = useFormDialog({ | 
|---|
|  |  |  | async function parkBountyApplyFinanceReg() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.ParkBountyApplyRechargeInput = { | 
|---|
|  |  |  | parkBountyApplyDetailId: editRegisterForm.parkBountyApplyDetailId, | 
|---|
|  |  |  | bountyAmount: editRegisterForm.amount, | 
|---|
|  |  |  | parkBountyApplyId: editRegisterForm.parkBountyApplyId, | 
|---|
|  |  |  | financeToFileUrl: convertFormUrl2ApiBySeparator(editRegisterForm.fileUrl), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await parkBountyApplyServices.parkBountyApplyFinanceReg(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.successMessage('操作成功'); | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | async function parkBountyApplyTransferReg() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.ParkBountyApplyTransferInput = { | 
|---|
|  |  |  | parkBountyApplyDetailId: editRegisterForm.parkBountyApplyDetailId, | 
|---|
|  |  |  | transferToAmount: editRegisterForm.amount, | 
|---|
|  |  |  | parkBountyApplyId: editRegisterForm.parkBountyApplyId, | 
|---|
|  |  |  | transferToFileUrl: convertFormUrl2ApiBySeparator(editRegisterForm.fileUrl), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await parkBountyApplyServices.parkBountyApplyTransferReg(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.successMessage('操作成功'); | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | dialogProps: dialogUploadFileProps, | 
|---|
|  |  |  | handleAdd: handleUploadFileAdd, | 
|---|
|  |  |  | editForm: uploadFileForm, | 
|---|
|  |  |  | } = useFormDialog({ | 
|---|
|  |  |  | onConfirm: handleImportParkBountyData, | 
|---|
|  |  |  | defaultFormParams: { | 
|---|
|  |  |  | parkBountyApplyId: '', | 
|---|
|  |  |  | url: [] as UploadUserFile[], | 
|---|
|  |  |  | certificateUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | financeToFileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | transferToFileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function handleImportParkBountyData(response: UploadUserFile) { | 
|---|
|  |  |  | async function handleImportParkBountyData() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.ImportBountyApplyDataInput = { | 
|---|
|  |  |  | parkBountyApplyId: id, | 
|---|
|  |  |  | url: response.url, | 
|---|
|  |  |  | parkBountyApplyId: uploadFileForm.parkBountyApplyId, | 
|---|
|  |  |  | url: uploadFileForm.url?.[0]?.path ?? '', | 
|---|
|  |  |  | financeToFileUrl: convertFormUrl2ApiBySeparator(uploadFileForm.financeToFileUrl), | 
|---|
|  |  |  | transferToFileUrl: convertFormUrl2ApiBySeparator(uploadFileForm.transferToFileUrl), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await parkBountyApplyServices.importParkBountyData(params, { | 
|---|
|  |  |  | let res = await parkBountyApplyServices.importParkBountyDataReg(params, { | 
|---|
|  |  |  | timeout: 100000000, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | if (res.error.length > 0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | handleUploadFileAdd({ | 
|---|
|  |  |  | parkBountyApplyId: id, | 
|---|
|  |  |  | url: [] as UploadUserFile[], | 
|---|
|  |  |  | certificateUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | financeToFileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | transferToFileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | handleBatchRegisterAdd({ | 
|---|
|  |  |  | parkBountyApplyId: id, | 
|---|
|  |  |  | showSuportPlatRecharge: false, | 
|---|
|  |  |  | showSuportPlatRecharge: form.suportPlatRecharge, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | parkBountyApplyId: '', | 
|---|
|  |  |  | showSuportPlatRecharge: false, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | certificateUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | fileUrl: [] as UploadUserFile[], | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function handleBatchRegister() {} | 
|---|
|  |  |  | async function handleBatchRegister() { | 
|---|
|  |  |  | if (batchRegisterEditForm.incomeType === IncomeTypeEnum.Fiscal) { | 
|---|
|  |  |  | await parkBountyApplyBatchFinanceReg(); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | await parkBountyApplyBatchTransferReg(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function parkBountyApplyBatchFinanceReg() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.ParkBountyApplyBatchFinanceInput = { | 
|---|
|  |  |  | parkBountyApplyDetailId: batchRegisterEditForm.parkBountyApplyDetailIds, | 
|---|
|  |  |  | financeToAmount: batchRegisterEditForm.amount, | 
|---|
|  |  |  | parkBountyApplyId: id, | 
|---|
|  |  |  | financeToFileUrl: convertFormUrl2ApiBySeparator(batchRegisterEditForm.fileUrl), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await parkBountyApplyServices.parkBountyApplyBatchFinanceReg(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.successMessage('操作成功'); | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | async function parkBountyApplyBatchTransferReg() { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | let params: API.ParkBountyApplyBatchTransferInput = { | 
|---|
|  |  |  | parkBountyApplyDetailId: batchRegisterEditForm.parkBountyApplyDetailIds, | 
|---|
|  |  |  | transferToAmount: batchRegisterEditForm.amount, | 
|---|
|  |  |  | parkBountyApplyId: id, | 
|---|
|  |  |  | transferToFileUrl: convertFormUrl2ApiBySeparator(batchRegisterEditForm.fileUrl), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | let res = await parkBountyApplyServices.parkBountyApplyBatchTransferReg(params); | 
|---|
|  |  |  | if (res) { | 
|---|
|  |  |  | Message.successMessage('操作成功'); | 
|---|
|  |  |  | getList(paginationState.pageIndex); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (error) {} | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function downloadTemp() { | 
|---|
|  |  |  | downloadFileByUrl(BountyBatchApplyTransferTemp, '登记模板'); | 
|---|