优化网站导航模块
This commit is contained in:
106
modules/api/booking_____/bookingCard/index.ts
Normal file
106
modules/api/booking_____/bookingCard/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingCard, BookingCardParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageBookingCard(params: BookingCardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingCard>>>(
|
||||
MODULES_API_URL + '/booking/booking-card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listBookingCard(params?: BookingCardParam) {
|
||||
const res = await request.get<ApiResult<BookingCard[]>>(
|
||||
MODULES_API_URL + '/booking/booking-card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addBookingCard(data: BookingCard) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateBookingCard(data: BookingCard) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeBookingCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchBookingCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡
|
||||
*/
|
||||
export async function getBookingCard(id: number) {
|
||||
const res = await request.get<ApiResult<BookingCard>>(
|
||||
MODULES_API_URL + '/booking/booking-card/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
modules/api/booking_____/bookingCard/model/index.ts
Normal file
57
modules/api/booking_____/bookingCard/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface BookingCard {
|
||||
// ID
|
||||
cardId?: number;
|
||||
// 会员卡名称
|
||||
cardName?: string;
|
||||
// 会员卡标识
|
||||
cardCode?: string;
|
||||
// 会员卡介绍
|
||||
cardDesc?: string;
|
||||
// 卡类型:1成人卡,2儿童卡
|
||||
cardType?: number;
|
||||
// IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡
|
||||
type?: number;
|
||||
// 会员卡图片
|
||||
image?: string;
|
||||
// 价格
|
||||
price?: string;
|
||||
// 次数
|
||||
number?: number;
|
||||
// 月份
|
||||
month?: number;
|
||||
// 折扣
|
||||
discount?: string;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户类型
|
||||
merchantType?: string;
|
||||
// 适用的场馆ID
|
||||
merchantIds?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡搜索条件
|
||||
*/
|
||||
export interface BookingCardParam extends PageParam {
|
||||
cardId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingCardPlan/index.ts
Normal file
106
modules/api/booking_____/bookingCardPlan/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingCardPlan, BookingCardPlanParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡类型
|
||||
*/
|
||||
export async function pageBookingCardPlan(params: BookingCardPlanParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingCardPlan>>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡类型列表
|
||||
*/
|
||||
export async function listBookingCardPlan(params?: BookingCardPlanParam) {
|
||||
const res = await request.get<ApiResult<BookingCardPlan[]>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡类型
|
||||
*/
|
||||
export async function addBookingCardPlan(data: BookingCardPlan) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡类型
|
||||
*/
|
||||
export async function updateBookingCardPlan(data: BookingCardPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡类型
|
||||
*/
|
||||
export async function removeBookingCardPlan(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡类型
|
||||
*/
|
||||
export async function removeBatchBookingCardPlan(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡类型
|
||||
*/
|
||||
export async function getBookingCardPlan(id: number) {
|
||||
const res = await request.get<ApiResult<BookingCardPlan>>(
|
||||
MODULES_API_URL + '/booking/booking-card-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
modules/api/booking_____/bookingCardPlan/model/index.ts
Normal file
33
modules/api/booking_____/bookingCardPlan/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡类型
|
||||
*/
|
||||
export interface BookingCardPlan {
|
||||
// ID
|
||||
cardPlanId?: number;
|
||||
// 会员卡名称
|
||||
name?: string;
|
||||
// 标识
|
||||
code?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡类型搜索条件
|
||||
*/
|
||||
export interface BookingCardPlanParam extends PageParam {
|
||||
cardPlanId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingCooperate/index.ts
Normal file
106
modules/api/booking_____/bookingCooperate/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingCooperate, BookingCooperateParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商务合作
|
||||
*/
|
||||
export async function pageBookingCooperate(params: BookingCooperateParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingCooperate>>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商务合作列表
|
||||
*/
|
||||
export async function listBookingCooperate(params?: BookingCooperateParam) {
|
||||
const res = await request.get<ApiResult<BookingCooperate[]>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商务合作
|
||||
*/
|
||||
export async function addBookingCooperate(data: BookingCooperate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商务合作
|
||||
*/
|
||||
export async function updateBookingCooperate(data: BookingCooperate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商务合作
|
||||
*/
|
||||
export async function removeBookingCooperate(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商务合作
|
||||
*/
|
||||
export async function removeBatchBookingCooperate(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商务合作
|
||||
*/
|
||||
export async function getBookingCooperate(id: number) {
|
||||
const res = await request.get<ApiResult<BookingCooperate>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
modules/api/booking_____/bookingCooperate/model/index.ts
Normal file
33
modules/api/booking_____/bookingCooperate/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商务合作
|
||||
*/
|
||||
export interface BookingCooperate {
|
||||
// ID
|
||||
cooperateId?: number;
|
||||
// 部门名称
|
||||
name?: string;
|
||||
// 咨询电话
|
||||
phone?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商务合作搜索条件
|
||||
*/
|
||||
export interface BookingCooperateParam extends PageParam {
|
||||
cooperateId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingCooperateLog/index.ts
Normal file
106
modules/api/booking_____/bookingCooperateLog/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingCooperateLog, BookingCooperateLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商务合作留言记录
|
||||
*/
|
||||
export async function pageBookingCooperateLog(params: BookingCooperateLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingCooperateLog>>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商务合作留言记录列表
|
||||
*/
|
||||
export async function listBookingCooperateLog(params?: BookingCooperateLogParam) {
|
||||
const res = await request.get<ApiResult<BookingCooperateLog[]>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商务合作留言记录
|
||||
*/
|
||||
export async function addBookingCooperateLog(data: BookingCooperateLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商务合作留言记录
|
||||
*/
|
||||
export async function updateBookingCooperateLog(data: BookingCooperateLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商务合作留言记录
|
||||
*/
|
||||
export async function removeBookingCooperateLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商务合作留言记录
|
||||
*/
|
||||
export async function removeBatchBookingCooperateLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商务合作留言记录
|
||||
*/
|
||||
export async function getBookingCooperateLog(id: number) {
|
||||
const res = await request.get<ApiResult<BookingCooperateLog>>(
|
||||
MODULES_API_URL + '/booking/booking-cooperate-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
modules/api/booking_____/bookingCooperateLog/model/index.ts
Normal file
35
modules/api/booking_____/bookingCooperateLog/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商务合作留言记录
|
||||
*/
|
||||
export interface BookingCooperateLog {
|
||||
// ID
|
||||
logId?: number;
|
||||
// 关联ID
|
||||
cooperateId?: number;
|
||||
// 部门名称
|
||||
name?: string;
|
||||
// 咨询电话
|
||||
phone?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商务合作留言记录搜索条件
|
||||
*/
|
||||
export interface BookingCooperateLogParam extends PageParam {
|
||||
logId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingCoupon/index.ts
Normal file
106
modules/api/booking_____/bookingCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingCoupon, BookingCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询我的优惠券
|
||||
*/
|
||||
export async function pageBookingCoupon(params: BookingCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingCoupon>>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的优惠券列表
|
||||
*/
|
||||
export async function listBookingCoupon(params?: BookingCouponParam) {
|
||||
const res = await request.get<ApiResult<BookingCoupon[]>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的优惠券
|
||||
*/
|
||||
export async function addBookingCoupon(data: BookingCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的优惠券
|
||||
*/
|
||||
export async function updateBookingCoupon(data: BookingCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的优惠券
|
||||
*/
|
||||
export async function removeBookingCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的优惠券
|
||||
*/
|
||||
export async function removeBatchBookingCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的优惠券
|
||||
*/
|
||||
export async function getBookingCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<BookingCoupon>>(
|
||||
MODULES_API_URL + '/booking/booking-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
modules/api/booking_____/bookingCoupon/model/index.ts
Normal file
55
modules/api/booking_____/bookingCoupon/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
*/
|
||||
export interface BookingCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券类型(10满减券 20折扣券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: string;
|
||||
// 有效期结束时间
|
||||
endTime?: string;
|
||||
// 适用范围(10全部商品 20指定商品)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券搜索条件
|
||||
*/
|
||||
export interface BookingCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingEmergency/index.ts
Normal file
106
modules/api/booking_____/bookingEmergency/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingEmergency, BookingEmergencyParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询紧急联系人管理
|
||||
*/
|
||||
export async function pageBookingEmergency(params: BookingEmergencyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingEmergency>>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询紧急联系人管理列表
|
||||
*/
|
||||
export async function listBookingEmergency(params?: BookingEmergencyParam) {
|
||||
const res = await request.get<ApiResult<BookingEmergency[]>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加紧急联系人管理
|
||||
*/
|
||||
export async function addBookingEmergency(data: BookingEmergency) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改紧急联系人管理
|
||||
*/
|
||||
export async function updateBookingEmergency(data: BookingEmergency) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除紧急联系人管理
|
||||
*/
|
||||
export async function removeBookingEmergency(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除紧急联系人管理
|
||||
*/
|
||||
export async function removeBatchBookingEmergency(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询紧急联系人管理
|
||||
*/
|
||||
export async function getBookingEmergency(id: number) {
|
||||
const res = await request.get<ApiResult<BookingEmergency>>(
|
||||
MODULES_API_URL + '/booking/booking-emergency/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
modules/api/booking_____/bookingEmergency/model/index.ts
Normal file
35
modules/api/booking_____/bookingEmergency/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 紧急联系人管理
|
||||
*/
|
||||
export interface BookingEmergency {
|
||||
// ID
|
||||
emergencyId?: number;
|
||||
// 姓名
|
||||
name?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 紧急联系人管理搜索条件
|
||||
*/
|
||||
export interface BookingEmergencyParam extends PageParam {
|
||||
emergencyId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingField/index.ts
Normal file
106
modules/api/booking_____/bookingField/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingField, BookingFieldParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询场馆场地
|
||||
*/
|
||||
export async function pageBookingField(params: BookingFieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingField>>>(
|
||||
MODULES_API_URL + '/booking/booking-field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场馆场地列表
|
||||
*/
|
||||
export async function listBookingField(params?: BookingFieldParam) {
|
||||
const res = await request.get<ApiResult<BookingField[]>>(
|
||||
MODULES_API_URL + '/booking/booking-field',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加场馆场地
|
||||
*/
|
||||
export async function addBookingField(data: BookingField) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场馆场地
|
||||
*/
|
||||
export async function updateBookingField(data: BookingField) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场馆场地
|
||||
*/
|
||||
export async function removeBookingField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场馆场地
|
||||
*/
|
||||
export async function removeBatchBookingField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询场馆场地
|
||||
*/
|
||||
export async function getBookingField(id: number) {
|
||||
const res = await request.get<ApiResult<BookingField>>(
|
||||
MODULES_API_URL + '/booking/booking-field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
modules/api/booking_____/bookingField/model/index.ts
Normal file
45
modules/api/booking_____/bookingField/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 场馆场地
|
||||
*/
|
||||
export interface BookingField {
|
||||
//
|
||||
fieldId?: number;
|
||||
// 场地名称
|
||||
fieldName?: string;
|
||||
// 是否有卫生间,1有,0没有
|
||||
isToilet?: string;
|
||||
// 状态,0开启,1关闭
|
||||
isStatus?: string;
|
||||
// 是否重复预订,1可以,0不可以
|
||||
isRepeat?: string;
|
||||
// 是否可预定半场,1可以,0不可以
|
||||
isHalf?: string;
|
||||
// 是否支持儿童价:1支持,0不支持
|
||||
isChildren?: string;
|
||||
// 可重复预订次数
|
||||
num?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 关联id
|
||||
merchantId?: number;
|
||||
// 显示在第几行
|
||||
row?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场馆场地搜索条件
|
||||
*/
|
||||
export interface BookingFieldParam extends PageParam {
|
||||
fieldId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingIntegral/index.ts
Normal file
106
modules/api/booking_____/bookingIntegral/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingIntegral, BookingIntegralParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询签到积分
|
||||
*/
|
||||
export async function pageBookingIntegral(params: BookingIntegralParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingIntegral>>>(
|
||||
MODULES_API_URL + '/booking/booking-integral/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询签到积分列表
|
||||
*/
|
||||
export async function listBookingIntegral(params?: BookingIntegralParam) {
|
||||
const res = await request.get<ApiResult<BookingIntegral[]>>(
|
||||
MODULES_API_URL + '/booking/booking-integral',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加签到积分
|
||||
*/
|
||||
export async function addBookingIntegral(data: BookingIntegral) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改签到积分
|
||||
*/
|
||||
export async function updateBookingIntegral(data: BookingIntegral) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除签到积分
|
||||
*/
|
||||
export async function removeBookingIntegral(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除签到积分
|
||||
*/
|
||||
export async function removeBatchBookingIntegral(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询签到积分
|
||||
*/
|
||||
export async function getBookingIntegral(id: number) {
|
||||
const res = await request.get<ApiResult<BookingIntegral>>(
|
||||
MODULES_API_URL + '/booking/booking-integral/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
modules/api/booking_____/bookingIntegral/model/index.ts
Normal file
33
modules/api/booking_____/bookingIntegral/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 签到积分
|
||||
*/
|
||||
export interface BookingIntegral {
|
||||
//
|
||||
id?: number;
|
||||
// 用户id
|
||||
uid?: number;
|
||||
// 微信昵称
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 获得积分
|
||||
integral?: string;
|
||||
// 日期
|
||||
dateTime?: string;
|
||||
// 天
|
||||
day?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 签到时间
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到积分搜索条件
|
||||
*/
|
||||
export interface BookingIntegralParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingIntegralLog/index.ts
Normal file
106
modules/api/booking_____/bookingIntegralLog/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingIntegralLog, BookingIntegralLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询积分明细
|
||||
*/
|
||||
export async function pageBookingIntegralLog(params: BookingIntegralLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingIntegralLog>>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分明细列表
|
||||
*/
|
||||
export async function listBookingIntegralLog(params?: BookingIntegralLogParam) {
|
||||
const res = await request.get<ApiResult<BookingIntegralLog[]>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加积分明细
|
||||
*/
|
||||
export async function addBookingIntegralLog(data: BookingIntegralLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改积分明细
|
||||
*/
|
||||
export async function updateBookingIntegralLog(data: BookingIntegralLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除积分明细
|
||||
*/
|
||||
export async function removeBookingIntegralLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除积分明细
|
||||
*/
|
||||
export async function removeBatchBookingIntegralLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询积分明细
|
||||
*/
|
||||
export async function getBookingIntegralLog(id: number) {
|
||||
const res = await request.get<ApiResult<BookingIntegralLog>>(
|
||||
MODULES_API_URL + '/booking/booking-integral-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
modules/api/booking_____/bookingIntegralLog/model/index.ts
Normal file
39
modules/api/booking_____/bookingIntegralLog/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 积分明细
|
||||
*/
|
||||
export interface BookingIntegralLog {
|
||||
//
|
||||
id?: number;
|
||||
// 场馆订单号
|
||||
orderNum?: string;
|
||||
// 订单id
|
||||
oid?: number;
|
||||
// 场馆名称
|
||||
siteName?: string;
|
||||
// 微信昵称
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 获得积分
|
||||
integral?: string;
|
||||
// 变化前积分
|
||||
oldMoney?: string;
|
||||
// 变化后积分
|
||||
newMoney?: string;
|
||||
// 描述
|
||||
info?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 记录时间
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分明细搜索条件
|
||||
*/
|
||||
export interface BookingIntegralLogParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingItem/index.ts
Normal file
106
modules/api/booking_____/bookingItem/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingItem, BookingItemParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目类型
|
||||
*/
|
||||
export async function pageBookingItem(params: BookingItemParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingItem>>>(
|
||||
MODULES_API_URL + '/booking/booking-item/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目类型列表
|
||||
*/
|
||||
export async function listBookingItem(params?: BookingItemParam) {
|
||||
const res = await request.get<ApiResult<BookingItem[]>>(
|
||||
MODULES_API_URL + '/booking/booking-item',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目类型
|
||||
*/
|
||||
export async function addBookingItem(data: BookingItem) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目类型
|
||||
*/
|
||||
export async function updateBookingItem(data: BookingItem) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目类型
|
||||
*/
|
||||
export async function removeBookingItem(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-item/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目类型
|
||||
*/
|
||||
export async function removeBatchBookingItem(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-item/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目类型
|
||||
*/
|
||||
export async function getBookingItem(id: number) {
|
||||
const res = await request.get<ApiResult<BookingItem>>(
|
||||
MODULES_API_URL + '/booking/booking-item/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
modules/api/booking_____/bookingItem/model/index.ts
Normal file
31
modules/api/booking_____/bookingItem/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
export interface BookingItem {
|
||||
// ID
|
||||
id?: number;
|
||||
// 项目类型
|
||||
name?: string;
|
||||
// 项目图标
|
||||
image?: string;
|
||||
// 项目备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目类型搜索条件
|
||||
*/
|
||||
export interface BookingItemParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingOrder/index.ts
Normal file
106
modules/api/booking_____/bookingOrder/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingOrder, BookingOrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageBookingOrder(params: BookingOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingOrder>>>(
|
||||
MODULES_API_URL + '/booking/booking-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listBookingOrder(params?: BookingOrderParam) {
|
||||
const res = await request.get<ApiResult<BookingOrder[]>>(
|
||||
MODULES_API_URL + '/booking/booking-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 addBookingOrder(data: BookingOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateBookingOrder(data: BookingOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeBookingOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchBookingOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getBookingOrder(id: number) {
|
||||
const res = await request.get<ApiResult<BookingOrder>>(
|
||||
MODULES_API_URL + '/booking/booking-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
107
modules/api/booking_____/bookingOrder/model/index.ts
Normal file
107
modules/api/booking_____/bookingOrder/model/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface BookingOrder {
|
||||
//
|
||||
orderId?: number;
|
||||
// 订单类型,0商城订单 1预定订单 2会员卡
|
||||
type?: number;
|
||||
// 订单号
|
||||
orderNo?: string;
|
||||
// 下单渠道,0小程序预定 1俱乐部训练场 3活动订场
|
||||
channel?: number;
|
||||
// 微信支付订单号
|
||||
transactionId?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 场馆id用于权限判断
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 用户id
|
||||
uid?: number;
|
||||
// 使用的优惠券id
|
||||
cid?: number;
|
||||
// 使用的会员卡id
|
||||
vid?: number;
|
||||
// 关联管理员id
|
||||
aid?: number;
|
||||
// 核销管理员id
|
||||
adminId?: number;
|
||||
// IC卡号
|
||||
code?: string;
|
||||
// 真实姓名
|
||||
name?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 教练价格
|
||||
coachPrice?: string;
|
||||
// 教练id
|
||||
coachId?: number;
|
||||
// 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡
|
||||
payType?: string;
|
||||
// 1已付款,2未付款
|
||||
payStatus?: string;
|
||||
// 1已完成,2未使用,3已取消,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: string;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
couponType?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// 优惠说明
|
||||
couponDesc?: string;
|
||||
// vip月卡年卡、ic月卡年卡回退次数
|
||||
returnNum?: number;
|
||||
// vip充值回退金额
|
||||
returnMoney?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:1已开发票,2未开发票,3不能开具发票
|
||||
isInvoice?: string;
|
||||
// 下单时间
|
||||
createTime?: number;
|
||||
//
|
||||
updateTime?: number;
|
||||
// 付款时间
|
||||
payTime?: number;
|
||||
// 退款时间
|
||||
refundTime?: number;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: number;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BookingOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingOrderInfo/index.ts
Normal file
106
modules/api/booking_____/bookingOrderInfo/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingOrderInfo, BookingOrderInfoParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageBookingOrderInfo(params: BookingOrderInfoParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingOrderInfo>>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listBookingOrderInfo(params?: BookingOrderInfoParam) {
|
||||
const res = await request.get<ApiResult<BookingOrderInfo[]>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addBookingOrderInfo(data: BookingOrderInfo) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateBookingOrderInfo(data: BookingOrderInfo) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeBookingOrderInfo(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchBookingOrderInfo(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getBookingOrderInfo(id: number) {
|
||||
const res = await request.get<ApiResult<BookingOrderInfo>>(
|
||||
MODULES_API_URL + '/booking/booking-order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
modules/api/booking_____/bookingOrderInfo/model/index.ts
Normal file
57
modules/api/booking_____/bookingOrderInfo/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface BookingOrderInfo {
|
||||
//
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
oid?: number;
|
||||
// 关联场馆id
|
||||
sid?: number;
|
||||
// 关联场地id
|
||||
fid?: number;
|
||||
// 场馆
|
||||
siteName?: string;
|
||||
// 场地
|
||||
fieldName?: string;
|
||||
// 预约时间段
|
||||
dateTime?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: string;
|
||||
// 成人人数
|
||||
adultNum?: string;
|
||||
// 儿童人数
|
||||
childrenNum?: string;
|
||||
// 1已付款,2未付款,3无需付款或占用状态
|
||||
payStatus?: string;
|
||||
// 是否免费:1免费、2收费
|
||||
isFree?: string;
|
||||
// 是否支持儿童票:1支持,2不支持
|
||||
isChildren?: string;
|
||||
// 预订类型:1全场,2半场
|
||||
type?: string;
|
||||
// 组合数据:日期+时间段+场馆id+场地id
|
||||
mergeData?: string;
|
||||
// 开场时间
|
||||
startTime?: number;
|
||||
// 下单时间
|
||||
orderTime?: number;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BookingOrderInfoParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingPeriod/index.ts
Normal file
106
modules/api/booking_____/bookingPeriod/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingPeriod, BookingPeriodParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询场地时段
|
||||
*/
|
||||
export async function pageBookingPeriod(params: BookingPeriodParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingPeriod>>>(
|
||||
MODULES_API_URL + '/booking/booking-period/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场地时段列表
|
||||
*/
|
||||
export async function listBookingPeriod(params?: BookingPeriodParam) {
|
||||
const res = await request.get<ApiResult<BookingPeriod[]>>(
|
||||
MODULES_API_URL + '/booking/booking-period',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加场地时段
|
||||
*/
|
||||
export async function addBookingPeriod(data: BookingPeriod) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-period',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场地时段
|
||||
*/
|
||||
export async function updateBookingPeriod(data: BookingPeriod) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-period',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场地时段
|
||||
*/
|
||||
export async function removeBookingPeriod(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-period/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场地时段
|
||||
*/
|
||||
export async function removeBatchBookingPeriod(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-period/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询场地时段
|
||||
*/
|
||||
export async function getBookingPeriod(id: number) {
|
||||
const res = await request.get<ApiResult<BookingPeriod>>(
|
||||
MODULES_API_URL + '/booking/booking-period/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
modules/api/booking_____/bookingPeriod/model/index.ts
Normal file
49
modules/api/booking_____/bookingPeriod/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 场地时段
|
||||
*/
|
||||
export interface BookingPeriod {
|
||||
//
|
||||
periodId?: number;
|
||||
// 时段
|
||||
timePeriod?: string;
|
||||
// 价格
|
||||
price?: string;
|
||||
// 每日不同价格
|
||||
prices?: string;
|
||||
// 半场价格
|
||||
halfPrice?: string;
|
||||
// 每日不同半场价格
|
||||
halfPrices?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: string;
|
||||
// 星期选择
|
||||
week?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 关联id
|
||||
merchantId?: number;
|
||||
// 是否关闭,0开启,1关闭
|
||||
isStatus?: string;
|
||||
// 是否免费:0免费,1收费
|
||||
isFree?: string;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场地时段搜索条件
|
||||
*/
|
||||
export interface BookingPeriodParam extends PageParam {
|
||||
periodId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingUser/index.ts
Normal file
106
modules/api/booking_____/bookingUser/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingUser, BookingUserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageBookingUser(params: BookingUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingUser>>>(
|
||||
MODULES_API_URL + '/booking/booking-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listBookingUser(params?: BookingUserParam) {
|
||||
const res = await request.get<ApiResult<BookingUser[]>>(
|
||||
MODULES_API_URL + '/booking/booking-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addBookingUser(data: BookingUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateBookingUser(data: BookingUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeBookingUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchBookingUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getBookingUser(id: number) {
|
||||
const res = await request.get<ApiResult<BookingUser>>(
|
||||
MODULES_API_URL + '/booking/booking-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
modules/api/booking_____/bookingUser/model/index.ts
Normal file
49
modules/api/booking_____/bookingUser/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface BookingUser {
|
||||
//
|
||||
id?: number;
|
||||
// 用户唯一小程序id
|
||||
openId?: string;
|
||||
// 小程序用户秘钥
|
||||
sessionKey?: string;
|
||||
// 用户名
|
||||
username?: string;
|
||||
// 头像地址
|
||||
avatarUrl?: string;
|
||||
// 1男,2女
|
||||
gender?: string;
|
||||
// 国家
|
||||
country?: string;
|
||||
// 省份
|
||||
province?: string;
|
||||
// 城市
|
||||
city?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 积分
|
||||
integral?: string;
|
||||
// 余额
|
||||
money?: string;
|
||||
// 注册时间
|
||||
createTime?: number;
|
||||
//
|
||||
idcard?: string;
|
||||
//
|
||||
truename?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface BookingUserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingUserCard/index.ts
Normal file
106
modules/api/booking_____/bookingUserCard/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingUserCard, BookingUserCardParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageBookingUserCard(params: BookingUserCardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingUserCard>>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listBookingUserCard(params?: BookingUserCardParam) {
|
||||
const res = await request.get<ApiResult<BookingUserCard[]>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addBookingUserCard(data: BookingUserCard) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateBookingUserCard(data: BookingUserCard) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeBookingUserCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchBookingUserCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡
|
||||
*/
|
||||
export async function getBookingUserCard(id: number) {
|
||||
const res = await request.get<ApiResult<BookingUserCard>>(
|
||||
MODULES_API_URL + '/booking/booking-user-card/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
98
modules/api/booking_____/bookingUserCard/model/index.ts
Normal file
98
modules/api/booking_____/bookingUserCard/model/index.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface BookingUserCard {
|
||||
//
|
||||
id?: number;
|
||||
// sid场馆id集合,适用的场馆
|
||||
sid?: string;
|
||||
// 用户id
|
||||
uid?: number;
|
||||
// vip卡id
|
||||
vid?: number;
|
||||
// 开卡人id
|
||||
aid?: number;
|
||||
// 微信订单号
|
||||
wechatOrder?: string;
|
||||
// 卡号
|
||||
code?: string;
|
||||
// 会员卡名称
|
||||
name?: string;
|
||||
// 真实姓名
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// vip购卡价格
|
||||
price?: string;
|
||||
// 会员卡介绍
|
||||
comments?: string;
|
||||
// 会员卡说明
|
||||
info?: string;
|
||||
// vip卡折扣率
|
||||
discount?: string;
|
||||
// 使用次数
|
||||
count?: number;
|
||||
// 每使用一次减少的金额
|
||||
eachMoney?: string;
|
||||
// 剩余金额
|
||||
remainingMoney?: string;
|
||||
// 续费累加次数
|
||||
number?: number;
|
||||
// 剩余次数
|
||||
num?: number;
|
||||
// 付款状态,1已付款,2未付款
|
||||
status?: number;
|
||||
// 会员卡年限
|
||||
term?: number;
|
||||
// 月限
|
||||
month?: number;
|
||||
// IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡
|
||||
type?: number;
|
||||
// 卡类型:1成人卡,2儿童卡
|
||||
cardType?: number;
|
||||
// vip卡等级类型:1特殊vip卡,2普通vip卡
|
||||
vipType?: number;
|
||||
// 特殊卡开发凭证图
|
||||
pic?: string;
|
||||
// 价格组
|
||||
prices?: string;
|
||||
// 1微信支付,2支付宝支付,3现金,4POS机刷卡,15平安健康卡
|
||||
payType?: number;
|
||||
// 是否赠送积分:1赠送,2不赠送
|
||||
isIntegral?: number;
|
||||
// 是否已开具发票:1已开发票,2未开发票
|
||||
isInvoice?: number;
|
||||
// vip卡到期时间
|
||||
expireTime?: number;
|
||||
// 紧急联系人
|
||||
urgentName?: string;
|
||||
// 紧急联系人号码
|
||||
urgentPhone?: string;
|
||||
// 卡号
|
||||
cardNum?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 使用时间
|
||||
useTime?: number;
|
||||
// 创建时间
|
||||
createTime?: number;
|
||||
//
|
||||
updateTime?: number;
|
||||
@TableField("IDCard")
|
||||
// 身份证号码
|
||||
idcard?: string;
|
||||
// 备注
|
||||
remark?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡搜索条件
|
||||
*/
|
||||
export interface BookingUserCardParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingUserCoupon/index.ts
Normal file
106
modules/api/booking_____/bookingUserCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingUserCoupon, BookingUserCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询我的优惠券
|
||||
*/
|
||||
export async function pageBookingUserCoupon(params: BookingUserCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingUserCoupon>>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的优惠券列表
|
||||
*/
|
||||
export async function listBookingUserCoupon(params?: BookingUserCouponParam) {
|
||||
const res = await request.get<ApiResult<BookingUserCoupon[]>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的优惠券
|
||||
*/
|
||||
export async function addBookingUserCoupon(data: BookingUserCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的优惠券
|
||||
*/
|
||||
export async function updateBookingUserCoupon(data: BookingUserCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的优惠券
|
||||
*/
|
||||
export async function removeBookingUserCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的优惠券
|
||||
*/
|
||||
export async function removeBatchBookingUserCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的优惠券
|
||||
*/
|
||||
export async function getBookingUserCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<BookingUserCoupon>>(
|
||||
MODULES_API_URL + '/booking/booking-user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
modules/api/booking_____/bookingUserCoupon/model/index.ts
Normal file
59
modules/api/booking_____/bookingUserCoupon/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
*/
|
||||
export interface BookingUserCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠劵id
|
||||
couponId?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券类型(10满减券 20折扣券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: string;
|
||||
// 有效期结束时间
|
||||
endTime?: string;
|
||||
// 适用范围(10全部商品 20指定商品)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 是否已使用(0未使用 1已使用)
|
||||
isUse?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券搜索条件
|
||||
*/
|
||||
export interface BookingUserCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/bookingUserInvoice/index.ts
Normal file
106
modules/api/booking_____/bookingUserInvoice/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { BookingUserInvoice, BookingUserInvoiceParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询发票
|
||||
*/
|
||||
export async function pageBookingUserInvoice(params: BookingUserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<BookingUserInvoice>>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票列表
|
||||
*/
|
||||
export async function listBookingUserInvoice(params?: BookingUserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<BookingUserInvoice[]>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加发票
|
||||
*/
|
||||
export async function addBookingUserInvoice(data: BookingUserInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票
|
||||
*/
|
||||
export async function updateBookingUserInvoice(data: BookingUserInvoice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票
|
||||
*/
|
||||
export async function removeBookingUserInvoice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除发票
|
||||
*/
|
||||
export async function removeBatchBookingUserInvoice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询发票
|
||||
*/
|
||||
export async function getBookingUserInvoice(id: number) {
|
||||
const res = await request.get<ApiResult<BookingUserInvoice>>(
|
||||
MODULES_API_URL + '/booking/booking-user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
modules/api/booking_____/bookingUserInvoice/model/index.ts
Normal file
61
modules/api/booking_____/bookingUserInvoice/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 发票
|
||||
*/
|
||||
export interface BookingUserInvoice {
|
||||
// id
|
||||
id?: number;
|
||||
// 发票类型(0纸质 1电子)
|
||||
type?: number;
|
||||
// 发票名称
|
||||
name?: string;
|
||||
// 开票类型(0普票 1专票)
|
||||
invoiceType?: number;
|
||||
// 税号
|
||||
invoiceCode?: string;
|
||||
// 公司地址
|
||||
address?: string;
|
||||
// 公司电话
|
||||
tel?: string;
|
||||
// 开户行
|
||||
bankName?: string;
|
||||
// 开户账号
|
||||
bankAccount?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 电子邮箱
|
||||
email?: string;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 发票图片预览
|
||||
invoiceImg?: string;
|
||||
// 发票pdf地址
|
||||
invoicePdf?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否启用
|
||||
isCompany?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票搜索条件
|
||||
*/
|
||||
export interface BookingUserInvoiceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/card/index.ts
Normal file
106
modules/api/booking_____/card/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Card, CardParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageCard(params: CardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Card>>>(
|
||||
MODULES_API_URL + '/booking/card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listCard(params?: CardParam) {
|
||||
const res = await request.get<ApiResult<Card[]>>(
|
||||
MODULES_API_URL + '/booking/card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addCard(data: Card) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateCard(data: Card) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡
|
||||
*/
|
||||
export async function getCard(id: number) {
|
||||
const res = await request.get<ApiResult<Card>>(
|
||||
MODULES_API_URL + '/booking/card/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
modules/api/booking_____/card/model/index.ts
Normal file
57
modules/api/booking_____/card/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface Card {
|
||||
// ID
|
||||
cardId?: number;
|
||||
// 会员卡名称
|
||||
cardName?: string;
|
||||
// 会员卡标识
|
||||
cardCode?: string;
|
||||
// 会员卡类型
|
||||
type?: string;
|
||||
// 成人儿童
|
||||
cardType?: number;
|
||||
// 会员卡图片
|
||||
image?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 次数
|
||||
number?: number;
|
||||
// 月份
|
||||
month?: number;
|
||||
// 折扣
|
||||
discount?: number;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户类型
|
||||
merchantType?: string;
|
||||
// 可使用的场馆ID
|
||||
merchantIds?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡搜索条件
|
||||
*/
|
||||
export interface CardParam extends PageParam {
|
||||
cardId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/cardPlan/index.ts
Normal file
106
modules/api/booking_____/cardPlan/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CardPlan, CardPlanParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡类型
|
||||
*/
|
||||
export async function pageCardPlan(params: CardPlanParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CardPlan>>>(
|
||||
MODULES_API_URL + '/booking/card-plan/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡类型列表
|
||||
*/
|
||||
export async function listCardPlan(params?: CardPlanParam) {
|
||||
const res = await request.get<ApiResult<CardPlan[]>>(
|
||||
MODULES_API_URL + '/booking/card-plan',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡类型
|
||||
*/
|
||||
export async function addCardPlan(data: CardPlan) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡类型
|
||||
*/
|
||||
export async function updateCardPlan(data: CardPlan) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡类型
|
||||
*/
|
||||
export async function removeCardPlan(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡类型
|
||||
*/
|
||||
export async function removeBatchCardPlan(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/card-plan/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡类型
|
||||
*/
|
||||
export async function getCardPlan(id: number) {
|
||||
const res = await request.get<ApiResult<CardPlan>>(
|
||||
MODULES_API_URL + '/booking/card-plan/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
modules/api/booking_____/cardPlan/model/index.ts
Normal file
33
modules/api/booking_____/cardPlan/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡类型
|
||||
*/
|
||||
export interface CardPlan {
|
||||
// ID
|
||||
cardPlanId?: number;
|
||||
// 会员卡名称
|
||||
name?: string;
|
||||
// 标识
|
||||
code?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡类型搜索条件
|
||||
*/
|
||||
export interface CardPlanParam extends PageParam {
|
||||
cardPlanId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/category/index.ts
Normal file
106
modules/api/booking_____/category/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Category, CategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程分类
|
||||
*/
|
||||
export async function pageCategory(params: CategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Category>>>(
|
||||
MODULES_API_URL + '/booking/category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程分类列表
|
||||
*/
|
||||
export async function listCategory(params?: CategoryParam) {
|
||||
const res = await request.get<ApiResult<Category[]>>(
|
||||
MODULES_API_URL + '/booking/category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程分类
|
||||
*/
|
||||
export async function addCategory(data: Category) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程分类
|
||||
*/
|
||||
export async function updateCategory(data: Category) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程分类
|
||||
*/
|
||||
export async function removeCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程分类
|
||||
*/
|
||||
export async function removeBatchCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程分类
|
||||
*/
|
||||
export async function getCategory(id: number) {
|
||||
const res = await request.get<ApiResult<Category>>(
|
||||
MODULES_API_URL + '/booking/category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
modules/api/booking_____/category/model/index.ts
Normal file
57
modules/api/booking_____/category/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程分类
|
||||
*/
|
||||
export interface Category {
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
// 分类标识
|
||||
categoryCode?: string;
|
||||
// 分类名称
|
||||
title?: string;
|
||||
// 类型 0列表 1单页 2外链
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品数量
|
||||
count?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程分类搜索条件
|
||||
*/
|
||||
export interface CategoryParam extends PageParam {
|
||||
categoryId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/cooperate/index.ts
Normal file
106
modules/api/booking_____/cooperate/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Cooperate, CooperateParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商务合作
|
||||
*/
|
||||
export async function pageCooperate(params: CooperateParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Cooperate>>>(
|
||||
MODULES_API_URL + '/booking/cooperate/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商务合作列表
|
||||
*/
|
||||
export async function listCooperate(params?: CooperateParam) {
|
||||
const res = await request.get<ApiResult<Cooperate[]>>(
|
||||
MODULES_API_URL + '/booking/cooperate',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商务合作
|
||||
*/
|
||||
export async function addCooperate(data: Cooperate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商务合作
|
||||
*/
|
||||
export async function updateCooperate(data: Cooperate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商务合作
|
||||
*/
|
||||
export async function removeCooperate(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商务合作
|
||||
*/
|
||||
export async function removeBatchCooperate(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商务合作
|
||||
*/
|
||||
export async function getCooperate(id: number) {
|
||||
const res = await request.get<ApiResult<Cooperate>>(
|
||||
MODULES_API_URL + '/booking/cooperate/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
modules/api/booking_____/cooperate/model/index.ts
Normal file
33
modules/api/booking_____/cooperate/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商务合作
|
||||
*/
|
||||
export interface Cooperate {
|
||||
// ID
|
||||
cooperateId?: number;
|
||||
// 部门名称
|
||||
name?: string;
|
||||
// 咨询电话
|
||||
phone?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商务合作搜索条件
|
||||
*/
|
||||
export interface CooperateParam extends PageParam {
|
||||
cooperateId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/cooperateLog/index.ts
Normal file
106
modules/api/booking_____/cooperateLog/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CooperateLog, CooperateLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商务合作留言记录
|
||||
*/
|
||||
export async function pageCooperateLog(params: CooperateLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CooperateLog>>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商务合作留言记录列表
|
||||
*/
|
||||
export async function listCooperateLog(params?: CooperateLogParam) {
|
||||
const res = await request.get<ApiResult<CooperateLog[]>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商务合作留言记录
|
||||
*/
|
||||
export async function addCooperateLog(data: CooperateLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商务合作留言记录
|
||||
*/
|
||||
export async function updateCooperateLog(data: CooperateLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商务合作留言记录
|
||||
*/
|
||||
export async function removeCooperateLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商务合作留言记录
|
||||
*/
|
||||
export async function removeBatchCooperateLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商务合作留言记录
|
||||
*/
|
||||
export async function getCooperateLog(id: number) {
|
||||
const res = await request.get<ApiResult<CooperateLog>>(
|
||||
MODULES_API_URL + '/booking/cooperate-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
modules/api/booking_____/cooperateLog/model/index.ts
Normal file
35
modules/api/booking_____/cooperateLog/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商务合作留言记录
|
||||
*/
|
||||
export interface CooperateLog {
|
||||
// ID
|
||||
logId?: number;
|
||||
// 关联ID
|
||||
cooperateId?: number;
|
||||
// 部门名称
|
||||
name?: string;
|
||||
// 咨询电话
|
||||
phone?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商务合作留言记录搜索条件
|
||||
*/
|
||||
export interface CooperateLogParam extends PageParam {
|
||||
logId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/course/index.ts
Normal file
106
modules/api/booking_____/course/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Course, CourseParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程管理
|
||||
*/
|
||||
export async function pageCourse(params: CourseParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Course>>>(
|
||||
MODULES_API_URL + '/booking/course/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程管理列表
|
||||
*/
|
||||
export async function listCourse(params?: CourseParam) {
|
||||
const res = await request.get<ApiResult<Course[]>>(
|
||||
MODULES_API_URL + '/booking/course',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程管理
|
||||
*/
|
||||
export async function addCourse(data: Course) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程管理
|
||||
*/
|
||||
export async function updateCourse(data: Course) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程管理
|
||||
*/
|
||||
export async function removeCourse(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程管理
|
||||
*/
|
||||
export async function removeBatchCourse(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程管理
|
||||
*/
|
||||
export async function getCourse(id: number) {
|
||||
const res = await request.get<ApiResult<Course>>(
|
||||
MODULES_API_URL + '/booking/course/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
55
modules/api/booking_____/course/model/index.ts
Normal file
55
modules/api/booking_____/course/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程管理
|
||||
*/
|
||||
export interface Course {
|
||||
// ID
|
||||
lessonId?: number;
|
||||
// 课程名称
|
||||
lessonName?: string;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 课程价格
|
||||
price?: string;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 课时
|
||||
classPeriod?: number;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 详细介绍
|
||||
content?: string;
|
||||
// 课程相册
|
||||
files?: string;
|
||||
// 年龄限制
|
||||
ageLimit?: string;
|
||||
// 报名时间
|
||||
bmTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程管理搜索条件
|
||||
*/
|
||||
export interface CourseParam extends PageParam {
|
||||
lessonId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/courseCategory/index.ts
Normal file
106
modules/api/booking_____/courseCategory/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CourseCategory, CourseCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程分类
|
||||
*/
|
||||
export async function pageCourseCategory(params: CourseCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CourseCategory>>>(
|
||||
MODULES_API_URL + '/booking/course-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程分类列表
|
||||
*/
|
||||
export async function listCourseCategory(params?: CourseCategoryParam) {
|
||||
const res = await request.get<ApiResult<CourseCategory[]>>(
|
||||
MODULES_API_URL + '/booking/course-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程分类
|
||||
*/
|
||||
export async function addCourseCategory(data: CourseCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程分类
|
||||
*/
|
||||
export async function updateCourseCategory(data: CourseCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程分类
|
||||
*/
|
||||
export async function removeCourseCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程分类
|
||||
*/
|
||||
export async function removeBatchCourseCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/course-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程分类
|
||||
*/
|
||||
export async function getCourseCategory(id: number) {
|
||||
const res = await request.get<ApiResult<CourseCategory>>(
|
||||
MODULES_API_URL + '/booking/course-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
modules/api/booking_____/courseCategory/model/index.ts
Normal file
41
modules/api/booking_____/courseCategory/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程分类
|
||||
*/
|
||||
export interface CourseCategory {
|
||||
// 商品分类ID
|
||||
id?: number;
|
||||
// 分类名称
|
||||
name?: string;
|
||||
// 分类标识
|
||||
code?: string;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程分类搜索条件
|
||||
*/
|
||||
export interface CourseCategoryParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/emergency/index.ts
Normal file
106
modules/api/booking_____/emergency/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Emergency, EmergencyParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询紧急联系人管理
|
||||
*/
|
||||
export async function pageEmergency(params: EmergencyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Emergency>>>(
|
||||
MODULES_API_URL + '/booking/emergency/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询紧急联系人管理列表
|
||||
*/
|
||||
export async function listEmergency(params?: EmergencyParam) {
|
||||
const res = await request.get<ApiResult<Emergency[]>>(
|
||||
MODULES_API_URL + '/booking/emergency',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加紧急联系人管理
|
||||
*/
|
||||
export async function addEmergency(data: Emergency) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改紧急联系人管理
|
||||
*/
|
||||
export async function updateEmergency(data: Emergency) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除紧急联系人管理
|
||||
*/
|
||||
export async function removeEmergency(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除紧急联系人管理
|
||||
*/
|
||||
export async function removeBatchEmergency(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/emergency/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询紧急联系人管理
|
||||
*/
|
||||
export async function getEmergency(id: number) {
|
||||
const res = await request.get<ApiResult<Emergency>>(
|
||||
MODULES_API_URL + '/booking/emergency/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
modules/api/booking_____/emergency/model/index.ts
Normal file
35
modules/api/booking_____/emergency/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 紧急联系人管理
|
||||
*/
|
||||
export interface Emergency {
|
||||
// ID
|
||||
emergencyId?: number;
|
||||
// 姓名
|
||||
name?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 紧急联系人管理搜索条件
|
||||
*/
|
||||
export interface EmergencyParam extends PageParam {
|
||||
emergencyId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/field/index.ts
Normal file
106
modules/api/booking_____/field/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Field, FieldParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询场馆场地
|
||||
*/
|
||||
export async function pageField(params: FieldParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Field>>>(
|
||||
MODULES_API_URL + '/booking/field/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场馆场地列表
|
||||
*/
|
||||
export async function listField(params?: FieldParam) {
|
||||
const res = await request.get<ApiResult<Field[]>>(
|
||||
MODULES_API_URL + '/booking/field',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加场馆场地
|
||||
*/
|
||||
export async function addField(data: Field) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场馆场地
|
||||
*/
|
||||
export async function updateField(data: Field) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场馆场地
|
||||
*/
|
||||
export async function removeField(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场馆场地
|
||||
*/
|
||||
export async function removeBatchField(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/field/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询场馆场地
|
||||
*/
|
||||
export async function getField(id: number) {
|
||||
const res = await request.get<ApiResult<Field>>(
|
||||
MODULES_API_URL + '/booking/field/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
69
modules/api/booking_____/field/model/index.ts
Normal file
69
modules/api/booking_____/field/model/index.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { OrderInfo } from "@/api/shop/orderInfo/model";
|
||||
|
||||
/**
|
||||
* 场馆场地
|
||||
*/
|
||||
export interface Field {
|
||||
// ID
|
||||
fieldId?: number;
|
||||
// 场地名称
|
||||
fieldName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 关联用户
|
||||
userId?: number;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 是否支持半场
|
||||
isHalf?: number;
|
||||
// 可重复订阅数
|
||||
isRepeat?: number;
|
||||
// 是否厕所
|
||||
isToilet?: number;
|
||||
// 是否支持儿童价
|
||||
isChildren?: number;
|
||||
// 显示在第几行
|
||||
row?: number;
|
||||
num?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 场地状态
|
||||
isStatus?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
orderId?: number;
|
||||
orderInfoList?: OrderInfo[];
|
||||
orderKey?: string;
|
||||
// 是否已预定
|
||||
sold?: boolean;
|
||||
// 购买数量
|
||||
cartNum?: number;
|
||||
// 场地价格
|
||||
price?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场馆场地搜索条件
|
||||
*/
|
||||
export interface FieldParam extends PageParam {
|
||||
fieldId?: number;
|
||||
fieldName?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/integral/index.ts
Normal file
106
modules/api/booking_____/integral/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Integral, IntegralParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询签到积分
|
||||
*/
|
||||
export async function pageIntegral(params: IntegralParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Integral>>>(
|
||||
MODULES_API_URL + '/booking/integral/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询签到积分列表
|
||||
*/
|
||||
export async function listIntegral(params?: IntegralParam) {
|
||||
const res = await request.get<ApiResult<Integral[]>>(
|
||||
MODULES_API_URL + '/booking/integral',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加签到积分
|
||||
*/
|
||||
export async function addIntegral(data: Integral) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改签到积分
|
||||
*/
|
||||
export async function updateIntegral(data: Integral) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除签到积分
|
||||
*/
|
||||
export async function removeIntegral(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除签到积分
|
||||
*/
|
||||
export async function removeBatchIntegral(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询签到积分
|
||||
*/
|
||||
export async function getIntegral(id: number) {
|
||||
const res = await request.get<ApiResult<Integral>>(
|
||||
MODULES_API_URL + '/booking/integral/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
modules/api/booking_____/integral/model/index.ts
Normal file
33
modules/api/booking_____/integral/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 签到积分
|
||||
*/
|
||||
export interface Integral {
|
||||
//
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 微信昵称
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 获得积分
|
||||
integral?: string;
|
||||
// 日期
|
||||
dateTime?: string;
|
||||
// 天
|
||||
day?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 签到时间
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签到积分搜索条件
|
||||
*/
|
||||
export interface IntegralParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/integralLog/index.ts
Normal file
106
modules/api/booking_____/integralLog/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { IntegralLog, IntegralLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询积分明细
|
||||
*/
|
||||
export async function pageIntegralLog(params: IntegralLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<IntegralLog>>>(
|
||||
MODULES_API_URL + '/booking/integral-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分明细列表
|
||||
*/
|
||||
export async function listIntegralLog(params?: IntegralLogParam) {
|
||||
const res = await request.get<ApiResult<IntegralLog[]>>(
|
||||
MODULES_API_URL + '/booking/integral-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加积分明细
|
||||
*/
|
||||
export async function addIntegralLog(data: IntegralLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改积分明细
|
||||
*/
|
||||
export async function updateIntegralLog(data: IntegralLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除积分明细
|
||||
*/
|
||||
export async function removeIntegralLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除积分明细
|
||||
*/
|
||||
export async function removeBatchIntegralLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/integral-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询积分明细
|
||||
*/
|
||||
export async function getIntegralLog(id: number) {
|
||||
const res = await request.get<ApiResult<IntegralLog>>(
|
||||
MODULES_API_URL + '/booking/integral-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
modules/api/booking_____/integralLog/model/index.ts
Normal file
39
modules/api/booking_____/integralLog/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 积分明细
|
||||
*/
|
||||
export interface IntegralLog {
|
||||
//
|
||||
id?: number;
|
||||
// 场馆订单号
|
||||
orderNum?: string;
|
||||
// 订单id
|
||||
oid?: number;
|
||||
// 场馆名称
|
||||
siteName?: string;
|
||||
// 微信昵称
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 获得积分
|
||||
integral?: string;
|
||||
// 变化前积分
|
||||
oldMoney?: string;
|
||||
// 变化后积分
|
||||
newMoney?: string;
|
||||
// 描述
|
||||
info?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 记录时间
|
||||
createTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分明细搜索条件
|
||||
*/
|
||||
export interface IntegralLogParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/item/index.ts
Normal file
106
modules/api/booking_____/item/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Item, ItemParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询项目类型
|
||||
*/
|
||||
export async function pageItem(params: ItemParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Item>>>(
|
||||
MODULES_API_URL + '/booking/item/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目类型列表
|
||||
*/
|
||||
export async function listItem(params?: ItemParam) {
|
||||
const res = await request.get<ApiResult<Item[]>>(
|
||||
MODULES_API_URL + '/booking/item',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目类型
|
||||
*/
|
||||
export async function addItem(data: Item) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目类型
|
||||
*/
|
||||
export async function updateItem(data: Item) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目类型
|
||||
*/
|
||||
export async function removeItem(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目类型
|
||||
*/
|
||||
export async function removeBatchItem(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/item/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目类型
|
||||
*/
|
||||
export async function getItem(id: number) {
|
||||
const res = await request.get<ApiResult<Item>>(
|
||||
MODULES_API_URL + '/booking/item/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
32
modules/api/booking_____/item/model/index.ts
Normal file
32
modules/api/booking_____/item/model/index.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目类型
|
||||
*/
|
||||
export interface Item {
|
||||
// ID
|
||||
id?: number;
|
||||
// 项目类型
|
||||
name?: string;
|
||||
// 项目图标
|
||||
image?: string;
|
||||
// 项目备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目类型搜索条件
|
||||
*/
|
||||
export interface ItemParam extends PageParam {
|
||||
id?: number;
|
||||
ids?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/lesson/index.ts
Normal file
106
modules/api/booking_____/lesson/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Lesson, LessonParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询课程管理
|
||||
*/
|
||||
export async function pageLesson(params: LessonParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Lesson>>>(
|
||||
MODULES_API_URL + '/booking/lesson/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询课程管理列表
|
||||
*/
|
||||
export async function listLesson(params?: LessonParam) {
|
||||
const res = await request.get<ApiResult<Lesson[]>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程管理
|
||||
*/
|
||||
export async function addLesson(data: Lesson) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程管理
|
||||
*/
|
||||
export async function updateLesson(data: Lesson) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程管理
|
||||
*/
|
||||
export async function removeLesson(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除课程管理
|
||||
*/
|
||||
export async function removeBatchLesson(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/lesson/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询课程管理
|
||||
*/
|
||||
export async function getLesson(id: number) {
|
||||
const res = await request.get<ApiResult<Lesson>>(
|
||||
MODULES_API_URL + '/booking/lesson/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
modules/api/booking_____/lesson/model/index.ts
Normal file
43
modules/api/booking_____/lesson/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 课程管理
|
||||
*/
|
||||
export interface Lesson {
|
||||
// ID
|
||||
lessonId?: number;
|
||||
// 课程名称
|
||||
lessonName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
// 老师ID
|
||||
teacherId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 上课时间
|
||||
startTime?: string;
|
||||
// 报名人数上限
|
||||
maxNumber?: number;
|
||||
// 上课地点
|
||||
address?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 课程管理搜索条件
|
||||
*/
|
||||
export interface LessonParam extends PageParam {
|
||||
lessonId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/match/index.ts
Normal file
106
modules/api/booking_____/match/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Match, MatchParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询比赛信息表
|
||||
*/
|
||||
export async function pageMatch(params: MatchParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Match>>>(
|
||||
MODULES_API_URL + '/booking/match/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询比赛信息表列表
|
||||
*/
|
||||
export async function listMatch(params?: MatchParam) {
|
||||
const res = await request.get<ApiResult<Match[]>>(
|
||||
MODULES_API_URL + '/booking/match',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加比赛信息表
|
||||
*/
|
||||
export async function addMatch(data: Match) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改比赛信息表
|
||||
*/
|
||||
export async function updateMatch(data: Match) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除比赛信息表
|
||||
*/
|
||||
export async function removeMatch(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除比赛信息表
|
||||
*/
|
||||
export async function removeBatchMatch(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询比赛信息表
|
||||
*/
|
||||
export async function getMatch(id: number) {
|
||||
const res = await request.get<ApiResult<Match>>(
|
||||
MODULES_API_URL + '/booking/match/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
73
modules/api/booking_____/match/model/index.ts
Normal file
73
modules/api/booking_____/match/model/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 比赛信息表
|
||||
*/
|
||||
export interface Match {
|
||||
// 赛事ID
|
||||
matchId?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 比赛类型 0常规比赛
|
||||
type?: number;
|
||||
// 活动开始时间
|
||||
matchStartTime?: number;
|
||||
// 活动结束时间
|
||||
matchEndTime?: number;
|
||||
// 报名时间
|
||||
bmStartTime?: number;
|
||||
// 报名时间
|
||||
bmEndTime?: number;
|
||||
// 文章分类ID
|
||||
categoryId?: number;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 虚拟阅读量(仅用作展示)
|
||||
virtualViews?: number;
|
||||
// 实际阅读量
|
||||
actualViews?: number;
|
||||
// 文章附件
|
||||
files?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 退费规则
|
||||
refundRule?: string;
|
||||
// 活动介绍
|
||||
content?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 比赛活动地点
|
||||
address?: string;
|
||||
// 报名费用
|
||||
price?: string;
|
||||
// 已报名人数
|
||||
users?: number;
|
||||
// 报名人数限制
|
||||
maxUsers?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0未开始, 1进行中,2已结束
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 比赛信息表搜索条件
|
||||
*/
|
||||
export interface MatchParam extends PageParam {
|
||||
matchId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/matchOrder/index.ts
Normal file
106
modules/api/booking_____/matchOrder/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MatchOrder, MatchOrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询比赛报名记录表
|
||||
*/
|
||||
export async function pageMatchOrder(params: MatchOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MatchOrder>>>(
|
||||
MODULES_API_URL + '/booking/match-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询比赛报名记录表列表
|
||||
*/
|
||||
export async function listMatchOrder(params?: MatchOrderParam) {
|
||||
const res = await request.get<ApiResult<MatchOrder[]>>(
|
||||
MODULES_API_URL + '/booking/match-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 addMatchOrder(data: MatchOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改比赛报名记录表
|
||||
*/
|
||||
export async function updateMatchOrder(data: MatchOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除比赛报名记录表
|
||||
*/
|
||||
export async function removeMatchOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除比赛报名记录表
|
||||
*/
|
||||
export async function removeBatchMatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/match-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询比赛报名记录表
|
||||
*/
|
||||
export async function getMatchOrder(id: number) {
|
||||
const res = await request.get<ApiResult<MatchOrder>>(
|
||||
MODULES_API_URL + '/booking/match-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
modules/api/booking_____/matchOrder/model/index.ts
Normal file
47
modules/api/booking_____/matchOrder/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 比赛报名记录表
|
||||
*/
|
||||
export interface MatchOrder {
|
||||
// 赛事ID
|
||||
matchOrderId?: number;
|
||||
// 赛事ID
|
||||
matchId?: number;
|
||||
// 场次
|
||||
session?: number;
|
||||
// 比赛活动地点
|
||||
address?: string;
|
||||
// 姓名
|
||||
name?: number;
|
||||
// 性别
|
||||
sex?: number;
|
||||
// 身份证号码
|
||||
idCardNo?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0未开始, 1进行中,2已结束
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 比赛报名记录表搜索条件
|
||||
*/
|
||||
export interface MatchOrderParam extends PageParam {
|
||||
matchOrderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/order/index.ts
Normal file
106
modules/api/booking_____/order/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageOrder(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
MODULES_API_URL + '/booking/order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listOrder(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
MODULES_API_URL + '/booking/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 addOrder(data: Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateOrder(data: Order) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getOrder(id: number) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
MODULES_API_URL + '/booking/order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
107
modules/api/booking_____/order/model/index.ts
Normal file
107
modules/api/booking_____/order/model/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface Order {
|
||||
//
|
||||
orderId?: number;
|
||||
// 订单类型,0商城订单 1预定订单 2会员卡
|
||||
type?: number;
|
||||
// 订单号
|
||||
orderNo?: string;
|
||||
// 下单渠道,0小程序预定 1俱乐部训练场 3活动订场
|
||||
channel?: number;
|
||||
// 微信支付订单号
|
||||
transactionId?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 场馆id用于权限判断
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 用户id
|
||||
uid?: number;
|
||||
// 使用的优惠券id
|
||||
cid?: number;
|
||||
// 使用的会员卡id
|
||||
vid?: number;
|
||||
// 关联管理员id
|
||||
aid?: number;
|
||||
// 核销管理员id
|
||||
adminId?: number;
|
||||
// IC卡号
|
||||
code?: string;
|
||||
// 真实姓名
|
||||
name?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 教练价格
|
||||
coachPrice?: string;
|
||||
// 教练id
|
||||
coachId?: number;
|
||||
// 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡
|
||||
payType?: string;
|
||||
// 1已付款,2未付款
|
||||
payStatus?: string;
|
||||
// 1已完成,2未使用,3已取消,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: string;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
couponType?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// 优惠说明
|
||||
couponDesc?: string;
|
||||
// vip月卡年卡、ic月卡年卡回退次数
|
||||
returnNum?: number;
|
||||
// vip充值回退金额
|
||||
returnMoney?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:1已开发票,2未开发票,3不能开具发票
|
||||
isInvoice?: string;
|
||||
// 下单时间
|
||||
createTime?: number;
|
||||
//
|
||||
updateTime?: number;
|
||||
// 付款时间
|
||||
payTime?: number;
|
||||
// 退款时间
|
||||
refundTime?: number;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: number;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface OrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/orderExport/index.ts
Normal file
106
modules/api/booking_____/orderExport/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderExport, OrderExportParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询统计报表导出
|
||||
*/
|
||||
export async function pageOrderExport(params: OrderExportParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderExport>>>(
|
||||
MODULES_API_URL + '/booking/order-export/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计报表导出列表
|
||||
*/
|
||||
export async function listOrderExport(params?: OrderExportParam) {
|
||||
const res = await request.get<ApiResult<OrderExport[]>>(
|
||||
MODULES_API_URL + '/booking/order-export',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加统计报表导出
|
||||
*/
|
||||
export async function addOrderExport(data: OrderExport) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-export',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改统计报表导出
|
||||
*/
|
||||
export async function updateOrderExport(data: OrderExport) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-export',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除统计报表导出
|
||||
*/
|
||||
export async function removeOrderExport(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-export/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除统计报表导出
|
||||
*/
|
||||
export async function removeBatchOrderExport(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-export/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询统计报表导出
|
||||
*/
|
||||
export async function getOrderExport(id: number) {
|
||||
const res = await request.get<ApiResult<OrderExport>>(
|
||||
MODULES_API_URL + '/booking/order-export/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
modules/api/booking_____/orderExport/model/index.ts
Normal file
57
modules/api/booking_____/orderExport/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 统计报表导出
|
||||
*/
|
||||
export interface OrderExport {
|
||||
// 自增ID
|
||||
exportId?: number;
|
||||
// 机构名称
|
||||
organizationName?: string;
|
||||
// 实际消费的金额(不含退款)
|
||||
expendMoney?: string;
|
||||
// 早餐报餐次数
|
||||
breakfastPost?: number;
|
||||
// 早餐签到次数
|
||||
breakfastSign?: number;
|
||||
// 午餐报餐次数
|
||||
lunchPost?: number;
|
||||
// 午餐签到次数
|
||||
lunchSign?: number;
|
||||
// 晚餐报餐次数
|
||||
dinnerPost?: number;
|
||||
// 晚餐签到次数
|
||||
dinnerSign?: number;
|
||||
// 档口 10 食堂档口 20 物品档口
|
||||
gear?: string;
|
||||
// 商品价格(单价)
|
||||
goodsPrice?: string;
|
||||
// 发货时间
|
||||
deliveryTime?: string;
|
||||
// 状态, 0待发布, 1已发布
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 订单号
|
||||
orderId?: number;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 发布人
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计报表导出搜索条件
|
||||
*/
|
||||
export interface OrderExportParam extends PageParam {
|
||||
exportId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/orderInfo/index.ts
Normal file
106
modules/api/booking_____/orderInfo/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { OrderInfo, OrderInfoParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageOrderInfo(params: OrderInfoParam) {
|
||||
const res = await request.get<ApiResult<PageResult<OrderInfo>>>(
|
||||
MODULES_API_URL + '/booking/order-info/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listOrderInfo(params?: OrderInfoParam) {
|
||||
const res = await request.get<ApiResult<OrderInfo[]>>(
|
||||
MODULES_API_URL + '/booking/order-info',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addOrderInfo(data: OrderInfo) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateOrderInfo(data: OrderInfo) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-info',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeOrderInfo(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchOrderInfo(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/order-info/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getOrderInfo(id: number) {
|
||||
const res = await request.get<ApiResult<OrderInfo>>(
|
||||
MODULES_API_URL + '/booking/order-info/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
modules/api/booking_____/orderInfo/model/index.ts
Normal file
57
modules/api/booking_____/orderInfo/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface OrderInfo {
|
||||
//
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
oid?: number;
|
||||
// 关联场馆id
|
||||
sid?: number;
|
||||
// 关联场地id
|
||||
fid?: number;
|
||||
// 场馆
|
||||
siteName?: string;
|
||||
// 场地
|
||||
fieldName?: string;
|
||||
// 预约时间段
|
||||
dateTime?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: string;
|
||||
// 成人人数
|
||||
adultNum?: string;
|
||||
// 儿童人数
|
||||
childrenNum?: string;
|
||||
// 1已付款,2未付款,3无需付款或占用状态
|
||||
payStatus?: string;
|
||||
// 是否免费:1免费、2收费
|
||||
isFree?: string;
|
||||
// 是否支持儿童票:1支持,2不支持
|
||||
isChildren?: string;
|
||||
// 预订类型:1全场,2半场
|
||||
type?: string;
|
||||
// 组合数据:日期+时间段+场馆id+场地id
|
||||
mergeData?: string;
|
||||
// 开场时间
|
||||
startTime?: number;
|
||||
// 下单时间
|
||||
orderTime?: number;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface OrderInfoParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/period/index.ts
Normal file
106
modules/api/booking_____/period/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Period, PeriodParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询场地时段
|
||||
*/
|
||||
export async function pagePeriod(params: PeriodParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Period>>>(
|
||||
MODULES_API_URL + '/booking/period/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场地时段列表
|
||||
*/
|
||||
export async function listPeriod(params?: PeriodParam) {
|
||||
const res = await request.get<ApiResult<Period[]>>(
|
||||
MODULES_API_URL + '/booking/period',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加场地时段
|
||||
*/
|
||||
export async function addPeriod(data: Period) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场地时段
|
||||
*/
|
||||
export async function updatePeriod(data: Period) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场地时段
|
||||
*/
|
||||
export async function removePeriod(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除场地时段
|
||||
*/
|
||||
export async function removeBatchPeriod(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/period/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询场地时段
|
||||
*/
|
||||
export async function getPeriod(id: number) {
|
||||
const res = await request.get<ApiResult<Period>>(
|
||||
MODULES_API_URL + '/booking/period/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
modules/api/booking_____/period/model/index.ts
Normal file
61
modules/api/booking_____/period/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { BookingField } from '@/api/booking/bookingField/model';
|
||||
|
||||
/**
|
||||
* 场地时段
|
||||
*/
|
||||
export interface Period {
|
||||
//
|
||||
periodId?: number;
|
||||
// 时段
|
||||
timePeriod?: string;
|
||||
timePeriod1?: string;
|
||||
timePeriod2?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 每日不同价格
|
||||
prices?: string;
|
||||
// 半场价格
|
||||
halfPrice?: number;
|
||||
// 每日不同半场价格
|
||||
halfPrices?: string;
|
||||
// 儿童价
|
||||
childrenPrice?: number;
|
||||
// 星期选择
|
||||
week?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 关联id
|
||||
merchantId?: number;
|
||||
// 是否关闭,1开启,2关闭
|
||||
isStatus?: number;
|
||||
// 是否免费:1免费,2收费
|
||||
isFree?: number;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 场地列表
|
||||
fieldList?: BookingField[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 场地时段搜索条件
|
||||
*/
|
||||
export interface PeriodParam extends PageParam {
|
||||
periodId?: number;
|
||||
keywords?: string;
|
||||
dateTime?: string;
|
||||
isStatus?: number;
|
||||
timePeriod?: string;
|
||||
merchantId?: number;
|
||||
week?: number;
|
||||
startTime?: string;
|
||||
half?: number;
|
||||
}
|
||||
106
modules/api/booking_____/site/index.ts
Normal file
106
modules/api/booking_____/site/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Site, SiteParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageSite(params: SiteParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Site>>>(
|
||||
MODULES_API_URL + '/booking/site/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listSite(params?: SiteParam) {
|
||||
const res = await request.get<ApiResult<Site[]>>(
|
||||
MODULES_API_URL + '/booking/site',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addSite(data: Site) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/site',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateSite(data: Site) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/site',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeSite(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/site/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchSite(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/site/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getSite(id: number) {
|
||||
const res = await request.get<ApiResult<Site>>(
|
||||
MODULES_API_URL + '/booking/site/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
modules/api/booking_____/site/model/index.ts
Normal file
47
modules/api/booking_____/site/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface Site {
|
||||
//
|
||||
id?: number;
|
||||
// 场地名称
|
||||
name?: string;
|
||||
// 封面图
|
||||
thumb?: string;
|
||||
// 每小时价格
|
||||
price?: string;
|
||||
// 营业时间
|
||||
businessTime?: string;
|
||||
// 场馆地址
|
||||
address?: string;
|
||||
// 场馆介绍
|
||||
info?: string;
|
||||
// 场馆电话
|
||||
tel?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 类型:1天,2小时
|
||||
type?: string;
|
||||
// 天数或小时
|
||||
num?: string;
|
||||
// 退款比率
|
||||
proportion?: string;
|
||||
// 退款规则组
|
||||
moneyJson?: string;
|
||||
// 创建时间
|
||||
createTime?: number;
|
||||
// 更新时间
|
||||
updateTime?: number;
|
||||
// 周末活动订场开关:1开,0关
|
||||
weekendOpen?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface SiteParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/teacher/index.ts
Normal file
106
modules/api/booking_____/teacher/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Teacher, TeacherParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询老师管理
|
||||
*/
|
||||
export async function pageTeacher(params: TeacherParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Teacher>>>(
|
||||
MODULES_API_URL + '/booking/teacher/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询老师管理列表
|
||||
*/
|
||||
export async function listTeacher(params?: TeacherParam) {
|
||||
const res = await request.get<ApiResult<Teacher[]>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加老师管理
|
||||
*/
|
||||
export async function addTeacher(data: Teacher) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改老师管理
|
||||
*/
|
||||
export async function updateTeacher(data: Teacher) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除老师管理
|
||||
*/
|
||||
export async function removeTeacher(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除老师管理
|
||||
*/
|
||||
export async function removeBatchTeacher(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/teacher/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询老师管理
|
||||
*/
|
||||
export async function getTeacher(id: number) {
|
||||
const res = await request.get<ApiResult<Teacher>>(
|
||||
MODULES_API_URL + '/booking/teacher/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
modules/api/booking_____/teacher/model/index.ts
Normal file
35
modules/api/booking_____/teacher/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 老师管理
|
||||
*/
|
||||
export interface Teacher {
|
||||
// ID
|
||||
teacherId?: number;
|
||||
// 老师姓名
|
||||
teacherName?: string;
|
||||
// 老师照片
|
||||
image?: string;
|
||||
// 老师介绍
|
||||
content?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 老师管理搜索条件
|
||||
*/
|
||||
export interface TeacherParam extends PageParam {
|
||||
teacherId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/user/index.ts
Normal file
106
modules/api/booking_____/user/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { User, UserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageUser(params: UserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<User>>>(
|
||||
MODULES_API_URL + '/booking/user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listUser(params?: UserParam) {
|
||||
const res = await request.get<ApiResult<User[]>>(
|
||||
MODULES_API_URL + '/booking/user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addUser(data: User) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateUser(data: User) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getUser(id: number) {
|
||||
const res = await request.get<ApiResult<User>>(
|
||||
MODULES_API_URL + '/booking/user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
modules/api/booking_____/user/model/index.ts
Normal file
49
modules/api/booking_____/user/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface User {
|
||||
//
|
||||
id?: number;
|
||||
// 用户唯一小程序id
|
||||
openId?: string;
|
||||
// 小程序用户秘钥
|
||||
sessionKey?: string;
|
||||
// 用户名
|
||||
username?: string;
|
||||
// 头像地址
|
||||
avatarUrl?: string;
|
||||
// 1男,2女
|
||||
gender?: string;
|
||||
// 国家
|
||||
country?: string;
|
||||
// 省份
|
||||
province?: string;
|
||||
// 城市
|
||||
city?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 积分
|
||||
integral?: string;
|
||||
// 余额
|
||||
money?: string;
|
||||
// 注册时间
|
||||
createTime?: number;
|
||||
//
|
||||
idcard?: string;
|
||||
//
|
||||
truename?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UserParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/userCard/index.ts
Normal file
106
modules/api/booking_____/userCard/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCard, UserCardParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询会员卡
|
||||
*/
|
||||
export async function pageUserCard(params: UserCardParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCard>>>(
|
||||
MODULES_API_URL + '/booking/user-card/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员卡列表
|
||||
*/
|
||||
export async function listUserCard(params?: UserCardParam) {
|
||||
const res = await request.get<ApiResult<UserCard[]>>(
|
||||
MODULES_API_URL + '/booking/user-card',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加会员卡
|
||||
*/
|
||||
export async function addUserCard(data: UserCard) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改会员卡
|
||||
*/
|
||||
export async function updateUserCard(data: UserCard) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员卡
|
||||
*/
|
||||
export async function removeUserCard(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除会员卡
|
||||
*/
|
||||
export async function removeBatchUserCard(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询会员卡
|
||||
*/
|
||||
export async function getUserCard(id: number) {
|
||||
const res = await request.get<ApiResult<UserCard>>(
|
||||
MODULES_API_URL + '/booking/user-card/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
109
modules/api/booking_____/userCard/model/index.ts
Normal file
109
modules/api/booking_____/userCard/model/index.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
export interface UserCard {
|
||||
//
|
||||
id?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// sid场馆id集合,适用的场馆
|
||||
sid?: string;
|
||||
// 用户id(旧)
|
||||
uid?: number;
|
||||
// vip卡id
|
||||
vid?: number;
|
||||
// 开卡人id
|
||||
aid?: number;
|
||||
// 微信订单号
|
||||
wechatOrder?: string;
|
||||
// 卡号
|
||||
code?: string;
|
||||
// 会员卡名称
|
||||
name?: string;
|
||||
// 真实姓名
|
||||
username?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// vip购卡价格
|
||||
price?: string;
|
||||
// 会员卡介绍
|
||||
desc?: string;
|
||||
// 会员卡说明
|
||||
info?: string;
|
||||
// vip卡折扣率
|
||||
discount?: string;
|
||||
// 使用次数
|
||||
count?: number;
|
||||
// 每使用一次减少的金额
|
||||
eachMoney?: string;
|
||||
// 剩余金额
|
||||
remainingMoney?: string;
|
||||
// 续费累加次数
|
||||
number?: number;
|
||||
// 剩余次数
|
||||
num?: number;
|
||||
// 付款状态,1已付款,2未付款
|
||||
status?: number;
|
||||
// 会员卡年限
|
||||
term?: number;
|
||||
// 月限
|
||||
month?: number;
|
||||
// IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡
|
||||
type?: number;
|
||||
// 卡类型:1成人卡,2儿童卡
|
||||
cardType?: number;
|
||||
// vip卡等级类型:1特殊vip卡,2普通vip卡
|
||||
vipType?: number;
|
||||
// 特殊卡开发凭证图
|
||||
pic?: string;
|
||||
// 价格组
|
||||
prices?: string;
|
||||
// 1微信支付,2支付宝支付,3现金,4POS机刷卡,15平安健康卡
|
||||
payType?: number;
|
||||
// 是否赠送积分:1赠送,2不赠送
|
||||
isIntegral?: number;
|
||||
// 是否已开具发票:1已开发票,2未开发票
|
||||
isInvoice?: number;
|
||||
// vip卡到期时间
|
||||
expireTime?: number;
|
||||
// 紧急联系人
|
||||
urgentName?: string;
|
||||
// 紧急联系人号码
|
||||
urgentPhone?: string;
|
||||
// 卡号
|
||||
cardNum?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 使用时间
|
||||
useTime?: number;
|
||||
// 创建时间
|
||||
createTime?: number;
|
||||
//
|
||||
updateTime?: number;
|
||||
// 身份证号码
|
||||
idCard?: string;
|
||||
// 备注
|
||||
remark?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员卡搜索条件
|
||||
*/
|
||||
export interface UserCardParam extends PageParam {
|
||||
id?: number;
|
||||
type?: number;
|
||||
typeName?: string;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
phone?: string;
|
||||
cardNum?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/userCardLog/index.ts
Normal file
106
modules/api/booking_____/userCardLog/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCardLog, UserCardLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询明细表
|
||||
*/
|
||||
export async function pageUserCardLog(params: UserCardLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCardLog>>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询明细表列表
|
||||
*/
|
||||
export async function listUserCardLog(params?: UserCardLogParam) {
|
||||
const res = await request.get<ApiResult<UserCardLog[]>>(
|
||||
MODULES_API_URL + '/booking/user-card-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加明细表
|
||||
*/
|
||||
export async function addUserCardLog(data: UserCardLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改明细表
|
||||
*/
|
||||
export async function updateUserCardLog(data: UserCardLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除明细表
|
||||
*/
|
||||
export async function removeUserCardLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除明细表
|
||||
*/
|
||||
export async function removeBatchUserCardLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询明细表
|
||||
*/
|
||||
export async function getUserCardLog(id: number) {
|
||||
const res = await request.get<ApiResult<UserCardLog>>(
|
||||
MODULES_API_URL + '/booking/user-card-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
modules/api/booking_____/userCardLog/model/index.ts
Normal file
49
modules/api/booking_____/userCardLog/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 明细表
|
||||
*/
|
||||
export interface UserCardLog {
|
||||
// 主键ID
|
||||
logId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡
|
||||
type?: number;
|
||||
// 变动金额
|
||||
money?: string;
|
||||
// 变动后余额
|
||||
balance?: string;
|
||||
// 管理员备注
|
||||
remark?: string;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 操作人ID
|
||||
adminId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户编码
|
||||
merchantCode?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细表搜索条件
|
||||
*/
|
||||
export interface UserCardLogParam extends PageParam {
|
||||
logId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/userCoupon/index.ts
Normal file
106
modules/api/booking_____/userCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserCoupon, UserCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询我的优惠券
|
||||
*/
|
||||
export async function pageUserCoupon(params: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserCoupon>>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的优惠券列表
|
||||
*/
|
||||
export async function listUserCoupon(params?: UserCouponParam) {
|
||||
const res = await request.get<ApiResult<UserCoupon[]>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加我的优惠券
|
||||
*/
|
||||
export async function addUserCoupon(data: UserCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改我的优惠券
|
||||
*/
|
||||
export async function updateUserCoupon(data: UserCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除我的优惠券
|
||||
*/
|
||||
export async function removeUserCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除我的优惠券
|
||||
*/
|
||||
export async function removeBatchUserCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询我的优惠券
|
||||
*/
|
||||
export async function getUserCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<UserCoupon>>(
|
||||
MODULES_API_URL + '/booking/user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
modules/api/booking_____/userCoupon/model/index.ts
Normal file
59
modules/api/booking_____/userCoupon/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 我的优惠券
|
||||
*/
|
||||
export interface UserCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠劵id
|
||||
couponId?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券类型(10满减券 20折扣券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: number;
|
||||
// 有效期结束时间
|
||||
endTime?: number;
|
||||
// 适用范围(10全部商品 20指定商品)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 是否已使用(0未使用 1已使用)
|
||||
isUse?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的优惠券搜索条件
|
||||
*/
|
||||
export interface UserCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/userInvoice/index.ts
Normal file
106
modules/api/booking_____/userInvoice/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { UserInvoice, UserInvoiceParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询发票
|
||||
*/
|
||||
export async function pageUserInvoice(params: UserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<UserInvoice>>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票列表
|
||||
*/
|
||||
export async function listUserInvoice(params?: UserInvoiceParam) {
|
||||
const res = await request.get<ApiResult<UserInvoice[]>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加发票
|
||||
*/
|
||||
export async function addUserInvoice(data: UserInvoice) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票
|
||||
*/
|
||||
export async function updateUserInvoice(data: UserInvoice) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票
|
||||
*/
|
||||
export async function removeUserInvoice(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除发票
|
||||
*/
|
||||
export async function removeBatchUserInvoice(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询发票
|
||||
*/
|
||||
export async function getUserInvoice(id: number) {
|
||||
const res = await request.get<ApiResult<UserInvoice>>(
|
||||
MODULES_API_URL + '/booking/user-invoice/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
modules/api/booking_____/userInvoice/model/index.ts
Normal file
53
modules/api/booking_____/userInvoice/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 发票
|
||||
*/
|
||||
export interface UserInvoice {
|
||||
// id
|
||||
id?: number;
|
||||
// 发票类型(0纸质 1电子)
|
||||
type?: number;
|
||||
// 发票名称
|
||||
name?: string;
|
||||
// 开票类型(0铺票 1专票)
|
||||
invoiceType?: string;
|
||||
// 税号
|
||||
invoiceCode?: string;
|
||||
// 公司地址
|
||||
address?: string;
|
||||
// 公司电话
|
||||
tel?: string;
|
||||
// 开户行
|
||||
bankName?: string;
|
||||
// 开户账号
|
||||
bankAccount?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 电子邮箱
|
||||
email?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0待使用, 1已使用, 2已失效
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票搜索条件
|
||||
*/
|
||||
export interface UserInvoiceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
modules/api/booking_____/users/index.ts
Normal file
106
modules/api/booking_____/users/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Users, UsersParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
export async function pageUsers(params: UsersParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Users>>>(
|
||||
MODULES_API_URL + '/booking/users/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
export async function listUsers(params?: UsersParam) {
|
||||
const res = await request.get<ApiResult<Users[]>>(
|
||||
MODULES_API_URL + '/booking/users',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
export async function addUsers(data: Users) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/users',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
export async function updateUsers(data: Users) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/users',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
export async function removeUsers(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/users/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
export async function removeBatchUsers(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/booking/users/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*/
|
||||
export async function getUsers(id: number) {
|
||||
const res = await request.get<ApiResult<Users>>(
|
||||
MODULES_API_URL + '/booking/users/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
modules/api/booking_____/users/model/index.ts
Normal file
49
modules/api/booking_____/users/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export interface Users {
|
||||
//
|
||||
id?: number;
|
||||
// 用户唯一小程序id
|
||||
openId?: string;
|
||||
// 小程序用户秘钥
|
||||
sessionKey?: string;
|
||||
// 用户名
|
||||
username?: string;
|
||||
// 头像地址
|
||||
avatarUrl?: string;
|
||||
// 1男,2女
|
||||
gender?: string;
|
||||
// 国家
|
||||
country?: string;
|
||||
// 省份
|
||||
province?: string;
|
||||
// 城市
|
||||
city?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 积分
|
||||
integral?: string;
|
||||
// 余额
|
||||
money?: string;
|
||||
// 注册时间
|
||||
createTime?: number;
|
||||
//
|
||||
idcard?: string;
|
||||
//
|
||||
truename?: string;
|
||||
// 是否管理员:1是;2否
|
||||
isAdmin?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface UsersParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
293
modules/views/bak/account/components/edit.vue
Normal file
293
modules/views/bak/account/components/edit.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
: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="username">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入登录账号"
|
||||
:disabled="isUpdate"
|
||||
v-model:value="form.username"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="手机号码" name="phone">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
:disabled="isUpdate && !isSuperAdmin"
|
||||
v-model:value="form.phone"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="密码" name="password" v-if="!isUpdate">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入登录密码"
|
||||
:disabled="isUpdate"
|
||||
v-model:value="form.password"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="真实姓名" name="realName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入真实姓名"
|
||||
v-model:value="form.realName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择角色" name="roles">
|
||||
<role-select v-model:value="form.roles" />
|
||||
</a-form-item>
|
||||
<a-form-item label="可管理场馆" name="merchantId">
|
||||
<MerchantSelect v-model:value="merchants" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch, computed } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import { addUser, updateUser } from '@/api/system/user';
|
||||
import { User } from '@/api/system/user/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
||||
import RoleSelect from './role-select.vue';
|
||||
import MerchantSelect from './merchant-select.vue';
|
||||
import { getMerchantId } from '@/utils/common';
|
||||
import { getMerchantName } from '@/utils/merchant';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { Merchant } from '@/api/shop/merchant/model';
|
||||
import { listMerchant } from '@/api/shop/merchant';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
// 当前用户信息
|
||||
const loginUser = computed(() => userStore.info ?? {});
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: User | 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 isSuperAdmin = ref<boolean>(false);
|
||||
const merchants = ref<Merchant[]>([]);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<User>({
|
||||
type: undefined,
|
||||
userId: undefined,
|
||||
username: '',
|
||||
nickname: '',
|
||||
realName: '',
|
||||
companyName: '',
|
||||
merchants: '',
|
||||
merchantId: getMerchantId(),
|
||||
merchantName: getMerchantName(),
|
||||
sex: undefined,
|
||||
roles: [],
|
||||
roleId: undefined,
|
||||
roleName: undefined,
|
||||
email: '',
|
||||
phone: '',
|
||||
mobile: '',
|
||||
password: '',
|
||||
introduction: '',
|
||||
organizationId: undefined,
|
||||
birthday: '',
|
||||
idCard: '',
|
||||
comments: '',
|
||||
gradeName: '',
|
||||
isAdmin: true,
|
||||
gradeId: undefined
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
merchantAccountName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写场馆账号名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
// merchantId: [
|
||||
// {
|
||||
// required: true,
|
||||
// type: 'string',
|
||||
// message: '请选择场馆',
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ],
|
||||
roles: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请选择角色',
|
||||
trigger: 'blur',
|
||||
validator: async (_rule: RuleObject) => {
|
||||
if (form.roles?.length == 0) {
|
||||
return Promise.reject('请选择角色');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
],
|
||||
username: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写登录账号',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写手机号码',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
password: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请输入登录密码',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
realName: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '请填写真实姓名',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
/* 搜索 */
|
||||
const chooseMerchantId = (item) => {
|
||||
form.merchantId = item.merchantId;
|
||||
form.merchantName = item.merchantName;
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form,
|
||||
merchants: merchants.value?.map((d) => d.merchantId).join(',')
|
||||
};
|
||||
if (getMerchantId()) {
|
||||
form.merchantId = getMerchantId();
|
||||
form.merchantName = getMerchantName();
|
||||
}
|
||||
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
||||
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 = [];
|
||||
merchants.value = [];
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
if (props.data.merchants) {
|
||||
listMerchant({ merchantIds: props.data.merchants }).then((list) => {
|
||||
merchants.value = list;
|
||||
});
|
||||
}
|
||||
// if (props.data.comments) {
|
||||
// listMerchant({ merchantCodes: props.data.comments }).then(
|
||||
// (list) => {
|
||||
// merchants.value = list;
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
resetFields();
|
||||
isUpdate.value = false;
|
||||
}
|
||||
const superAdmin = loginUser.value.roles?.filter(
|
||||
(d) => d.roleCode == 'superAdmin'
|
||||
);
|
||||
// 是否超级管理员
|
||||
if (superAdmin && superAdmin.length > 0) {
|
||||
isSuperAdmin.value = true;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
73
modules/views/bak/account/components/merchant-select.vue
Normal file
73
modules/views/bak/account/components/merchant-select.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<!-- 角色选择下拉框 -->
|
||||
<template>
|
||||
<a-select
|
||||
allow-clear
|
||||
mode="multiple"
|
||||
:value="merchantIds"
|
||||
:placeholder="placeholder"
|
||||
@update:value="updateValue"
|
||||
@blur="onBlur"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in data"
|
||||
:key="item.merchantId"
|
||||
:value="item.merchantId"
|
||||
>
|
||||
{{ item.merchantName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { Merchant } from '@/api/shop/merchant/model';
|
||||
import { listMerchant } from '@/api/shop/merchant';
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:value', value: Merchant[]): void;
|
||||
(e: 'blur'): void;
|
||||
}>();
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的商户
|
||||
value?: Merchant[];
|
||||
//
|
||||
placeholder?: string;
|
||||
}>(),
|
||||
{
|
||||
placeholder: '请选择场馆'
|
||||
}
|
||||
);
|
||||
|
||||
// 选中的角色id
|
||||
const merchantIds = computed(() =>
|
||||
props.value?.map((d) => d.merchantId as number)
|
||||
);
|
||||
|
||||
// 角色数据
|
||||
const data = ref<Merchant[]>([]);
|
||||
|
||||
/* 更新选中数据 */
|
||||
const updateValue = (value: number[]) => {
|
||||
emit(
|
||||
'update:value',
|
||||
value.map((v) => ({ merchantId: v }))
|
||||
);
|
||||
};
|
||||
|
||||
/* 获取角色数据 */
|
||||
listMerchant({})
|
||||
.then((list) => {
|
||||
data.value = list;
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
|
||||
/* 失去焦点 */
|
||||
const onBlur = () => {
|
||||
emit('blur');
|
||||
};
|
||||
</script>
|
||||
73
modules/views/bak/account/components/role-select.vue
Normal file
73
modules/views/bak/account/components/role-select.vue
Normal file
@@ -0,0 +1,73 @@
|
||||
<!-- 角色选择下拉框 -->
|
||||
<template>
|
||||
<a-select
|
||||
allow-clear
|
||||
mode="multiple"
|
||||
:value="roleIds"
|
||||
:placeholder="placeholder"
|
||||
@update:value="updateValue"
|
||||
@blur="onBlur"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="item in data"
|
||||
:key="item.roleId"
|
||||
:value="item.roleId"
|
||||
>
|
||||
{{ item.roleName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { listRoles } from '@/api/system/role';
|
||||
import type { Role } from '@/api/system/role/model';
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:value', value: Role[]): void;
|
||||
(e: 'blur'): void;
|
||||
}>();
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
value?: Role[];
|
||||
//
|
||||
placeholder?: string;
|
||||
}>(),
|
||||
{
|
||||
placeholder: '请选择角色'
|
||||
}
|
||||
);
|
||||
|
||||
// 选中的角色id
|
||||
const roleIds = computed(() => props.value?.map((d) => d.roleId as number));
|
||||
|
||||
// 角色数据
|
||||
const data = ref<Role[]>([]);
|
||||
|
||||
/* 更新选中数据 */
|
||||
const updateValue = (value: number[]) => {
|
||||
emit(
|
||||
'update:value',
|
||||
value.map((v) => ({ roleId: v }))
|
||||
);
|
||||
};
|
||||
|
||||
/* 获取角色数据 */
|
||||
listRoles()
|
||||
.then((list) => {
|
||||
data.value = list.filter(
|
||||
(d) => d.roleCode == 'merchant' || d.roleCode == 'merchantClerk'
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
|
||||
/* 失去焦点 */
|
||||
const onBlur = () => {
|
||||
emit('blur');
|
||||
};
|
||||
</script>
|
||||
70
modules/views/bak/account/components/search.vue
Normal file
70
modules/views/bak/account/components/search.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<!-- 搜索表单 -->
|
||||
<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-input-search
|
||||
allow-clear
|
||||
placeholder="请输入关键词"
|
||||
v-model:value="where.keywords"
|
||||
@pressEnter="search"
|
||||
@search="search"
|
||||
/>
|
||||
<!-- <a-button @click="reset">重置</a-button>-->
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import { watch } from 'vue';
|
||||
import useSearch from '@/utils/use-search';
|
||||
import { UserParam } from '@/api/system/user/model';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
// 选中的角色
|
||||
selection?: [];
|
||||
}>(),
|
||||
{}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'search', where?: UserParam): void;
|
||||
(e: 'add'): void;
|
||||
(e: 'remove'): void;
|
||||
(e: 'batchMove'): void;
|
||||
}>();
|
||||
|
||||
// 新增
|
||||
const add = () => {
|
||||
emit('add');
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
const { where, resetFields } = useSearch<UserParam>({
|
||||
userId: undefined,
|
||||
username: undefined,
|
||||
phone: undefined,
|
||||
realName: undefined,
|
||||
keywords: undefined
|
||||
});
|
||||
|
||||
const search = () => {
|
||||
emit('search', where);
|
||||
};
|
||||
|
||||
/* 重置 */
|
||||
const reset = () => {
|
||||
resetFields();
|
||||
search();
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.selection,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
241
modules/views/bak/account/index.vue
Normal file
241
modules/views/bak/account/index.vue
Normal file
@@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card title="管理员列表" :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
: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-else-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 === '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 v-if="record.username != 'admin'">
|
||||
<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>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<Edit 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 type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import Edit from './components/edit.vue';
|
||||
import { pageUsers, removeUser, removeUsers } from '@/api/system/user';
|
||||
import type { User, UserParam } from '@/api/system/user/model';
|
||||
import { getMerchantId } from '@/utils/common';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<User[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<User | 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;
|
||||
}
|
||||
where.isAdmin = true;
|
||||
where.merchantId = getMerchantId();
|
||||
return pageUsers({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '真实姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
dataIndex: 'roles',
|
||||
key: 'roles',
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// title: '可管理场馆',
|
||||
// dataIndex: 'merchantName',
|
||||
// key: 'merchantName',
|
||||
// align: 'center'
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
fixed: 'right',
|
||||
align: 'center',
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: UserParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: User) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: User) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeUser(row.userId)
|
||||
.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);
|
||||
removeUsers(selection.value.map((d) => d.userId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: User) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'User'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -0,0 +1,299 @@
|
||||
<!-- 编辑弹窗 -->
|
||||
<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="类型 0商城 1外卖" name="type">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入类型 0商城 1外卖"
|
||||
v-model:value="form.type"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="唯一标识" name="code">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入唯一标识"
|
||||
v-model:value="form.code"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品ID" name="goodsId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商品ID"
|
||||
v-model:value="form.goodsId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品名称" name="name">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商品名称"
|
||||
v-model:value="form.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品规格" name="spec">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商品规格"
|
||||
v-model:value="form.spec"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品价格" name="price">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商品价格"
|
||||
v-model:value="form.price"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品数量" name="cartNum">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商品数量"
|
||||
v-model:value="form.cartNum"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="单商品合计" name="totalPrice">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入单商品合计"
|
||||
v-model:value="form.totalPrice"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="0 = 未购买 1 = 已购买" name="isPay">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入0 = 未购买 1 = 已购买"
|
||||
v-model:value="form.isPay"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否为立即购买" name="isNew">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否为立即购买"
|
||||
v-model:value="form.isNew"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="是否选中" name="selected">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入是否选中"
|
||||
v-model:value="form.selected"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="商户ID" name="merchantId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入商户ID"
|
||||
v-model:value="form.merchantId"
|
||||
/>
|
||||
</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="用户ID" name="userId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入用户ID"
|
||||
v-model:value="form.userId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="收银员ID" name="cashierId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入收银员ID"
|
||||
v-model:value="form.cashierId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="分组取单" name="groupId">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入分组取单"
|
||||
v-model:value="form.groupId"
|
||||
/>
|
||||
</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 { addBookingCashier, updateBookingCashier } from '@/api/booking/bookingCashier';
|
||||
import { BookingCashier } from '@/api/booking/bookingCashier/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?: BookingCashier | 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<BookingCashier>({
|
||||
id: undefined,
|
||||
type: undefined,
|
||||
code: undefined,
|
||||
goodsId: undefined,
|
||||
name: undefined,
|
||||
spec: undefined,
|
||||
price: undefined,
|
||||
cartNum: undefined,
|
||||
totalPrice: undefined,
|
||||
isPay: undefined,
|
||||
isNew: undefined,
|
||||
selected: undefined,
|
||||
merchantId: undefined,
|
||||
comments: undefined,
|
||||
userId: undefined,
|
||||
cashierId: undefined,
|
||||
groupId: undefined,
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
bookingCashierId: undefined,
|
||||
bookingCashierName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
bookingCashierName: [
|
||||
{
|
||||
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 ? updateBookingCashier : addBookingCashier;
|
||||
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
modules/views/bak/bookingCashier/components/search.vue
Normal file
42
modules/views/bak/bookingCashier/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>
|
||||
317
modules/views/bak/bookingCashier/index.vue
Normal file
317
modules/views/bak/bookingCashier/index.vue
Normal file
@@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="bookingCashierId"
|
||||
: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>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<BookingCashierEdit 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 BookingCashierEdit from './components/bookingCashierEdit.vue';
|
||||
import { pageBookingCashier, removeBookingCashier, removeBatchBookingCashier } from '@/api/booking/bookingCashier';
|
||||
import type { BookingCashier, BookingCashierParam } from '@/api/booking/bookingCashier/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<BookingCashier[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<BookingCashier | 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 pageBookingCashier({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: '收银单ID',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
title: '类型 0商城 1外卖',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '唯一标识',
|
||||
dataIndex: 'code',
|
||||
key: 'code',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商品ID',
|
||||
dataIndex: 'goodsId',
|
||||
key: 'goodsId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商品名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商品规格',
|
||||
dataIndex: 'spec',
|
||||
key: 'spec',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商品价格',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商品数量',
|
||||
dataIndex: 'cartNum',
|
||||
key: 'cartNum',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '单商品合计',
|
||||
dataIndex: 'totalPrice',
|
||||
key: 'totalPrice',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '0 = 未购买 1 = 已购买',
|
||||
dataIndex: 'isPay',
|
||||
key: 'isPay',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '是否为立即购买',
|
||||
dataIndex: 'isNew',
|
||||
key: 'isNew',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '是否选中',
|
||||
dataIndex: 'selected',
|
||||
key: 'selected',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '商户ID',
|
||||
dataIndex: 'merchantId',
|
||||
key: 'merchantId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '收银员ID',
|
||||
dataIndex: 'cashierId',
|
||||
key: 'cashierId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '分组取单',
|
||||
dataIndex: 'groupId',
|
||||
key: 'groupId',
|
||||
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?: BookingCashierParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: BookingCashier) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: BookingCashier) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBookingCashier(row.bookingCashierId)
|
||||
.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);
|
||||
removeBatchBookingCashier(selection.value.map((d) => d.bookingCashierId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: BookingCashier) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'BookingCashier'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
178
modules/views/bak/cardDict/components/dict-edit.vue
Normal file
178
modules/views/bak/cardDict/components/dict-edit.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<!-- 分类编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="460"
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
:title="isUpdate ? '修改类型' : '添加类型'"
|
||||
:body-style="{ paddingBottom: '8px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="styleResponsive ? { md: 5, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||
:wrapper-col="
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="标识" name="dictCode">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="20"
|
||||
disabled
|
||||
placeholder="请输入分类标识"
|
||||
v-model:value="form.dictCode"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="类型名称" name="dictDataName">
|
||||
<a-input
|
||||
allow-clear
|
||||
:maxlength="20"
|
||||
placeholder="请输入类型名称"
|
||||
v-model:value="form.dictDataName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="99999"
|
||||
class="ele-fluid"
|
||||
placeholder="请输入排序号"
|
||||
v-model:value="form.sortNumber"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
:maxlength="200"
|
||||
placeholder="请输入备注"
|
||||
v-model:value="form.comments"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import useFormData from '@/utils/use-form-data';
|
||||
import { addDictData, updateDictData } from '@/api/system/dict-data';
|
||||
import { DictData } from '@/api/system/dict-data/model';
|
||||
import { removeSiteInfoCache } from '@/api/cms/website';
|
||||
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: DictData | null;
|
||||
// 字典ID
|
||||
dictId?: number | 0;
|
||||
}>();
|
||||
|
||||
//
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
|
||||
// 表单数据
|
||||
const { form, resetFields, assignFields } = useFormData<DictData>({
|
||||
dictId: undefined,
|
||||
dictDataId: undefined,
|
||||
dictDataName: '',
|
||||
dictCode: 'cardPlanId',
|
||||
dictDataCode: '',
|
||||
sortNumber: 100,
|
||||
comments: ''
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive<Record<string, Rule[]>>({
|
||||
dictDataCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入分类名称',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
dictCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入分类标识',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const saveOrUpdate = isUpdate.value ? updateDictData : addDictData;
|
||||
form.dictDataCode = form.dictDataName;
|
||||
form.dictId = props.dictId;
|
||||
saveOrUpdate(form)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
// 清除字典缓存
|
||||
removeSiteInfoCache(form.dictCode + ':' + form.tenantId);
|
||||
updateVisible(false);
|
||||
emit('done');
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.value = false;
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
assignFields(props.data);
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
formRef.value?.clearValidate();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
176
modules/views/bak/cardDict/index.vue
Normal file
176
modules/views/bak/cardDict/index.vue
Normal file
@@ -0,0 +1,176 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false">
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="dictDataId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
:scroll="{ x: 800 }"
|
||||
cache-key="proSystemRoleTable"
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space>
|
||||
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
|
||||
<template #icon>
|
||||
<plus-outlined />
|
||||
</template>
|
||||
<span>新建</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-popconfirm
|
||||
placement="topRight"
|
||||
title="确定要删除此分类吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a class="ele-text-danger">删除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
<!-- 编辑弹窗 -->
|
||||
<dict-edit
|
||||
v-model:visible="showEdit"
|
||||
:dictId="dictId"
|
||||
:data="current"
|
||||
@done="reload"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro/es';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import { messageLoading } from 'ele-admin-pro/es';
|
||||
import DictEdit from './components/dict-edit.vue';
|
||||
import { pageDictData, removeDictData } from '@/api/system/dict-data';
|
||||
import { DictParam } from '@/api/system/dict/model';
|
||||
import { DictData } from '@/api/system/dict-data/model';
|
||||
import { addDict, listDictionaries } from '@/api/system/dict';
|
||||
import { Dictionary } from '@/api/system/dictionary/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
const dictId = ref(0);
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'dictDataId',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
title: '类型名称',
|
||||
dataIndex: 'dictDataName',
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'comments',
|
||||
sorter: true,
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '排序号',
|
||||
width: 180,
|
||||
align: 'center',
|
||||
dataIndex: 'sortNumber'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 180,
|
||||
align: 'center'
|
||||
}
|
||||
]);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<DictData[]>([]);
|
||||
|
||||
// 当前编辑数据
|
||||
const current = ref<Dictionary | null>(null);
|
||||
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||
where.dictCode = 'cardPlanId';
|
||||
return pageDictData({ ...where, ...orders, page, limit });
|
||||
};
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: DictParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ page: 1, where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: DictData) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: DictData) => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
removeDictData(row.dictDataId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
// 初始化字典
|
||||
const loadDict = () => {
|
||||
listDictionaries({ dictCode: 'cardPlanId' }).then(async (data) => {
|
||||
if (data?.length == 0) {
|
||||
await addDict({ dictCode: 'cardPlanId', dictName: '会员卡类型' });
|
||||
}
|
||||
await listDictionaries({ dictCode: 'cardPlanId' }).then((list) => {
|
||||
list?.map((d) => {
|
||||
dictId.value = Number(d.dictId);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
loadDict();
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: DictData) => {
|
||||
return {
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'CardPlanDict'
|
||||
};
|
||||
</script>
|
||||
190
modules/views/bak/cashier/components/cashier.vue
Normal file
190
modules/views/bak/cashier/components/cashier.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<a-card
|
||||
:title="`收银员:${loginUser?.realName}`"
|
||||
:bordered="false"
|
||||
:body-style="{ minHeight: '60vh', width: '380px', padding: '0' }"
|
||||
:head-style="{ className: 'bg-gray-500' }"
|
||||
>
|
||||
<template #extra>
|
||||
<a-button danger @click="removeAll" size="small">整单取消</a-button>
|
||||
</template>
|
||||
<div class="goods-list overflow-x-hidden px-3 h-[600px]">
|
||||
<a-empty v-if="cashier?.totalNums === 0" :image="simpleImage" />
|
||||
<a-spin :spinning="spinning">
|
||||
<template v-for="(item, index) in cashier?.cashiers" :key="index">
|
||||
<div class="goods-item py-4 flex">
|
||||
<div class="goods-image" v-if="item.image">
|
||||
<a-avatar :src="item.image" shape="square" :size="42" />
|
||||
</div>
|
||||
<div class="goods-info w-full ml-2">
|
||||
<div class="goods-bar flex justify-between">
|
||||
<div class="goods-name flex-1">{{ item.name }}</div>
|
||||
</div>
|
||||
<div class="spec text-gray-400">{{ item.spec }}</div>
|
||||
<div class="goods-price flex justify-between items-center">
|
||||
<div class="flex">
|
||||
<div class="price text-red-500">¥{{ item.price }}</div>
|
||||
<div class="total-num ml-5 text-gray-400"
|
||||
>x {{ item.cartNum }}</div
|
||||
>
|
||||
</div>
|
||||
<div class="add flex items-center text-gray-500">
|
||||
<MinusCircleOutlined class="text-xl" @click="subNum(item)" />
|
||||
<div class="block text-center px-3">{{ item.cartNum }}</div>
|
||||
<PlusCircleOutlined class="text-xl" @click="addNum(item)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="total-nums"> </div>
|
||||
</div>
|
||||
<a-divider dashed />
|
||||
</template>
|
||||
</a-spin>
|
||||
</div>
|
||||
<template #actions>
|
||||
<div class="flex flex-col">
|
||||
<div class="text-left pb-4 pl-4 text-gray-500"
|
||||
>共计 {{ cashier.totalNums }} 件,已优惠:¥0.00
|
||||
</div>
|
||||
<div class="flex justify-between px-2">
|
||||
<a-button size="large" class="w-full mx-1" @click="getListByGroup"
|
||||
>取单</a-button
|
||||
>
|
||||
<a-button size="large" class="w-full mx-1" @click="onPack"
|
||||
>挂单</a-button
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
class="w-full mx-1"
|
||||
size="large"
|
||||
@click="onPay"
|
||||
>收款¥{{ formatNumber(cashier.totalPrice) }}
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {
|
||||
DeleteOutlined,
|
||||
PlusCircleOutlined,
|
||||
MinusCircleOutlined,
|
||||
ExclamationCircleOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { ref, watch, createVNode } from 'vue';
|
||||
import { Cashier, CashierVo } from '@/api/shop/cashier/model';
|
||||
import { User } from '@/api/system/user/model';
|
||||
import { formatNumber } from 'ele-admin-pro/es';
|
||||
import {
|
||||
subCartNum,
|
||||
addCartNum,
|
||||
removeBatchCashier,
|
||||
removeCashier,
|
||||
packCashier
|
||||
} from '@/api/shop/cashier';
|
||||
import { Empty, Modal, message } from 'ant-design-vue';
|
||||
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
value?: string;
|
||||
placeholder?: string;
|
||||
loginUser?: User;
|
||||
cashier?: CashierVo;
|
||||
count?: number;
|
||||
spinning?: boolean;
|
||||
}>(),
|
||||
{
|
||||
placeholder: undefined
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'reload'): void;
|
||||
(e: 'group'): void;
|
||||
(e: 'pay'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
const cashiers = ref<Cashier[]>([]);
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const onPay = () => {
|
||||
emit('pay');
|
||||
};
|
||||
|
||||
const subNum = (row: Cashier) => {
|
||||
if (row.cartNum === 1) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除该商品吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeCashier(row?.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
emit('reload');
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
subCartNum(row).then(() => {
|
||||
emit('reload');
|
||||
});
|
||||
};
|
||||
|
||||
const addNum = (row: Cashier) => {
|
||||
addCartNum(row).then(() => {
|
||||
emit('reload');
|
||||
});
|
||||
};
|
||||
|
||||
const removeAll = () => {
|
||||
const ids = props.cashier?.cashiers?.map((d) => d.id);
|
||||
if (ids) {
|
||||
removeBatchCashier(ids)
|
||||
.then(() => {})
|
||||
.finally(() => {
|
||||
emit('reload');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 取单
|
||||
const getListByGroup = () => {
|
||||
emit('group');
|
||||
};
|
||||
|
||||
// 挂单
|
||||
const onPack = () => {
|
||||
cashiers.value =
|
||||
props.cashier?.cashiers?.map((d) => {
|
||||
return {
|
||||
id: d.id,
|
||||
groupId: Number(d.groupId) + 1
|
||||
};
|
||||
}) || [];
|
||||
if (cashiers.value.length === 0) {
|
||||
return false;
|
||||
}
|
||||
packCashier(cashiers.value).then((res) => {
|
||||
emit('reload');
|
||||
});
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.count,
|
||||
() => {}
|
||||
);
|
||||
</script>
|
||||
252
modules/views/bak/cashier/components/goods.vue
Normal file
252
modules/views/bak/cashier/components/goods.vue
Normal file
@@ -0,0 +1,252 @@
|
||||
<template>
|
||||
<a-card
|
||||
class="w-full relative"
|
||||
:bordered="false"
|
||||
:body-style="{ padding: '16px' }"
|
||||
>
|
||||
<a-spin :spinning="spinning">
|
||||
<div class="flex leading-7 mb-6">
|
||||
<div class="w-[202px] text-gray-500">选择场馆:</div>
|
||||
<div class="list">
|
||||
<a-radio-group v-model:value="where.merchantId" button-style="solid">
|
||||
<a-radio-button
|
||||
v-for="(item, index) in category"
|
||||
:key="index"
|
||||
:value="item.merchantId"
|
||||
@click="onMerchant(item)"
|
||||
>{{ item.merchantName }}</a-radio-button
|
||||
>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex leading-7 mb-6">
|
||||
<div class="w-[138px] text-gray-500">预定日期:</div>
|
||||
<div class="list">
|
||||
<a-radio-group v-model:value="where.dateTime" button-style="solid">
|
||||
<a-radio-button
|
||||
v-for="(item, index) in next7day"
|
||||
:key="index"
|
||||
:value="item.dateTime"
|
||||
>{{ item.label }}</a-radio-button
|
||||
>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="flex leading-7 mb-6">-->
|
||||
<!-- <div class="w-[138px] text-gray-500">选择时段:</div>-->
|
||||
<!-- <div class="list">-->
|
||||
<!-- <a-radio-group v-model:value="where.timePeriod">-->
|
||||
<!-- <a-radio-button-->
|
||||
<!-- v-for="(item, index) in periods"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- :value="item.merchantId"-->
|
||||
<!-- @click="onMerchant(item)"-->
|
||||
<!-- >{{ item.timePeriod }}</a-radio-button-->
|
||||
<!-- >-->
|
||||
<!-- </a-radio-group>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="flex leading-7 mb-6">
|
||||
<div class="w-[138px] text-gray-500">选择场地:</div>
|
||||
<div class="list flex-1">
|
||||
<template v-for="(item, index) in periodList" :key="index">
|
||||
<div class="time-period leading-7 text-gray-500 mb-2">
|
||||
<a-tag color="blue">
|
||||
<template #icon>
|
||||
<ClockCircleOutlined />
|
||||
</template>
|
||||
{{ item.timePeriod }}</a-tag
|
||||
>
|
||||
</div>
|
||||
<div class="field-list flex flex-wrap mb-2">
|
||||
<a-button
|
||||
class="w-[140px]"
|
||||
v-for="(field, fieldIndex) in item.fieldList"
|
||||
:key="fieldIndex"
|
||||
:disabled="field.sold"
|
||||
@click="add(field, item.timePeriod)"
|
||||
>
|
||||
<div class="flex justify-between">
|
||||
<text>{{ field.fieldName }}</text>
|
||||
<text>¥{{ item.price }}</text>
|
||||
</div>
|
||||
</a-button>
|
||||
</div>
|
||||
</template>
|
||||
<!-- <div class="h-20 flex items-center m-auto w-full justify-center">-->
|
||||
<!-- <a-pagination-->
|
||||
<!-- v-model:current="page"-->
|
||||
<!-- :total="count"-->
|
||||
<!-- show-less-items-->
|
||||
<!-- @change="reload"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
</a-spin>
|
||||
<!-- 编辑弹窗 -->
|
||||
<SpecForm
|
||||
v-model:visible="showSpecForm"
|
||||
:data="current"
|
||||
@done="addSpecField"
|
||||
/>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import {
|
||||
ShoppingCartOutlined,
|
||||
ClockCircleOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import SpecForm from './specForm.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { User } from '@/api/system/user/model';
|
||||
import { listMerchant } from '@/api/shop/merchant';
|
||||
import { getNext7day, getServerTime } from '@/api/layout';
|
||||
import { getWeek } from '@/utils/common';
|
||||
import { listPeriod, pagePeriod } from '@/api/booking/period';
|
||||
import { Period, PeriodParam } from '@/api/booking/period/model';
|
||||
import { Merchant } from '@/api/shop/merchant/model';
|
||||
import { Field } from '@/api/booking/field/model';
|
||||
import { addCashier } from '@/api/shop/cashier';
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
value?: string;
|
||||
placeholder?: string;
|
||||
loginUser?: User;
|
||||
}>(),
|
||||
{
|
||||
placeholder: undefined
|
||||
}
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'reload'): void;
|
||||
}>();
|
||||
|
||||
// 搜索表单
|
||||
const where = reactive<PeriodParam>({
|
||||
merchantId: undefined,
|
||||
merchantName: undefined,
|
||||
dateTime: undefined,
|
||||
week: undefined,
|
||||
half: 0,
|
||||
isStatus: 0,
|
||||
startTime: undefined,
|
||||
timePeriod: undefined
|
||||
});
|
||||
|
||||
// 加载中状态
|
||||
const spinning = ref<boolean>(true);
|
||||
// 当前编辑数据
|
||||
const current = ref<Field | null>(null);
|
||||
const form = ref<Field>({});
|
||||
const category = ref<Merchant[]>([]);
|
||||
const periods = ref<Period[]>([]);
|
||||
const periodList = ref<Period[] | null>();
|
||||
const specs = ref<string>();
|
||||
const showSpecForm = ref<boolean>(false);
|
||||
const next7day = ref<any[]>();
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openSpecForm = (row?: Field) => {
|
||||
current.value = row ?? null;
|
||||
showSpecForm.value = true;
|
||||
};
|
||||
|
||||
const add = (row?: Field, timePeriod?: string) => {
|
||||
if (row?.merchantId == 3028) {
|
||||
form.value = row;
|
||||
form.value.cartNum = 1;
|
||||
openSpecForm(row);
|
||||
return false;
|
||||
}
|
||||
console.log(row);
|
||||
addCashier({
|
||||
goodsId: row?.fieldId,
|
||||
name: `${where.merchantName} ${row?.fieldName}`,
|
||||
price: row?.price,
|
||||
spec: `${where.dateTime} ${getWeek(where.week)} ${timePeriod}`,
|
||||
cartNum: 1,
|
||||
isNew: true,
|
||||
selected: true,
|
||||
merchantId: row?.merchantId
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
emit('reload');
|
||||
})
|
||||
.catch(() => {
|
||||
message.error('该场地已有人预定');
|
||||
});
|
||||
};
|
||||
|
||||
const addSpecField = () => {
|
||||
emit('reload');
|
||||
};
|
||||
|
||||
const onMerchant = (e) => {
|
||||
where.merchantId = e.merchantId;
|
||||
reload();
|
||||
};
|
||||
|
||||
const reload = async () => {
|
||||
spinning.value = true;
|
||||
await getNext7day().then((list) => {
|
||||
next7day.value = list.map((d: any, i) => {
|
||||
if (where.dateTime == undefined) {
|
||||
where.dateTime = d.dateTime;
|
||||
}
|
||||
if (where.week == undefined) {
|
||||
where.week = d.week;
|
||||
}
|
||||
d.label = `${getWeek(d.week)}(${d.date})`;
|
||||
return d;
|
||||
});
|
||||
});
|
||||
await listMerchant({}).then((list) => {
|
||||
category.value = list;
|
||||
if (where.merchantId == undefined) {
|
||||
where.merchantId = list[0].merchantId;
|
||||
where.merchantName = list[0].merchantName;
|
||||
}
|
||||
});
|
||||
await getServerTime().then((res) => {
|
||||
if (where.merchantId != 3028) {
|
||||
where.startTime = res.hourMinute;
|
||||
}
|
||||
});
|
||||
// await pagePeriod({ merchantId: where.merchantId }).then((res) => {
|
||||
// if (res?.list) {
|
||||
// periods.value = res.list;
|
||||
// }
|
||||
// });
|
||||
await listPeriod(where)
|
||||
.then((list) => {
|
||||
periodList.value = list;
|
||||
})
|
||||
.catch(() => {
|
||||
periodList.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
spinning.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
reload();
|
||||
|
||||
watch(currentRoute, () => {}, { immediate: true });
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'PeriodField'
|
||||
};
|
||||
</script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user