From ccc59ace343de3ecdf2ca7c4d82966faaf3b32e7 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期五, 14 十一月 2025 19:58:50 +0800
Subject: [PATCH] fix: bug

---
 src/views/StatisticalReport/RewardStatistics.vue |  173 +++++++++++++--------------------------------------------
 1 files changed, 39 insertions(+), 134 deletions(-)

diff --git a/src/views/StatisticalReport/RewardStatistics.vue b/src/views/StatisticalReport/RewardStatistics.vue
index 8d22efb..1aa7b2d 100644
--- a/src/views/StatisticalReport/RewardStatistics.vue
+++ b/src/views/StatisticalReport/RewardStatistics.vue
@@ -20,17 +20,6 @@
       </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"
@@ -41,6 +30,18 @@
               clearable
               @change="getList()"
             />
+          </QueryFilterItem>
+          <QueryFilterItem tip-content="鐢虫姤鏈堜唤">
+            <FieldDatePicker
+              v-model="extraParamState.months"
+              type="months"
+              clearable
+              placeholder="璇烽�夋嫨鐢虫姤鏈堜唤"
+              format="YYYY-MM"
+              value-format="YYYY-MM"
+              @change="getList()"
+              :disabled-date="disabledDate"
+            ></FieldDatePicker>
           </QueryFilterItem>
           <QueryFilterItem>
             <SearchInput
@@ -53,7 +54,13 @@
           </QueryFilterItem>
         </template>
         <template #btn>
-          <el-button @click="handleExport()" icon="Download" type="primary">瀵煎嚭</el-button>
+          <el-button
+            v-if="checkSubModuleItemShow('pageButton', 'exportBtn')"
+            @click="handleExport()"
+            icon="Download"
+            type="primary"
+            >瀵煎嚭</el-button
+          >
         </template>
       </ProTableQueryFilterBar>
       <ProTableV2 v-bind="proTableProps" :columns="column" :show-operation-column="false">
@@ -124,7 +131,7 @@
 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 { format, toThousand } from '@/utils';
 import _ from 'lodash';
 import FinancialAllocationDetailDialog from './components/FinancialAllocationDetailDialog.vue';
 import PlatformDisbursementDetailDialog from './components/PlatformDisbursementDetailDialog.vue';
@@ -133,127 +140,13 @@
 import EnterpriseWithdrawalDetailDialog from './components/EnterpriseWithdrawalDetailDialog.vue';
 import BalanceDetailDialog from './components/BalanceDetailDialog.vue';
 import { EnumParkRewardStatisticsDetailScene } from '@/constants';
+import { useRewardStatisticsMonths } from './hooks';
 
 defineOptions({
   name: 'RewardStatistics',
 });
 
-const column = defineColumns([
-  {
-    id: '1',
-    enCode: 'enterpriseName',
-    name: '浼佷笟鍚嶇О',
-    width: 250,
-  },
-  {
-    id: '2',
-    enCode: 'societyCreditCode',
-    name: '淇$敤浠g爜',
-    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 { checkSubModuleItemShow, column, operationBtns } = useAccess({});
 
 const BaseState = {
   loading: true,
@@ -285,14 +178,19 @@
 } = useTable(
   async ({ pageIndex, pageSize }, extraParamState) => {
     try {
-      if (!extraParamState.month) {
-        Message.errorMessage('璇烽�夋嫨鏈堜唤');
-        return;
-      }
+      // if (!extraParamState.month) {
+      //   Message.errorMessage('璇烽�夋嫨鏈堜唤');
+      //   return;
+      // }
       if (!extraParamState.industrialParkId) {
         Message.errorMessage('璇烽�夋嫨鍥尯');
         return;
       }
+      if (!extraParamState.months.length) {
+        Message.errorMessage('璇烽�夋嫨鏈堜唤');
+        return;
+      }
+
       let params: API.GetRewardStatisticsInput = {
         pageModel: {
           rows: pageSize,
@@ -301,7 +199,8 @@
         },
         keywords: extraParamState.keywords,
         industrialParkId: extraParamState.industrialParkId,
-        month: extraParamState.month,
+        // month: extraParamState.month,
+        months: extraParamState.months.map((x) => format(x as any, 'YYYY-MM')),
       };
       let res = await parkBountyApplyServices.getRewardStatistics(params, {
         showLoading: !state.loading,
@@ -314,6 +213,7 @@
       keywords: '',
       industrialParkId: '',
       month: '',
+      months: [] as string[],
       orderInput: [{ property: 'enterpriseId', order: OrderInputType.Desc }],
     },
     columnsRenderProps: {
@@ -352,6 +252,11 @@
   }
 );
 
+const { disabledDate } = useRewardStatisticsMonths({
+  industrialParkId: toRef(extraParamState, 'industrialParkId'),
+  enabled: computed(() => !!extraParamState.industrialParkId),
+});
+
 const handleExport = _.debounce(
   async () => {
     if (!extraParamState.month) {

--
Gitblit v1.9.1