修改打印机页面,增加叫号管理页面、霸王餐、店铺优惠券
|
|
@ -0,0 +1,60 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/freeDing";
|
||||||
|
const API = {
|
||||||
|
getList() {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
edit(data: editRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
export default API;
|
||||||
|
/**
|
||||||
|
* 修改信息
|
||||||
|
*
|
||||||
|
* FreeDineConfigEditDTO
|
||||||
|
*/
|
||||||
|
export interface editRequest {
|
||||||
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
|
enable?: boolean | null;
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
id: number | null;
|
||||||
|
/**
|
||||||
|
* 充值说明
|
||||||
|
*/
|
||||||
|
rechargeDesc?: null | string;
|
||||||
|
/**
|
||||||
|
* 满多少可用
|
||||||
|
*/
|
||||||
|
rechargeThreshold?: number | null;
|
||||||
|
/**
|
||||||
|
* 充值倍数
|
||||||
|
*/
|
||||||
|
rechargeTimes?: number | null;
|
||||||
|
/**
|
||||||
|
* 使用类型 dine-in店内 takeout 自取 post快递,takeaway外卖
|
||||||
|
*/
|
||||||
|
useType?: string[] | null;
|
||||||
|
/**
|
||||||
|
* 与优惠券同享
|
||||||
|
*/
|
||||||
|
withCoupon?: boolean | null;
|
||||||
|
/**
|
||||||
|
* 积分同享
|
||||||
|
*/
|
||||||
|
withPoints?: boolean | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,277 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/callTable";
|
||||||
|
const API = {
|
||||||
|
// 获取叫号配置
|
||||||
|
getConfig() {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/config`,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 修改叫号配置
|
||||||
|
editConfig(data: editConfigRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/config`,
|
||||||
|
method: "put",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 叫号桌型获取
|
||||||
|
getTable(params: getTableRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addTable(data: addTableRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
editTable(data: editTableRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteTable(data: deleteTableRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "delete",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取叫号号码
|
||||||
|
getTakeNumber(data: getTableNumberRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/takeNumber`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取叫号队列
|
||||||
|
getTableNumberList(params: getTableNumberListRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/queue`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//执行号码
|
||||||
|
callTableCall(data: callTableCallRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/call`,
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取叫号页面二维码
|
||||||
|
callTableCode(params: callTableCodeRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/takeNumberCode`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//修改叫号队列状态
|
||||||
|
updateTableState(data: updateTableStateRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/updateState`,
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取叫号记录列表
|
||||||
|
|
||||||
|
getCallRecord(params: getCallRecordRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/callRecord`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
export default API;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateConfigDTO
|
||||||
|
*/
|
||||||
|
export interface editConfigRequest {
|
||||||
|
/**
|
||||||
|
* 背景图
|
||||||
|
*/
|
||||||
|
bgCover?: null | string;
|
||||||
|
/**
|
||||||
|
* 是否线上取号
|
||||||
|
*/
|
||||||
|
isOnline?: number | null;
|
||||||
|
/**
|
||||||
|
* 临近几桌提醒
|
||||||
|
*/
|
||||||
|
nearNum?: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface getTableRequest {
|
||||||
|
/**
|
||||||
|
* 叫号桌型id
|
||||||
|
*/
|
||||||
|
callTableId?: number;
|
||||||
|
page?: string;
|
||||||
|
size?: string;
|
||||||
|
/**
|
||||||
|
* 0禁用 1使用
|
||||||
|
*/
|
||||||
|
state?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增数据
|
||||||
|
*
|
||||||
|
* CallTableDTO
|
||||||
|
*/
|
||||||
|
export interface addTableRequest {
|
||||||
|
/**
|
||||||
|
* 是否顺延
|
||||||
|
*/
|
||||||
|
isPostpone?: number | null;
|
||||||
|
/**
|
||||||
|
* 台桌名称
|
||||||
|
*/
|
||||||
|
name: null | string;
|
||||||
|
/**
|
||||||
|
* 临近几桌提醒
|
||||||
|
*/
|
||||||
|
nearNum: number | null;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
note?: null | string;
|
||||||
|
/**
|
||||||
|
* 顺延数量
|
||||||
|
*/
|
||||||
|
postponeNum?: number | null;
|
||||||
|
/**
|
||||||
|
* 前缀
|
||||||
|
*/
|
||||||
|
prefix: null | string;
|
||||||
|
/**
|
||||||
|
* 起始号码
|
||||||
|
*/
|
||||||
|
start: number | null;
|
||||||
|
/**
|
||||||
|
* 等待时间
|
||||||
|
*/
|
||||||
|
waitTime: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UpdateCallTableDTO
|
||||||
|
*/
|
||||||
|
export interface editTableRequest {
|
||||||
|
callTableId: number | null;
|
||||||
|
name?: null | string;
|
||||||
|
nearNum?: number | null;
|
||||||
|
note?: null | string;
|
||||||
|
prefix?: null | string;
|
||||||
|
start?: number | null;
|
||||||
|
waitTime?: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BaseCallTableDTO
|
||||||
|
*/
|
||||||
|
export interface deleteTableRequest {
|
||||||
|
/**
|
||||||
|
* 叫号桌型id
|
||||||
|
*/
|
||||||
|
callTableId: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TakeNumberDTO
|
||||||
|
*/
|
||||||
|
export interface getTableNumberRequest {
|
||||||
|
/**
|
||||||
|
* 叫号桌型id
|
||||||
|
*/
|
||||||
|
callTableId: number | null;
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
name?: null | string;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
note?: null | string;
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
phone: null | string;
|
||||||
|
/**
|
||||||
|
* 对应小程序用户id
|
||||||
|
*/
|
||||||
|
userId?: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
export interface Request {
|
||||||
|
/**
|
||||||
|
* 桌型id
|
||||||
|
*/
|
||||||
|
callTableId?: number;
|
||||||
|
/**
|
||||||
|
* 状态 -1已取消 0排队中 1叫号中 2已入座 3 已过号
|
||||||
|
*/
|
||||||
|
state?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
export interface getTableNumberListRequest {
|
||||||
|
/**
|
||||||
|
* 桌型id
|
||||||
|
*/
|
||||||
|
callTableId?: number;
|
||||||
|
/**
|
||||||
|
* 状态 -1已取消 0排队中 1叫号中 2已入座 3 已过号
|
||||||
|
*/
|
||||||
|
state?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* CallQueueDTO
|
||||||
|
*/
|
||||||
|
export interface callTableCallRequest {
|
||||||
|
callQueueId: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface callTableCodeRequest {
|
||||||
|
/**
|
||||||
|
* 叫号桌型id
|
||||||
|
*/
|
||||||
|
callTableId: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* UpdateCallQueueDTO
|
||||||
|
*/
|
||||||
|
export interface updateTableStateRequest {
|
||||||
|
callQueueId: number | null;
|
||||||
|
state: number | null;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
export interface getCallRecordRequest {
|
||||||
|
/**
|
||||||
|
* 桌型id
|
||||||
|
*/
|
||||||
|
callTableId?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,130 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/coupon";
|
||||||
|
const API = {
|
||||||
|
getList(params: getListRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add(data: addRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
edit(data: editRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
export default API;
|
||||||
|
export interface getListRequest {
|
||||||
|
status?: number;
|
||||||
|
type?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* ShopCouponDTO
|
||||||
|
*/
|
||||||
|
export interface addRequest {
|
||||||
|
createTime?: string;
|
||||||
|
/**
|
||||||
|
* 隔多少天生效
|
||||||
|
*/
|
||||||
|
daysToTakeEffect?: number;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
description?: string;
|
||||||
|
/**
|
||||||
|
* 减多少金额
|
||||||
|
*/
|
||||||
|
discountAmount?: number;
|
||||||
|
/**
|
||||||
|
* 发放人
|
||||||
|
*/
|
||||||
|
editor?: string;
|
||||||
|
/**
|
||||||
|
* 满多少金额
|
||||||
|
*/
|
||||||
|
fullAmount?: number;
|
||||||
|
/**
|
||||||
|
* 自增
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
* 剩余数量
|
||||||
|
*/
|
||||||
|
leftNumber?: number;
|
||||||
|
/**
|
||||||
|
* 发放数量
|
||||||
|
*/
|
||||||
|
number?: number;
|
||||||
|
shopId?: number;
|
||||||
|
/**
|
||||||
|
* 状态0-关闭 1 正常
|
||||||
|
*/
|
||||||
|
status?: number;
|
||||||
|
/**
|
||||||
|
* 名称(无意义)
|
||||||
|
*/
|
||||||
|
title?: string;
|
||||||
|
/**
|
||||||
|
* 1-满减 2-商品
|
||||||
|
*/
|
||||||
|
type?: number;
|
||||||
|
updateTime?: string;
|
||||||
|
/**
|
||||||
|
* 可用结束时间
|
||||||
|
*/
|
||||||
|
useEndTime?: string;
|
||||||
|
/**
|
||||||
|
* 已使用数量
|
||||||
|
*/
|
||||||
|
useNumber?: number;
|
||||||
|
/**
|
||||||
|
* 周 数组["周一","周二"]
|
||||||
|
*/
|
||||||
|
userDays?: string;
|
||||||
|
/**
|
||||||
|
* 可用开始时间
|
||||||
|
*/
|
||||||
|
useStartTime?: string;
|
||||||
|
/**
|
||||||
|
* all-全时段 custom-指定时段
|
||||||
|
*/
|
||||||
|
useTimeType?: string;
|
||||||
|
/**
|
||||||
|
* 有效天数
|
||||||
|
*/
|
||||||
|
validDays?: number;
|
||||||
|
/**
|
||||||
|
* 有效结束时间
|
||||||
|
*/
|
||||||
|
validEndTime?: string;
|
||||||
|
/**
|
||||||
|
* 有效期类型,可选值为 fixed(固定时间)/custom(自定义时间)
|
||||||
|
*/
|
||||||
|
validityType?: string;
|
||||||
|
/**
|
||||||
|
* 有效开始时间
|
||||||
|
*/
|
||||||
|
validStartTime?: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface editRequest extends addRequest {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
id: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import { Account_BaseUrl } from "@/api/config";
|
||||||
|
const baseURL = Account_BaseUrl + "/admin/printer";
|
||||||
|
const API = {
|
||||||
|
getList(data: getListRequest) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "get",
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add(data: addRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delete(id: number | string) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "delete",
|
||||||
|
data: { id },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
edit(data: editRequest) {
|
||||||
|
return request({
|
||||||
|
url: `${baseURL}`,
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
get(id: number | string) {
|
||||||
|
return request<any>({
|
||||||
|
url: `${baseURL}/detail`,
|
||||||
|
method: "get",
|
||||||
|
params: { id }
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
export default API;
|
||||||
|
export interface getListRequest {
|
||||||
|
/**
|
||||||
|
* 类型 USB 网络 蓝牙
|
||||||
|
*/
|
||||||
|
connectionType?: string;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
name?: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* PrinterAddDTO
|
||||||
|
*/
|
||||||
|
export interface addRequest {
|
||||||
|
/**
|
||||||
|
* ip地址
|
||||||
|
*/
|
||||||
|
address?: null | string;
|
||||||
|
/**
|
||||||
|
* 打印分类Id
|
||||||
|
*/
|
||||||
|
categoryIds?: null | string;
|
||||||
|
/**
|
||||||
|
* 分类
|
||||||
|
*/
|
||||||
|
categoryList?: null | string;
|
||||||
|
/**
|
||||||
|
* 分类打印 0-所有 1-部分分类 2-部分商品
|
||||||
|
*/
|
||||||
|
classifyPrint: null | string;
|
||||||
|
/**
|
||||||
|
* 现在打印机支持USB 和 网络、蓝牙
|
||||||
|
*/
|
||||||
|
connectionType: null | string;
|
||||||
|
/**
|
||||||
|
* 打印机品牌
|
||||||
|
*/
|
||||||
|
contentType: null | string;
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
name: null | string;
|
||||||
|
/**
|
||||||
|
* 端口
|
||||||
|
*/
|
||||||
|
port?: null | string;
|
||||||
|
/**
|
||||||
|
* 打印方式 all-全部打印 normal-仅打印结账单「前台」one-仅打印制作单「厨房」
|
||||||
|
*/
|
||||||
|
printMethod: null | string;
|
||||||
|
/**
|
||||||
|
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3顾客2+商家1[3张]
|
||||||
|
*/
|
||||||
|
printQty: null | string;
|
||||||
|
/**
|
||||||
|
* 打印类型,JSON数组 refund-确认退款单 handover-交班单 queue-排队取号
|
||||||
|
*/
|
||||||
|
printType: null | string;
|
||||||
|
/**
|
||||||
|
* 小票尺寸 58mm 80mm
|
||||||
|
*/
|
||||||
|
receiptSize?: null | string;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
sort?: number | null;
|
||||||
|
/**
|
||||||
|
* 打印类型(分类)label标签cash小票kitchen出品
|
||||||
|
*/
|
||||||
|
subType?: null | string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface editRequest extends addRequest {
|
||||||
|
id: number | string
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
|
@ -342,7 +342,7 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "marketing",
|
path: "marketing",
|
||||||
component: () => import("@/views/application/marketing.vue"),
|
component: () => import("@/views/application/marketing/index.vue"),
|
||||||
name: "applicationMarketing",
|
name: "applicationMarketing",
|
||||||
meta: {
|
meta: {
|
||||||
title: "营销中心",
|
title: "营销中心",
|
||||||
|
|
@ -352,14 +352,75 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "index",
|
path: "index",
|
||||||
component: () => import("@/views/application/index.vue"),
|
component: () => import("@/views/application/list/index.vue"),
|
||||||
name: "applicationIndex",
|
name: "applicationIndex",
|
||||||
meta: {
|
meta: {
|
||||||
title: "列表管理",
|
title: "列表管理",
|
||||||
affix: false,
|
affix: false,
|
||||||
keepAlive: true,
|
keepAlive: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 营销中心 start
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
path: "coupon",
|
||||||
|
component: () => import("@/views/application/marketing/coupon/list.vue"),
|
||||||
|
name: "coupon",
|
||||||
|
meta: {
|
||||||
|
title: "优惠券",
|
||||||
|
affix: false,
|
||||||
|
hidden: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "bwc",
|
||||||
|
component: () => import("@/views/application/marketing/bwc.vue"),
|
||||||
|
name: "bwc",
|
||||||
|
meta: {
|
||||||
|
title: "霸王餐",
|
||||||
|
affix: false,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "ad",
|
||||||
|
component: () => import("@/views/application/list/ad/index.vue"),
|
||||||
|
name: "ad",
|
||||||
|
meta: {
|
||||||
|
title: "广告",
|
||||||
|
affix: false,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/** 营销中心end */
|
||||||
|
|
||||||
|
/**列表start */
|
||||||
|
|
||||||
|
{
|
||||||
|
path: "lineUplist",
|
||||||
|
component: () => import("@/views/application/list/lineUplist/index.vue"),
|
||||||
|
name: "lineUplist",
|
||||||
|
meta: {
|
||||||
|
title: "叫号",
|
||||||
|
affix: false,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "lineUpRecord",
|
||||||
|
component: () => import("@/views/application/list/lineUplist/record.vue"),
|
||||||
|
name: "lineUpRecord",
|
||||||
|
meta: {
|
||||||
|
title: "叫号记录",
|
||||||
|
affix: false,
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/**列表end */
|
||||||
|
|
||||||
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="title">应用中心</div>
|
||||||
|
<div class="list">
|
||||||
|
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
||||||
|
<img :src="item.icon" class="icon" />
|
||||||
|
<div class="info">
|
||||||
|
<div class="name">{{ item.name }}</div>
|
||||||
|
<div class="intro">
|
||||||
|
{{ item.desc }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import bear from "@/assets/images/application/bear.png";
|
||||||
|
import song from "@/assets/images/application/song.png";
|
||||||
|
import ad from "@/assets/images/application/ad.png";
|
||||||
|
import call from "@/assets/images/application/call.png";
|
||||||
|
|
||||||
|
const list = ref([
|
||||||
|
{ name: "存酒", icon: bear, path: "", desc: "用户未喝完的酒可暂存在店里" },
|
||||||
|
{ name: "点歌", icon: song, path: "", desc: "用户可以付费点歌" },
|
||||||
|
{ name: "广告", icon: ad, path: "", desc: "添加弹窗广告" },
|
||||||
|
{ name: "叫号", icon: call, path: "lineUplist", desc: "" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const to = (item) => {
|
||||||
|
router.push("/application/" + item.path);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.title {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
padding: 20px 0;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 14px;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 400px;
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
.name {
|
||||||
|
color: #39d47a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: #39d47a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 10px;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: #999;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,413 @@
|
||||||
|
<template>
|
||||||
|
<div class="basicStyle">
|
||||||
|
<div>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||||
|
<el-form-item label="排队页地址">
|
||||||
|
<span style="color: #999999">{{ form.pageAddress }}</span>
|
||||||
|
<span @click="copydata">复制</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="线上取号">
|
||||||
|
<el-switch v-model="form.isOnline" :active-value="1" :inactive-value="0"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="背景图片">
|
||||||
|
<single-image-upload v-model="form.bgCover" @change="uploadChange"></single-image-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="桌型">
|
||||||
|
<div style="width: 100%">
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
showLocation = true;
|
||||||
|
title = '新增';
|
||||||
|
"
|
||||||
|
>
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="formtable.records" border style="width: 60%; margin-top: 20px">
|
||||||
|
<el-table-column prop="name" label="名称"></el-table-column>
|
||||||
|
<el-table-column prop="note" label="描述"></el-table-column>
|
||||||
|
<el-table-column prop="waitTime" label="等待时间「桌」"></el-table-column>
|
||||||
|
<el-table-column prop="prefix" label="号码前缀"></el-table-column>
|
||||||
|
<el-table-column prop="start" label="开始号码"></el-table-column>
|
||||||
|
<el-table-column prop="name" label="操作">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: flex; gap: 10px">
|
||||||
|
<el-button type="text" @click="editPop(scope.row)">编辑</el-button>
|
||||||
|
<el-button type="text" style="color: #ff4d4f" @click="deleteevnt(scope.row)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<h2>通知模板</h2>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||||
|
<el-form-item label="排队成功提醒">
|
||||||
|
<el-input
|
||||||
|
v-model="form.successMsg"
|
||||||
|
placeholder="请输入排队成功提醒"
|
||||||
|
disabled
|
||||||
|
style="width: 500px"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排队即将排到通知">
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="form.nearMsg"
|
||||||
|
placeholder="请输入排队成功提醒"
|
||||||
|
disabled
|
||||||
|
style="width: 500px"
|
||||||
|
></el-input>
|
||||||
|
<div class="duoshaozhuo">
|
||||||
|
<div>前面等待</div>
|
||||||
|
<el-input v-model="form.nearNum" placeholder="" disabled></el-input>
|
||||||
|
<div>桌时提醒</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排队到号提醒">
|
||||||
|
<el-input
|
||||||
|
v-model="form.callingMsg"
|
||||||
|
placeholder="请输入排队到号提醒"
|
||||||
|
disabled
|
||||||
|
style="width: 500px"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="submitHandle" :loading="formLoading">
|
||||||
|
<span v-if="!formLoading">保存</span>
|
||||||
|
<span v-else>保存中...</span>
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<el-dialog :title="title" v-model="showLocation" width="500px">
|
||||||
|
<el-form :model="forms" label-width="140px" label-position="left">
|
||||||
|
<el-form-item label="名称">
|
||||||
|
<el-input v-model="forms.name" placeholder="请输入名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述">
|
||||||
|
<el-input v-model="forms.note" placeholder="如:1-2人"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="等待时间">
|
||||||
|
<el-input v-model="forms.waitTime" placeholder="0">
|
||||||
|
<template #append>分钟/1桌</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="号码前缀">
|
||||||
|
<el-input v-model="forms.prefix" placeholder="请输入英文字母「不支持中文」"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始号码">
|
||||||
|
<el-input v-model="forms.start" placeholder="请输入开始号码"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="临近几桌提醒">
|
||||||
|
<el-input-number
|
||||||
|
step-strictly
|
||||||
|
v-model="forms.nearNum"
|
||||||
|
placeholder="请输入临近几桌提醒"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="过号保留">
|
||||||
|
<el-input
|
||||||
|
v-model="forms.postponeNum"
|
||||||
|
:disabled="!forms.isPostpone"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<div>
|
||||||
|
<span><el-checkbox v-model="forms.isPostpone">开启顺延</el-checkbox></span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #append>桌</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" width="120">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: flex; gap: 10px">
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
@click="
|
||||||
|
showLocation = false;
|
||||||
|
forms = {};
|
||||||
|
"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" @click="submitE">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import callTableApi from "@/api/account/callTable";
|
||||||
|
import { ElMessage, ElMessageBox, ElSubMenu } from "element-plus";
|
||||||
|
import uploadImg from "@/assets/images/upload.png";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
uploadImg,
|
||||||
|
showLocation: false,
|
||||||
|
showUpload: false,
|
||||||
|
uploadIndex: 1,
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
formLoading: false,
|
||||||
|
form: {
|
||||||
|
nearNum: 1,
|
||||||
|
},
|
||||||
|
forms: {},
|
||||||
|
formtable: "",
|
||||||
|
rules: {
|
||||||
|
shopName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: " ",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
phone: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: " ",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
settleTime: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: " ",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
fileList: [],
|
||||||
|
files: [],
|
||||||
|
headers: {
|
||||||
|
Authorization: "",
|
||||||
|
},
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async editPop(item) {
|
||||||
|
this.forms = item;
|
||||||
|
this.showLocation = true;
|
||||||
|
this.title = "编辑";
|
||||||
|
},
|
||||||
|
async deleteevnt(item) {
|
||||||
|
ElMessageBox.confirm("是否要删除" + item.name, {
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const res = await callTableApi.deleteTable({
|
||||||
|
callTableId: item.id,
|
||||||
|
});
|
||||||
|
ElSubMenu.success("删除成功");
|
||||||
|
this.init();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
async submitE() {
|
||||||
|
if (this.title == "新增") {
|
||||||
|
const res = await callTableApi.addTable({
|
||||||
|
...this.forms,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("新增成功");
|
||||||
|
this.showLocation = false;
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const res = await callTableApi.editTable({
|
||||||
|
...this.forms,
|
||||||
|
callTableId: this.forms.id,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
ElMessage.success("修改成功");
|
||||||
|
this.showLocation = false;
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.forms = {};
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
try {
|
||||||
|
const res = await callTableApi.getConfig();
|
||||||
|
this.form = res;
|
||||||
|
const data = await callTableApi.getTable({
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
});
|
||||||
|
this.formtable = data;
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
// 保存
|
||||||
|
submitHandle() {
|
||||||
|
this.$refs.form.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.formLoading = true;
|
||||||
|
try {
|
||||||
|
// if (this.startTime && this.endTime) {
|
||||||
|
// this.form.businessTime = `${this.startTime}-${this.endTime}`;
|
||||||
|
// }
|
||||||
|
const res = await callTableApi.editConfig(this.form);
|
||||||
|
this.formLoading = false;
|
||||||
|
this.forms = {};
|
||||||
|
ElMessage({
|
||||||
|
title: "成功",
|
||||||
|
message: "提交成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} catch (error) {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleSuccess(response, file, fileList) {
|
||||||
|
// const uid = file.uid
|
||||||
|
// const id = response.id
|
||||||
|
// this.files.push({ uid, id })
|
||||||
|
console.log("上传成功", response);
|
||||||
|
this.files = response.data;
|
||||||
|
this.form.bgCover = response.data[0];
|
||||||
|
},
|
||||||
|
handleBeforeRemove(file, fileList) {
|
||||||
|
for (let i = 0; i < this.files.length; i++) {
|
||||||
|
if (this.files[i].uid === file.uid) {
|
||||||
|
crudQiNiu.del([this.files[i].id]).then((res) => {});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
this.dialogImageUrl = file.url;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
// 监听上传失败
|
||||||
|
handleError(e, file, fileList) {
|
||||||
|
const msg = JSON.parse(e.message);
|
||||||
|
this.crud.notify(msg.message, CRUD.NOTIFICATION_TYPE.ERROR);
|
||||||
|
},
|
||||||
|
async copydata(content) {
|
||||||
|
let copyResult = true;
|
||||||
|
// 设置想要复制的文本内容
|
||||||
|
const text = this.form.pageAddress || "复制内容为空哦~";
|
||||||
|
// 判断是否支持clipboard方式
|
||||||
|
if (!!window.navigator.clipboard) {
|
||||||
|
// 利用clipboard将文本写入剪贴板(这是一个异步promise)
|
||||||
|
await window.navigator.clipboard
|
||||||
|
.writeText(text)
|
||||||
|
.then((res) => {
|
||||||
|
console.log("复制成功");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log("复制失败--采取第二种复制方案", err);
|
||||||
|
// clipboard方式复制失败 则采用document.execCommand()方式进行尝试
|
||||||
|
copyResult = copyContent2(text);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 不支持clipboard方式 则采用document.execCommand()方式
|
||||||
|
copyResult = copyContent2(text);
|
||||||
|
}
|
||||||
|
// 返回复制操作的最终结果
|
||||||
|
// return copyResult;
|
||||||
|
},
|
||||||
|
// 刷新列表数据
|
||||||
|
doSubmit() {
|
||||||
|
this.fileList = [];
|
||||||
|
this.showUpload = false;
|
||||||
|
switch (this.uploadIndex) {
|
||||||
|
case 1:
|
||||||
|
this.form.bgCover = this.files[0];
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.form.coverImg = this.files[0];
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.form.shopQrcode = this.files[0];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.basicStyle {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_box {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.map {
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search_box {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search_wrap {
|
||||||
|
padding: 6px 0;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
padding: 12px 0;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-right: 20px;
|
||||||
|
|
||||||
|
.location {
|
||||||
|
color: #999;
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.duoshaozhuo {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
> input {
|
||||||
|
width: 120px;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div {
|
||||||
|
color: #999;
|
||||||
|
width: 118px;
|
||||||
|
height: 33px;
|
||||||
|
line-height: 33px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid #dddfe6;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
margin-top: 9px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,533 @@
|
||||||
|
<template>
|
||||||
|
<div class="lineUpBox">
|
||||||
|
<div class="lineUpBoxTop">
|
||||||
|
<ul class="lineUpBoxUl">
|
||||||
|
<li :class="[[selecttopType == '' ? 'active' : '']]" @click="gettypeevent('')">
|
||||||
|
<div>全部</div>
|
||||||
|
<div>{{ tableData.totalCount || 0 }}桌</div>
|
||||||
|
<div class="postionStyle" v-if="selecttopType == ''">
|
||||||
|
<el-icon style="transform: translateY(-4px)" color="#fff"><Check /></el-icon>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li
|
||||||
|
v-for="item in tableData.records"
|
||||||
|
:key="item.id"
|
||||||
|
@click="gettypeevent(item.id)"
|
||||||
|
:class="[[selecttopType == item.id ? 'active' : '']]"
|
||||||
|
>
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
<div>{{ item.totalCount || 0 }}桌</div>
|
||||||
|
<div class="postionStyle" v-if="selecttopType == item.id">
|
||||||
|
<el-icon style="transform: translateY(-4px)" color="#fff"><Check /></el-icon>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="buttonstyle">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
dialogVisibles = true;
|
||||||
|
phone = '';
|
||||||
|
"
|
||||||
|
>
|
||||||
|
取号
|
||||||
|
</el-button>
|
||||||
|
<el-button plain type="primary" @click="toUrl">叫号记录</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; align-items: center; flex-wrap: wrap">
|
||||||
|
<div class="lineUpBoxList" v-for="item in list" style="margin-right: 20px" :key="item.id">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div>用户</div>
|
||||||
|
<div>{{ item.phone }}</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>号码</div>
|
||||||
|
<div>{{ item.callNum }}</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>桌型</div>
|
||||||
|
<div>{{ item.name }}{{ item.note }}</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>等待</div>
|
||||||
|
<div>{{ item.waitingCount }}桌</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" @click="dialogConfirm(1, item)">取消</el-button>
|
||||||
|
<el-button type="primary" @click="profilepicture(item)">播报</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 播报弹窗 -->
|
||||||
|
<el-dialog title="提示" v-model="dialogVisible" center width="30%">
|
||||||
|
<div style="text-align: center">
|
||||||
|
<div style="font-size: 16px">正在叫号,请稍等</div>
|
||||||
|
<div
|
||||||
|
v-if="profilepicturedata.state == 1"
|
||||||
|
style="color: #52c41a; font-size: 16px; margin-top: 17px"
|
||||||
|
>
|
||||||
|
已发送至用户
|
||||||
|
<i class="el-icon-circle-check" style="color: #52c41a"></i>
|
||||||
|
</div>
|
||||||
|
<div v-else style="color: #ff4d4f; font-size: 16px; margin-top: 17px">
|
||||||
|
用户未订阅消息
|
||||||
|
<i style="color: #ff4d4f" class="el-icon-circle-close"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button
|
||||||
|
style="
|
||||||
|
width: 176px;
|
||||||
|
height: 48px;
|
||||||
|
background: #f7f7fa;
|
||||||
|
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
|
||||||
|
border-radius: 2px 2px 2px 2px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0);
|
||||||
|
"
|
||||||
|
@click="dialogConfirm(2)"
|
||||||
|
>
|
||||||
|
完成
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
style="
|
||||||
|
width: 189px;
|
||||||
|
height: 45px;
|
||||||
|
background: #ff4d4f;
|
||||||
|
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
|
||||||
|
border-radius: 2px 2px 2px 2px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.28);
|
||||||
|
"
|
||||||
|
@click="dialogConfirm(3)"
|
||||||
|
>
|
||||||
|
过号
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 取号 -->
|
||||||
|
<el-dialog title="取号" v-model="dialogVisibles" width="30%">
|
||||||
|
<div>
|
||||||
|
<div style="color: #000">选择桌型</div>
|
||||||
|
<ul
|
||||||
|
class="lineUpBoxUl"
|
||||||
|
:class="[tableData.records.length > 2 ? 'dfs' : 'dfas']"
|
||||||
|
style="margin-top: 10px"
|
||||||
|
>
|
||||||
|
<li
|
||||||
|
v-for="item in tableData.records"
|
||||||
|
:key="item.id"
|
||||||
|
@click="selectTabletype = item"
|
||||||
|
:class="[[selectTabletype.id == item.id ? 'active' : '']]"
|
||||||
|
>
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
<div>{{ item.totalCount }}桌</div>
|
||||||
|
<div class="postionStyle" v-if="selectTabletype.id == item.id">
|
||||||
|
<el-icon style="transform: translateY(-4px)" color="#fff"><Check /></el-icon>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div style="margin-top: 20px; color: #000">手机号码</div>
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
<input v-model="phone" style="height: 30px" type="text" placeholder="填写号码" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="callTabletakeNumberEvent">确认取号</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const synth = window.speechSynthesis;
|
||||||
|
const msg = new SpeechSynthesisUtterance();
|
||||||
|
import callTableApi from "@/api/account/callTable";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: {
|
||||||
|
productId: "",
|
||||||
|
name: "",
|
||||||
|
categoryId: "",
|
||||||
|
typeEnum: "",
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
page: 0,
|
||||||
|
size: 30,
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
selecttopType: "",
|
||||||
|
list: [],
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogVisibles: false,
|
||||||
|
profilepictureInfo: "",
|
||||||
|
phone: "",
|
||||||
|
selectTabletype: "",
|
||||||
|
// 播报弹窗显示是否订阅
|
||||||
|
profilepicturedata: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
await this.getlist();
|
||||||
|
await this.getTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async callTabletakeNumberEvent() {
|
||||||
|
const res = await callTableApi.getTakeNumber({
|
||||||
|
callTableId: this.selectTabletype.id,
|
||||||
|
phone: this.phone,
|
||||||
|
note: this.selectTabletype.note,
|
||||||
|
name: this.selectTabletype.name,
|
||||||
|
});
|
||||||
|
if (res.callNum) {
|
||||||
|
this.getTableData();
|
||||||
|
this.getlist();
|
||||||
|
this.dialogVisibles = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSpeak(text) {
|
||||||
|
msg.text = text; // 文字内容: 小朋友,你是否有很多问号
|
||||||
|
msg.lang = "zh-CN"; // 使用的语言:中文
|
||||||
|
msg.volume = 3; // 声音音量:1
|
||||||
|
msg.rate = 1; // 语速:1
|
||||||
|
msg.pitch = 1; // 音高:1
|
||||||
|
synth.speak(msg); // 播放
|
||||||
|
},
|
||||||
|
// // 语音停止
|
||||||
|
// handleStop(e) {
|
||||||
|
// msg.text = e;
|
||||||
|
// msg.lang = "zh-CN";
|
||||||
|
// synth.cancel(msg);
|
||||||
|
// },
|
||||||
|
|
||||||
|
async profilepicture(d) {
|
||||||
|
this.handleSpeak("请" + d.callNum + "用餐");
|
||||||
|
let res = await callTablecall({
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
callQueueId: d.id,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.profilepicturedata = res;
|
||||||
|
this.profilepictureInfo = d;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gettypeevent(d) {
|
||||||
|
this.selecttopType = d;
|
||||||
|
this.getTableData();
|
||||||
|
this.getlist();
|
||||||
|
},
|
||||||
|
async dialogConfirm(value, item) {
|
||||||
|
if (value == 1) {
|
||||||
|
const res = await callTableput({
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
state: -1,
|
||||||
|
callQueueId: item.id,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
this.getTableData();
|
||||||
|
this.getlist();
|
||||||
|
}
|
||||||
|
} else if (value == 2) {
|
||||||
|
const res = await callTableput({
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
state: 2,
|
||||||
|
callQueueId: this.profilepictureInfo.id,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
this.getTableData();
|
||||||
|
this.getlist();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
} else if (value == 3) {
|
||||||
|
const res = await callTableput({
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
|
||||||
|
state: 3,
|
||||||
|
callQueueId: this.profilepictureInfo.id,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
this.getTableData();
|
||||||
|
this.getlist();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
toUrl() {
|
||||||
|
this.$router.push({ path: "/application/lineUpRecord" });
|
||||||
|
},
|
||||||
|
// 获取商品列表
|
||||||
|
async getTableData() {
|
||||||
|
try {
|
||||||
|
const res = await callTableApi.getTableNumberList({
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
});
|
||||||
|
// this.tableData.loading = false
|
||||||
|
this.tableData = res;
|
||||||
|
this.selectTabletype = res.records[0];
|
||||||
|
// this.tableData.total = res.totalElements
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getlist() {
|
||||||
|
const res = await callTableApi.getTableNumberList({
|
||||||
|
page: 1,
|
||||||
|
size: 9999,
|
||||||
|
callTableId: this.selecttopType,
|
||||||
|
state: 0,
|
||||||
|
});
|
||||||
|
this.list = res.records;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
text-decoration: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul,
|
||||||
|
li {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.show {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lineUpBox {
|
||||||
|
}
|
||||||
|
|
||||||
|
.lineUpBoxTop {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.lineUpBoxUl {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0;
|
||||||
|
> li {
|
||||||
|
border-radius: 4px 4px 4px 4px;
|
||||||
|
border: 1px solid #dddfe6;
|
||||||
|
width: 112px;
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 20px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-top: 8px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:first-child {
|
||||||
|
color: #333333;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 16px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postionStyle {
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: -9px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border: 14px solid;
|
||||||
|
border-color: #318afe #318afe #fff #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postionStyleI {
|
||||||
|
position: absolute;
|
||||||
|
right: -13px;
|
||||||
|
top: -13px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
border: 2px solid #318afe;
|
||||||
|
|
||||||
|
> view:first-child {
|
||||||
|
color: #318afe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonstyle {
|
||||||
|
> button {
|
||||||
|
height: 31px;
|
||||||
|
|
||||||
|
padding: 5px 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lineUpBoxList {
|
||||||
|
width: 507px;
|
||||||
|
height: 148px;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 6px 6px 6px 6px;
|
||||||
|
border: 1px solid #dddfe6;
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
> ul {
|
||||||
|
padding: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
> li {
|
||||||
|
> div:nth-child(2) {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> div {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
|
||||||
|
> button {
|
||||||
|
width: 169px;
|
||||||
|
height: 32px;
|
||||||
|
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
|
||||||
|
border-radius: 1px 1px 1px 1px;
|
||||||
|
border: 1px solid #d9d9d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
> button:first-child {
|
||||||
|
background: #ffffff;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666666;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dfs {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dfas {
|
||||||
|
> li {
|
||||||
|
margin-right: 52px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lineUpBoxUl {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
> li {
|
||||||
|
border-radius: 4px 4px 4px 4px;
|
||||||
|
border: 1px solid #dddfe6;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
min-width: 110px;
|
||||||
|
cursor: pointer;
|
||||||
|
> div {
|
||||||
|
margin-top: 8px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
> div:first-child {
|
||||||
|
color: #333333;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 16px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postionStyle {
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: -9px;
|
||||||
|
border: 14px solid;
|
||||||
|
border-color: #318afe #318afe #fff #fff;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.postionStyleI {
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
|
right: -13px;
|
||||||
|
top: -13px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
border: 2px solid #318afe;
|
||||||
|
|
||||||
|
> view:first-child {
|
||||||
|
color: #318afe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.handle {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: grab;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop_info {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.tag_wrap {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-tabs v-model="activeName" type="card">
|
||||||
|
<el-tab-pane label="排队列表" name="1"></el-tab-pane>
|
||||||
|
<el-tab-pane label="基本设置" name="2"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<index v-if="activeName == 1" />
|
||||||
|
<basic v-if="activeName == 2" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import index from "./components/index.vue";
|
||||||
|
import basic from "./components/basic.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
index,
|
||||||
|
basic,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: "1",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.app-container {
|
||||||
|
background-color: #fff;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="head-container">叫号记录</div>
|
||||||
|
<div class="head-container" id="table_drag">
|
||||||
|
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||||
|
<el-table-column label="桌号" prop="callNum"></el-table-column>
|
||||||
|
<el-table-column label="桌型" prop="typeEnum">
|
||||||
|
<template v-slot="scope">{{ scope.row.name }}({{ scope.row.note }})</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="手机号" prop="phone"></el-table-column>
|
||||||
|
<el-table-column label="状态">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<span
|
||||||
|
style="font-weight: 400; font-size: 14px"
|
||||||
|
:style="{ color: scope.row.state == 2 ? '#3F9EFF' : '' }"
|
||||||
|
>
|
||||||
|
{{ stateFilter(scope.row.state) }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="时间" prop="callTime"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="head-container">
|
||||||
|
<el-pagination :total="tableData.total" @size-change="handleSizeChange" :current-page="tableData.page + 1"
|
||||||
|
:page-size="tableData.size" @current-change="paginationChange"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import callTableApi from "@/api/account/callTable";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
query: {
|
||||||
|
productId: "",
|
||||||
|
name: "",
|
||||||
|
categoryId: "",
|
||||||
|
typeEnum: "",
|
||||||
|
},
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
page: 0,
|
||||||
|
size: 30,
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
await this.getTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
stateFilter(i) {
|
||||||
|
if (i == -1) {
|
||||||
|
return "已取消";
|
||||||
|
} else if (i == 0) {
|
||||||
|
return "排队中";
|
||||||
|
} else if (i == 1) {
|
||||||
|
return "叫号中";
|
||||||
|
} else if (i == 2) {
|
||||||
|
return "已入座";
|
||||||
|
} else if (i == 3) {
|
||||||
|
return "已过号 ";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
// paginationChange(e) {
|
||||||
|
// this.tableData.page = e - 1
|
||||||
|
// this.getTableData()
|
||||||
|
// },
|
||||||
|
// 获取商品列表
|
||||||
|
async getTableData() {
|
||||||
|
try {
|
||||||
|
const res = await callTableApi.getCallRecord({
|
||||||
|
page: 1,
|
||||||
|
size: 9999,
|
||||||
|
});
|
||||||
|
this.tableData.data = res.records;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// handleSizeChange(val) {
|
||||||
|
// this.tableData.size = val
|
||||||
|
// this.getTableData()
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.handle {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #999;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: grab;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop_info {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.tag_wrap {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
<template></template>
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="container">
|
||||||
|
<el-form ref="form" :model="form" label-width="140px" label-position="left">
|
||||||
|
<el-form-item label="功能启用">
|
||||||
|
<el-switch v-model="form.enable"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="充值设置">
|
||||||
|
<div class="labelbox">
|
||||||
|
用户消费结账时,成功充值消费
|
||||||
|
<el-input style="width: 80px; margin: 0 15px" v-model="form.rechargeTimes"></el-input>
|
||||||
|
倍的金额,本单即可享受免单
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="充值门槛">
|
||||||
|
<div class="labelbox">
|
||||||
|
订单支付金额需满
|
||||||
|
<el-input
|
||||||
|
style="width: 80px; margin: 0 15px"
|
||||||
|
v-model="form.rechargeThreshold"
|
||||||
|
></el-input>
|
||||||
|
元才能使用
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="充值说明">
|
||||||
|
<el-input type="textarea" v-model="form.rechargeDesc"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="editlist">保存</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import bwcApi from "@/api/account/bwc";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
export default {
|
||||||
|
name: "bwc",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
id: "",
|
||||||
|
enable: "",
|
||||||
|
rechargeTimes: "",
|
||||||
|
rechargeThreshold: "",
|
||||||
|
withCoupon: "",
|
||||||
|
withPoints: "",
|
||||||
|
rechargeDesc: "",
|
||||||
|
useTypeList: [],
|
||||||
|
childShopIdList: "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getlist();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getlist() {
|
||||||
|
let res = await bwcApi.getList();
|
||||||
|
this.form = res;
|
||||||
|
},
|
||||||
|
async editlist() {
|
||||||
|
let res = await bwcApi.edit(this.form);
|
||||||
|
ElMessage({
|
||||||
|
message: "保存成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.getlist();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.app-container {
|
||||||
|
padding: 12px 20px;
|
||||||
|
height: auto;
|
||||||
|
background-color: #f4f9ff;
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 30px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #ffffff;
|
||||||
|
|
||||||
|
.labelbox {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,325 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog title="领取详情" :visible.sync="dialogVisible" width="70%" @close="reset">
|
||||||
|
<div class="search">
|
||||||
|
<el-form :model="query" inline label-position="left">
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="query.value"
|
||||||
|
placeholder="用户ID/用户昵称/用户手机"
|
||||||
|
style="width: 180px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-select v-model="query.status" placeholder="选择状态" style="width: 154px">
|
||||||
|
<el-option
|
||||||
|
v-for="item in stateList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item />
|
||||||
|
<el-form-item label="领取时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryTime"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
@change="queryTimeChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
|
<!-- <el-button v-loading="downloadLoading" icon="el-icon-download" @click="downloadHandle">
|
||||||
|
<span v-if="!downloadLoading">导出</span>
|
||||||
|
<span v-else>下载中...</span>
|
||||||
|
</el-button> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-table v-loading="loading" :data="tableData.data">
|
||||||
|
<el-table-column label="用户ID" prop="id" />
|
||||||
|
<el-table-column label="用户名" prpo="name">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div>{{ scope.row.name ? scope.row.name : "-" }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="领取时间" prop="receiveTime" />
|
||||||
|
<el-table-column label="使用时间" prpo="useTime">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div>{{ scope.row.useTime ? scope.row.useTime : "-" }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="获得来源" prpo="source">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div>
|
||||||
|
{{
|
||||||
|
scope.row.source == "activate"
|
||||||
|
? "充值活动"
|
||||||
|
: scope.row.source == "invited"
|
||||||
|
? "好友分享"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" align="status">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<div v-if="scope.row.overNum == scope.row.num" style="color: #faad14">未使用</div>
|
||||||
|
<div v-if="scope.row.num != 0 && scope.row.overNum != scope.row.num">
|
||||||
|
{{ scope.row.overNum }}/{{ scope.row.num }}
|
||||||
|
</div>
|
||||||
|
<div v-if="scope.row.overNum == 0" style="color: #52c41a">已使用</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="使用门店" prpo="useTime">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div>{{ scope.row.tableName ? scope.row.tableName : "-" }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
style="color: #ff4d4f"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-pagination
|
||||||
|
:total="tableData.total"
|
||||||
|
:current-page="tableData.page"
|
||||||
|
:page-size="tableData.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="paginationChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import couponApi from "@/api/account/coupon";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// eslint-disable-next-line vue/require-prop-types
|
||||||
|
props: ["couponId"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
downloadLoading: false,
|
||||||
|
loading: false,
|
||||||
|
stateList: [
|
||||||
|
{ label: "未使用", value: 0 },
|
||||||
|
{ label: "已使用", value: 1 },
|
||||||
|
],
|
||||||
|
queryTime: [],
|
||||||
|
query: {
|
||||||
|
couponId: "",
|
||||||
|
value: "",
|
||||||
|
status: 0,
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
},
|
||||||
|
resetQuery: null,
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.resetQuery = { ...this.query };
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
async getTableData() {
|
||||||
|
// eslint-disable-next-line no-unused-vars, prefer-const
|
||||||
|
// console.log(this.couponId)
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars, prefer-const
|
||||||
|
let res = await queryReceive({
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
couponId: this.query.couponId,
|
||||||
|
value: this.query.value,
|
||||||
|
status: this.query.status,
|
||||||
|
startTime: this.query.startTime,
|
||||||
|
endTime: this.query.endTime,
|
||||||
|
page: this.query.page,
|
||||||
|
size: this.query.size,
|
||||||
|
});
|
||||||
|
this.tableData.loading = false;
|
||||||
|
this.tableData.data = res.content;
|
||||||
|
this.tableData.total = res.totalElements;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间选择监听
|
||||||
|
*/
|
||||||
|
queryTimeChange(e) {
|
||||||
|
if (e) {
|
||||||
|
this.query.startTime = e[0];
|
||||||
|
this.query.endTime = e[1];
|
||||||
|
} else {
|
||||||
|
this.query.startTime = "";
|
||||||
|
this.query.endTime = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除优惠券
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
async delTableHandle(id) {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const delRes = await delReceive(id);
|
||||||
|
console.log(delRes);
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开详情
|
||||||
|
* @param obj
|
||||||
|
*/
|
||||||
|
show(obj) {
|
||||||
|
console.log(obj);
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.query.couponId = obj.id;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
sizeChange(e) {
|
||||||
|
this.tableData.size = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
paginationChange(e) {
|
||||||
|
this.tableData.page = e;
|
||||||
|
this.query.page = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 关闭详情
|
||||||
|
*/
|
||||||
|
close() {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出Excel
|
||||||
|
*/
|
||||||
|
async downloadHandle() {
|
||||||
|
try {
|
||||||
|
this.downloadLoading = true;
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
const file = await summaryTableDownload({
|
||||||
|
startTime: this.query.createdAt[0],
|
||||||
|
endTime: this.query.createdAt[1],
|
||||||
|
});
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
downloadFile(file, "数据", "xlsx");
|
||||||
|
this.downloadLoading = false;
|
||||||
|
} catch (error) {
|
||||||
|
this.downloadLoading = false;
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.query = { ...this.resetQuery };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.shop_list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.item_wrap {
|
||||||
|
$size: 80px;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
$radius: 4px;
|
||||||
|
width: $size;
|
||||||
|
height: $size;
|
||||||
|
border-radius: $radius;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: attr(data-index);
|
||||||
|
font-size: 12px;
|
||||||
|
height: 20px;
|
||||||
|
display: flex;
|
||||||
|
padding: 0 10px;
|
||||||
|
border-radius: 0 0 $radius 0;
|
||||||
|
align-items: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "删除";
|
||||||
|
font-size: 12px;
|
||||||
|
width: 100%;
|
||||||
|
height: 20px;
|
||||||
|
display: flex;
|
||||||
|
padding: 0 10px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 10;
|
||||||
|
transition: all 0.1s ease-in-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: $size;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
export default {
|
||||||
|
classType: [
|
||||||
|
{
|
||||||
|
value: "product",
|
||||||
|
label: "商品券"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "common",
|
||||||
|
label: "通用券"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
type: [
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
label: "满减"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "1",
|
||||||
|
label: "折扣"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
cycle: [
|
||||||
|
{ label: "周一", value: "Monday" },
|
||||||
|
{ label: "周二", value: "Tuesday" },
|
||||||
|
{ label: "周三", value: "Wednesday" },
|
||||||
|
{ label: "周四", value: "Thursday" },
|
||||||
|
{ label: "周五", value: "Friday" },
|
||||||
|
{ label: "周六", value: "Saturday" },
|
||||||
|
{ label: "周七", value: "Sunday" }
|
||||||
|
],
|
||||||
|
validityType: [
|
||||||
|
{
|
||||||
|
value: "fixed",
|
||||||
|
label: "领券后有效期内可用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "custom",
|
||||||
|
label: "固定有效期范围内可用"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
useTimeType: [
|
||||||
|
{
|
||||||
|
value: "all",
|
||||||
|
label: "全时段可用"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "custom",
|
||||||
|
label: "指定时间段"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="head-container">
|
||||||
|
<!-- <el-button type="primary" icon="el-icon-plus" @click="$refs.addCoupon.show()">
|
||||||
|
添加优惠券
|
||||||
|
</el-button> -->
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="plus"
|
||||||
|
@click="$router.push({ name: 'add_coupon', query: { type: 1 } })"
|
||||||
|
>
|
||||||
|
添加优惠券
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-table v-loading="tableData.loading" :data="tableData.data">
|
||||||
|
<el-table-column label="ID" prop="id" />
|
||||||
|
<el-table-column label="名称" prop="title" />
|
||||||
|
<el-table-column label="使用门槛">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{
|
||||||
|
`满${scope.row.fullAmount}${
|
||||||
|
scope.row.discountAmount ? "减" + scope.row.discountAmount + "元" : ""
|
||||||
|
}`
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="有效期">
|
||||||
|
<template v-slot="scope">
|
||||||
|
{{ `领券后${scope.row.validDays}天过期` }}
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column label="用户领取方式" prpo="source">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div>{{ scope.row.source == 'activate' ? '充值活动' :
|
||||||
|
scope.row.source == 'invited' ? '好友分享' : '' }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="总发放数量" prop="number" />
|
||||||
|
<el-table-column label="已领取" align="center">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: flex; align-items: center; justify-content: center">
|
||||||
|
<div style="width: 30px">{{ scope.row.number - scope.row.leftNumber }}</div>
|
||||||
|
<div style="margin: 0 10px">|</div>
|
||||||
|
<div
|
||||||
|
style="color: #3f9eff; cursor: pointer; flex-shrink: 0"
|
||||||
|
@click="couponDetailsOpen(scope.row)"
|
||||||
|
>
|
||||||
|
详情
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="已使用" prop="useNumber" />
|
||||||
|
<el-table-column label="剩余" prop="leftNumber" />
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="
|
||||||
|
$router.push({
|
||||||
|
name: 'add_coupon',
|
||||||
|
query: { type: scope.row.type, id: scope.row.id },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-pagination
|
||||||
|
:total="tableData.total"
|
||||||
|
:current-page="tableData.page"
|
||||||
|
:page-size="tableData.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="paginationChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<couponDetails ref="couponDetails" @success="resetHandle" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import couponEnum from "./couponEnum";
|
||||||
|
import couponDetails from "./components/coupon_details.vue";
|
||||||
|
import couponApi from "@/api/account/coupon";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// eslint-disable-next-line vue/no-unused-components
|
||||||
|
components: { couponDetails },
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableData: {
|
||||||
|
data: [],
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
couponId: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
typeFilter(value) {
|
||||||
|
// eslint-disable-next-line eqeqeq
|
||||||
|
return couponEnum.type.find((item) => item.value == value).label;
|
||||||
|
},
|
||||||
|
effectTypeFilter(value) {
|
||||||
|
// eslint-disable-next-line eqeqeq
|
||||||
|
return couponEnum.effectType.find((item) => item.value == value).label;
|
||||||
|
},
|
||||||
|
// 是否允许修改商品
|
||||||
|
toPath(path, row) {
|
||||||
|
this.$router.push({ path: path, query: row });
|
||||||
|
},
|
||||||
|
// 重置查询
|
||||||
|
resetHandle() {
|
||||||
|
this.page = 1;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
sizeChange(e) {
|
||||||
|
this.tableData.size = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
paginationChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.tableData.page = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 获取优惠券列表
|
||||||
|
async getTableData() {
|
||||||
|
this.tableData.loading = true;
|
||||||
|
try {
|
||||||
|
const res = await couponApi.getList({
|
||||||
|
page: this.tableData.page,
|
||||||
|
size: this.tableData.size,
|
||||||
|
});
|
||||||
|
this.tableData.loading = false;
|
||||||
|
this.tableData.data = res;
|
||||||
|
this.tableData.total = res.length;
|
||||||
|
console.log(this.tableData);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看领取详情
|
||||||
|
*/
|
||||||
|
couponDetailsOpen(row) {
|
||||||
|
this.$refs.couponDetails.show(row);
|
||||||
|
this.couponId = row.id;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除优惠券
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
async delTableHandle(id) {
|
||||||
|
console.log(delRes);
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="title">营销中心</div>
|
||||||
|
<div class="list">
|
||||||
|
<div class="item" v-for="item in list" :key="item.id" @click="to(item)">
|
||||||
|
<img :src="item.icon" class="icon" />
|
||||||
|
<div class="info">
|
||||||
|
<div class="name">{{ item.name }}</div>
|
||||||
|
<div class="intro">
|
||||||
|
{{ item.value }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import card from "@/assets/images/marketing/card.png";
|
||||||
|
import charge from "@/assets/images/marketing/charge.png";
|
||||||
|
import invite from "@/assets/images/marketing/invite.png";
|
||||||
|
import score from "@/assets/images/marketing/score.png";
|
||||||
|
const router = useRouter();
|
||||||
|
const to = (item) => {
|
||||||
|
router.push("/application/" + item.path);
|
||||||
|
};
|
||||||
|
const list = ref([
|
||||||
|
{ name: "优惠券", icon: card, path: "coupon" },
|
||||||
|
{ name: "霸王餐", icon: charge, path: "bwc" },
|
||||||
|
{ name: "邀请裂变", icon: invite, path: "" },
|
||||||
|
{ name: "积分锁客", icon: score, path: "" },
|
||||||
|
]);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.title {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
padding: 20px 0;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 14px;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 400px;
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 14px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.info {
|
||||||
|
.name {
|
||||||
|
color: #39d47a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: #39d47a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 10px;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
color: #999;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,28 +1,32 @@
|
||||||
import UserAPI, { type UserForm } from "@/api/system/user";
|
import printerApi, { type addRequest } from "@/api/account/printer";
|
||||||
|
import { options } from './config'
|
||||||
|
|
||||||
import type { IModalConfig } from "@/components/CURD/types";
|
import type { IModalConfig } from "@/components/CURD/types";
|
||||||
|
|
||||||
const modalConfig: IModalConfig<UserForm> = {
|
const modalConfig: IModalConfig<addRequest> = {
|
||||||
pageName: "sys:user",
|
pageName: "sys:user",
|
||||||
dialog: {
|
dialog: {
|
||||||
title: "新增用户",
|
title: "新增打印机",
|
||||||
width: 800,
|
width: 800,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
labelWidth: 100,
|
labelWidth: 100,
|
||||||
},
|
},
|
||||||
formAction: UserAPI.add,
|
formAction: function (data) {
|
||||||
|
return printerApi.add(data);
|
||||||
|
},
|
||||||
beforeSubmit(data) {
|
beforeSubmit(data) {
|
||||||
console.log("提交之前处理", data);
|
console.log("提交之前处理", data);
|
||||||
},
|
},
|
||||||
formItems: [
|
formItems: [
|
||||||
{
|
{
|
||||||
label: "用户名",
|
label: "设备名称",
|
||||||
prop: "username",
|
prop: "name",
|
||||||
rules: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
|
rules: [{ required: true, message: "设备名称不能为空", trigger: "blur" }],
|
||||||
type: "input",
|
type: "input",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入用户名",
|
placeholder: "请输入设备名称",
|
||||||
},
|
},
|
||||||
col: {
|
col: {
|
||||||
xs: 24,
|
xs: 24,
|
||||||
|
|
@ -30,90 +34,127 @@ const modalConfig: IModalConfig<UserForm> = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "用户昵称",
|
|
||||||
prop: "nickname",
|
|
||||||
rules: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
|
|
||||||
type: "input",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入用户昵称",
|
|
||||||
},
|
|
||||||
col: {
|
|
||||||
xs: 24,
|
|
||||||
sm: 12,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "所属部门",
|
|
||||||
prop: "deptId",
|
|
||||||
rules: [{ required: true, message: "所属部门不能为空", trigger: "blur" }],
|
|
||||||
type: "tree-select",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请选择所属部门",
|
|
||||||
data: [],
|
|
||||||
filterable: true,
|
|
||||||
"check-strictly": true,
|
|
||||||
"render-after-expand": false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "custom",
|
|
||||||
label: "性别",
|
|
||||||
prop: "gender",
|
|
||||||
initialValue: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "角色",
|
|
||||||
prop: "roleIds",
|
|
||||||
rules: [{ required: true, message: "用户角色不能为空", trigger: "blur" }],
|
|
||||||
type: "select",
|
type: "select",
|
||||||
|
label: "类型",
|
||||||
|
prop: "connectionType",
|
||||||
|
rules: [{ required: true, message: "请选择设备类型", trigger: "blur" }],
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请选择",
|
placeholder: "请选择设备类型",
|
||||||
multiple: true,
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
},
|
},
|
||||||
options: [],
|
|
||||||
initialValue: [],
|
|
||||||
},
|
},
|
||||||
{
|
options: options.connectionType,
|
||||||
type: "input",
|
col: {
|
||||||
label: "手机号码",
|
xs: 24,
|
||||||
prop: "mobile",
|
sm: 12,
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入手机号码",
|
|
||||||
maxlength: 11,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "邮箱",
|
label: "ip地址",
|
||||||
prop: "email",
|
prop: "address",
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
pattern: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,
|
|
||||||
message: "请输入正确的邮箱地址",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
type: "input",
|
type: "input",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入邮箱",
|
placeholder: "请输入ip地址",
|
||||||
maxlength: 50,
|
},
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "状态",
|
label: "端口",
|
||||||
prop: "status",
|
prop: "port",
|
||||||
|
type: "input",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入端口",
|
||||||
|
},
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "打印类型",
|
||||||
|
prop: "subType",
|
||||||
|
rules: [{ required: false, message: "请选择打印类型", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择打印类型",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: options.subType,
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "打印机品牌",
|
||||||
|
prop: "contentType",
|
||||||
|
rules: [{ required: true, message: "请选择打印机品牌", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择打印机品牌",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: options.contentType,
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio-button",
|
||||||
|
label: "小票尺寸",
|
||||||
|
prop: "receiptSize",
|
||||||
|
options: options.receiptSize,
|
||||||
|
initialValue: options.receiptSize[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio-button",
|
||||||
|
label: "分类打印",
|
||||||
|
prop: "classifyPrint",
|
||||||
|
options: options.classifyPrint,
|
||||||
|
initialValue: options.classifyPrint[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
type: "radio",
|
type: "radio",
|
||||||
options: [
|
label: "打印数量",
|
||||||
{ label: "正常", value: 1 },
|
prop: "printQty",
|
||||||
{ label: "禁用", value: 0 },
|
options: options.printQty,
|
||||||
],
|
initialValue: options.printQty[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio",
|
||||||
|
label: "打印方式",
|
||||||
|
prop: "printMethod",
|
||||||
|
options: options.printMethod,
|
||||||
|
initialValue: options.printMethod[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "checkbox",
|
||||||
|
label: "打印类型",
|
||||||
|
prop: "printType",
|
||||||
|
options: options.printType,
|
||||||
|
initialValue: options.printType.map(v => v.value)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "打印机状态",
|
||||||
|
prop: "status",
|
||||||
|
type: "switch",
|
||||||
initialValue: 1,
|
initialValue: 1,
|
||||||
|
attrs: {
|
||||||
|
activeValue: 1,
|
||||||
|
inactiveValue: 0,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
export const options: optionObject = {
|
||||||
|
connectionType: [
|
||||||
|
{ label: "USB", value: 'USB' },
|
||||||
|
{ label: "网络", value: '网络' },
|
||||||
|
{ label: "蓝牙", value: '蓝牙' },
|
||||||
|
],
|
||||||
|
subType: [
|
||||||
|
{ label: "标签", value: 'label' },
|
||||||
|
{ label: "小票", value: 'cash' },
|
||||||
|
{ label: "出品", value: 'kitchen' },
|
||||||
|
],
|
||||||
|
contentType: [
|
||||||
|
{ label: "云想印", value: '云想印' },
|
||||||
|
{ label: "飞鹅", value: '飞鹅' },
|
||||||
|
],
|
||||||
|
receiptSize: [
|
||||||
|
{ label: "58mm", value: '58mm' },
|
||||||
|
{ label: "80mm", value: '80mm' },
|
||||||
|
],
|
||||||
|
classifyPrint: [
|
||||||
|
{ label: "所有", value: 0 },
|
||||||
|
{ label: "部分分类", value: 1 },
|
||||||
|
{ label: "部分商品", value: 2 },
|
||||||
|
],
|
||||||
|
printQty: [
|
||||||
|
{ label: "顾客+商家[2张] ", value: 'c1m1^2' },
|
||||||
|
{ label: "商家[1张]", value: 'm1^1' },
|
||||||
|
{ label: "顾客[1张]", value: 'c1^1' },
|
||||||
|
{ label: "顾客2+商家1[3张]", value: 'c2m1^3' },
|
||||||
|
],
|
||||||
|
printMethod: [
|
||||||
|
{ value: "all", label: '全部打印' },
|
||||||
|
{ value: "normal", label: '仅打印结账单「前台」' },
|
||||||
|
{ value: "one", label: '仅打印制作单「厨房」' },
|
||||||
|
],
|
||||||
|
printType: [
|
||||||
|
{ label: "确认退款单", value: 'refund' },
|
||||||
|
{ label: "交班单", value: 'handover' },
|
||||||
|
{ label: "排队取号", value: 'queue' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type optionsType = string;
|
||||||
|
|
||||||
|
export function returnOptions(type: optionsType) {
|
||||||
|
return options[type]
|
||||||
|
}
|
||||||
|
|
||||||
|
export function returnOptionsLabel(optionsType: optionsType, value: string | number) {
|
||||||
|
const options = returnOptions(optionsType);
|
||||||
|
if (!options) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const option = options.find((item) => item.value === value);
|
||||||
|
return option ? option.label : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface options {
|
||||||
|
label: string;
|
||||||
|
value: string | number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
export interface optionObject {
|
||||||
|
[property: string]: options[];
|
||||||
|
}
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
import UserAPI from "@/api/system/user";
|
import printerApi, { type getListRequest } from "@/api/account/printer";
|
||||||
import RoleAPI from "@/api/system/role";
|
|
||||||
import type { UserPageQuery } from "@/api/system/user";
|
|
||||||
import type { IContentConfig } from "@/components/CURD/types";
|
import type { IContentConfig } from "@/components/CURD/types";
|
||||||
|
|
||||||
const contentConfig: IContentConfig<UserPageQuery> = {
|
|
||||||
|
const contentConfig: IContentConfig<getListRequest> = {
|
||||||
pageName: "sys:user",
|
pageName: "sys:user",
|
||||||
table: {
|
table: {
|
||||||
border: true,
|
border: true,
|
||||||
highlightCurrentRow: true,
|
highlightCurrentRow: true,
|
||||||
},
|
},
|
||||||
|
indexActionData: function (data: any) {
|
||||||
|
// Add your implementation here
|
||||||
|
return Promise.resolve(data);
|
||||||
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
background: true,
|
background: true,
|
||||||
layout: "prev,pager,next,jumper,total,sizes",
|
layout: "prev,pager,next,jumper,total,sizes",
|
||||||
|
|
@ -16,14 +19,11 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||||
pageSizes: [10, 20, 30, 50],
|
pageSizes: [10, 20, 30, 50],
|
||||||
},
|
},
|
||||||
indexAction: function (params) {
|
indexAction: function (params) {
|
||||||
return UserAPI.getPage(params);
|
return printerApi.getList(params);
|
||||||
},
|
},
|
||||||
deleteAction: UserAPI.deleteByIds,
|
deleteAction: function (id) {
|
||||||
importAction(file) {
|
return printerApi.delete(id)
|
||||||
return UserAPI.import(1, file);
|
|
||||||
},
|
},
|
||||||
exportAction: UserAPI.export,
|
|
||||||
importTemplate: UserAPI.downloadTemplate,
|
|
||||||
importsAction(data) {
|
importsAction(data) {
|
||||||
// 模拟导入数据
|
// 模拟导入数据
|
||||||
console.log("importsAction", data);
|
console.log("importsAction", data);
|
||||||
|
|
@ -31,7 +31,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||||
},
|
},
|
||||||
exportsAction: async function (params) {
|
exportsAction: async function (params) {
|
||||||
// 模拟获取到的是全量数据
|
// 模拟获取到的是全量数据
|
||||||
const res = await UserAPI.getPage(params);
|
const res = await printerApi.getPage(params);
|
||||||
console.log("exportsAction", res.list);
|
console.log("exportsAction", res.list);
|
||||||
return res.list;
|
return res.list;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
import type { IContentConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const contentConfig: IContentConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
table: {
|
|
||||||
showOverflowTooltip: true,
|
|
||||||
},
|
|
||||||
toolbar: [],
|
|
||||||
indexAction: function (params) {
|
|
||||||
// 模拟发起网络请求获取列表数据
|
|
||||||
console.log("indexAction:", params);
|
|
||||||
return Promise.resolve({
|
|
||||||
total: 2,
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
username: "tom",
|
|
||||||
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
|
|
||||||
percent: 99,
|
|
||||||
price: 10,
|
|
||||||
url: "https://www.baidu.com",
|
|
||||||
icon: "el-icon-setting",
|
|
||||||
gender: 1,
|
|
||||||
status: 1,
|
|
||||||
status2: 1,
|
|
||||||
sort: 99,
|
|
||||||
createTime: 1715647982437,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
username: "jerry",
|
|
||||||
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
|
|
||||||
percent: 88,
|
|
||||||
price: 999,
|
|
||||||
url: "https://www.google.com",
|
|
||||||
icon: "el-icon-user",
|
|
||||||
gender: 0,
|
|
||||||
status: 0,
|
|
||||||
status2: 0,
|
|
||||||
sort: 0,
|
|
||||||
createTime: 1715648977426,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
},
|
|
||||||
modifyAction(data) {
|
|
||||||
// 模拟发起网络请求修改字段
|
|
||||||
// console.log("modifyAction:", data);
|
|
||||||
ElMessage.success(JSON.stringify(data));
|
|
||||||
return Promise.resolve(null);
|
|
||||||
},
|
|
||||||
cols: [
|
|
||||||
{ type: "index", width: 50, align: "center" },
|
|
||||||
{ label: "ID", align: "center", prop: "id", show: false },
|
|
||||||
{ label: "文本", align: "center", prop: "username" },
|
|
||||||
{ label: "图片", align: "center", prop: "avatar", templet: "image" },
|
|
||||||
{
|
|
||||||
label: "百分比",
|
|
||||||
align: "center",
|
|
||||||
prop: "percent",
|
|
||||||
templet: "percent",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "货币符",
|
|
||||||
align: "center",
|
|
||||||
prop: "price",
|
|
||||||
templet: "price",
|
|
||||||
priceFormat: "$",
|
|
||||||
},
|
|
||||||
{ label: "链接", align: "center", prop: "url", width: 180, templet: "url" },
|
|
||||||
{ label: "图标", align: "center", prop: "icon", templet: "icon" },
|
|
||||||
{
|
|
||||||
label: "列表值",
|
|
||||||
align: "center",
|
|
||||||
prop: "gender",
|
|
||||||
templet: "list",
|
|
||||||
selectList: { "0": "女", "1": "男" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "自定义",
|
|
||||||
align: "center",
|
|
||||||
prop: "status",
|
|
||||||
templet: "custom",
|
|
||||||
slotName: "status",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Switch",
|
|
||||||
align: "center",
|
|
||||||
prop: "status2",
|
|
||||||
templet: "switch",
|
|
||||||
activeValue: 1,
|
|
||||||
inactiveValue: 0,
|
|
||||||
activeText: "启用",
|
|
||||||
inactiveText: "禁用",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "输入框",
|
|
||||||
align: "center",
|
|
||||||
prop: "sort",
|
|
||||||
templet: "input",
|
|
||||||
inputType: "number",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "日期格式化",
|
|
||||||
align: "center",
|
|
||||||
prop: "createTime",
|
|
||||||
minWidth: 120,
|
|
||||||
templet: "date",
|
|
||||||
dateFormat: "YYYY/MM/DD HH:mm:ss",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "操作栏",
|
|
||||||
align: "center",
|
|
||||||
fixed: "right",
|
|
||||||
width: 220,
|
|
||||||
templet: "tool",
|
|
||||||
operat: [
|
|
||||||
{
|
|
||||||
name: "reset_pwd",
|
|
||||||
auth: "password:reset",
|
|
||||||
icon: "refresh-left",
|
|
||||||
text: "重置密码",
|
|
||||||
type: "primary",
|
|
||||||
render(row) {
|
|
||||||
return row.id === 1;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default contentConfig;
|
|
||||||
|
|
@ -1,117 +1,163 @@
|
||||||
import UserAPI, { type UserForm } from "@/api/system/user";
|
import printerApi, { type editRequest } from "@/api/account/printer";
|
||||||
import type { IModalConfig } from "@/components/CURD/types";
|
import { options } from './config'
|
||||||
import { DeviceEnum } from "@/enums/DeviceEnum";
|
|
||||||
import { useAppStore } from "@/store";
|
|
||||||
|
|
||||||
const modalConfig: IModalConfig<UserForm> = {
|
import type { IModalConfig } from "@/components/CURD/types";
|
||||||
|
|
||||||
|
const modalConfig: IModalConfig<editRequest> = {
|
||||||
pageName: "sys:user",
|
pageName: "sys:user",
|
||||||
component: "drawer",
|
dialog: {
|
||||||
drawer: {
|
title: "修改打印机",
|
||||||
title: "修改用户",
|
width: 800,
|
||||||
size: useAppStore().device === DeviceEnum.MOBILE ? "80%" : 500,
|
draggable: true,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
labelWidth: 100,
|
||||||
},
|
},
|
||||||
pk: "id",
|
|
||||||
formAction: function (data) {
|
formAction: function (data) {
|
||||||
return UserAPI.update(data.id as number, data);
|
return printerApi.edit(data);
|
||||||
},
|
},
|
||||||
beforeSubmit(data) {
|
beforeSubmit(data) {
|
||||||
console.log("提交之前处理", data);
|
console.log("提交之前处理", data);
|
||||||
},
|
},
|
||||||
formItems: [
|
formItems: [
|
||||||
{
|
{
|
||||||
label: "用户名",
|
label: "设备名称",
|
||||||
prop: "username",
|
prop: "name",
|
||||||
rules: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
|
rules: [{ required: true, message: "设备名称不能为空", trigger: "blur" }],
|
||||||
type: "input",
|
type: "input",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入用户名",
|
placeholder: "请输入设备名称",
|
||||||
readonly: true,
|
},
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "用户昵称",
|
|
||||||
prop: "nickname",
|
|
||||||
rules: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
|
|
||||||
type: "input",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入用户昵称",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "所属部门",
|
|
||||||
prop: "deptId",
|
|
||||||
rules: [{ required: true, message: "所属部门不能为空", trigger: "blur" }],
|
|
||||||
type: "tree-select",
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请选择所属部门",
|
|
||||||
data: [],
|
|
||||||
filterable: true,
|
|
||||||
"check-strictly": true,
|
|
||||||
"render-after-expand": false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "custom",
|
|
||||||
label: "性别",
|
|
||||||
prop: "gender",
|
|
||||||
initialValue: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "角色",
|
|
||||||
prop: "roleIds",
|
|
||||||
rules: [{ required: true, message: "用户角色不能为空", trigger: "blur" }],
|
|
||||||
type: "select",
|
type: "select",
|
||||||
|
label: "类型",
|
||||||
|
prop: "connectionType",
|
||||||
|
rules: [{ required: true, message: "请选择设备类型", trigger: "blur" }],
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请选择",
|
placeholder: "请选择设备类型",
|
||||||
multiple: true,
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
},
|
},
|
||||||
options: [],
|
|
||||||
initialValue: [],
|
|
||||||
},
|
},
|
||||||
{
|
options: options.connectionType,
|
||||||
type: "input",
|
col: {
|
||||||
label: "手机号码",
|
xs: 24,
|
||||||
prop: "mobile",
|
sm: 12,
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
||||||
message: "请输入正确的手机号码",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
attrs: {
|
|
||||||
placeholder: "请输入手机号码",
|
|
||||||
maxlength: 11,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "邮箱",
|
label: "ip地址",
|
||||||
prop: "email",
|
prop: "address",
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
pattern: /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/,
|
|
||||||
message: "请输入正确的邮箱地址",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
type: "input",
|
type: "input",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入邮箱",
|
placeholder: "请输入ip地址",
|
||||||
maxlength: 50,
|
},
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "状态",
|
label: "端口",
|
||||||
|
prop: "port",
|
||||||
|
type: "input",
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请输入端口",
|
||||||
|
},
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "打印类型",
|
||||||
|
prop: "subType",
|
||||||
|
rules: [{ required: false, message: "请选择打印类型", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择打印类型",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: options.subType,
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
label: "打印机品牌",
|
||||||
|
prop: "contentType",
|
||||||
|
rules: [{ required: true, message: "请选择打印机品牌", trigger: "blur" }],
|
||||||
|
attrs: {
|
||||||
|
placeholder: "请选择打印机品牌",
|
||||||
|
clearable: true,
|
||||||
|
style: {
|
||||||
|
width: "200px",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: options.contentType,
|
||||||
|
col: {
|
||||||
|
xs: 24,
|
||||||
|
sm: 12,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio-button",
|
||||||
|
label: "小票尺寸",
|
||||||
|
prop: "receiptSize",
|
||||||
|
options: options.receiptSize,
|
||||||
|
initialValue: options.receiptSize[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio-button",
|
||||||
|
label: "分类打印",
|
||||||
|
prop: "classifyPrint",
|
||||||
|
options: options.classifyPrint,
|
||||||
|
initialValue: options.classifyPrint[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio",
|
||||||
|
label: "打印数量",
|
||||||
|
prop: "printQty",
|
||||||
|
options: options.printQty,
|
||||||
|
initialValue: options.printQty[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "radio",
|
||||||
|
label: "打印方式",
|
||||||
|
prop: "printMethod",
|
||||||
|
options: options.printMethod,
|
||||||
|
initialValue: options.printMethod[0].value
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "checkbox",
|
||||||
|
label: "打印类型",
|
||||||
|
prop: "printType",
|
||||||
|
options: options.printType,
|
||||||
|
initialValue: options.printType.map(v => v.value)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "打印机状态",
|
||||||
prop: "status",
|
prop: "status",
|
||||||
type: "switch",
|
type: "switch",
|
||||||
|
initialValue: 1,
|
||||||
attrs: {
|
attrs: {
|
||||||
activeText: "正常",
|
|
||||||
inactiveText: "禁用",
|
|
||||||
activeValue: 1,
|
activeValue: 1,
|
||||||
inactiveValue: 0,
|
inactiveValue: 0,
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 如果有异步数据会修改配置的,推荐用reactive包裹,而纯静态配置的可以直接导出
|
||||||
export default reactive(modalConfig);
|
export default reactive(modalConfig);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
import DeptAPI from "@/api/system/dept";
|
|
||||||
import type { ISearchConfig } from "@/components/CURD/types";
|
import type { ISearchConfig } from "@/components/CURD/types";
|
||||||
|
import { options } from './config'
|
||||||
const searchConfig: ISearchConfig = {
|
const searchConfig: ISearchConfig = {
|
||||||
pageName: "sys:user",
|
pageName: "sys:user",
|
||||||
formItems: [
|
formItems: [
|
||||||
{
|
{
|
||||||
type: "input",
|
type: "input",
|
||||||
label: "设备名称",
|
label: "设备名称",
|
||||||
prop: "keywords",
|
prop: "name",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "请输入设备名称",
|
placeholder: "请输入设备名称",
|
||||||
clearable: true,
|
clearable: true,
|
||||||
|
|
@ -18,19 +17,16 @@ const searchConfig: ISearchConfig = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "select",
|
type: "select",
|
||||||
label: "状态",
|
label: "类型",
|
||||||
prop: "status",
|
prop: "connectionType",
|
||||||
attrs: {
|
attrs: {
|
||||||
placeholder: "全部",
|
placeholder: "请选择设备类型",
|
||||||
clearable: true,
|
clearable: true,
|
||||||
style: {
|
style: {
|
||||||
width: "100px",
|
width: "200px",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
options: options.connectionType,
|
||||||
{ label: "启用", value: 1 },
|
|
||||||
{ label: "禁用", value: 0 },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,26 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<template v-if="isA">
|
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="handleQueryClick"
|
<page-search
|
||||||
@reset-click="handleResetClick" />
|
ref="searchRef"
|
||||||
|
:search-config="searchConfig"
|
||||||
|
@query-click="handleQueryClick"
|
||||||
|
@reset-click="handleResetClick"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
<page-content
|
||||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
ref="contentRef"
|
||||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
:content-config="contentConfig"
|
||||||
|
@add-click="handleAddClick"
|
||||||
|
@edit-click="handleEditClick"
|
||||||
|
@export-click="handleExportClick"
|
||||||
|
@search-click="handleSearchClick"
|
||||||
|
@toolbar-click="handleToolbarClick"
|
||||||
|
@operat-click="handleOperatClick"
|
||||||
|
@filter-change="handleFilterChange"
|
||||||
|
>
|
||||||
<template #status="scope">
|
<template #status="scope">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
|
|
@ -20,7 +31,11 @@
|
||||||
</template>
|
</template>
|
||||||
<template #mobile="scope">
|
<template #mobile="scope">
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
<copy-button
|
||||||
|
v-if="scope.row[scope.prop]"
|
||||||
|
:text="scope.row[scope.prop]"
|
||||||
|
style="margin-left: 2px"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</page-content>
|
</page-content>
|
||||||
|
|
||||||
|
|
@ -32,33 +47,24 @@
|
||||||
</page-modal>
|
</page-modal>
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
<page-modal
|
||||||
|
ref="editModalRef"
|
||||||
|
:modal-config="editModalConfig"
|
||||||
|
@submit-click="handleSubmitClick"
|
||||||
|
>
|
||||||
<template #gender="scope">
|
<template #gender="scope">
|
||||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
|
|
||||||
<template #status="scope">
|
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</page-content>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import UserAPI from "@/api/system/user";
|
import UserAPI from "@/api/system/user";
|
||||||
import DeptAPI from "@/api/system/dept";
|
|
||||||
import RoleAPI from "@/api/system/role";
|
|
||||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||||
import usePage from "@/components/CURD/usePage";
|
import usePage from "@/components/CURD/usePage";
|
||||||
import addModalConfig from "./config/add";
|
import addModalConfig from "./config/add";
|
||||||
import contentConfig from "./config/content";
|
import contentConfig from "./config/content";
|
||||||
import contentConfig2 from "./config/content2";
|
|
||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
|
|
||||||
|
|
@ -80,19 +86,11 @@ const {
|
||||||
// 新增
|
// 新增
|
||||||
async function handleAddClick() {
|
async function handleAddClick() {
|
||||||
addModalRef.value?.setModalVisible();
|
addModalRef.value?.setModalVisible();
|
||||||
// 加载部门下拉数据源
|
|
||||||
addModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
|
||||||
// 加载角色下拉数据源
|
|
||||||
addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
|
||||||
}
|
}
|
||||||
// 编辑
|
// 编辑
|
||||||
async function handleEditClick(row: IObject) {
|
async function handleEditClick(row: IObject) {
|
||||||
editModalRef.value?.handleDisabled(false);
|
editModalRef.value?.handleDisabled(false);
|
||||||
editModalRef.value?.setModalVisible();
|
editModalRef.value?.setModalVisible();
|
||||||
// 加载部门下拉数据源
|
|
||||||
editModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
|
||||||
// 加载角色下拉数据源
|
|
||||||
editModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
|
||||||
// 根据id获取数据进行填充
|
// 根据id获取数据进行填充
|
||||||
const data = await UserAPI.getFormData(row.id);
|
const data = await UserAPI.getFormData(row.id);
|
||||||
editModalRef.value?.setFormData(data);
|
editModalRef.value?.setFormData(data);
|
||||||
|
|
@ -107,31 +105,11 @@ function handleToolbarClick(name: string) {
|
||||||
// 其他操作列
|
// 其他操作列
|
||||||
async function handleOperatClick(data: IOperatData) {
|
async function handleOperatClick(data: IOperatData) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
// 重置密码
|
if (data.name === "detail") {
|
||||||
if (data.name === "reset_pwd") {
|
|
||||||
ElMessageBox.prompt("请输入用户「" + data.row.username + "」的新密码", "重置密码", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
}).then(({ value }) => {
|
|
||||||
if (!value || value.length < 6) {
|
|
||||||
ElMessage.warning("密码至少需要6位字符,请重新输入");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
UserAPI.resetPassword(data.row.id, value).then(() => {
|
|
||||||
ElMessage.success("密码重置成功,新密码是:" + value);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else if (data.name === "detail") {
|
|
||||||
// 禁用表单编辑
|
// 禁用表单编辑
|
||||||
editModalRef.value?.handleDisabled(true);
|
editModalRef.value?.handleDisabled(true);
|
||||||
// 打开抽屉
|
// 打开抽屉
|
||||||
editModalRef.value?.setModalVisible();
|
editModalRef.value?.setModalVisible();
|
||||||
// 修改抽屉标题
|
|
||||||
editModalConfig.drawer = { ...editModalConfig.drawer, title: "用户详情" };
|
|
||||||
// 加载部门下拉数据源
|
|
||||||
editModalConfig.formItems[2]!.attrs!.data = await DeptAPI.getOptions();
|
|
||||||
// 加载角色下拉数据源
|
|
||||||
editModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
|
|
||||||
// 根据id获取数据进行填充
|
// 根据id获取数据进行填充
|
||||||
const formData = await UserAPI.getFormData(data.row.id);
|
const formData = await UserAPI.getFormData(data.row.id);
|
||||||
// 设置表单数据
|
// 设置表单数据
|
||||||
|
|
|
||||||