|
@@ -14,6 +14,8 @@ import { useModal } from '@/components/zt/Modal/hooks/useModal';
|
|
|
import type { FormSchema } from '@/components/zt/Form/types/form';
|
|
import type { FormSchema } from '@/components/zt/Form/types/form';
|
|
|
import SVGIcon from '@/components/custom/svg-icon.vue';
|
|
import SVGIcon from '@/components/custom/svg-icon.vue';
|
|
|
const importTemplateRef = useTemplateRef('importTemplateRef');
|
|
const importTemplateRef = useTemplateRef('importTemplateRef');
|
|
|
|
|
+const loading = ref(false);
|
|
|
|
|
+
|
|
|
const ModalColumns: NaiveUI.TableColumn<Api.government.PointsRecharge>[] = [
|
|
const ModalColumns: NaiveUI.TableColumn<Api.government.PointsRecharge>[] = [
|
|
|
{
|
|
{
|
|
|
key: 'channelName',
|
|
key: 'channelName',
|
|
@@ -163,7 +165,7 @@ const failColumns: NaiveUI.TableColumn<Api.government.PointsFailureRecordVO>[] =
|
|
|
}
|
|
}
|
|
|
];
|
|
];
|
|
|
const failData = ref<Api.government.PointsFailureRecordVO[]>([]);
|
|
const failData = ref<Api.government.PointsFailureRecordVO[]>([]);
|
|
|
-const [registerTable, { refresh }] = useTable({
|
|
|
|
|
|
|
+const [registerTable, { refresh, setFieldsValue: setSearchValues }] = useTable({
|
|
|
searchFormConfig: {
|
|
searchFormConfig: {
|
|
|
schemas: [
|
|
schemas: [
|
|
|
{
|
|
{
|
|
@@ -174,7 +176,16 @@ const [registerTable, { refresh }] = useTable({
|
|
|
api: fetchGetLoginUserList,
|
|
api: fetchGetLoginUserList,
|
|
|
labelFeild: 'channelName',
|
|
labelFeild: 'channelName',
|
|
|
valueFeild: 'id',
|
|
valueFeild: 'id',
|
|
|
- multiple: true
|
|
|
|
|
|
|
+ multiple: true,
|
|
|
|
|
+ onUpdateValue: () => {
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ listHandleSearch();
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ getOptions: async (options: any) => {
|
|
|
|
|
+ await setSearchValues({ channelIdList: [options[0].id] });
|
|
|
|
|
+ listHandleSearch();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
@@ -186,25 +197,27 @@ const [registerTable, { refresh }] = useTable({
|
|
|
tableConfig: {
|
|
tableConfig: {
|
|
|
keyField: 'id',
|
|
keyField: 'id',
|
|
|
title: '充值积分',
|
|
title: '充值积分',
|
|
|
- showAddButton: false
|
|
|
|
|
- }
|
|
|
|
|
-});
|
|
|
|
|
-const [registerModalTable, { refresh: refreshModal, setFieldsValue, getSeachForm }] = useTable({
|
|
|
|
|
- searchFormConfig: {
|
|
|
|
|
- schemas: searchSchemas,
|
|
|
|
|
- inline: false,
|
|
|
|
|
- size: 'small',
|
|
|
|
|
- labelPlacement: 'left',
|
|
|
|
|
- isFull: false
|
|
|
|
|
- },
|
|
|
|
|
- tableConfig: {
|
|
|
|
|
- keyField: 'id',
|
|
|
|
|
- title: '积分列表',
|
|
|
|
|
showAddButton: false,
|
|
showAddButton: false,
|
|
|
- minHeight: 400,
|
|
|
|
|
defaultParamsNotReset: 'channelIdList'
|
|
defaultParamsNotReset: 'channelIdList'
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+const [registerModalTable, { refresh: refreshModal, setFieldsValue, getSeachForm, setTableLoading, getTableData }] =
|
|
|
|
|
+ useTable({
|
|
|
|
|
+ searchFormConfig: {
|
|
|
|
|
+ schemas: searchSchemas,
|
|
|
|
|
+ inline: false,
|
|
|
|
|
+ size: 'small',
|
|
|
|
|
+ labelPlacement: 'left',
|
|
|
|
|
+ isFull: false
|
|
|
|
|
+ },
|
|
|
|
|
+ tableConfig: {
|
|
|
|
|
+ keyField: 'id',
|
|
|
|
|
+ title: '积分列表',
|
|
|
|
|
+ showAddButton: false,
|
|
|
|
|
+ minHeight: 400,
|
|
|
|
|
+ defaultParamsNotReset: 'channelIdList'
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
const [registerModal, { openModal }] = useModal({
|
|
const [registerModal, { openModal }] = useModal({
|
|
|
title: '充值积分',
|
|
title: '充值积分',
|
|
@@ -234,12 +247,30 @@ async function openImportModal() {
|
|
|
const { data } = await fetchGetFailPointsList();
|
|
const { data } = await fetchGetFailPointsList();
|
|
|
failData.value = data as Api.government.PointsFailureRecordVO[];
|
|
failData.value = data as Api.government.PointsFailureRecordVO[];
|
|
|
}
|
|
}
|
|
|
-function hanleExportFailure(code: string) {
|
|
|
|
|
- commonExport('/platform/pointsFailureRecord/export', { code });
|
|
|
|
|
|
|
+async function hanleExportFailure(code: string) {
|
|
|
|
|
+ if (loading.value) {
|
|
|
|
|
+ window.$message?.error('正在导出,请勿重复点击');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ await commonExport('/platform/pointsFailureRecord/export', { code }, '失败的记录.xlsx');
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function exportIntegral() {
|
|
|
|
|
+ setTableLoading(true);
|
|
|
|
|
+ await commonExport('/platform/pointsRecharge/export', getSeachForm(), '积分列表.xlsx');
|
|
|
|
|
+ setTableLoading(false);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
function handleSearch() {
|
|
function handleSearch() {
|
|
|
refreshModal();
|
|
refreshModal();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+function listHandleSearch() {
|
|
|
|
|
+ refresh();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function setSearchForm(value: Recordable) {
|
|
async function setSearchForm(value: Recordable) {
|
|
|
await setFieldsValue(value);
|
|
await setFieldsValue(value);
|
|
|
}
|
|
}
|
|
@@ -247,7 +278,7 @@ async function setSearchForm(value: Recordable) {
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<LayoutTable>
|
|
<LayoutTable>
|
|
|
- <ZTable :show-table-action="false" :columns="outColumns" :api="fetchGetPointsOutList" @register="registerTable">
|
|
|
|
|
|
|
+ <ZTable :columns="outColumns" :immediate="false" :api="fetchGetPointsOutList" @register="registerTable">
|
|
|
<template #prefix>
|
|
<template #prefix>
|
|
|
<NButton size="small" @click="openModal">充值积分</NButton>
|
|
<NButton size="small" @click="openModal">充值积分</NButton>
|
|
|
</template>
|
|
</template>
|
|
@@ -261,11 +292,13 @@ async function setSearchForm(value: Recordable) {
|
|
|
:api="fetchGetPointsList"
|
|
:api="fetchGetPointsList"
|
|
|
@register="registerModalTable"
|
|
@register="registerModalTable"
|
|
|
>
|
|
>
|
|
|
- <template #prefix>
|
|
|
|
|
|
|
+ <template #prefix="{ loading: tabloading }">
|
|
|
<NButton
|
|
<NButton
|
|
|
v-if="useAuth().hasAuth('points:user:export')"
|
|
v-if="useAuth().hasAuth('points:user:export')"
|
|
|
size="small"
|
|
size="small"
|
|
|
- @click="commonExport('/platform/pointsRecharge/export', getSeachForm())"
|
|
|
|
|
|
|
+ :loading="tabloading"
|
|
|
|
|
+ :disabled="getTableData().length == 0"
|
|
|
|
|
+ @click="exportIntegral"
|
|
|
>
|
|
>
|
|
|
导出
|
|
导出
|
|
|
</NButton>
|
|
</NButton>
|