| <template> | 
|   <LoadingLayout :loading="state.loading"> | 
|     <AppContainer> | 
|       <ChunkCell title="账户信息"> | 
|         <ProForm :model="form" ref="formRef" label-width="120px" :is-read="true"> | 
|           <ProFormCol> | 
|             <ProFormColItem :span="8"> | 
|               <ProFormItemV2 label="账户余额:" prop="balance"> | 
|                 <ProFormInputNumber v-model="form.balance" format-value="money"> | 
|                 </ProFormInputNumber> | 
|               </ProFormItemV2> | 
|             </ProFormColItem> | 
|             <ProFormColItem :span="8"> | 
|               <ProFormItemV2 label="账户类型:" prop="access"> | 
|                 <ProFormSelect v-model="form.access" :valueEnum="EnumEnterpriseWalletAccessText"> | 
|                 </ProFormSelect> | 
|               </ProFormItemV2> | 
|             </ProFormColItem> | 
|             <ProFormColItem :span="8"> | 
|               <ProFormItemV2 label="户号:" prop="identity"> | 
|                 <ProFormText v-model.trim="form.identity"> </ProFormText> | 
|               </ProFormItemV2> | 
|             </ProFormColItem> | 
|           </ProFormCol> | 
|         </ProForm> | 
|       </ChunkCell> | 
|       <ChunkCell title="发放明细" style="flex: 1" class="settlement-user-list-chunk"> | 
|         <ProTableQueryFilterBar @on-reset="reset"> | 
|           <template #query> | 
|             <QueryFilterItem> | 
|               <FieldDatePicker | 
|                 v-model="extraParamState.creationTime" | 
|                 type="daterange" | 
|                 range-separator="~" | 
|                 start-placeholder="起始日期" | 
|                 end-placeholder="截止日期" | 
|                 clearable | 
|                 @change="getList()" | 
|                 tooltipContent="申请时间" | 
|               ></FieldDatePicker> | 
|             </QueryFilterItem> | 
|           </template> | 
|           <template #btn> | 
|             <el-button type="primary" @click="handleExport()">导出</el-button> | 
|           </template> | 
|         </ProTableQueryFilterBar> | 
|         <ProTableV2 | 
|           v-bind="proTableProps" | 
|           :columns="column" | 
|           :show-operation-column="false" | 
|           :auto-height="false" | 
|           :table-props="{ | 
|             height: '400px', | 
|           }" | 
|         > | 
|         </ProTableV2> | 
|       </ChunkCell> | 
|     </AppContainer> | 
|   </LoadingLayout> | 
| </template> | 
| <script setup lang="ts"> | 
| import { | 
|   LoadingLayout, | 
|   AppContainer, | 
|   ChunkCell, | 
|   ProForm, | 
|   ProFormItemV2, | 
|   ProFormText, | 
|   ProFormCol, | 
|   ProFormColItem, | 
|   FieldDatePicker, | 
|   ProFormInputNumber, | 
|   useTable, | 
|   ProTableV2, | 
|   QueryFilterItem, | 
|   ProTableQueryFilterBar, | 
|   ProFormSelect, | 
| } from '@bole-core/components'; | 
| import { EnumWalletTransactionStatusText, EnumEnterpriseWalletAccessText } from '@/constants'; | 
| import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; | 
| import * as userServices from '@/services/api/user'; | 
| import { Message } from '@bole-core/core'; | 
| import { downloadFileByUrl, format, setOSSLink } from '@/utils'; | 
| import _ from 'lodash'; | 
| import { ModelValueType } from 'element-plus'; | 
|   | 
| defineOptions({ | 
|   name: 'EnterpriseBalanceManageDetail', | 
| }); | 
|   | 
| const { column, operationBtns } = useAccess({}); | 
|   | 
| const route = useRoute(); | 
| const id = (route.params.id as string) ?? ''; | 
|   | 
| const form = reactive({ | 
|   identity: '', | 
|   access: '' as any as EnumEnterpriseWalletAccess, | 
|   balance: 0, | 
| }); | 
|   | 
| const BaseState = { | 
|   loading: true, | 
| }; | 
|   | 
| const state = reactive({ ...BaseState }); | 
|   | 
| const { | 
|   getDataSource: getList, | 
|   proTableProps, | 
|   paginationState, | 
|   extraParamState, | 
|   reset, | 
| } = useTable( | 
|   async ({ pageIndex, pageSize }, extraParamState) => { | 
|     try { | 
|       let params: API.GetPersonalUserTransactionsQuery = { | 
|         pageModel: { | 
|           rows: pageSize, | 
|           page: pageIndex, | 
|           orderInput: extraParamState.orderInput, | 
|         }, | 
|         createdTimeStart: format(extraParamState.creationTime?.[0] ?? '', 'YYYY-MM-DD 00:00:00'), | 
|         createdTimeEnd: format(extraParamState.creationTime?.[1] ?? '', 'YYYY-MM-DD 23:59:59'), | 
|         enterpriseWalletId: id, | 
|       }; | 
|       let res = await userServices.getPersonalUserTransactions(params); | 
|       if (res.objectData?.enterpriseWallet) { | 
|         form.identity = res.objectData.enterpriseWallet.identity; | 
|         form.access = res.objectData.enterpriseWallet.access; | 
|         form.balance = res.objectData.enterpriseWallet.balance; | 
|       } | 
|       return res; | 
|     } catch (error) {} | 
|   }, | 
|   { | 
|     defaultExtraParams: { | 
|       creationTime: [] as unknown as ModelValueType, | 
|       orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }], | 
|     }, | 
|     columnsRenderProps: { | 
|       transDate: { type: 'date' }, | 
|       sendTime: { type: 'date' }, | 
|       amount: { type: 'money' }, | 
|       transactionStatus: { type: 'enum', valueEnum: EnumWalletTransactionStatusText }, | 
|       ereceiptDownloadOssUrl: { | 
|         type: 'url', | 
|         formatter: (row: API.GetPersonalUserTransactionsQueryResultItem) => | 
|           row.ereceiptDownloadOssUrl ? setOSSLink(row.ereceiptDownloadOssUrl) : '', | 
|       }, | 
|     }, | 
|   } | 
| ); | 
|   | 
| const handleExport = _.debounce( | 
|   async () => { | 
|     if (paginationState.total === 0) { | 
|       Message.warnMessage('没有数据可以导出哦~'); | 
|       return; | 
|     } | 
|     try { | 
|       let params: API.ExportEnterpriseBalanceDetailsCommand = { | 
|         enterpriseWalletId: id, | 
|         createdTimeStart: format(extraParamState.creationTime?.[0] ?? '', 'YYYY-MM-DD 00:00:00'), | 
|         createdTimeEnd: format(extraParamState.creationTime?.[1] ?? '', 'YYYY-MM-DD 23:59:59'), | 
|       }; | 
|       let res = await enterpriseWalletServices.exportEnterpriseBalanceDetails(params); | 
|       if (res) { | 
|         downloadFileByUrl(setOSSLink(res)); | 
|       } | 
|     } catch (error) {} | 
|   }, | 
|   1000, | 
|   { leading: true, trailing: false } | 
| ); | 
|   | 
| onMounted(() => { | 
|   state.loading = false; | 
|   getList(); | 
| }); | 
| </script> | 
|   | 
| <style lang="scss" scoped> | 
| @use '@/style/common.scss' as *; | 
|   | 
| .step-wrapper { | 
|   margin: 0 auto; | 
|   padding: 24px 0; | 
| } | 
|   | 
| .settlement-user-list-chunk { | 
|   :deep() { | 
|     .no-data img { | 
|       width: 280px; | 
|     } | 
|   } | 
| } | 
| </style> | 
| <style lang="scss"> | 
| .text-over-tooltip-content { | 
|   max-width: 600px; | 
|   word-break: break-all; | 
| } | 
| </style> |