<template>
|
<LoadingLayout :loading="isLoading">
|
<AppContainer>
|
<ChunkCell title="账户信息">
|
<ProForm :model="form" ref="formRef" label-width="120px" :is-read="true">
|
<ProFormCol>
|
<ProFormColItem :span="8">
|
<ProFormItemV2 label="账户余额:" prop="name">
|
<ProFormInputNumber v-model="form.name" format-value="money"> </ProFormInputNumber>
|
</ProFormItemV2>
|
</ProFormColItem>
|
<ProFormColItem :span="8">
|
<ProFormItemV2 label="账户类型:" prop="settlementAmount">
|
<ProFormSelect v-model="form.name" :valueEnum="[]"> </ProFormSelect>
|
</ProFormItemV2>
|
</ProFormColItem>
|
<ProFormColItem :span="8">
|
<ProFormItemV2 label="户号:" prop="actualSettlementAmount">
|
<ProFormText v-model.trim="form.name"> </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.time"
|
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="BalanceManageDetailColumns"
|
:show-operation-column="false"
|
>
|
</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 { BalanceManageDetailColumns } from './constants';
|
import { useQuery } from '@tanstack/vue-query';
|
import * as taskServices from '@/services/api/task';
|
import * as taskUserServices from '@/services/api/taskUser';
|
import * as userServices from '@/services/api/user';
|
import { Message } from '@bole-core/core';
|
import { downloadFileByUrl, setOSSLink } from '@/utils';
|
import _ from 'lodash';
|
import { ModelValueType } from 'element-plus';
|
|
defineOptions({
|
name: 'BalanceManageDetail',
|
});
|
|
const route = useRoute();
|
const id = (route.params.id as string) ?? '';
|
|
const form = reactive({
|
name: '',
|
});
|
|
const BaseState = {
|
loading: true,
|
};
|
|
const state = reactive({ ...BaseState });
|
|
const { isLoading, refetch } = useQuery({
|
queryKey: ['taskUserServices/getSettlementTaskUsers', id],
|
queryFn: async () => {
|
return await taskUserServices.getSettlementTaskUsers(
|
{ id: id },
|
{
|
showLoading: false,
|
}
|
);
|
},
|
placeholderData: () => ({} as API.GetSettlementTaskUsersQueryResult),
|
onSuccess(res) {
|
if (res?.detail) {
|
form.name = res?.detail?.name;
|
}
|
getList();
|
},
|
enabled: !!id,
|
});
|
|
const {
|
getDataSource: getList,
|
proTableProps,
|
paginationState,
|
extraParamState,
|
reset,
|
} = useTable(
|
async ({ pageIndex, pageSize }, extraParamState) => {
|
try {
|
let params: API.GetPersonalUserWalletBalancesQuery = {
|
pageModel: {
|
rows: pageSize,
|
page: pageIndex,
|
orderInput: extraParamState.orderInput,
|
},
|
};
|
|
let res = await userServices.getPersonalUserWalletBalances(params, {
|
showLoading: !state.loading,
|
});
|
return res;
|
} catch (error) {}
|
},
|
{
|
defaultExtraParams: {
|
time: [] as unknown as ModelValueType,
|
orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }],
|
},
|
columnsRenderProps: {
|
balance: { type: 'money' },
|
},
|
}
|
);
|
|
const handleExport = _.debounce(
|
async () => {
|
if (paginationState.total === 0) {
|
Message.warnMessage('没有数据可以导出哦~');
|
return;
|
}
|
try {
|
let params: API.ExportTaskSettlementOrderRostersCommand = {
|
id: id,
|
};
|
let res = await taskServices.exportTaskSettlementOrderRosters(params);
|
if (res) {
|
downloadFileByUrl(setOSSLink(res), `${form.name}`);
|
}
|
} catch (error) {}
|
},
|
1000,
|
{ leading: true, trailing: false }
|
);
|
</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>
|