From 524b1febe13e9305e9a27c870e09819e0e363bbd Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期一, 21 四月 2025 17:28:48 +0800
Subject: [PATCH] feat: 接口

---
 src/views/Reward/RewardGrant.vue |  136 +++++++++++++++++++++++++++++++++++----------
 1 files changed, 105 insertions(+), 31 deletions(-)

diff --git a/src/views/Reward/RewardGrant.vue b/src/views/Reward/RewardGrant.vue
index 7e3bbb8..5891bf6 100644
--- a/src/views/Reward/RewardGrant.vue
+++ b/src/views/Reward/RewardGrant.vue
@@ -47,15 +47,18 @@
       </ProTableQueryFilterBar>
 
       <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
-        <template #operationBtn-checkBtn="{ data, row }">
-          <PreviewBtnV2
-            class="pro-table-operation-btn"
-            :url="convertApi2FormUrlBySeparator(row.settleFileUrl ?? '')"
-            preview-btn-text="鏌ョ湅鍑瘉"
-          />
-        </template>
       </ProTableV2>
-      <RewardGrantDialog v-bind="dialogProps"></RewardGrantDialog>
+      <FourStreamsMaterialFileDialog
+        v-bind="dialogMaterialFileProps"
+        :show-upload-btn="false"
+        :show-delete-btn="false"
+        :show-check-btn="false"
+        downloadBtnText="鏌ョ湅"
+        title="鏌ョ湅鍑瘉"
+        :BusinessTypeEnumText="ApplyTransferFileBusinessTypeEnumText"
+      />
+      <FinancialDialog v-bind="dialogFinancialProps"></FinancialDialog>
+      <PlateformDialog v-bind="dialogPlateformProps"></PlateformDialog>
     </AppContainer>
   </LoadingLayout>
 </template>
@@ -74,20 +77,21 @@
   FieldDatePicker,
   useFormDialog,
   UploadUserFile,
-  PreviewBtnV2,
 } from '@bole-core/components';
 import { Message, OrderInputType } from '@bole-core/core';
-import {
-  convertApi2FormUrl,
-  convertApi2FormUrlBySeparator,
-  downloadFileByUrl,
-  format,
-} from '@/utils';
+import { format } from '@/utils';
 import { SettleStatusEnum, SettleStatusEnumText } from '@/constants';
 import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
-import RewardGrantDialog from './components/RewardGrantDialog.vue';
+import FinancialDialog from './components/FinancialDialog.vue';
+import PlateformDialog from './components/PlateformDialog.vue';
 import _ from 'lodash';
 import { ModelValueType } from 'element-plus';
+import { useQueryClient } from '@tanstack/vue-query';
+import { FourStreamsMaterialUtils } from '@/components/commonView/utils';
+import {
+  ApplyTransferMaterialFileTableItem,
+  ApplyTransferFileBusinessTypeEnumText,
+} from '@/components/commonView/types';
 
 defineOptions({
   name: 'RewardGrant',
@@ -112,12 +116,12 @@
   {
     id: '4',
     enCode: 'applyMonth',
-    name: '鐢宠濂栧姳閲戞湀浠�',
+    name: '鐢宠骞冲彴濂栧姳鏈堜唤',
   },
   {
     id: '5',
     enCode: 'applySumAmount',
-    name: '濂栧姳閲戞眹鎬婚噾棰濓紙鍏冿級',
+    name: '骞冲彴濂栧姳姹囨�婚噾棰濓紙鍏冿級',
   },
   {
     id: '6',
@@ -127,12 +131,22 @@
   {
     id: '7',
     enCode: 'settleStatus',
-    name: '鍙戞斁鐘舵��',
+    name: '璐㈡斂鎷ㄤ粯鐘舵��',
   },
   {
     id: '8',
     enCode: 'settleTime',
-    name: '鍙戞斁鏃ユ湡',
+    name: '鎷ㄤ粯鏃ユ湡',
+  },
+  {
+    id: '9',
+    enCode: 'settleStatus',
+    name: '骞冲彴鍏呭�肩姸鎬�',
+  },
+  {
+    id: '10',
+    enCode: 'settleTime',
+    name: '鍏呭�兼棩鏈�',
   },
 ];
 
@@ -148,11 +162,24 @@
   },
   {
     data: {
-      enCode: 'grantBtn',
-      name: '鍙戞斁',
+      enCode: 'financialBtn',
+      name: '璐㈡斂鎷ㄤ粯',
     },
     emits: {
-      onClick: (role) => openDialog(role),
+      onClick: (role) => openFinancialDialog(role),
+    },
+    extraProps: {
+      hide: (row: API.GetParkBountyApplyListOutput) =>
+        row.settleStatus === SettleStatusEnum.HasSettle,
+    },
+  },
+  {
+    data: {
+      enCode: 'plateformBtn',
+      name: '骞冲彴鍏呭��',
+    },
+    emits: {
+      onClick: (role) => openPlateformDialog(role),
     },
     extraProps: {
       hide: (row: API.GetParkBountyApplyListOutput) =>
@@ -163,6 +190,9 @@
     data: {
       enCode: 'checkBtn',
       name: '鏌ョ湅鍑瘉',
+    },
+    emits: {
+      onClick: (row) => openMaterialFileDialog(row),
     },
     extraProps: {
       hide: (row: API.GetParkBountyApplyListOutput) =>
@@ -238,34 +268,78 @@
   });
 }
 
-const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({
-  onConfirm: handleAddOrEdit,
+function openMaterialFileDialog(row: API.ParkBountyApplyTransferDetailInfo) {
+  handleMaterialFileAdd({
+    list: FourStreamsMaterialUtils.initApplyTransferMaterialFileList(row),
+  });
+}
+
+const { dialogProps: dialogMaterialFileProps, handleAdd: handleMaterialFileAdd } = useFormDialog({
+  defaultFormParams: {
+    list: [] as ApplyTransferMaterialFileTableItem[],
+  },
+});
+
+const queryClient = useQueryClient();
+const {
+  dialogProps: dialogFinancialProps,
+  handleEdit: handleFinancialEdit,
+  editForm: editFinancialForm,
+} = useFormDialog({
+  onConfirm: handleFinancial,
   defaultFormParams: {
     parkBountyApplyId: '',
+    amount: 0,
     settleFileUrl: [] as UploadUserFile[],
   },
 });
 
-function openDialog(row?: API.GetParkBountyApplyListOutput) {
-  handleEdit({
+function openFinancialDialog(row?: API.GetParkBountyApplyListOutput) {
+  handleFinancialEdit({
     parkBountyApplyId: row.id,
+    amount: 0,
     settleFileUrl: [] as UploadUserFile[],
   });
 }
-
-async function handleAddOrEdit() {
+async function handleFinancial() {
   try {
     let params: API.ParkBountyApplySettleInput = {
-      parkBountyApplyId: editForm.parkBountyApplyId,
-      settleFileUrl: editForm.settleFileUrl.map((x) => x.path).join('|'),
+      parkBountyApplyId: editFinancialForm.parkBountyApplyId,
+      settleFileUrl: editFinancialForm.settleFileUrl.map((x) => x.path).join('|'),
     };
     let res = await parkBountyApplyServices.parkBountyApplySettle(params);
     if (res) {
       Message.successMessage('鎿嶄綔鎴愬姛');
       getList(paginationState.pageIndex);
+      queryClient.invalidateQueries({
+        queryKey: ['parkBountyApplyServices/getGoverDataBoard'],
+      });
     }
   } catch (error) {}
 }
+
+const {
+  dialogProps: dialogPlateformProps,
+  handleEdit: handlePlateformEdit,
+  editForm: editPlateformForm,
+} = useFormDialog({
+  onConfirm: handlePlateform,
+  defaultFormParams: {
+    parkBountyApplyId: '',
+    amount: 0,
+    settleFileUrl: [] as UploadUserFile[],
+  },
+});
+
+function openPlateformDialog(row?: API.GetParkBountyApplyListOutput) {
+  handlePlateformEdit({
+    parkBountyApplyId: row.id,
+    amount: 0,
+    settleFileUrl: [] as UploadUserFile[],
+  });
+}
+
+async function handlePlateform() {}
 </script>
 
 <style lang="scss" scoped>

--
Gitblit v1.9.1