From 404a6138ba3594a66d1b66e2bc79b9b3132836c5 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 17 四月 2025 17:20:36 +0800 Subject: [PATCH] feat: 页面 --- src/views/Reward/RewardGrant.vue | 111 +++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 82 insertions(+), 29 deletions(-) diff --git a/src/views/Reward/RewardGrant.vue b/src/views/Reward/RewardGrant.vue index 18093e7..f6c1071 100644 --- a/src/views/Reward/RewardGrant.vue +++ b/src/views/Reward/RewardGrant.vue @@ -47,8 +47,16 @@ </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> + <FinancialDialog v-bind="dialogFinancialProps"></FinancialDialog> + <PlateformDialog v-bind="dialogPlateformProps"></PlateformDialog> </AppContainer> </LoadingLayout> </template> @@ -67,15 +75,17 @@ FieldDatePicker, useFormDialog, UploadUserFile, - bolePreview, + PreviewBtnV2, } from '@bole-core/components'; import { Message, OrderInputType } from '@bole-core/core'; -import { convertApi2FormUrl, convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils'; +import { convertApi2FormUrlBySeparator, 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'; defineOptions({ name: 'RewardGrant', @@ -100,12 +110,12 @@ { id: '4', enCode: 'applyMonth', - name: '鐢宠濂栧姳閲戞湀浠�', + name: '鐢宠骞冲彴濂栧姳鏈堜唤', }, { id: '5', enCode: 'applySumAmount', - name: '濂栧姳閲戞眹鎬婚噾棰濓紙鍏冿級', + name: '骞冲彴濂栧姳姹囨�婚噾棰濓紙鍏冿級', }, { id: '6', @@ -115,12 +125,22 @@ { id: '7', enCode: 'settleStatus', - name: '鍙戞斁鐘舵��', + name: '璐㈡斂鎷ㄤ粯鐘舵��', }, { id: '8', enCode: 'settleTime', - name: '鍙戞斁鏃ユ湡', + name: '鎷ㄤ粯鏃ユ湡', + }, + { + id: '9', + enCode: 'settleStatus', + name: '骞冲彴鍏呭�肩姸鎬�', + }, + { + id: '10', + enCode: 'settleTime', + name: '鍏呭�兼棩鏈�', }, ]; @@ -136,11 +156,11 @@ }, { data: { - enCode: 'grantBtn', - name: '鍙戞斁', + enCode: 'financialBtn', + name: '璐㈡斂鎷ㄤ粯', }, emits: { - onClick: (role) => openDialog(role), + onClick: (role) => openFinancialDialog(role), }, extraProps: { hide: (row: API.GetParkBountyApplyListOutput) => @@ -149,11 +169,21 @@ }, { data: { - enCode: 'previewBtn', - name: '鏌ョ湅鍑瘉', + enCode: 'plateformBtn', + name: '骞冲彴鍏呭��', }, emits: { - onClick: (role) => handlePreview(role), + onClick: (role) => openPlateformDialog(role), + }, + extraProps: { + hide: (row: API.GetParkBountyApplyListOutput) => + row.settleStatus === SettleStatusEnum.HasSettle, + }, + }, + { + data: { + enCode: 'checkBtn', + name: '鏌ョ湅鍑瘉', }, extraProps: { hide: (row: API.GetParkBountyApplyListOutput) => @@ -229,43 +259,66 @@ }); } -const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({ - onConfirm: handleAddOrEdit, +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) {} } -function handlePreview(row?: API.GetParkBountyApplyListOutput) { - const fileList = row.settleFileUrl?.split('|').map((x) => convertApi2FormUrl(x)) ?? []; - if (fileList.length > 1) { - console.log('fileList: ', fileList); - } else { - downloadFileByUrl(fileList[0]); - } +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