Browse Source

优化:捐款记录的列表

dev
科技小王子 5 months ago
parent
commit
323b316c3d
  1. 4
      .env.development
  2. 3
      src/api/bszx/bszxBm/model/index.ts
  3. 4
      src/api/index.ts
  4. 2
      src/store/modules/theme.ts
  5. 12
      src/store/modules/user.ts
  6. 45
      src/views/bszx/bszxPay/components/search.vue
  7. 82
      src/views/bszx/bszxPay/index.vue
  8. 1
      src/views/passport/login/index.vue

4
.env.development

@ -1,10 +1,10 @@
VITE_APP_NAME=后台管理系统
#VITE_SOCKET_URL=wss://server.gxwebsoft.com
VITE_SOCKET_URL=wss://server.gxwebsoft.com
VITE_SERVER_URL=https://server.gxwebsoft.com/api
#VITE_API_URL=https://cms-api.websoft.top/api
VITE_SOCKET_URL=ws://127.0.0.1:9191
#VITE_SOCKET_URL=ws://127.0.0.1:9191
#VITE_SERVER_URL=http://127.0.0.1:8000/api
VITE_API_URL=http://127.0.0.1:9000/api
#VITE_THINK_URL=http://127.0.0.1:9099/api

3
src/api/bszx/bszxBm/model/index.ts

@ -12,6 +12,9 @@ export interface BszxBm {
sex?: number;
// 手机号码
phone?: string;
mobile?: string;
// 捐款金额
price?: string;
// 班级
className?: string;
// 年级

4
src/api/index.ts

@ -47,9 +47,9 @@ export interface PageParam {
// 搜素关键词
keywords?: string;
// 起始时间
createTimeStart?: number;
createTimeStart?: string;
// 结束时间
createTimeEnd?: number;
createTimeEnd?: string;
timeStart?: number;
timeEnd?: number;
isExpireTime?: number;

2
src/store/modules/theme.ts

@ -41,7 +41,7 @@ const DEFAULT_STATE: ThemeState = Object.freeze({
// 内容区域是否全屏
bodyFullscreen: false,
// 是否开启页签栏
showTabs: true,
showTabs: false,
// 是否开启页脚
showFooter: true,
// 顶栏风格: light(亮色), dark(暗色), primary(主色)

12
src/store/modules/user.ts

@ -6,7 +6,7 @@ import { formatMenus, toTreeData, formatTreeData } from 'ele-admin-pro/es';
import type { MenuItemType } from 'ele-admin-pro/es';
import type { User } from '@/api/system/user/model';
import { TOKEN_STORE_NAME, USER_MENUS } from '@/config/setting';
import {getTenantInfo, getUserInfo} from '@/api/layout';
import {getUserInfo} from '@/api/layout';
import { initialization } from '@/api/layout';
import {clone} from "@/api/system/menu";
import { message } from 'ant-design-vue/es';
@ -40,9 +40,9 @@ export const useUserStore = defineStore({
*
*/
async fetchUserInfo() {
const company = await getTenantInfo().catch(() => void 0);
// const company = await getTenantInfo().catch(() => void 0);
const result = await getUserInfo().catch(() => {});
if (!result || !company) {
if (!result) {
Modal.info({
title: '系统提示',
content: '该应用已欠费,请先续费后访问!',
@ -67,7 +67,7 @@ export const useUserStore = defineStore({
});
}
// 克隆默认的云企业官网
if(company?.planId == 0){
if(result?.planId == 0){
const hide = message.loading('正在分配资源请勿刷新页面...', 0);
await clone({companyId: 10431,tenantId: 10398}).then(() => {
hide();
@ -93,7 +93,7 @@ export const useUserStore = defineStore({
}
// 用户权限
this.authorities =
company.authorities
result.authorities
?.filter((d) => !!d.authority)
?.map((d) => d.authority) ?? [];
// 用户角色
@ -104,7 +104,7 @@ export const useUserStore = defineStore({
const { menus, homePath } = formatMenus(
USER_MENUS ??
toTreeData({
data: company.authorities
data: result.authorities
?.filter((d) => d.menuType !== 1)
.map((d) => {
// 改造子模块的访问路径

45
src/views/bszx/bszxPay/components/search.vue

@ -8,6 +8,11 @@
v-model:value="where.keywords"
@search="reload"
/>
<a-range-picker
v-model:value="dateRange"
@change="search"
value-format="YYYY-MM-DD"
/>
<a-button type="text" @click="handleExport">导出</a-button>
</a-space>
</template>
@ -41,6 +46,8 @@
const { where } = useSearch<BszxPayParam>({
id: undefined,
keywords: '',
createTimeStart: undefined,
createTimeEnd: undefined,
userId: undefined
});
@ -48,6 +55,18 @@
emit('search', where);
};
/* 搜索 */
const search = () => {
const [d1, d2] = dateRange.value ?? [];
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
where.createTimeEnd = d2 ? d2 + ' 23:59:59' : undefined;
emit('search', {
...where
});
};
const dateRange = ref<[string, string]>(['', '']);
//
const loading = ref(false);
const bmList = ref<BszxBm[]>([])
@ -58,17 +77,15 @@
loading.value = true;
const array: (string | number)[][] = [
[
'用户ID',
'姓名',
'性别',
'手机号码',
'班级',
'捐款金额',
'性别',
'年级',
'班级',
'居住地址',
'工作单位',
'职务',
'是否能到场',
'邀请函',
'捐款时间'
]
];
@ -80,17 +97,15 @@
bmList.value = list;
list?.forEach((d: BszxBm) => {
array.push([
`${d.userId}`,
`${d.name}`,
`${d.sex}`,
`${d.phone}`,
`${d.className}`,
`${d.gradeName}`,
`${d.address}`,
`${d.workUnit}`,
`${d.position}`,
`${d.present}`,
`${d.certificate}`,
`${d.mobile}`,
`${d.price}`,
`${d.sex == 1 ? '男' : ''}${d.sex == 2 ? '女' : '-'}`,
`${d.gradeName ? d.gradeName : '-'}`,
`${d.className ? d.className : '-'}`,
`${d.address ? d.address : '-'}`,
`${d.workUnit ? d.workUnit : '-'}`,
`${d.position ? d.position : '-'}`,
`${d.createTime}`
]);
});

82
src/views/bszx/bszxPay/index.vue

@ -21,6 +21,13 @@
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'name'">
<div @click="onSearch(record)" class="cursor-pointer">{{ record.name }}</div>
</template>
<template v-if="column.key === 'phone'">
<div v-if="record.mobile" class="text-gray-400">{{ record.mobile }}</div>
<div v-else class="text-gray-600">{{ record.phone }}</div>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
@ -120,6 +127,21 @@
key: 'name',
align: 'center',
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 120
},
{
title: '捐款金额',
dataIndex: 'price',
key: 'price',
width: 120,
align: 'center',
customRender: ({ text }) => '¥' + text
},
{
title: '性别',
dataIndex: 'sex',
@ -128,9 +150,9 @@
customRender: ({ text }) => ['','男', '女'][text]
},
{
title: '手机号码',
dataIndex: 'phone',
key: 'phone',
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
@ -139,12 +161,6 @@
key: 'className',
align: 'center',
},
{
title: '年级',
dataIndex: 'gradeName',
key: 'gradeName',
align: 'center',
},
{
title: '居住地址',
dataIndex: 'address',
@ -169,20 +185,20 @@
// key: 'certificate',
// align: 'center',
// },
// {
// title: '',
// dataIndex: 'comments',
// key: 'comments',
// align: 'center',
// },
// {
// title: '',
// dataIndex: 'status',
// key: 'status',
// align: 'center',
// },
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '创建时间',
title: '捐款时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
@ -190,14 +206,14 @@
sorter: true,
ellipsis: true
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
// {
// title: '',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */
@ -206,6 +222,10 @@
tableRef?.value?.reload({ where: where });
};
const onSearch = (item: BszxPay) => {
reload({ userId: item.userId })
}
/* 打开编辑弹窗 */
const openEdit = (row?: BszxPay) => {
current.value = row ?? null;
@ -273,7 +293,7 @@
},
//
onDblclick: () => {
openEdit(record);
// openEdit(record);
}
};
};

1
src/views/passport/login/index.vue

@ -530,6 +530,7 @@ const changeCaptcha = () => {
//
changeCaptcha();
loginConnect();
localStorage.clear();
watch(
currentRoute,

Loading…
Cancel
Save