1、右上角的登录信息改为优先显示真实姓名
2、修复已知bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
VITE_APP_NAME=后台管理系统
|
||||
VITE_SOCKET_URL=wss://server.gxwebsoft.com
|
||||
VITE_SERVER_URL=https://server.gxwebsoft.com/api
|
||||
#VITE_API_URL=https://modules.gxwebsoft.com/api
|
||||
VITE_API_URL=https://modules.gxwebsoft.com/api
|
||||
|
||||
#VITE_SERVER_URL=http://127.0.0.1:9091/api
|
||||
VITE_API_URL=http://127.0.0.1:9099/api
|
||||
#VITE_API_URL=http://127.0.0.1:9099/api
|
||||
|
||||
106
src/api/shop/rechargeOrder/index.ts
Normal file
106
src/api/shop/rechargeOrder/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { RechargeOrder, RechargeOrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员充值订单表
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
MODULES_API_URL + '/shop/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员充值订单表列表
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
MODULES_API_URL + '/shop/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员充值订单表
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员充值订单表
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员充值订单表
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员充值订单表
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员充值订单表
|
||||
*/
|
||||
export async function getRechargeOrder(id: number) {
|
||||
const res = await request.get<ApiResult<RechargeOrder>>(
|
||||
MODULES_API_URL + '/shop/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
63
src/api/shop/rechargeOrder/model/index.ts
Normal file
63
src/api/shop/rechargeOrder/model/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员充值订单表
|
||||
*/
|
||||
export interface RechargeOrder {
|
||||
// 订单ID
|
||||
orderId?: number;
|
||||
// 订单号
|
||||
orderNo?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 充值方式(10自定义金额 20套餐充值)
|
||||
rechargeType?: number;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 充值套餐ID
|
||||
planId?: number;
|
||||
// 用户支付金额
|
||||
payPrice?: string;
|
||||
// 赠送金额
|
||||
giftMoney?: string;
|
||||
// 实际到账金额
|
||||
actualMoney?: string;
|
||||
// 用户可用余额
|
||||
balance?: string;
|
||||
// 支付方式(微信/支付宝)
|
||||
payMethod?: string;
|
||||
// 支付状态(10待支付 20已支付)
|
||||
payStatus?: number;
|
||||
// 付款时间
|
||||
payTime?: number;
|
||||
// 第三方交易记录ID
|
||||
tradeId?: number;
|
||||
// 来源客户端 (APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 所属门店ID
|
||||
shopId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 商户编码
|
||||
merchantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员充值订单表搜索条件
|
||||
*/
|
||||
export interface RechargeOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
@@ -2,7 +2,6 @@ import type { PageParam } from '@/api';
|
||||
import type { Role } from '../../role/model';
|
||||
import type { Menu } from '../../menu/model';
|
||||
import { Company } from '@/api/system/company/model';
|
||||
import { Merchant } from "@/api/shop/merchant/model";
|
||||
|
||||
/**
|
||||
* 用户
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserBalanceLog, UserBalanceLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询余额明细
|
||||
*/
|
||||
export async function pageUserBalanceLog(params: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserBalanceLog>>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log/page',
|
||||
SERVER_API_URL + '/sys/user-balance-log/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -22,7 +22,7 @@ export async function pageUserBalanceLog(params: UserBalanceLogParam) {
|
||||
*/
|
||||
export async function listUserBalanceLog(params?: UserBalanceLogParam) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog[]>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log',
|
||||
SERVER_API_URL + '/sys/user-balance-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export async function listUserBalanceLog(params?: UserBalanceLogParam) {
|
||||
*/
|
||||
export async function getUserBalanceLog(id: number) {
|
||||
const res = await request.get<ApiResult<UserBalanceLog>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log/' + id
|
||||
SERVER_API_URL + '/sys/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
@@ -51,7 +51,7 @@ export async function getUserBalanceLog(id: number) {
|
||||
*/
|
||||
export async function addUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log',
|
||||
SERVER_API_URL + '/sys/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -65,7 +65,7 @@ export async function addUserBalanceLog(data: UserBalanceLog) {
|
||||
*/
|
||||
export async function updateUserBalanceLog(data: UserBalanceLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log',
|
||||
SERVER_API_URL + '/sys/user-balance-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -79,7 +79,7 @@ export async function updateUserBalanceLog(data: UserBalanceLog) {
|
||||
*/
|
||||
export async function removeUserBalanceLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log/' + id
|
||||
SERVER_API_URL + '/sys/user-balance-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -92,7 +92,7 @@ export async function removeUserBalanceLog(id?: number) {
|
||||
*/
|
||||
export async function removeUserBalanceLogs(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/user-balance-log/batch',
|
||||
SERVER_API_URL + '/sys/user-balance-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
|
||||
@@ -4,12 +4,13 @@ import type {
|
||||
RechargeOrder,
|
||||
RechargeOrderParam
|
||||
} from '@/api/user/recharge/export/model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
/**
|
||||
* 分页查询充值计划
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
'/shop/recharge-order/page',
|
||||
SERVER_API_URL + '/sys/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -25,7 +26,7 @@ export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
'/shop/recharge-order',
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -41,7 +42,7 @@ export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/recharge-order',
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -55,7 +56,7 @@ export async function addRechargeOrder(data: RechargeOrder) {
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/recharge-order',
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -69,7 +70,7 @@ export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
*/
|
||||
export async function bindRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/bind',
|
||||
SERVER_API_URL + '/sys/recharge-order/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -83,7 +84,7 @@ export async function bindRechargeOrder(data: RechargeOrder) {
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/' + id
|
||||
SERVER_API_URL + '/sys/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -96,7 +97,7 @@ export async function removeRechargeOrder(id?: number) {
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/batch',
|
||||
SERVER_API_URL + '/sys/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
|
||||
@@ -4,8 +4,14 @@ export interface RechargeOrder {
|
||||
orderId?: number;
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
rechargeType?: number;
|
||||
nickname?: string;
|
||||
realName?: string;
|
||||
phone?: string;
|
||||
payPrice?: number;
|
||||
giftMoney?: number;
|
||||
actualMoney?: number;
|
||||
operator?: string;
|
||||
comments?: string;
|
||||
createTime?: string;
|
||||
tenantId?: number;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { RechargeOrder, RechargeOrderParam } from './model/index';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
export async function recharge(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/recharge',
|
||||
SERVER_API_URL + '/sys/recharge-order/recharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -21,7 +22,7 @@ export async function recharge(data: RechargeOrder) {
|
||||
*/
|
||||
export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<RechargeOrder>>>(
|
||||
'/shop/recharge-order/page',
|
||||
SERVER_API_URL + '/sys/recharge-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -37,7 +38,7 @@ export async function pageRechargeOrder(params: RechargeOrderParam) {
|
||||
*/
|
||||
export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
const res = await request.get<ApiResult<RechargeOrder[]>>(
|
||||
'/shop/recharge-order',
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -53,7 +54,7 @@ export async function listRechargeOrder(params?: RechargeOrderParam) {
|
||||
*/
|
||||
export async function getRechargeOrder(id: number) {
|
||||
const res = await request.get<ApiResult<RechargeOrder>>(
|
||||
'/shop/recharge-order/' + id
|
||||
SERVER_API_URL + '/sys/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
@@ -66,7 +67,7 @@ export async function getRechargeOrder(id: number) {
|
||||
*/
|
||||
export async function addRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/recharge-order',
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -80,7 +81,7 @@ export async function addRechargeOrder(data: RechargeOrder) {
|
||||
*/
|
||||
export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/recharge-order',
|
||||
SERVER_API_URL + '/sys/recharge-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -94,7 +95,7 @@ export async function updateRechargeOrder(data: RechargeOrder) {
|
||||
*/
|
||||
export async function removeRechargeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/' + id
|
||||
SERVER_API_URL + '/sys/recharge-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -107,7 +108,7 @@ export async function removeRechargeOrder(id?: number) {
|
||||
*/
|
||||
export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/batch',
|
||||
SERVER_API_URL + '/sys/recharge-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -123,7 +124,7 @@ export async function removeBatchRechargeOrder(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function batchRecharge(data: RechargeOrder[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/recharge-order/batchRecharge',
|
||||
SERVER_API_URL + '/sys/recharge-order/batchRecharge',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface RechargeOrder {
|
||||
orderNo?: string;
|
||||
money?: string;
|
||||
payPrice?: number;
|
||||
actualMoney?: number;
|
||||
organizationId?: number;
|
||||
rechargeType?: number;
|
||||
describe?: string;
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</template>
|
||||
</a-avatar>
|
||||
<span :class="{ 'hidden-sm-and-down': styleResponsive }">
|
||||
{{ loginUser.nickname }}
|
||||
{{ loginUser.realName }}
|
||||
</span>
|
||||
<down-outlined style="margin-left: 6px" />
|
||||
</div>
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="user-info">
|
||||
<div class="nickname">
|
||||
<span class="ele-text-heading">
|
||||
{{ loginUser.nickname }}
|
||||
{{ loginUser.realName || loginUser.nickname }}
|
||||
</span>
|
||||
<div class="ele-text-placeholder">
|
||||
用户ID:<span class="ele-text-secondary">{{
|
||||
|
||||
@@ -334,6 +334,7 @@
|
||||
import { GoodsSku } from "@/api/shop/goodsSku/model";
|
||||
import { GoodsSpec } from "@/api/shop/goodsSpec/model";
|
||||
import { generateGoodsSku, listGoodsSku } from "@/api/shop/goodsSku";
|
||||
import { listGoodsSpec } from "@/api/shop/goodsSpec";
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -371,7 +372,6 @@
|
||||
const name = ref();
|
||||
const value = ref();
|
||||
const skuList = ref<GoodsSku[]>([]);
|
||||
const fileList = ref<any[]>([]);
|
||||
const files = ref<ItemType[]>([]);
|
||||
const goodsSpec = ref<GoodsSpec>();
|
||||
const category = ref<string[]>([]);
|
||||
@@ -584,9 +584,26 @@
|
||||
const onChange = (text: string) => {
|
||||
// 加载商品多规格
|
||||
if(text == 'spec'){
|
||||
listGoodsSku({goodsId: props.data?.goodsId}).then(data => {
|
||||
skuList.value = data;
|
||||
})
|
||||
const goodsId = props.data?.goodsId;
|
||||
if(goodsId){
|
||||
listGoodsSpec({goodsId}).then(data => {
|
||||
console.log(data[0].specValue);
|
||||
const specValue = data[0].specValue;
|
||||
if(specValue){
|
||||
spec.value = JSON.parse(specValue).map( d => {
|
||||
console.log(d);
|
||||
return {
|
||||
value: d.value,
|
||||
detail: d.detail
|
||||
};
|
||||
})
|
||||
}
|
||||
console.log(spec.value);
|
||||
})
|
||||
listGoodsSku({goodsId}).then(data => {
|
||||
skuList.value = data;
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -710,13 +727,10 @@
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
files.value.map((d) => {
|
||||
fileList.value.push(d.url);
|
||||
});
|
||||
const formData = {
|
||||
...form,
|
||||
content: content.value,
|
||||
files: JSON.stringify(fileList.value),
|
||||
files: JSON.stringify(files.value),
|
||||
goodsSpec: goodsSpec.value,
|
||||
goodsSkus: skuList.value
|
||||
};
|
||||
@@ -741,8 +755,8 @@
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
files.value = [];
|
||||
category.value = [];
|
||||
files.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if (props.data.image) {
|
||||
@@ -753,14 +767,7 @@
|
||||
});
|
||||
}
|
||||
if(props.data.files){
|
||||
const arr = JSON.parse(props.data.files);
|
||||
arr.map((img) => {
|
||||
files.value.push({
|
||||
uid: uuid(),
|
||||
url: img,
|
||||
status: 'done'
|
||||
});
|
||||
});
|
||||
files.value = JSON.parse(props.data.files);
|
||||
}
|
||||
if(props.data.goodsSpecs){
|
||||
goodsSpec.value = props.data.goodsSpecs[0];
|
||||
@@ -793,7 +800,7 @@
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
spec.value = [];
|
||||
goodsSpec.value = {};
|
||||
goodsSpec.value = undefined;
|
||||
skuList.value = [];
|
||||
isUpdate.value = false;
|
||||
}
|
||||
|
||||
332
src/views/shop/rechargeOrder/components/rechargeOrderEdit.vue
Normal file
332
src/views/shop/rechargeOrder/components/rechargeOrderEdit.vue
Normal file
@@ -0,0 +1,332 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="800"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:maxable="maxable"
|
||||
:title="isUpdate ? '编辑会员充值订单表' : '添加会员充值订单表'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="订单号" name="orderNo">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入订单号"
|
||||
v-model:value="form.orderNo"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="充值方式(10自定义金额 20套餐充值)" name="rechargeType">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入充值方式(10自定义金额 20套餐充值)"
|
||||
v-model:value="form.rechargeType"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="机构id" name="organizationId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入机构id"
|
||||
v-model:value="form.organizationId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="充值套餐ID" name="planId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入充值套餐ID"
|
||||
v-model:value="form.planId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="用户支付金额" name="payPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用户支付金额"
|
||||
v-model:value="form.payPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="赠送金额" name="giftMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入赠送金额"
|
||||
v-model:value="form.giftMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="实际到账金额" name="actualMoney">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入实际到账金额"
|
||||
v-model:value="form.actualMoney"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="用户可用余额" name="balance">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用户可用余额"
|
||||
v-model:value="form.balance"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="支付方式(微信/支付宝)" name="payMethod">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入支付方式(微信/支付宝)"
|
||||
v-model:value="form.payMethod"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="支付状态(10待支付 20已支付)" name="payStatus">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入支付状态(10待支付 20已支付)"
|
||||
v-model:value="form.payStatus"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="付款时间" name="payTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入付款时间"
|
||||
v-model:value="form.payTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="第三方交易记录ID" name="tradeId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入第三方交易记录ID"
|
||||
v-model:value="form.tradeId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="来源客户端 (APP、H5、小程序等)" name="platform">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入来源客户端 (APP、H5、小程序等)"
|
||||
v-model:value="form.platform"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属门店ID" name="shopId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入所属门店ID"
|
||||
v-model:value="form.shopId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="9999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入描述"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||
<a-radio-group v-model:value="form.status">
|
||||
<a-radio :value="0">显示</a-radio>
|
||||
<a-radio :value="1">隐藏</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否删除, 0否, 1是"
|
||||
v-model:value="form.deleted"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商户编码" name="merchantCode">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商户编码"
|
||||
v-model:value="form.merchantCode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="修改时间" name="updateTime">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入修改时间"
|
||||
v-model:value="form.updateTime"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, uuid } from 'ele-admin-pro';
|
||||
import { addRechargeOrder, updateRechargeOrder } from '@/api/shop/rechargeOrder';
|
||||
import { RechargeOrder } from '@/api/shop/rechargeOrder/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: RechargeOrder | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<RechargeOrder>({
|
||||
orderId: undefined,
|
||||
orderNo: undefined,
|
||||
userId: undefined,
|
||||
rechargeType: undefined,
|
||||
organizationId: undefined,
|
||||
planId: undefined,
|
||||
payPrice: undefined,
|
||||
giftMoney: undefined,
|
||||
actualMoney: undefined,
|
||||
balance: undefined,
|
||||
payMethod: undefined,
|
||||
payStatus: undefined,
|
||||
payTime: undefined,
|
||||
tradeId: undefined,
|
||||
platform: undefined,
|
||||
shopId: undefined,
|
||||
sortNumber: undefined,
|
||||
comments: undefined,
|
||||
status: undefined,
|
||||
deleted: undefined,
|
||||
merchantCode: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
rechargeOrderId: undefined,
|
||||
rechargeOrderName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
rechargeOrderName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写会员充值订单表名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
const chooseImage = (data: FileRecord) => {
|
||||
images.value.push({
|
||||
uid: data.id,
|
||||
url: data.path,
|
||||
status: 'done'
|
||||
});
|
||||
form.image = data.path;
|
||||
};
|
||||
|
||||
const onDeleteItem = (index: number) => {
|
||||
images.value.splice(index, 1);
|
||||
form.image = '';
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateRechargeOrder : addRechargeOrder;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if(props.data.image){
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
42
src/views/shop/rechargeOrder/components/search.vue
Normal file
42
src/views/shop/rechargeOrder/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import { watch } from 'vue';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: GradeParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
341
src/views/shop/rechargeOrder/index.vue
Normal file
341
src/views/shop/rechargeOrder/index.vue
Normal file
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="rechargeOrderId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'image'">
|
||||
<a-image :src="record.image" :width="50" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
title="确定要删除此记录吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<RechargeOrderEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import RechargeOrderEdit from './components/rechargeOrderEdit.vue';
|
||||
import { pageRechargeOrder, removeRechargeOrder, removeBatchRechargeOrder } from '@/api/shop/rechargeOrder';
|
||||
import type { RechargeOrder, RechargeOrderParam } from '@/api/shop/rechargeOrder/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<RechargeOrder[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<RechargeOrder | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageRechargeOrder({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '订单ID',
|
||||
dataIndex: 'orderId',
|
||||
key: 'orderId',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNo',
|
||||
key: 'orderNo',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '充值方式(10自定义金额 20套餐充值)',
|
||||
dataIndex: 'rechargeType',
|
||||
key: 'rechargeType',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '机构id',
|
||||
dataIndex: 'organizationId',
|
||||
key: 'organizationId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '充值套餐ID',
|
||||
dataIndex: 'planId',
|
||||
key: 'planId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户支付金额',
|
||||
dataIndex: 'payPrice',
|
||||
key: 'payPrice',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '赠送金额',
|
||||
dataIndex: 'giftMoney',
|
||||
key: 'giftMoney',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '实际到账金额',
|
||||
dataIndex: 'actualMoney',
|
||||
key: 'actualMoney',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户可用余额',
|
||||
dataIndex: 'balance',
|
||||
key: 'balance',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '支付方式(微信/支付宝)',
|
||||
dataIndex: 'payMethod',
|
||||
key: 'payMethod',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '支付状态(10待支付 20已支付)',
|
||||
dataIndex: 'payStatus',
|
||||
key: 'payStatus',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '付款时间',
|
||||
dataIndex: 'payTime',
|
||||
key: 'payTime',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '第三方交易记录ID',
|
||||
dataIndex: 'tradeId',
|
||||
key: 'tradeId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '来源客户端 (APP、H5、小程序等)',
|
||||
dataIndex: 'platform',
|
||||
key: 'platform',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '所属门店ID',
|
||||
dataIndex: 'shopId',
|
||||
key: 'shopId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '排序(数字越小越靠前)',
|
||||
dataIndex: 'sortNumber',
|
||||
key: 'sortNumber',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '状态, 0正常, 1冻结',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '是否删除, 0否, 1是',
|
||||
dataIndex: 'deleted',
|
||||
key: 'deleted',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商户编码',
|
||||
dataIndex: 'merchantCode',
|
||||
key: 'merchantCode',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '注册时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
},
|
||||
{
|
||||
title: '修改时间',
|
||||
dataIndex: 'updateTime',
|
||||
key: 'updateTime',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: RechargeOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: RechargeOrder) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: RechargeOrder) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeRechargeOrder(row.rechargeOrderId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchRechargeOrder(selection.value.map((d) => d.rechargeOrderId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: RechargeOrder) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'RechargeOrder'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -59,11 +59,11 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="证书文件 (KEY)" name="apiclientKey" extra="请上传 apiclient_key.pem 文件">
|
||||
<Upload accept=".crt" v-model:value="form.apiclientKey" />
|
||||
<Upload accept=".crt,.pem" v-model:value="form.apiclientKey" />
|
||||
{{ form.apiclientKey }}
|
||||
</a-form-item>
|
||||
<a-form-item label="证书文件 (CERT)" name="apiclientCert" extra="请上传 apiclient_cert.pem 文件">
|
||||
<Upload accept=".crt" v-model:value="form.apiclientCert" />
|
||||
<Upload accept=".crt,.pem" v-model:value="form.apiclientCert" />
|
||||
{{ form.apiclientCert }}
|
||||
</a-form-item>
|
||||
<a-form-item label="商户证书序列号" name="merchantSerialNumber" extra="填写API证书里的证书序列号">
|
||||
@@ -159,7 +159,7 @@
|
||||
const form = reactive<Payment>({
|
||||
id: 0,
|
||||
name: undefined,
|
||||
type: undefined,
|
||||
type: 1,
|
||||
code: '',
|
||||
image: '',
|
||||
wechatType: 0,
|
||||
@@ -267,7 +267,7 @@
|
||||
const onPayMethod = (value: string, item: any) => {
|
||||
form.name = item.label
|
||||
form.code = item.value
|
||||
form.type = item.type
|
||||
form.type = item.value
|
||||
}
|
||||
|
||||
const onUpload = (d: ItemType) => {
|
||||
@@ -296,6 +296,7 @@
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
console.log(form);
|
||||
const saveOrUpdate = isUpdate.value ? updatePayment : addPayment;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
|
||||
@@ -84,11 +84,16 @@
|
||||
<span v-if="hasRole('superAdmin')">{{ record.phone }}</span>
|
||||
<span v-else>{{ record.mobile }}</span>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'roles'">
|
||||
<template v-if="column.key === 'roles'">
|
||||
<a-tag v-for="item in record.roles" :key="item.roleId" color="blue">
|
||||
{{ item.roleName }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'platform'">
|
||||
<WechatOutlined v-if="record.platform === 'MP-WEIXIN'" />
|
||||
<Html5Outlined v-if="record.platform === 'H5'" />
|
||||
<ChromeOutlined v-if="record.platform === 'WEB'" />
|
||||
</template>
|
||||
<template v-if="column.key === 'balance'">
|
||||
<span class="ele-text-success">
|
||||
¥{{ formatNumber(record.balance) }}
|
||||
@@ -99,13 +104,13 @@
|
||||
¥{{ formatNumber(record.expendMoney) }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'isAdmin'">
|
||||
<template v-if="column.key === 'isAdmin'">
|
||||
<a-switch
|
||||
:checked="record.isAdmin == 1"
|
||||
@change="updateIsAdmin(record)"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'action'">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
@@ -146,6 +151,9 @@
|
||||
UploadOutlined,
|
||||
EditOutlined,
|
||||
UserOutlined,
|
||||
Html5Outlined,
|
||||
ChromeOutlined,
|
||||
WechatOutlined,
|
||||
ExclamationCircleOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro/es';
|
||||
@@ -158,13 +166,15 @@
|
||||
import UserEdit from './components/user-edit.vue';
|
||||
import UserImport from './components/user-import.vue';
|
||||
import UserInfo from './components/user-info.vue';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import {
|
||||
pageUsers,
|
||||
removeUser,
|
||||
removeUsers,
|
||||
updateUserStatus,
|
||||
updateUserPassword, updateUser
|
||||
} from "@/api/system/user";
|
||||
updateUserPassword,
|
||||
updateUser
|
||||
} from '@/api/system/user';
|
||||
import type { User, UserParam } from '@/api/system/user/model';
|
||||
import { toTreeData, uuid } from 'ele-admin-pro';
|
||||
import { listRoles } from '@/api/system/role';
|
||||
@@ -257,11 +267,6 @@
|
||||
align: 'center',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'username',
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'mobile',
|
||||
@@ -269,56 +274,62 @@
|
||||
key: 'mobile',
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '真实姓名',
|
||||
dataIndex: 'realName',
|
||||
align: 'center',
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '昵称',
|
||||
key: 'nickname',
|
||||
align: 'center',
|
||||
dataIndex: 'nickname'
|
||||
},
|
||||
// {
|
||||
// title: '客户分组',
|
||||
// dataIndex: 'type',
|
||||
// key: 'type',
|
||||
// align: 'center',
|
||||
// width: 120,
|
||||
// customRender: ({ text }) => typeName(text)
|
||||
// },
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sexName',
|
||||
dataIndex: 'sex',
|
||||
align: 'center',
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
dataIndex: 'email',
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '可用余额',
|
||||
dataIndex: 'balance',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '可用积分',
|
||||
dataIndex: 'points',
|
||||
align: 'center',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '实际消费金额',
|
||||
dataIndex: 'expendMoney',
|
||||
key: 'expendMoney',
|
||||
sorter: true,
|
||||
align: 'center',
|
||||
hideInTable: true,
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '可用积分',
|
||||
dataIndex: 'points',
|
||||
hideInTable: true,
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '注册来源',
|
||||
key: 'platform',
|
||||
align: 'center',
|
||||
dataIndex: 'platform',
|
||||
width: 120,
|
||||
customRender: ({ text }) => ['未知', '网站', '小程序', 'APP'][text]
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'idCard',
|
||||
align: 'center',
|
||||
hideInTable: true
|
||||
},
|
||||
{
|
||||
@@ -365,9 +376,7 @@
|
||||
title: '角色',
|
||||
dataIndex: 'roles',
|
||||
key: 'roles',
|
||||
align: 'center',
|
||||
filterMultiple: false,
|
||||
filters: roles.value
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '管理员',
|
||||
@@ -383,7 +392,7 @@
|
||||
sorter: true,
|
||||
showSorterTooltip: false,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => timeAgo(text)
|
||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
||||
@@ -114,11 +114,7 @@
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import {
|
||||
toDateString,
|
||||
messageLoading,
|
||||
formatNumber
|
||||
} from 'ele-admin-pro/es';
|
||||
import { toDateString, messageLoading, formatNumber } from 'ele-admin-pro/es';
|
||||
import {
|
||||
pageUserBalanceLog,
|
||||
removeUserBalanceLog,
|
||||
@@ -141,7 +137,7 @@
|
||||
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
},
|
||||
{
|
||||
title: '用户昵称',
|
||||
title: '用户',
|
||||
key: 'nickname',
|
||||
dataIndex: 'nickname',
|
||||
showSorterTooltip: false
|
||||
|
||||
@@ -111,8 +111,8 @@
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '用户账号',
|
||||
dataIndex: 'username',
|
||||
title: '用户',
|
||||
dataIndex: 'mobile',
|
||||
sorter: true,
|
||||
showSorterTooltip: false
|
||||
},
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
rechargeOrder.value?.push({
|
||||
rechargeType: 10,
|
||||
payPrice: form.payPrice,
|
||||
actualMoney: form.payPrice,
|
||||
comments: form.comments,
|
||||
organizationId: d.organizationId,
|
||||
userId: d.userId,
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
});
|
||||
if (list.length) {
|
||||
if (typeof list[0].key === 'number') {
|
||||
selectedRowKeys.value = [list[0].key];
|
||||
// selectedRowKeys.value = [list[0].key];
|
||||
}
|
||||
current.value = list[0];
|
||||
current.value.organizationId = 0;
|
||||
|
||||
172
src/views/user/recharge-export/components/search.vue
Normal file
172
src/views/user/recharge-export/components/search.vue
Normal file
@@ -0,0 +1,172 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<div class="search">
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<!-- <a-button-->
|
||||
<!-- danger-->
|
||||
<!-- type="primary"-->
|
||||
<!-- class="ele-btn-icon"-->
|
||||
<!-- :disabled="selection.length === 0"-->
|
||||
<!-- @click="removeBatch"-->
|
||||
<!-- >-->
|
||||
<!-- <template #icon>-->
|
||||
<!-- <DeleteOutlined />-->
|
||||
<!-- </template>-->
|
||||
<!-- <span>批量删除</span>-->
|
||||
<!-- </a-button>-->
|
||||
<SelectOrganization
|
||||
:placeholder="`请选择部门`"
|
||||
v-model:value="where.organizationName"
|
||||
@done="chooseOrganization"
|
||||
/>
|
||||
<a-range-picker
|
||||
v-model:value="dateRange"
|
||||
@change="search"
|
||||
value-format="YYYY-MM-DD"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
<a-input-search
|
||||
allow-clear
|
||||
placeholder="请输入手机号|用户ID"
|
||||
v-model:value="where.keywords"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
style="width: 220px"
|
||||
/>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
<a-button type="primary" class="ele-btn-icon" @click="handleExport">
|
||||
<template #icon>
|
||||
<download-outlined />
|
||||
</template>
|
||||
<span>导出</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
PlusOutlined,
|
||||
DeleteOutlined,
|
||||
DownloadOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { ref, watch } from 'vue';
|
||||
import { countOrderGoods } from '@/api/apps/statistics';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
import { Organization } from '@/api/system/organization/model';
|
||||
import { BcExportParam } from '@/api/apps/bc/export/model';
|
||||
import { RechargeOrder } from '@/api/user/recharge/export/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
exportData?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: BcExportParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'done'): void;
|
||||
(e: 'export'): void;
|
||||
}>();
|
||||
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<BcExportParam>({
|
||||
exportId: undefined,
|
||||
keywords: undefined,
|
||||
organizationName: '',
|
||||
organizationId: undefined,
|
||||
createTimeStart: undefined,
|
||||
createTimeEnd: undefined
|
||||
});
|
||||
// 下来选项
|
||||
// const categoryId = ref<number>(0);
|
||||
const post = ref<number>(0);
|
||||
const sign = ref<number>(0);
|
||||
const noSign = ref<number>(0);
|
||||
// 请求状态
|
||||
const loading = ref(true);
|
||||
// const deliveryStatus = ref<number>(0);
|
||||
// const gear = ref<number>(0);
|
||||
// 预定日期
|
||||
// const deliveryTime = ref<Dayjs>();
|
||||
// 日期范围选择
|
||||
const dateRange = ref<[string, string]>(['', '']);
|
||||
|
||||
/* 搜索 */
|
||||
const search = () => {
|
||||
const [d1, d2] = dateRange.value ?? [];
|
||||
where.createTimeStart = d1 ? d1 + ' 00:00:00' : undefined;
|
||||
where.createTimeEnd = d2 ? d2 + ' 00:00:00' : undefined;
|
||||
emit('search', {
|
||||
...where
|
||||
});
|
||||
count();
|
||||
};
|
||||
|
||||
const chooseOrganization = (e: Organization) => {
|
||||
where.organizationName = e.organizationName;
|
||||
where.organizationId = e.organizationId;
|
||||
search();
|
||||
};
|
||||
|
||||
/* 重置 */
|
||||
const reset = () => {
|
||||
resetFields();
|
||||
post.value = 0;
|
||||
sign.value = 0;
|
||||
noSign.value = 0;
|
||||
dateRange.value = ['', ''];
|
||||
search();
|
||||
};
|
||||
|
||||
const count = () => {
|
||||
if (where.deliveryTimeStart == undefined) {
|
||||
console.log('sss>>>');
|
||||
loading.value = false;
|
||||
return false;
|
||||
}
|
||||
loading.value = true;
|
||||
countOrderGoods(where)
|
||||
.then((data) => {
|
||||
console.log('data>>>', data);
|
||||
if (data) {
|
||||
post.value = data.post;
|
||||
sign.value = data.sign;
|
||||
noSign.value = data.noSign;
|
||||
} else {
|
||||
post.value = 0;
|
||||
sign.value = 0;
|
||||
noSign.value = 0;
|
||||
}
|
||||
loading.value = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
message.error(err.message);
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
// 导出
|
||||
const handleExport = () => {
|
||||
emit('done');
|
||||
};
|
||||
|
||||
// 批量删除
|
||||
const removeBatch = () => {
|
||||
emit('remove');
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
|
||||
count();
|
||||
</script>
|
||||
330
src/views/user/recharge-export/index.vue
Normal file
330
src/views/user/recharge-export/index.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="orderId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:parse-data="parseData"
|
||||
:customRow="customRow"
|
||||
tool-class="ele-toolbar-form"
|
||||
:scroll="{ x: 1200 }"
|
||||
class="sys-org-table"
|
||||
:striped="true"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
:export-data="exportData"
|
||||
@remove="removeBatch"
|
||||
@done="handleExport"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'organizationName'">
|
||||
{{ record.organizationName || '-' }}
|
||||
</template>
|
||||
<template v-if="column.key === 'createTime'">
|
||||
{{ record.createTime }}
|
||||
</template>
|
||||
<template v-if="column.key === 'rechargeType'">
|
||||
<span v-if="record.rechargeType == 10">自定义</span>
|
||||
<span v-if="record.rechargeType == 20">套餐</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button @click="openInfo(record)">详情</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<!-- 订单详情 -->
|
||||
<!-- <order-info v-model:visible="showInfo" :data="current" @done="reload" />-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
// import OrderInfo from './components/order-info.vue';
|
||||
import {
|
||||
pageRechargeOrder,
|
||||
removeBatchRechargeOrder
|
||||
} from '@/api/user/recharge/export';
|
||||
import type {
|
||||
RechargeOrder,
|
||||
RechargeOrderParam
|
||||
} from '@/api/user/recharge/export/model';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
|
||||
defineProps<{
|
||||
activeKey?: boolean;
|
||||
data?: any;
|
||||
}>();
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
key: 'index',
|
||||
width: 48,
|
||||
title: '序号',
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
hideInTable: true,
|
||||
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '部门名称',
|
||||
dataIndex: 'organizationName',
|
||||
key: 'organizationName',
|
||||
hideInTable: true,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'mobile',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '充值金额',
|
||||
dataIndex: 'payPrice',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '赠送金额',
|
||||
dataIndex: 'giftMoney',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '实际到账',
|
||||
dataIndex: 'actualMoney',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '充值方式',
|
||||
dataIndex: 'rechargeType',
|
||||
key: 'rechargeType',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '操作员',
|
||||
dataIndex: 'operator',
|
||||
key: 'operator',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '充值时间',
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
width: 180
|
||||
}
|
||||
]);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<RechargeOrder[]>([]);
|
||||
const exportData = ref<RechargeOrder[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<RechargeOrder | null>(null);
|
||||
// 是否显示资产详情
|
||||
const showInfo = ref(false);
|
||||
// 是否显示编辑弹窗
|
||||
// const showEdit = ref(false);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||
return pageRechargeOrder({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
// const { form } = useFormData<RechargeOrder>({
|
||||
// exportId: undefined
|
||||
// });
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: RechargeOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openInfo = (row?: RechargeOrder) => {
|
||||
current.value = row ?? null;
|
||||
showInfo.value = true;
|
||||
};
|
||||
|
||||
/* 数据转为树形结构 */
|
||||
const parseData = (data: any) => {
|
||||
exportData.value = data?.list;
|
||||
return data;
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
console.log(selection.value);
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的记录吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchRechargeOrder(selection.value.map((d) => d.orderId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 导出
|
||||
const handleExport = () => {
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'用户ID',
|
||||
'真实姓名',
|
||||
'手机号码',
|
||||
'充值金额',
|
||||
'赠送金额',
|
||||
'实际到账',
|
||||
'所属部门',
|
||||
'充值时间',
|
||||
'充值方式',
|
||||
'操作员',
|
||||
'备注'
|
||||
]
|
||||
];
|
||||
console.log('>>>>>>>>.', exportData.value);
|
||||
exportData.value?.forEach((d: RechargeOrder) => {
|
||||
array.push([
|
||||
`${d.userId}`,
|
||||
`${d.realName}`,
|
||||
`${d.phone}`,
|
||||
`${d.payPrice}`,
|
||||
`${d.giftMoney}`,
|
||||
`${d.actualMoney}`,
|
||||
`${d.organizationName}`,
|
||||
`${d.createTime}`,
|
||||
`${d.rechargeType == 10 ? '自定义' : '套餐'}`,
|
||||
`${d.operator}`,
|
||||
`${d.comments}`
|
||||
]);
|
||||
});
|
||||
const sheetName = '充值记录导出';
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 40 },
|
||||
{ wch: 10 }
|
||||
];
|
||||
writeFile(workbook, '充值记录导出.xlsx');
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: RechargeOrder) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
// openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// const query = () => {
|
||||
// pageRechargeOrder({}).then((data) => {
|
||||
// if (data?.list) {
|
||||
// exportData.value = data?.list;
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
// query();
|
||||
reload();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'RechargeOrderIndex'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
p {
|
||||
line-height: 0.8;
|
||||
}
|
||||
.sys-org-table :deep(.ant-table-body) {
|
||||
overflow: auto !important;
|
||||
overflow: overlay !important;
|
||||
}
|
||||
|
||||
.sys-org-table :deep(.ant-table-pagination.ant-pagination) {
|
||||
padding: 0 4px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.price-edit {
|
||||
padding-right: 5px;
|
||||
}
|
||||
.comments {
|
||||
max-width: 200px;
|
||||
}
|
||||
</style>
|
||||
@@ -11,7 +11,6 @@
|
||||
:datasource="datasource"
|
||||
:scroll="{ x: 1000 }"
|
||||
:where="defaultWhere"
|
||||
v-model:selection="selection"
|
||||
cache-key="proSystemUserTable"
|
||||
>
|
||||
<template #toolbar>
|
||||
|
||||
Reference in New Issue
Block a user