| <template> | 
|   <LoadingLayout :loading="state.loading"> | 
|     <AppContainer> | 
|       <div class="statistics-wrapper"> | 
|         <el-text class="mx-1">{{ | 
|           `财政拨付合计:¥${toThousand(objectData?.sumFinanceAmount ?? 0)}` | 
|         }}</el-text> | 
|         <el-text class="mx-1">{{ | 
|           `平台拨付合计:¥${toThousand(objectData?.sumTransferAmount ?? 0)}` | 
|         }}</el-text> | 
|         <el-text class="mx-1">{{ | 
|           `企业充值合计:¥${toThousand(objectData?.sumRechargeAmount ?? 0)}` | 
|         }}</el-text> | 
|         <el-text class="mx-1">{{ | 
|           `企业消费合计:¥${toThousand(objectData?.sumTradeAmount ?? 0)}` | 
|         }}</el-text> | 
|         <el-text class="mx-1">{{ | 
|           `企业余额合计:¥${toThousand(objectData?.sumAmount ?? 0)}` | 
|         }}</el-text> | 
|       </div> | 
|       <ProTableQueryFilterBar @on-reset="reset"> | 
|         <template #query> | 
|           <QueryFilterItem tip-content="申报月份"> | 
|             <FieldDatePicker | 
|               v-model="extraParamState.month" | 
|               type="month" | 
|               clearable | 
|               placeholder="请选择申报月份" | 
|               format="YYYY-MM" | 
|               value-format="YYYY-MM" | 
|               @change="getList()" | 
|             ></FieldDatePicker> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <FieldSelect | 
|               v-model="extraParamState.industrialParkId" | 
|               placeholder="请选择园区" | 
|               :value-enum="fourStreamsIndustrialParkList" | 
|               enumLabelKey="parkName" | 
|               enum-value-key="id" | 
|               clearable | 
|               @change="getList()" | 
|             /> | 
|           </QueryFilterItem> | 
|           <QueryFilterItem> | 
|             <SearchInput | 
|               v-model="extraParamState.keywords" | 
|               style="width: 300px" | 
|               placeholder="企业名/信用代码/联系人/联系方式" | 
|               @on-click-search="getList" | 
|             > | 
|             </SearchInput> | 
|           </QueryFilterItem> | 
|         </template> | 
|         <template #btn> | 
|           <el-button @click="handleExport()" icon="Download" type="primary">导出</el-button> | 
|         </template> | 
|       </ProTableQueryFilterBar> | 
|       <ProTableV2 v-bind="proTableProps" :columns="column" :show-operation-column="false"> | 
|         <template #sumFinanceAmountBtn="{ row }"> | 
|           <el-button type="primary" link @click="handleFinancialAllocationDetail(row)" | 
|             >查看明细</el-button | 
|           > | 
|         </template> | 
|         <template #sumTransferAmountBtn="{ row }"> | 
|           <el-button type="primary" link @click="handlePlatformDisbursementDetail(row)" | 
|             >查看明细</el-button | 
|           > | 
|         </template> | 
|         <template #sumRechargeAmountBtn="{ row }"> | 
|           <el-button type="primary" link @click="handleEnterpriseRechargeDetail(row)" | 
|             >查看明细</el-button | 
|           > | 
|         </template> | 
|         <template #sumTradeAmountBtn="{ row }"> | 
|           <el-button type="primary" link @click="handleEnterpriseConsumptionDetail(row)" | 
|             >查看明细</el-button | 
|           > | 
|         </template> | 
|         <template #sumDrawWithAmountBtn="{ row }"> | 
|           <el-button type="primary" link @click="handleEnterpriseWithdrawalDetail(row)" | 
|             >查看明细</el-button | 
|           > | 
|         </template> | 
|         <template #amountBtn="{ row }"> | 
|           <el-button type="primary" link @click="handleBalanceDetail(row)">查看明细</el-button> | 
|         </template> | 
|       </ProTableV2> | 
|     </AppContainer> | 
|     <FinancialAllocationDetailDialog | 
|       v-bind="dialogFinancialAllocationDetailProps" | 
|     ></FinancialAllocationDetailDialog> | 
|     <PlatformDisbursementDetailDialog | 
|       v-bind="dialogPlatformDisbursementDetailProps" | 
|     ></PlatformDisbursementDetailDialog> | 
|     <EnterpriseRechargeDetailDialog | 
|       v-bind="dialogEnterpriseRechargeDetailProps" | 
|     ></EnterpriseRechargeDetailDialog> | 
|     <EnterpriseConsumptionDetailDialog | 
|       v-bind="dialogEnterpriseConsumptionDetailProps" | 
|     ></EnterpriseConsumptionDetailDialog> | 
|     <EnterpriseWithdrawalDetailDialog | 
|       v-bind="dialogEnterpriseWithdrawalDetailProps" | 
|     ></EnterpriseWithdrawalDetailDialog> | 
|     <BalanceDetailDialog v-bind="dialogBalanceDetailProps"></BalanceDetailDialog> | 
|   </LoadingLayout> | 
| </template> | 
|   | 
| <script setup lang="ts"> | 
| import { | 
|   ProTableQueryFilterBar, | 
|   OperationBtnType, | 
|   ProTableV2, | 
|   SearchInput, | 
|   LoadingLayout, | 
|   AppContainer, | 
|   QueryFilterItem, | 
|   useTable, | 
|   FieldDatePicker, | 
|   FieldSelect, | 
|   useFormDialog, | 
|   defineColumns, | 
| } from '@bole-core/components'; | 
| import { useAccess, useIndustrialParkDropDownList } from '@/hooks'; | 
| import { downloadFile, Message, OrderInputType } from '@bole-core/core'; | 
| import * as parkBountyApplyServices from '@/services/api/ParkBountyApply'; | 
| import { toThousand } from '@/utils'; | 
| import _ from 'lodash'; | 
| import FinancialAllocationDetailDialog from './components/FinancialAllocationDetailDialog.vue'; | 
| import PlatformDisbursementDetailDialog from './components/PlatformDisbursementDetailDialog.vue'; | 
| import EnterpriseRechargeDetailDialog from './components/EnterpriseRechargeDetailDialog.vue'; | 
| import EnterpriseConsumptionDetailDialog from './components/EnterpriseConsumptionDetailDialog.vue'; | 
| import EnterpriseWithdrawalDetailDialog from './components/EnterpriseWithdrawalDetailDialog.vue'; | 
| import BalanceDetailDialog from './components/BalanceDetailDialog.vue'; | 
| import { EnumParkRewardStatisticsDetailScene } from '@/constants'; | 
|   | 
| defineOptions({ | 
|   name: 'RewardStatistics', | 
| }); | 
|   | 
| const column = defineColumns([ | 
|   { | 
|     id: '1', | 
|     enCode: 'enterpriseName', | 
|     name: '企业名称', | 
|     width: 250, | 
|   }, | 
|   { | 
|     id: '2', | 
|     enCode: 'societyCreditCode', | 
|     name: '信用代码', | 
|     width: 200, | 
|   }, | 
|   { | 
|     id: '3', | 
|     enCode: 'industrialParkName', | 
|     name: '所属园区', | 
|     width: 200, | 
|   }, | 
|   { | 
|     id: '4', | 
|     enCode: 'contact', | 
|     name: '联系人', | 
|     width: 150, | 
|   }, | 
|   { | 
|     id: '5', | 
|     enCode: 'contactPhone', | 
|     name: '联系方式', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '6', | 
|     enCode: 'month', | 
|     name: '申报月份', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '7', | 
|     enCode: 'batchNo', | 
|     name: '申报批次号', | 
|     width: 150, | 
|   }, | 
|   { | 
|     id: '8', | 
|     enCode: 'sumFinanceAmount', | 
|     name: '财政拨付金额', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '9', | 
|     enCode: 'sumFinanceAmountBtn', | 
|     name: '财政拨付明细', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '10', | 
|     enCode: 'sumTransferAmount', | 
|     name: '平台拨付金额', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '11', | 
|     enCode: 'sumTransferAmountBtn', | 
|     name: '平台拨付明细', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '12', | 
|     enCode: 'sumRechargeAmount', | 
|     name: '企业充值总额', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '13', | 
|     enCode: 'sumRechargeAmountBtn', | 
|     name: '企业充值明细', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '14', | 
|     enCode: 'sumTradeAmount', | 
|     name: '企业消费总额', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '15', | 
|     enCode: 'sumTradeAmountBtn', | 
|     name: '企业消费明细', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '16', | 
|     enCode: 'sumDrawWithAmount', | 
|     name: '企业提现总额', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '17', | 
|     enCode: 'sumDrawWithAmountBtn', | 
|     name: '企业提现明细', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '18', | 
|     enCode: 'amount', | 
|     name: '账户余额', | 
|     width: 120, | 
|   }, | 
|   { | 
|     id: '19', | 
|     enCode: 'amountBtn', | 
|     name: '余额明细', | 
|     width: 120, | 
|   }, | 
| ]); | 
|   | 
| const BaseState = { | 
|   loading: true, | 
|   czbf: false, | 
|   | 
|   detailObject: {} as API.GetRewardStatisticsDetailInput, | 
| }; | 
|   | 
| const state = reactive({ ...BaseState }); | 
|   | 
| onMounted(async () => { | 
|   // await getList(); | 
|   state.loading = false; | 
| }); | 
|   | 
| const { industrialParkList } = useIndustrialParkDropDownList(); | 
|   | 
| const fourStreamsIndustrialParkList = computed(() => { | 
|   return industrialParkList.value.filter((x) => !!x.rewardEnable); | 
| }); | 
|   | 
| const { | 
|   getDataSource: getList, | 
|   proTableProps, | 
|   paginationState, | 
|   extraParamState, | 
|   objectData, | 
|   reset, | 
| } = useTable( | 
|   async ({ pageIndex, pageSize }, extraParamState) => { | 
|     try { | 
|       if (!extraParamState.month) { | 
|         Message.errorMessage('请选择月份'); | 
|         return; | 
|       } | 
|       if (!extraParamState.industrialParkId) { | 
|         Message.errorMessage('请选择园区'); | 
|         return; | 
|       } | 
|       let params: API.GetRewardStatisticsInput = { | 
|         pageModel: { | 
|           rows: pageSize, | 
|           page: pageIndex, | 
|           orderInput: extraParamState.orderInput, | 
|         }, | 
|         keywords: extraParamState.keywords, | 
|         industrialParkId: extraParamState.industrialParkId, | 
|         month: extraParamState.month, | 
|       }; | 
|       let res = await parkBountyApplyServices.getRewardStatistics(params, { | 
|         showLoading: !state.loading, | 
|       }); | 
|       return res; | 
|     } catch (error) {} | 
|   }, | 
|   { | 
|     defaultExtraParams: { | 
|       keywords: '', | 
|       industrialParkId: '', | 
|       month: '', | 
|       orderInput: [{ property: 'enterpriseId', order: OrderInputType.Desc }], | 
|     }, | 
|     columnsRenderProps: { | 
|       month: { type: 'date', format: 'YYYY年MM月' }, | 
|       sumFinanceAmount: { | 
|         type: 'money', | 
|         formatter: (row: API.GetRewardStatisticsDto) => | 
|           row.sumFinanceAmount === null ? '不支持' : toThousand(row.sumFinanceAmount), | 
|       }, | 
|       sumTransferAmount: { | 
|         type: 'money', | 
|         formatter: (row: API.GetRewardStatisticsDto) => | 
|           row.sumTransferAmount === null ? '不支持' : toThousand(row.sumTransferAmount), | 
|       }, | 
|       sumRechargeAmount: { | 
|         type: 'money', | 
|         formatter: (row: API.GetRewardStatisticsDto) => | 
|           row.sumRechargeAmount === null ? '不支持' : toThousand(row.sumRechargeAmount), | 
|       }, | 
|       sumDrawWithAmount: { | 
|         type: 'money', | 
|         formatter: (row: API.GetRewardStatisticsDto) => | 
|           row.sumDrawWithAmount === null ? '不支持' : toThousand(row.sumDrawWithAmount), | 
|       }, | 
|       sumTradeAmount: { | 
|         type: 'money', | 
|         formatter: (row: API.GetRewardStatisticsDto) => | 
|           row.sumTradeAmount === null ? '不支持' : toThousand(row.sumTradeAmount), | 
|       }, | 
|       amount: { | 
|         type: 'money', | 
|         formatter: (row: API.GetRewardStatisticsDto) => | 
|           row.amount === null ? '不支持' : toThousand(row.amount), | 
|       }, | 
|     }, | 
|   } | 
| ); | 
|   | 
| const handleExport = _.debounce( | 
|   async () => { | 
|     if (!extraParamState.month) { | 
|       Message.errorMessage('请选择月份'); | 
|       return; | 
|     } | 
|     if (!extraParamState.industrialParkId) { | 
|       Message.errorMessage('请选择园区'); | 
|       return; | 
|     } | 
|     if (paginationState.total === 0) { | 
|       Message.warnMessage('没有数据可以导出哦~'); | 
|       return; | 
|     } | 
|     try { | 
|       let params: API.ExportRewardStatisticsInput = { | 
|         month: extraParamState.month, | 
|         industrialParkId: extraParamState.industrialParkId, | 
|         keywords: extraParamState.keywords, | 
|       }; | 
|       let res = await parkBountyApplyServices.exportRewardStatistics(params, { | 
|         responseType: 'blob', | 
|         getResponse: true, | 
|       }); | 
|       if (res) { | 
|         downloadFile(res.data, `奖励金统计`, 'xlsx'); | 
|         Message.successMessage('导出成功'); | 
|         getList(paginationState.pageIndex); | 
|       } | 
|     } catch (error) {} | 
|   }, | 
|   1000, | 
|   { leading: true, trailing: false } | 
| ); | 
|   | 
| function createDetailObj( | 
|   row: API.GetRewardStatisticsDto, | 
|   scene: EnumParkRewardStatisticsDetailScene | 
| ) { | 
|   return (state.detailObject = { | 
|     enterpriseId: row.enterpriseId, | 
|     month: row.month, | 
|     scene: scene, | 
|   }); | 
| } | 
|   | 
| const { | 
|   dialogProps: dialogFinancialAllocationDetailProps, | 
|   dialogState: dialogFinancialAllocationDetailState, | 
|   handleAdd: handleFinancialAllocationDetailAdd, | 
| } = useFormDialog({ | 
|   defaultFormParams: state.detailObject, | 
| }); | 
|   | 
| function handleFinancialAllocationDetail(row: API.GetRewardStatisticsDto) { | 
|   handleFinancialAllocationDetailAdd( | 
|     createDetailObj(row, EnumParkRewardStatisticsDetailScene.Finance) | 
|   ); | 
| } | 
|   | 
| const { | 
|   dialogProps: dialogPlatformDisbursementDetailProps, | 
|   dialogState: dialogPlatformDisbursementDetailState, | 
|   handleAdd: handlePlatformDisbursementDetailAdd, | 
| } = useFormDialog({ | 
|   defaultFormParams: state.detailObject, | 
| }); | 
|   | 
| function handlePlatformDisbursementDetail(row: API.GetRewardStatisticsDto) { | 
|   handlePlatformDisbursementDetailAdd( | 
|     createDetailObj(row, EnumParkRewardStatisticsDetailScene.Transfer) | 
|   ); | 
| } | 
|   | 
| const { | 
|   dialogProps: dialogEnterpriseRechargeDetailProps, | 
|   dialogState: dialogEnterpriseRechargeDetailState, | 
|   handleAdd: handleEnterpriseRechargeDetailAdd, | 
| } = useFormDialog({ | 
|   defaultFormParams: state.detailObject, | 
| }); | 
|   | 
| function handleEnterpriseRechargeDetail(row: API.GetRewardStatisticsDto) { | 
|   handleEnterpriseRechargeDetailAdd( | 
|     createDetailObj(row, EnumParkRewardStatisticsDetailScene.Recharge) | 
|   ); | 
| } | 
|   | 
| const { | 
|   dialogProps: dialogEnterpriseConsumptionDetailProps, | 
|   dialogState: dialogEnterpriseConsumptionDetailState, | 
|   handleAdd: handleEnterpriseConsumptionDetailAdd, | 
| } = useFormDialog({ | 
|   defaultFormParams: state.detailObject, | 
| }); | 
|   | 
| function handleEnterpriseConsumptionDetail(row: API.GetRewardStatisticsDto) { | 
|   handleEnterpriseConsumptionDetailAdd( | 
|     createDetailObj(row, EnumParkRewardStatisticsDetailScene.Trade) | 
|   ); | 
| } | 
|   | 
| const { | 
|   dialogProps: dialogEnterpriseWithdrawalDetailProps, | 
|   dialogState: dialogEnterpriseWithdrawalDetailState, | 
|   handleAdd: handleEnterpriseWithdrawalDetailAdd, | 
| } = useFormDialog({ | 
|   defaultFormParams: state.detailObject, | 
| }); | 
|   | 
| function handleEnterpriseWithdrawalDetail(row: API.GetRewardStatisticsDto) { | 
|   handleEnterpriseWithdrawalDetailAdd( | 
|     createDetailObj(row, EnumParkRewardStatisticsDetailScene.DrawWith) | 
|   ); | 
| } | 
|   | 
| const { | 
|   dialogProps: dialogBalanceDetailProps, | 
|   dialogState: dialogBalanceDetailState, | 
|   handleAdd: handleBalanceDetailAdd, | 
| } = useFormDialog({ | 
|   defaultFormParams: { | 
|     financeAmount: 0, | 
|     bountyAmount: 0, | 
|     rechargeAmount: 0, | 
|     sumDrawWithAmount: null, | 
|   }, | 
| }); | 
|   | 
| function handleBalanceDetail(row: API.GetRewardStatisticsDto) { | 
|   handleBalanceDetailAdd({ | 
|     financeAmount: row.financeAmount, | 
|     bountyAmount: row.bountyAmount, | 
|     rechargeAmount: row.rechargeAmount, | 
|     sumDrawWithAmount: row.sumDrawWithAmount, | 
|   }); | 
| } | 
| </script> | 
| <style lang="scss" scoped> | 
| @use '@/style/common.scss' as *; | 
|   | 
| .statistics-wrapper { | 
|   display: flex; | 
|   margin-bottom: 16px; | 
|   padding: 20px boleGetCssVar('proTable', 'filter-bar-horizontal-padding'); | 
|   background-color: #ffffff; | 
|   | 
|   .mx-1 + .mx-1 { | 
|     margin-left: 20px; | 
|   } | 
| } | 
| </style> |