修改打印机页面,增加叫号管理页面、霸王餐、店铺优惠券
This commit is contained in:
93
src/views/application/list/index.vue
Normal file
93
src/views/application/list/index.vue
Normal file
@@ -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>
|
||||
413
src/views/application/list/lineUplist/components/basic.vue
Normal file
413
src/views/application/list/lineUplist/components/basic.vue
Normal file
@@ -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>
|
||||
533
src/views/application/list/lineUplist/components/index.vue
Normal file
533
src/views/application/list/lineUplist/components/index.vue
Normal file
@@ -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>
|
||||
34
src/views/application/list/lineUplist/index.vue
Normal file
34
src/views/application/list/lineUplist/index.vue
Normal file
@@ -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>
|
||||
119
src/views/application/list/lineUplist/record.vue
Normal file
119
src/views/application/list/lineUplist/record.vue
Normal file
@@ -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>
|
||||
99
src/views/application/marketing/bwc.vue
Normal file
99
src/views/application/marketing/bwc.vue
Normal file
@@ -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>
|
||||
51
src/views/application/marketing/coupon/couponEnum.js
Normal file
51
src/views/application/marketing/coupon/couponEnum.js
Normal file
@@ -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: "指定时间段"
|
||||
}
|
||||
]
|
||||
};
|
||||
183
src/views/application/marketing/coupon/list.vue
Normal file
183
src/views/application/marketing/coupon/list.vue
Normal file
@@ -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>
|
||||
90
src/views/application/marketing/index.vue
Normal file
90
src/views/application/marketing/index.vue
Normal file
@@ -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>
|
||||
Reference in New Issue
Block a user