From e3fb9ba2835e3986bb0a963173929e87173b0de8 Mon Sep 17 00:00:00 2001 From: gxwebsoft Date: Sat, 1 Jun 2024 02:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/booking/card/model/index.ts | 6 + src/api/booking/userCard/index.ts | 106 ++++ src/api/booking/userCard/model/index.ts | 109 ++++ src/api/booking/userCardLog/index.ts | 106 ++++ src/api/booking/userCardLog/model/index.ts | 49 ++ src/api/cms/mp-menu/model/index.ts | 2 + src/api/shop/merchant/model/index.ts | 4 + src/api/shop/order/model/index.ts | 4 + src/api/system/user/model/index.ts | 3 + src/components/DictSelect/index.vue | 8 +- src/layout/components/header-tools.vue | 54 +- src/layout/components/merchant-select.vue | 54 ++ src/views/booking/account/components/edit.vue | 61 ++- .../account/components/merchant-select.vue | 73 +++ .../booking/account/components/search.vue | 32 +- src/views/booking/account/index.vue | 24 +- .../booking/card/components/cardEdit.vue | 134 ++++- src/views/booking/card/components/search.vue | 20 +- src/views/booking/card/index.vue | 8 +- src/views/booking/field/list.vue | 1 + .../booking/integral/components/search.vue | 39 +- src/views/booking/integral/index.vue | 42 +- .../booking/order/components/orderInfo.vue | 1 + src/views/booking/order/components/search.vue | 14 +- src/views/booking/order/index.vue | 1 + .../school/components/merchantEdit.vue | 31 +- src/views/booking/school/index.vue | 6 + .../booking/userCard/components/search.vue | 104 ++++ .../userCard/components/userCardEdit.vue | 492 +++++++++++++++++ src/views/booking/userCard/index.vue | 505 ++++++++++++++++++ .../components/search.vue | 29 +- .../components/userCardLogEdit.vue} | 215 +++----- .../{users.bak => userCardLog}/index.vue | 212 ++++---- .../mp-weixin/user/components/mpMenuEdit.vue | 26 + .../cms/mp-weixin/user/components/search.vue | 3 +- src/views/cms/mp-weixin/user/index.vue | 13 +- 36 files changed, 2161 insertions(+), 430 deletions(-) create mode 100644 src/api/booking/userCard/index.ts create mode 100644 src/api/booking/userCard/model/index.ts create mode 100644 src/api/booking/userCardLog/index.ts create mode 100644 src/api/booking/userCardLog/model/index.ts create mode 100644 src/layout/components/merchant-select.vue create mode 100644 src/views/booking/account/components/merchant-select.vue create mode 100644 src/views/booking/userCard/components/search.vue create mode 100644 src/views/booking/userCard/components/userCardEdit.vue create mode 100644 src/views/booking/userCard/index.vue rename src/views/booking/{users.bak => userCardLog}/components/search.vue (51%) rename src/views/booking/{users.bak/components/userEdit.vue => userCardLog/components/userCardLogEdit.vue} (52%) rename src/views/booking/{users.bak => userCardLog}/index.vue (58%) diff --git a/src/api/booking/card/model/index.ts b/src/api/booking/card/model/index.ts index aebd79c..4aba8f0 100644 --- a/src/api/booking/card/model/index.ts +++ b/src/api/booking/card/model/index.ts @@ -10,6 +10,10 @@ export interface Card { cardName?: string; // 会员卡标识 cardCode?: string; + // 会员卡类型 + type?: string; + // 成人儿童 + cardType?: number; // 会员卡图片 image?: string; // 价格 @@ -30,6 +34,8 @@ export interface Card { merchantName?: string; // 商户类型 merchantType?: string; + // 可使用的场馆ID + merchantIds?: string; // 备注 comments?: string; // 状态 diff --git a/src/api/booking/userCard/index.ts b/src/api/booking/userCard/index.ts new file mode 100644 index 0000000..cabf425 --- /dev/null +++ b/src/api/booking/userCard/index.ts @@ -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>>( + 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>( + 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>( + 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>( + 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>( + 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>( + 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>( + 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)); +} diff --git a/src/api/booking/userCard/model/index.ts b/src/api/booking/userCard/model/index.ts new file mode 100644 index 0000000..6752e94 --- /dev/null +++ b/src/api/booking/userCard/model/index.ts @@ -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; +} diff --git a/src/api/booking/userCardLog/index.ts b/src/api/booking/userCardLog/index.ts new file mode 100644 index 0000000..abb916e --- /dev/null +++ b/src/api/booking/userCardLog/index.ts @@ -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>>( + 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>( + 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>( + 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>( + 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>( + 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>( + 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>( + 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)); +} diff --git a/src/api/booking/userCardLog/model/index.ts b/src/api/booking/userCardLog/model/index.ts new file mode 100644 index 0000000..59c772a --- /dev/null +++ b/src/api/booking/userCardLog/model/index.ts @@ -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; +} diff --git a/src/api/cms/mp-menu/model/index.ts b/src/api/cms/mp-menu/model/index.ts index bcc7175..0427e64 100644 --- a/src/api/cms/mp-menu/model/index.ts +++ b/src/api/cms/mp-menu/model/index.ts @@ -50,6 +50,8 @@ export interface MpMenu { goodsId?: number; // 用户ID userId?: number; + // 是否管理人员可见 + adminShow?: number; // 设为首页 home?: number; // 排序(数字越小越靠前) diff --git a/src/api/shop/merchant/model/index.ts b/src/api/shop/merchant/model/index.ts index ce7c7fb..cc41b7d 100644 --- a/src/api/shop/merchant/model/index.ts +++ b/src/api/shop/merchant/model/index.ts @@ -17,6 +17,8 @@ export interface Merchant { realName?: string; // 店铺类型 shopType?: string; + // 项目类型 + itemType?: string; // 商户分类 category?: string; // 商户坐标 @@ -75,5 +77,7 @@ export interface Merchant { */ export interface MerchantParam extends PageParam { merchantId?: number; + merchantIds?: string; + merchantCodes?: string; keywords?: string; } diff --git a/src/api/shop/order/model/index.ts b/src/api/shop/order/model/index.ts index 55a77df..6bacdf9 100644 --- a/src/api/shop/order/model/index.ts +++ b/src/api/shop/order/model/index.ts @@ -7,6 +7,10 @@ import { OrderInfo } from '@/api/shop/orderInfo/model'; export interface Order { // 订单号 orderId?: number; + // 订单类型 + type?: number; + // 下单渠道 + channel?: number; // 订单编号 orderNo?: string; // 微信支付订单号 diff --git a/src/api/system/user/model/index.ts b/src/api/system/user/model/index.ts index e775093..51a6115 100644 --- a/src/api/system/user/model/index.ts +++ b/src/api/system/user/model/index.ts @@ -2,6 +2,7 @@ import type { PageParam } from '@/api'; import type { Role } from '../../role/model'; import type { Menu } from '../../menu/model'; import { Company } from '@/api/system/company/model'; +import { Merchant } from "@/api/shop/merchant/model"; /** * 用户 @@ -65,6 +66,8 @@ export interface User { deliveryTime?: string; receiptTime?: string; merchantId?: number; + // 可管理的商户 + merchants?: string; // 创建时间 createTime?: string; // 租户ID diff --git a/src/components/DictSelect/index.vue b/src/components/DictSelect/index.vue index eaec11d..b7515e0 100644 --- a/src/components/DictSelect/index.vue +++ b/src/components/DictSelect/index.vue @@ -9,6 +9,7 @@ :placeholder="placeholder" @update:value="updateValue" :style="`width: ${width}px`" + @change="change" @blur="onBlur" /> @@ -20,6 +21,7 @@ (e: 'update:value', value: string): void; (e: 'index', index: number): void; (e: 'blur'): void; + (e: 'done', item: any): void; }>(); const props = withDefaults( @@ -42,12 +44,16 @@ /* 更新选中数据 */ const updateValue = (value: string) => { - console.log(value); emit('update:value', value); emit('index', Number(props.index)); }; + /* 失去焦点 */ const onBlur = () => { emit('blur'); }; + + const change = (e, item) => { + emit('done', item); + }; diff --git a/src/layout/components/header-tools.vue b/src/layout/components/header-tools.vue index 934ea95..63116f3 100644 --- a/src/layout/components/header-tools.vue +++ b/src/layout/components/header-tools.vue @@ -19,19 +19,16 @@ - @@ -83,9 +71,12 @@ 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(); @@ -118,6 +109,7 @@ const formRef = ref(null); const images = ref([]); const isSuperAdmin = ref(false); + const merchants = ref([]); // 用户信息 const form = reactive({ @@ -127,6 +119,7 @@ nickname: '', realName: '', companyName: '', + merchants: '', merchantId: getMerchantId(), merchantName: getMerchantName(), sex: undefined, @@ -162,14 +155,14 @@ trigger: 'blur' } ], - merchantId: [ - { - required: true, - type: 'number', - message: '请选择场馆', - trigger: 'blur' - } - ], + // merchantId: [ + // { + // required: true, + // type: 'string', + // message: '请选择场馆', + // trigger: 'blur' + // } + // ], roles: [ { required: true, @@ -236,7 +229,8 @@ .then(() => { loading.value = true; const formData = { - ...form + ...form, + merchants: merchants.value?.map((d) => d.merchantId).join(',') }; if (getMerchantId()) { form.merchantId = getMerchantId(); @@ -263,8 +257,21 @@ (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(); diff --git a/src/views/booking/account/components/merchant-select.vue b/src/views/booking/account/components/merchant-select.vue new file mode 100644 index 0000000..f3a7d07 --- /dev/null +++ b/src/views/booking/account/components/merchant-select.vue @@ -0,0 +1,73 @@ + + + + diff --git a/src/views/booking/account/components/search.vue b/src/views/booking/account/components/search.vue index 82fea9d..22a1182 100644 --- a/src/views/booking/account/components/search.vue +++ b/src/views/booking/account/components/search.vue @@ -7,13 +7,22 @@ 添加 + + 重置 diff --git a/src/views/booking/userCard/components/userCardEdit.vue b/src/views/booking/userCard/components/userCardEdit.vue new file mode 100644 index 0000000..5a56aa1 --- /dev/null +++ b/src/views/booking/userCard/components/userCardEdit.vue @@ -0,0 +1,492 @@ + + + + diff --git a/src/views/booking/userCard/index.vue b/src/views/booking/userCard/index.vue new file mode 100644 index 0000000..eebf59e --- /dev/null +++ b/src/views/booking/userCard/index.vue @@ -0,0 +1,505 @@ + + + + + + + diff --git a/src/views/booking/users.bak/components/search.vue b/src/views/booking/userCardLog/components/search.vue similarity index 51% rename from src/views/booking/users.bak/components/search.vue rename to src/views/booking/userCardLog/components/search.vue index aaa3a5f..82fea9d 100644 --- a/src/views/booking/users.bak/components/search.vue +++ b/src/views/booking/userCardLog/components/search.vue @@ -1,20 +1,19 @@ diff --git a/src/views/cms/mp-weixin/user/components/mpMenuEdit.vue b/src/views/cms/mp-weixin/user/components/mpMenuEdit.vue index c252a50..540f4f8 100644 --- a/src/views/cms/mp-weixin/user/components/mpMenuEdit.vue +++ b/src/views/cms/mp-weixin/user/components/mpMenuEdit.vue @@ -57,6 +57,27 @@ v-model:value="form.target" /> + + + 会员功能 + 订单管理 + 首页导航 + 商城导航 + 管理中心 + + + + + { + form.adminShow = value ? 1 : 0; + }; + // 预设颜色 const predefineColors = ref([ '#40a9ff', diff --git a/src/views/cms/mp-weixin/user/components/search.vue b/src/views/cms/mp-weixin/user/components/search.vue index 837060e..cbe4e52 100644 --- a/src/views/cms/mp-weixin/user/components/search.vue +++ b/src/views/cms/mp-weixin/user/components/search.vue @@ -12,7 +12,8 @@ >菜单类型 - 功能图标 + 会员功能 + 管理中心 订单图标 diff --git a/src/views/cms/mp-weixin/user/index.vue b/src/views/cms/mp-weixin/user/index.vue index a2ae828..4362247 100644 --- a/src/views/cms/mp-weixin/user/index.vue +++ b/src/views/cms/mp-weixin/user/index.vue @@ -79,7 +79,7 @@