1.对接会员列表 2.对接排队叫号
This commit is contained in:
@@ -194,10 +194,10 @@ function payTypeFilter(t) {
|
||||
|
||||
// 订单类型
|
||||
const typeList = reactive([
|
||||
{
|
||||
value: 1,
|
||||
label: '自营'
|
||||
},
|
||||
// {
|
||||
// value: 1,
|
||||
// label: '自营'
|
||||
// },
|
||||
{
|
||||
value: 2,
|
||||
label: '抖音'
|
||||
|
||||
@@ -82,7 +82,8 @@
|
||||
<el-text>¥{{ item.skuList[0].salePrice }}</el-text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-text tag="del" class="del" size="small">¥{{ item.skuList[0].salePrice }}</el-text>
|
||||
<el-text tag="del" class="del" size="small">¥{{ item.skuList[0].salePrice
|
||||
}}</el-text>
|
||||
<el-text>¥{{ item.skuList[0].memberPrice }}</el-text>
|
||||
</template>
|
||||
</div>
|
||||
@@ -412,7 +413,7 @@ function searchHandle() {
|
||||
|
||||
// 确认选择规格回调
|
||||
function skuConfirm(params) {
|
||||
console.log(params);
|
||||
// console.log(params);
|
||||
let goodsItem = goodsStore.cartList.find(goods => goods.product_id == params.productId && goods.sku_id == params.id)
|
||||
if (goodsItem && goodsItem.id) {
|
||||
// 编辑新增
|
||||
@@ -427,7 +428,11 @@ function skuConfirm(params) {
|
||||
}
|
||||
} else {
|
||||
// 添加
|
||||
goodsStore.addCart({ ...params, number: params.suitNum })
|
||||
if (params.type == 'weight') {
|
||||
goodsStore.addCart({ ...params, number: params.number })
|
||||
} else {
|
||||
goodsStore.addCart({ ...params, number: params.suitNum })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1028,9 +1033,11 @@ defineExpose({
|
||||
padding: 6px 10px;
|
||||
background-color: var(--primary-color);
|
||||
position: relative;
|
||||
|
||||
.price_warp {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.del {
|
||||
color: #fff;
|
||||
position: relative;
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
<div class="button">
|
||||
<el-checkbox v-model="isPrint" border label="打印结算小票" style="width: 100%" />
|
||||
</div>
|
||||
<div class="print">
|
||||
<!-- <div class="print">
|
||||
<el-button type="warning" :loading="discountLoading" @click="showStaffDiscountHandle">添加折扣</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="print">
|
||||
<el-button type="primary" :loading="printLoading" @click="printHandle">打印预结单</el-button>
|
||||
</div>
|
||||
@@ -297,7 +297,7 @@ function paySuccess() {
|
||||
dialogVisible.value = false;
|
||||
|
||||
ElMessage.success('支付成功')
|
||||
goodsStore.successClearCart()
|
||||
goodsStore.successClearCart(!cartList.length)
|
||||
// printOrderLable()
|
||||
// emit("paySuccess");
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
<div class="number" @click="SelectVipUserRef.show()">
|
||||
<div class="left">
|
||||
<el-icon class="icon">
|
||||
<UserFilled />
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
<template v-if="!goodsStore.vipUserInfo.id">
|
||||
<el-text class="t">选择会员</el-text>
|
||||
<span class="t">选择会员</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="user_info" @click="goodsStore.vipUserInfo = ''">
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="table_info" v-if="goodsStore.tableInfo.name">
|
||||
<div class="left">
|
||||
<span>台桌:{{ goodsStore.tableInfo.name }}</span>
|
||||
<span>{{ goodsStore.tableInfo.num }}人</span>
|
||||
<span>{{ goodsStore.tableInfo.num || 1 }}人</span>
|
||||
</div>
|
||||
<div class="close" @click="goodsStore.selectTable()">
|
||||
<el-icon class="icon">
|
||||
@@ -390,7 +390,7 @@ function clearVipUserHandle() {
|
||||
.menu {
|
||||
background-color: var(--el-color-warning);
|
||||
color: #fff;
|
||||
width: 60px;
|
||||
width: 80px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -415,11 +415,11 @@ function clearVipUserHandle() {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: var(--el-color-info-light-7);
|
||||
padding: 0 10px;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 14px;
|
||||
}
|
||||
|
||||
.icon_wrap {
|
||||
@@ -430,8 +430,8 @@ function clearVipUserHandle() {
|
||||
justify-content: center;
|
||||
|
||||
.u_icon {
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
font-size: 16px;
|
||||
color: var(--el-color-primary);
|
||||
|
||||
.i {
|
||||
display: flex;
|
||||
@@ -446,7 +446,10 @@ function clearVipUserHandle() {
|
||||
|
||||
.t {
|
||||
font-size: var(--el-font-size-base);
|
||||
margin-left: 4px;
|
||||
color: var(--el-color-primary);
|
||||
margin-left: 6px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
.user_info {
|
||||
@@ -465,8 +468,9 @@ function clearVipUserHandle() {
|
||||
.p {
|
||||
width: 83px;
|
||||
flex: 1;
|
||||
color: #999;
|
||||
color: var(--el-color-primary);
|
||||
font-size: 14px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@ const submitHandle = () => {
|
||||
store
|
||||
.userlogin(form)
|
||||
.then(async (res) => {
|
||||
console.log(res);
|
||||
|
||||
// 登录成功后保存商户号
|
||||
// useStorage.set('merchantLoginAccount', form.username)
|
||||
ElMessage.success("登录成功");
|
||||
@@ -156,7 +158,7 @@ const submitHandle = () => {
|
||||
});
|
||||
}, 1000);
|
||||
// const douyin = await douyincheckIn({
|
||||
// token: res.token,
|
||||
// token: store.token,
|
||||
// loginName: res.loginName,
|
||||
// clientType: 'pc'
|
||||
// })
|
||||
|
||||
163
src/views/member/components/addUserDrawer.vue
Normal file
163
src/views/member/components/addUserDrawer.vue
Normal file
@@ -0,0 +1,163 @@
|
||||
<template>
|
||||
<el-dialog v-model="showDialog" title="添加会员" top="10vh" @closed="resetHandle">
|
||||
<div class="height_auto" style="height: 400px;">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px" label-position="left">
|
||||
<el-form-item label="用户头像">
|
||||
<UploadImg ref="UploadImgRef" @success="e => form.headImg = e" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="电话号码" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入电话号码"
|
||||
@input="phoneInput($event, 'phone')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员生日">
|
||||
<el-date-picker v-model="form.birthDay" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择会员生日">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="form.sex">
|
||||
<el-radio-button label="男" :value="1"></el-radio-button>
|
||||
<el-radio-button label="女" :value="0"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="账户积分">
|
||||
<el-input v-model="form.accountPoints" placeholder="请输入账户积分"
|
||||
@input="phoneInput($event, 'accountPoints')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="钱包余额">
|
||||
<el-input v-model="form.amount" placeholder="请输入钱包余额"
|
||||
@input="phoneInput($event, 'amount')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否会员">
|
||||
<el-radio-group v-model="form.isVip">
|
||||
<el-radio-button label="否" :value="0"></el-radio-button>
|
||||
<el-radio-button label="是" :value="1"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="btn">
|
||||
<el-button style="width: 100%;" @click="closeHandle">取消</el-button>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button type="primary" style="width: 100%;" @click="confirmHandle">确定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import UploadImg from '@/components/uploadImg.vue'
|
||||
import { addShopUser } from '@/api/account.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { inputFilterInt, regPhone, inputFilterFloat } from '@/utils/index.js'
|
||||
|
||||
const emits = defineEmits(['success'])
|
||||
|
||||
const UploadImgRef = ref(null)
|
||||
const showDialog = ref(false)
|
||||
const formRef = ref(null)
|
||||
|
||||
const form = ref({
|
||||
headImg: '', // 用户头像
|
||||
nickName: '', // 用户昵称
|
||||
phone: '', // 电话号码
|
||||
birthDay: '', // 会员生日
|
||||
sex: '', // 0-女 1男
|
||||
accountPoints: '', // 账户积分
|
||||
amount: '', // 钱包余额
|
||||
isVip: 0, // 是否会员
|
||||
})
|
||||
|
||||
const rules = ref({
|
||||
nickName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入用户昵称',
|
||||
trigger: 'blur',
|
||||
}
|
||||
],
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('请输入电话号码'))
|
||||
} else if (!regPhone(value)) {
|
||||
return callback(new Error('请输入正确的电话号码'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const resetForm = ref({})
|
||||
|
||||
function phoneInput(e, key) {
|
||||
if (key == 'amount') {
|
||||
setTimeout(() => {
|
||||
form.value[key] = inputFilterFloat(e)
|
||||
}, 50)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
form.value[key] = inputFilterInt(e)
|
||||
}, 50)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交
|
||||
function confirmHandle() {
|
||||
formRef.value.validate(async valid => {
|
||||
try {
|
||||
if (valid) {
|
||||
await addShopUser(form.value)
|
||||
ElMessage.success('添加成功')
|
||||
closeHandle()
|
||||
emits('success')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function closeHandle() {
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
function resetHandle() {
|
||||
form.value = { ...resetForm.value }
|
||||
}
|
||||
|
||||
function show() {
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
resetForm.value = { ...form.value }
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.footer {
|
||||
display: flex;
|
||||
gap: var(--el-font-size-base);
|
||||
padding-top: var(--el-font-size-base);
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,26 +1,25 @@
|
||||
<template>
|
||||
<el-dialog v-model="visableDialog" title="余额明细" width="500">
|
||||
<el-dialog v-model="visableDialog" title="余额明细" top="10vh" width="500" @closed="closeHandle">
|
||||
<div class="box">
|
||||
<div class="box1" v-loading="tableData.loading">
|
||||
<div class="dialog_footer" v-for="(item, index) in tableData.list" :key="index">
|
||||
<div class="dialog_footer_left">
|
||||
<span>{{ item.biz_name }}</span>
|
||||
<span>{{ dayjs(item.create_time).format("YYYY-MM-DD HH:mm:ss") }}</span>
|
||||
<span>{{ labelFilter(item.bizCode) }}</span>
|
||||
<span>{{ item.createTime }}</span>
|
||||
</div>
|
||||
<div class="dialog_footer_right">
|
||||
<span :class="{ active: item.type == '+' }">
|
||||
<template v-if="item.type == '+'">+</template>
|
||||
<template v-else>-</template>
|
||||
<span :class="{ active: item.amount > 0 }">
|
||||
<template v-if="item.amount > 0">+</template>
|
||||
¥{{ formatDecimal(item.amount) }}
|
||||
</span>
|
||||
<span>余额:¥{{ formatDecimal(item.balance) }}</span>
|
||||
</div>
|
||||
<div class="btm" style="width: 80px;">
|
||||
<el-button type="primary"
|
||||
v-if="item.biz_code == 'scanMemberIn' || item.biz_code == 'cashMemberIn'"
|
||||
@click="showRefundHandle(item)" :disabled="item.is_return == 1">
|
||||
<template v-if="item.is_return == 0">退款</template>
|
||||
<template v-if="item.is_return == 1">已退</template>
|
||||
v-if="item.bizCode == 'cashIn' || item.bizCode == 'wechatIn' || item.bizCode == 'alipayIn'"
|
||||
@click="showRefundHandle(item)" :disabled="item.refundAmount > 0">
|
||||
<template v-if="item.refundAmount == 0">退款</template>
|
||||
<template v-if="item.refundAmount > 0">已退</template>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,11 +29,29 @@
|
||||
<el-pagination v-model:current-page="tableData.page" background layout="prev, pager, next, total"
|
||||
:total="tableData.total" @current-change="memberqueryMemberAccountAjax" />
|
||||
</div>
|
||||
<el-dialog v-model="showDialog" title="会员充值退款">
|
||||
<el-dialog v-model="showDialog" top="1vh" title="会员充值退款">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100">
|
||||
<el-form-item label="当前余额">
|
||||
<span>{{ refundItem.amount }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值金额">
|
||||
<span>{{ refundItem.inAmount }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="已退金额">
|
||||
<el-input v-model="refundItem.inRefundAmount" disabled />
|
||||
</el-form-item>
|
||||
<template v-if="refundItem.giftAmount - refundItem.giftRefundAmount > 0">
|
||||
<el-form-item label="赠送金额">
|
||||
<el-input v-model="refundItem.giftAmount" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="已退赠送金额">
|
||||
<el-input v-model="refundItem.giftRefundAmount" disabled />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="退款金额" prop="amount">
|
||||
<el-input-number v-model="form.amount" :min="1" :max="refundItem.amount"
|
||||
placeholder="请输入退款金额" />
|
||||
<el-input-number v-model="form.amount" :min="0.01" :max="form.max" placeholder="请输入退款金额" />
|
||||
<div class="tips" v-if="refundItem.giftAmount - refundItem.giftRefundAmount > 0">
|
||||
注意:一旦退款,赠送金额{{ refundItem.giftAmount }}也将全额退还</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="退款说明">
|
||||
<el-input v-model="form.remark" placeholder="请输入退款说明" />
|
||||
@@ -55,17 +72,21 @@
|
||||
|
||||
<script setup>
|
||||
import md5 from "js-md5";
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { dayjs, ElMessage } from 'element-plus'
|
||||
import { formatDecimal } from '@/utils/index'
|
||||
import { shopUserChargeFlow } from '@/api/account.js'
|
||||
import { refundVipBefore, refundVip } from '@/api/order.js'
|
||||
import { returnFlow, memberqueryMemberAccount } from '@/api/member/index.js'
|
||||
import { queryPwdInfo, staffPermission } from '@/api/user.js'
|
||||
import takeFoodCode from "@/components/takeFoodCode.vue";
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
import { useUser } from '@/store/user.js'
|
||||
|
||||
const memberId = ref('')
|
||||
|
||||
const userStore = useUser()
|
||||
const globalStore = useGlobal()
|
||||
const userInfo = ref('')
|
||||
const visableDialog = ref(false)
|
||||
|
||||
const tableData = reactive({
|
||||
page: 1,
|
||||
total: 0,
|
||||
@@ -73,18 +94,37 @@ const tableData = reactive({
|
||||
list: []
|
||||
})
|
||||
|
||||
// 重置
|
||||
function closeHandle() {
|
||||
tableData.page = 1
|
||||
tableData.total = 0
|
||||
tableData.loading = false
|
||||
tableData.list = []
|
||||
}
|
||||
|
||||
// 过滤流水名称
|
||||
function labelFilter(type) {
|
||||
let item = globalStore.bizCodes.find(item => item.type == type)
|
||||
if (item) {
|
||||
return item.label
|
||||
} else {
|
||||
return type
|
||||
}
|
||||
}
|
||||
|
||||
// 会员流水
|
||||
async function memberqueryMemberAccountAjax() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
let res = await memberqueryMemberAccount({
|
||||
memberId: memberId.value,
|
||||
let res = await shopUserChargeFlow({
|
||||
userId: userInfo.value.userId,
|
||||
bizCode: '',
|
||||
page: tableData.page,
|
||||
pageSize: 10
|
||||
})
|
||||
tableData.loading = false
|
||||
tableData.total = res.total
|
||||
tableData.list = res.list
|
||||
tableData.total = +res.totalRow
|
||||
tableData.list = res.records
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -95,7 +135,8 @@ const emits = defineEmits(['refund'])
|
||||
const takeFoodCodeRef = ref(null)
|
||||
const showDialog = ref(false)
|
||||
const form = reactive({
|
||||
amount: 1,
|
||||
amount: 0,
|
||||
max: 999,
|
||||
remark: ''
|
||||
})
|
||||
const rules = reactive({
|
||||
@@ -110,12 +151,28 @@ const rules = reactive({
|
||||
const loading = ref(false)
|
||||
const refundItem = ref({})
|
||||
const formRef = ref(null)
|
||||
const flowItem = ref({})
|
||||
|
||||
// 显示充值退款
|
||||
async function showRefundHandle(item) {
|
||||
try {
|
||||
await staffPermission('yun_xu_tui_kuan')
|
||||
refundItem.value = item
|
||||
form.amount = item.amount
|
||||
// await staffPermission('yun_xu_tui_kuan')
|
||||
// 退款前置操作
|
||||
flowItem.value = item
|
||||
const res = await refundVipBefore({
|
||||
shopId: item.shopId,
|
||||
userId: item.userId,
|
||||
flowId: item.id
|
||||
})
|
||||
refundItem.value = res
|
||||
|
||||
if (res.amount - res.giftAmount - res.giftRefundAmount >= (res.inAmount - res.inRefundAmount)) {
|
||||
form.amount = formatDecimal(res.inAmount - res.inRefundAmount, 2, true)
|
||||
} else {
|
||||
form.amount = formatDecimal(res.amount - res.giftAmount - res.giftRefundAmount, 2, true)
|
||||
}
|
||||
|
||||
form.max = form.amount
|
||||
showDialog.value = true
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -128,9 +185,10 @@ function refundHandle() {
|
||||
try {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
let res = await queryPwdInfo()
|
||||
// 更新店铺详情获取最新的密码规则
|
||||
await userStore.getShopInfo()
|
||||
loading.value = false
|
||||
if (res.isMemberReturn == 1) {
|
||||
if (userStore.shopInfo.isMemberInPwd == 1) {
|
||||
takeFoodCodeRef.value.show();
|
||||
} else {
|
||||
passwordSuccess()
|
||||
@@ -147,11 +205,15 @@ function refundHandle() {
|
||||
async function passwordSuccess(e = '') {
|
||||
try {
|
||||
loading.value = true
|
||||
const res = await returnFlow({
|
||||
flowId: refundItem.value.id,
|
||||
await refundVip({
|
||||
shopId: flowItem.value.shopId,
|
||||
userId: flowItem.value.userId,
|
||||
flowId: flowItem.value.id,
|
||||
refAmount: form.amount,
|
||||
remark: form.remark,
|
||||
amount: form.amount,
|
||||
pwd: e ? md5(e) : '',
|
||||
outOfRange: false,
|
||||
cashRefund: true,
|
||||
pwd: e,
|
||||
})
|
||||
ElMessage.success('退款成功')
|
||||
form.amount = 1
|
||||
@@ -159,15 +221,15 @@ async function passwordSuccess(e = '') {
|
||||
showDialog.value = false
|
||||
loading.value = false
|
||||
emits('refund')
|
||||
memberqueryMemberAccountAjax()
|
||||
// memberqueryMemberAccountAjax()
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function show(id) {
|
||||
memberId.value = id
|
||||
function show(row) {
|
||||
userInfo.value = row
|
||||
visableDialog.value = true
|
||||
memberqueryMemberAccountAjax()
|
||||
}
|
||||
@@ -33,7 +33,9 @@ function paySuccess() {
|
||||
|
||||
function show() {
|
||||
dialogVisible.value = true;
|
||||
fastPayCardRef.value.reset();
|
||||
setTimeout(() => {
|
||||
fastPayCardRef.value.reset();
|
||||
}, 100)
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
807
src/views/member/index copy.vue
Normal file
807
src/views/member/index copy.vue
Normal file
@@ -0,0 +1,807 @@
|
||||
<template>
|
||||
<div class="orderbox">
|
||||
<div class="orderbox_left">
|
||||
<div class="demo_tabs" v-if="props.membershow == '0'">
|
||||
<div class="demo_tabs_div">
|
||||
<el-input v-model="tableData.phone" placeholder="请输入手机号" @input="inputChange" clearable @focus="
|
||||
global.updateData(false)" @blur="global.updateData(true)" />
|
||||
<el-button style="margin-left: 10px;" type="primary" @click="addMemberHandle">添加</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="tableData.list" style="width: 100%;margin-top: 10px;height:80%;"
|
||||
:row-class-name="tableRowClassName" @cell-click="cellclicktableData" v-loading="loading">
|
||||
<el-table-column prop="name" label="昵称" />
|
||||
<el-table-column prop="telephone" label="手机" width="200px" />
|
||||
<el-table-column prop="code" label="编号" width="150px" />
|
||||
<el-table-column prop="level" label="等级" />
|
||||
<el-table-column prop="levelConsume" label="积分" />
|
||||
<el-table-column prop="amount" label="余额" />
|
||||
</el-table>
|
||||
<el-pagination layout="prev, pager, next, jumper" style="margin-top: 20px;" :total="Number(tableData.total)"
|
||||
@current-change="handleCurrentChange" />
|
||||
</div>
|
||||
<div class="orderbox_right">
|
||||
<div class="orderbox_right_top">
|
||||
<div class="orderbox_right_topdiv">
|
||||
<span>会员昵称:</span>
|
||||
<span>{{ tableData.list.length != 0 ? tableData.list[datarow].name : '无' }}</span>
|
||||
</div>
|
||||
<div class="orderbox_right_topdiv">
|
||||
<span>手机号码:</span>
|
||||
<span>{{ tableData.list.length != 0 ? tableData.list[datarow].telephone : '无' }}</span>
|
||||
</div>
|
||||
<div class="orderbox_right_topdiv">
|
||||
<span>会员编号:</span>
|
||||
<span>{{ tableData.list.length != 0 ? tableData.list[datarow].code : '无' }}</span>
|
||||
</div>
|
||||
<div class="orderbox_right_topdiv">
|
||||
<span>会员等级:</span>
|
||||
<span>{{ tableData.list.length != 0 ? tableData.list[datarow].level : '无' }}</span>
|
||||
</div>
|
||||
<div class="orderbox_right_top_item">
|
||||
<div class="orderbox_right_top_item_one">
|
||||
<el-icon :size="24" style="color:#ffbc42 ;">
|
||||
<Money />
|
||||
</el-icon>
|
||||
<span class="orderbox_right_top_item_onespan">会员积分</span>
|
||||
</div>
|
||||
<div class="orderbox_right_top_item_tow">{{ tableData.list.length != 0 ?
|
||||
tableData.list[datarow].levelConsume : '无' }}</div>
|
||||
</div>
|
||||
<div class="orderbox_right_top_item" @click="dialogRef.show(tableData.list[datarow].id)">
|
||||
<div class="orderbox_right_top_item_one">
|
||||
<el-icon :size="24" style="color:#00b58d ;">
|
||||
<Box />
|
||||
</el-icon>
|
||||
<span class="orderbox_right_top_item_onespan">储值余额</span>
|
||||
</div>
|
||||
<div class="orderbox_right_top_item_tow">
|
||||
<span>{{ tableData.list.length != 0 ? tableData.list[datarow].amount : '无' }}</span>
|
||||
<el-icon size="10">
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="orderbox_right_top_item">
|
||||
<div class="orderbox_right_top_item_one">
|
||||
<el-icon :size="24" style="color:#00b58d ;">
|
||||
<CopyDocument />
|
||||
</el-icon>
|
||||
<span class="orderbox_right_top_item_onespan">优惠券</span>
|
||||
</div>
|
||||
<div class="orderbox_right_top_item_tow">
|
||||
<span>0</span>
|
||||
<el-icon size="10">
|
||||
<ArrowRight />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="orderbox_right_input" style="margin-top:20px ;" v-if="props.membershow == '1'">
|
||||
<el-input placeholder="请输入会员手机号或者编号" v-model="tableData.phone" clearable
|
||||
@input="inputChange"></el-input>
|
||||
</div>
|
||||
<keyboard v-if="props.membershow == '1'" @consumeFees="consumeFees"></keyboard>
|
||||
<div class="orderbox_right_button" v-if="props.membershow == '0'">
|
||||
<!-- <el-button style="width: 100%;" @click="toHome">创建订单</el-button> -->
|
||||
<!-- <el-button style="width: 60%;" type="primary" @click="recharge = true">账户充值</el-button> -->
|
||||
<el-button style="width: 100%;" type="primary" @click="menberAddNnum">账户充值</el-button>
|
||||
</div>
|
||||
<div class="orderbox_right_button" v-if="props.membershow == '1'">
|
||||
<router-link to="/" style="width: 35%;">
|
||||
<el-button style="width: 100%;" @click="memberaddshowclose">添加会员</el-button>
|
||||
</router-link>
|
||||
<el-button style="width: 60%;" type="primary">确认</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<add ref="dialogRef" @refund="refundSuccess" @page-change="MemberAccount" />
|
||||
<el-dialog v-model="memberaddshow" title="添加会员" width="600" :before-close="memberaddshowclose"
|
||||
@open="membrform = { ...resetMembrform }">
|
||||
<el-form ref="formRef" :rules="rules" :model="membrform" label-width="70px" hide-required-asterisk>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="membrform.phone" @focus="
|
||||
global.updateData(false)" @blur="global.updateData(true)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="昵称" prop="nickName">
|
||||
<el-input v-model="membrform.nickName" @focus="
|
||||
global.updateData(false)" @blur="global.updateData(true)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生日" prop="birthDay">
|
||||
<el-col :span="11">
|
||||
<el-date-picker v-model="membrform.birthDay" type="date" placeholder="请选择生日" style="width: 100%"
|
||||
@focus="
|
||||
global.updateData(false)" @blur="global.updateData(true)" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-radio-group v-model="membrform.sex">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="2">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级" prop="level">
|
||||
<el-select v-model="membrform.level" placeholder="请选择等级">
|
||||
<el-option label="等级1" value="1" />
|
||||
<el-option label="等级2" value="2" />
|
||||
<el-option label="等级3" value="3" />
|
||||
<el-option label="等级4" value="4" />
|
||||
<el-option label="等级5" value="5" />
|
||||
<el-option label="等级6" value="6" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button style="width: 100%;" type="primary" @click="createMembermemberSubmit">确认</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="recharge" title="会员充值" width="400" :before-close="handlerecharge">
|
||||
<div class="recharge_footer">
|
||||
<!-- <div class="recharge_footer_item">
|
||||
<div class="recharge_footer_items" v-for="(item, index) in 6" :key="index">
|
||||
<div>充1000送300</div>
|
||||
<div>充1000.00到13000.00</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="recharge_footer_itemright">
|
||||
<div class="recharge_footer_itemright_input">
|
||||
<div>充值金额:</div>
|
||||
<div v-if="moneys">{{ moneys ? moneys : '请输入充值金额' }}</div>
|
||||
|
||||
</div>
|
||||
<div class='keyboard'>
|
||||
<cwxeyboard @confirmEvent="confirmEvent" @consumeFee="consumeFee" btn-color="orange" title="支付">
|
||||
</cwxeyboard>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<el-dialog width="500" v-model="payCarddialogVisible" style="padding: 0; " title="会员充值"
|
||||
:close-on-click-modal="false">
|
||||
<payCard :amount="moneys" :orderId="orderId" :selecttype="1" @paySuccess="paySuccess" />
|
||||
</el-dialog>
|
||||
<userCharge ref="userChargeRef" :userInfo="tableData.list[datarow]" @paySuccess="asyncqueryMembermember" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, watch, onMounted } from 'vue'
|
||||
import { ElMessage, dayjs } from 'element-plus'
|
||||
import { queryMembermember, createMembermember, memberqueryMemberAccount, accountPaymember } from '@/api/member/index.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import lodash from 'lodash'
|
||||
import add from '@/views/member/components/add.vue'
|
||||
import cwxeyboard from '@/components/cwx-keyboard/cwx-keyboard.vue'
|
||||
import keyboard from '@/views/home/components/keyboard.vue'
|
||||
import payCard from '@/components/payCard/payCard.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import useStorage from '@/utils/useStorage'
|
||||
import userCharge from './components/userCharge.vue'
|
||||
import { staffPermission } from '@/api/user.js'
|
||||
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
const global = useGlobal()
|
||||
|
||||
const userChargeRef = ref(null)
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const store = useUser()
|
||||
|
||||
const stored = ref(false)//储值余额
|
||||
|
||||
const handleClose = async () => {
|
||||
stored.value = !stored.value
|
||||
}
|
||||
|
||||
const dialogRef = ref(null)
|
||||
|
||||
const emit = defineEmits('paySuccess')
|
||||
|
||||
function paySuccess() {
|
||||
payCarddialogVisible.value = false
|
||||
recharge.value = false
|
||||
moneys.value = 0
|
||||
asyncqueryMembermember()
|
||||
emit('paySuccess')
|
||||
}
|
||||
|
||||
const props = defineProps({//首页传值
|
||||
membershow: {
|
||||
type: String,
|
||||
default: '0'
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '提示'
|
||||
},
|
||||
amount: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
const flowingwater = reactive({//获取流水初始化
|
||||
total: '',
|
||||
list: []
|
||||
})
|
||||
|
||||
const consumeFee = (e) => { //接收子组件值 并赋值给父组件
|
||||
moneys.value = e
|
||||
}
|
||||
|
||||
const consumeFees = (e) => {
|
||||
tableData.phone = e
|
||||
}
|
||||
|
||||
const payCarddialogVisible = ref(false)
|
||||
|
||||
const orderId = ref('')
|
||||
|
||||
// 添加会员
|
||||
async function addMemberHandle() {
|
||||
try {
|
||||
await staffPermission('yun_xu_guan_li_hui_yuan_xin_xi')
|
||||
memberaddshow.value = true
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 账户充值
|
||||
async function menberAddNnum() {
|
||||
try {
|
||||
await staffPermission('yun_xu_xiu_gai_hui_yuan_yu_e')
|
||||
userChargeRef.value.show()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 退款成功
|
||||
function refundSuccess() {
|
||||
asyncqueryMembermember()
|
||||
MemberAccount()
|
||||
}
|
||||
|
||||
const confirmEvent = async () => {//子组件 确认按钮
|
||||
orderId.value = tableData.list[datarow.value].id
|
||||
payCarddialogVisible.value = true
|
||||
// try {
|
||||
// let res = await accountPaymember({
|
||||
// shopId: store.userInfo.shopId,
|
||||
// memberId: tableData.list[datarow.value].id,
|
||||
// amount: moneys.value
|
||||
// })
|
||||
// if (res == null) {
|
||||
// recharge.value = false
|
||||
// moneys.value = 0
|
||||
// ElMessage({
|
||||
// message: '充值成功',
|
||||
// type: 'success',
|
||||
// })
|
||||
// resetMembrform.value = { ...membrform.value }
|
||||
// asyncqueryMembermember()
|
||||
// }
|
||||
// } catch (error) {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
const MemberAccount = async (page = 1) => {//获取流水
|
||||
try {
|
||||
let res = await memberqueryMemberAccount({
|
||||
memberId: tableData.list[datarow.value].id,
|
||||
page: page,
|
||||
pageSize: 10
|
||||
})
|
||||
flowingwater.total = res.total
|
||||
// flowingwater.list = res.list
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const recharge = ref(false)//充值
|
||||
|
||||
const memberaddshow = ref(false) //添加会员
|
||||
|
||||
const memberaddshowclose = () => {
|
||||
memberaddshow.value = !memberaddshow.value
|
||||
}
|
||||
|
||||
const tableData = reactive({//表格数据
|
||||
list: [],
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
phone: '',
|
||||
total: ''
|
||||
})
|
||||
|
||||
const inputChange = lodash.debounce(function () { //搜索手机号
|
||||
asyncqueryMembermember()
|
||||
}, 500)
|
||||
|
||||
const asyncqueryMembermember = async () => {//会员列表数据
|
||||
loading.value = true
|
||||
let res = await queryMembermember({
|
||||
shopId: store.userInfo.shopId,
|
||||
page: tableData.page,
|
||||
pageSize: 10,
|
||||
phone: tableData.phone,
|
||||
isFlag: 0
|
||||
})
|
||||
if (res) {
|
||||
setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 300)
|
||||
tableData.list = res.list
|
||||
MemberAccount()
|
||||
tableData.total = res.total
|
||||
}
|
||||
}
|
||||
|
||||
const tableRowClassName = ({ row, rowIndex }) => {//动态给tab加样式
|
||||
if (rowIndex === datarow.value) {
|
||||
return 'warning-row'
|
||||
} return ''
|
||||
}
|
||||
|
||||
const datarow = ref(0) //初始化右边
|
||||
const cellclicktableData = (row, column, cell, event) => {
|
||||
const index = tableData.list.findIndex(item => item.id == row.id)
|
||||
datarow.value = index
|
||||
MemberAccount()
|
||||
|
||||
}
|
||||
|
||||
const handleCurrentChange = (val) => { //页码
|
||||
tableData.page = val
|
||||
datarow.value = 0
|
||||
asyncqueryMembermember()
|
||||
}
|
||||
|
||||
const handlerecharge = () => {
|
||||
recharge.value = !recharge.value
|
||||
}
|
||||
|
||||
const resetMembrform = ref({})
|
||||
|
||||
const membrform = ref({ //membrform 添加会员表单
|
||||
phone: '',
|
||||
nickName: '',
|
||||
level: '',
|
||||
birthDay: '',
|
||||
sex: '',
|
||||
level: ''
|
||||
})
|
||||
|
||||
const formRef = ref(null); //ref membrform
|
||||
|
||||
const rules = reactive({ // membrform验证
|
||||
phone: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入11位手机号码",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
nickName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入昵称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
sex: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择性别",
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
level: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择等级",
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
birthDay: [
|
||||
{
|
||||
type: 'date',
|
||||
required: true,
|
||||
message: '请选择生日日期',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
});
|
||||
const createMembermemberSubmit = async () => { ///添加会员
|
||||
formRef.value.validate(async (valid) => {
|
||||
console.log(valid)
|
||||
if (valid) {
|
||||
|
||||
let res = await createMembermember({
|
||||
shopId: store.userInfo.shopId,
|
||||
phone: membrform.value.phone,
|
||||
nickName: membrform.value.nickName,
|
||||
sex: membrform.value.sex,
|
||||
level: membrform.value.level,
|
||||
birthDay: dayjs(membrform.value.birthDay).format("YYYY-MM-DD")
|
||||
})
|
||||
if (res == null) {
|
||||
|
||||
memberaddshowclose()
|
||||
ElMessage({
|
||||
message: '添加成功',
|
||||
type: 'success',
|
||||
})
|
||||
asyncqueryMembermember()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
const moneys = ref('')// 钱数
|
||||
|
||||
// 创建会员订单
|
||||
const toHome = () => {
|
||||
// useStorage.set('memberInfo', tableData.list[datarow.value])
|
||||
global.setOrderMember(tableData.list[datarow.value])
|
||||
router.push({
|
||||
name: 'home'
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// resetMembrform.value = { ...membrform.value }
|
||||
asyncqueryMembermember()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.orderbox {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
|
||||
.orderbox_left {
|
||||
width: 60%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 16px 0;
|
||||
|
||||
.demo_tabs {
|
||||
.demo_tabs_div {
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.demo_tabs_box {
|
||||
width: 100%;
|
||||
padding: 10px 20px;
|
||||
|
||||
.demo_tabs_boxitem {
|
||||
width: 100%;
|
||||
padding: 6px 16px;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// background: #eeeeee;
|
||||
border-bottom: 1px solid #ccc;
|
||||
|
||||
.demo_tabs_boxitem_one {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
||||
.demo_tabs_boxitem_oneone {
|
||||
display: flex;
|
||||
margin-left: 20px;
|
||||
flex-direction: column;
|
||||
height: 70px;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.demo_tabs_boxitem_onetow {
|
||||
display: flex;
|
||||
margin-left: 20px;
|
||||
flex-direction: column;
|
||||
height: 70px;
|
||||
justify-content: space-around;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.demo_tabs_boxitem_tow {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 70px;
|
||||
justify-content: space-around;
|
||||
align-items: flex-end;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.orderbox_right {
|
||||
position: relative;
|
||||
width: 40%;
|
||||
padding: 20px;
|
||||
margin-left: 10px;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
|
||||
.orderbox_right_top {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
background: #8b008b;
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
|
||||
.orderbox_right_topdiv:nth-child(1) {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.orderbox_right_topdiv {
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.orderbox_right_top_item {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
padding: 6px 10px;
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
border-radius: 10px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.orderbox_right_top_item_one {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.orderbox_right_top_item_onespan {
|
||||
color: black;
|
||||
margin-left: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.orderbox_right_top_item_tow {
|
||||
color: black;
|
||||
margin-left: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.orderbox_right_button {
|
||||
position: absolute;
|
||||
width: 90%;
|
||||
left: 50%;
|
||||
bottom: 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transform: translateX(-50%) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog_footer:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.dialog_footer {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding-bottom: 6px;
|
||||
|
||||
.dialog_footer_left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
span:nth-child(1) {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
|
||||
}
|
||||
|
||||
span:nth-child(2) {
|
||||
margin-top: 10px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog_footer_right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
|
||||
span:nth-child(1) {
|
||||
color: #fc3d3d;
|
||||
font-size: 16px;
|
||||
|
||||
}
|
||||
|
||||
span:nth-child(2) {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.recharge_footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.recharge_footer_item {
|
||||
width: 60%;
|
||||
background: #f2f2f2;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-flow: wrap;
|
||||
|
||||
.recharge_footer_items {
|
||||
background: #187ead;
|
||||
padding: 16px 22px;
|
||||
width: 45%;
|
||||
height: fit-content;
|
||||
text-align: center;
|
||||
border-radius: 10px;
|
||||
|
||||
div:nth-child(1) {
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
div:nth-child(2) {
|
||||
color: #bad9e7;
|
||||
font-size: 14px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.recharge_footer_itemright {
|
||||
padding-left: 20px;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
|
||||
.recharge_footer_itemright_input {
|
||||
width: 100%;
|
||||
background: #333333;
|
||||
border-radius: 10px;
|
||||
padding: 0 6px;
|
||||
display: flex;
|
||||
height: 60px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
div:nth-child(1) {
|
||||
color: #56792e;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
div:nth-child(2) {
|
||||
color: #88937c;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
width: 100%;
|
||||
height: 40vh;
|
||||
background: #FFFFFF;
|
||||
|
||||
.key-row {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
height: 10vh;
|
||||
line-height: 10vh;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.keyboard .key-cell {
|
||||
flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
height: 30vh;
|
||||
width: 25%;
|
||||
line-height: 30vh;
|
||||
color: #FFFFFF;
|
||||
z-index: 5;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm2 {
|
||||
position: absolute;
|
||||
height: 10vh;
|
||||
width: 25%;
|
||||
line-height: 10vh;
|
||||
z-index: 9999;
|
||||
right: 0;
|
||||
top: 60px;
|
||||
font-size: 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.key-zero-and-point {
|
||||
display: flex;
|
||||
height: 10vh;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 75%;
|
||||
font-size: 30px;
|
||||
|
||||
.zero {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 66.66%;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.point {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 33.33%;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.key-cell:active {
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
|
||||
.a:active,
|
||||
.key-confirm2:active {
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,25 +1,12 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="query_wrap">
|
||||
<el-input
|
||||
v-model="queryForm.orderNo"
|
||||
placeholder="请输入订单编号"
|
||||
style="width: 240px"
|
||||
></el-input>
|
||||
<el-input v-model="queryForm.orderNo" placeholder="请输入订单编号" style="width: 240px"></el-input>
|
||||
<!-- <el-input v-model="queryForm.productName" placeholder="请输入商品名称" style="width: 200px;"></el-input> -->
|
||||
<el-select
|
||||
v-model="queryForm.status"
|
||||
placeholder="订单状态"
|
||||
style="width: 140px"
|
||||
@change="queryFormHandle"
|
||||
>
|
||||
<el-select v-model="queryForm.status" placeholder="订单状态" style="width: 140px" @change="queryFormHandle">
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option
|
||||
:label="item.label"
|
||||
:value="item.type"
|
||||
v-for="item in globalStore.orderStatus"
|
||||
:key="item.type"
|
||||
></el-option>
|
||||
<el-option :label="item.label" :value="item.type" v-for="item in globalStore.orderStatus"
|
||||
:key="item.type"></el-option>
|
||||
</el-select>
|
||||
<DateRange ref="DateRangeRef" @success="dateSucess" />
|
||||
<div class="flex">
|
||||
@@ -29,18 +16,8 @@
|
||||
</div>
|
||||
<div class="table_wrap">
|
||||
<div class="table">
|
||||
<el-table
|
||||
:data="tableData.list"
|
||||
v-loading="tableData.loading"
|
||||
border
|
||||
strip
|
||||
height="100%"
|
||||
>
|
||||
<el-table-column
|
||||
label="台桌"
|
||||
prop="tableName"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table :data="tableData.list" v-loading="tableData.loading" border strip height="100%">
|
||||
<el-table-column label="台桌" prop="tableName" width="80"></el-table-column>
|
||||
<el-table-column label="订单信息" width="240">
|
||||
<template v-slot="scope">
|
||||
<div class="column">
|
||||
@@ -88,26 +65,14 @@
|
||||
{{ filterLable("orderStatus", scope.row.status) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="150"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<div class="column">
|
||||
<div class="row">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="RefundDrawerRef.show(scope.row)"
|
||||
>订单退款</el-button
|
||||
>
|
||||
<el-button type="primary" @click="RefundDrawerRef.show(scope.row)">订单退款</el-button>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 10px">
|
||||
<el-button
|
||||
type="success"
|
||||
@click="PrintDrawerRef.show(scope.row)"
|
||||
>
|
||||
<el-button type="success" @click="PrintDrawerRef.show(scope.row)">
|
||||
订单打印
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -117,16 +82,9 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<el-pagination
|
||||
background
|
||||
v-model:current-page="queryForm.page"
|
||||
v-model:page-size="queryForm.size"
|
||||
:page-sizes="[10, 30, 50, 100]"
|
||||
layout="sizes, pager, jumper, total"
|
||||
:total="tableData.total"
|
||||
@size-change="orderListAjax"
|
||||
@current-change="orderListAjax"
|
||||
></el-pagination>
|
||||
<el-pagination background v-model:current-page="queryForm.page" v-model:page-size="queryForm.size"
|
||||
:page-sizes="[10, 30, 50, 100]" layout="sizes, pager, jumper, total" :total="tableData.total"
|
||||
@size-change="orderListAjax" @current-change="orderListAjax"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
<template #append>桌</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="顺延数量" v-if="addTabForm.isPostpone">
|
||||
<el-input-number v-model="addTabForm.postponeNum" :min="1" placeholder="请输入顺延数量" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="footer" style="display: flex;">
|
||||
<el-button style="width: 100%" @click="showAddTable = false">
|
||||
@@ -42,7 +45,7 @@
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { addCallTable } from '@/api/queue.js'
|
||||
import { addCallTable } from '@/api/account.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
const store = useUser()
|
||||
|
||||
@@ -59,6 +62,7 @@ const addTabForm = ref({
|
||||
prefix: '',
|
||||
start: '',
|
||||
isPostpone: 0,
|
||||
postponeNum: 1, // 顺延数量
|
||||
nearNum: ''
|
||||
})
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-form-item label="选择桌型">
|
||||
<el-radio-group v-model="form.callTableId">
|
||||
<el-radio :value="item.id" border v-for="item in list" :key="item.id">{{ item.name
|
||||
}}</el-radio>
|
||||
}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="phone">
|
||||
@@ -26,7 +26,7 @@
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { takeNumber } from '@/api/queue.js'
|
||||
import { takeNumber } from '@/api/account.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
const store = useUser()
|
||||
|
||||
@@ -41,7 +41,7 @@ const formRef = ref(null)
|
||||
const resetForm = ref({})
|
||||
const form = ref({
|
||||
callTableId: '',
|
||||
shopId: '',
|
||||
userId: '',
|
||||
phone: '',
|
||||
note: '',
|
||||
name: ''
|
||||
@@ -70,9 +70,12 @@ function confirmHandle() {
|
||||
try {
|
||||
if (vaild) {
|
||||
loading.value = true
|
||||
form.value.shopId = store.userInfo.shopId
|
||||
form.value.note = list.value.find(item => item.id == form.value.callTableId).note
|
||||
form.value.name = list.value.find(item => item.id == form.value.callTableId).name
|
||||
|
||||
console.log(form.value);
|
||||
|
||||
|
||||
await takeNumber(form.value)
|
||||
loading.value = false
|
||||
ElMessage.success('取号成功')
|
||||
@@ -103,6 +106,6 @@ defineExpose({
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
resetForm.value = { ...form }
|
||||
resetForm.value = { ...form.value }
|
||||
})
|
||||
</script>
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
<script setup>
|
||||
import { dayjs } from 'element-plus'
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { callRecord } from '@/api/queue.js'
|
||||
import { reactive, ref } from 'vue';
|
||||
import { callRecord } from '@/api/account.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
const store = useUser()
|
||||
|
||||
@@ -72,16 +72,16 @@ async function callRecordAjax() {
|
||||
tableData.loading = true
|
||||
const res = await callRecord({
|
||||
callTableId: '',
|
||||
shopId: store.userInfo.shopId,
|
||||
shopId: store.shopInfo.id,
|
||||
page: tableData.page,
|
||||
size: tableData.size
|
||||
})
|
||||
tableData.loading = false
|
||||
tableData.list = res.records
|
||||
tableData.total = res.total
|
||||
tableData.total = +res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
tableData.loading = false
|
||||
}
|
||||
|
||||
function reset() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-dialog title="提示" v-model="visible">
|
||||
<div class="content">
|
||||
<div style="font-size: 18px;">正在叫号,请稍等</div>
|
||||
<el-alert :title="statusList[item.status].text" :type="statusList[item.status].type" :closable="false" />
|
||||
<el-alert :title="statusList[item.state].text" :type="statusList[item.state].type" :closable="false" />
|
||||
</div>
|
||||
<div class="footer" style="display: flex;">
|
||||
<el-button style="width: 100%" @click="confirmHandle(2)">完成</el-button>
|
||||
@@ -13,8 +13,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { updateState } from '@/api/queue.js'
|
||||
import { ref } from 'vue';
|
||||
import { callTableCallState } from '@/api/account.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
const store = useUser()
|
||||
|
||||
@@ -41,8 +41,7 @@ const statusList = {
|
||||
// 过号修改状态
|
||||
async function confirmHandle(state) {
|
||||
try {
|
||||
await updateState({
|
||||
shopId: store.userInfo.shopId,
|
||||
await callTableCallState({
|
||||
callQueueId: item.value.id,
|
||||
state: state
|
||||
})
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<el-form-item label="排队即将排到通知">
|
||||
<div style="display: flex;flex-direction: column;">
|
||||
<el-input disabled style="width: 50%;" v-model="config.nearMsg"></el-input>
|
||||
<el-input v-model="config.nearNum" disabled style="margin-top: 10px;">
|
||||
<el-input v-model="config.nearNum" style="margin-top: 10px;">
|
||||
<template #prepend>前面等待</template>
|
||||
<template #append>桌时提醒</template>
|
||||
</el-input>
|
||||
@@ -64,8 +64,8 @@ import UploadImg from '@/components/uploadImg.vue'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import AddTab from './addTab.vue'
|
||||
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { callTable, delCallTable, callTableConfig, callTableConfigPut } from '@/api/queue.js'
|
||||
import { reactive, ref } from 'vue';
|
||||
import { callTableConfig, callTableConfigPut, getCallTable, delCallTable } from '@/api/account.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
const store = useUser()
|
||||
|
||||
@@ -103,8 +103,7 @@ function delCallTableHandle(row) {
|
||||
ElMessageBox.confirm('确认要删除吗?', '注意').then(async () => {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await delCallTable({
|
||||
shopId: store.userInfo.shopId,
|
||||
await delCallTable({
|
||||
callTableId: row.id
|
||||
})
|
||||
getTableAjax()
|
||||
@@ -118,10 +117,10 @@ function delCallTableHandle(row) {
|
||||
async function getTableAjax() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
const res = await callTable({
|
||||
const res = await getCallTable({
|
||||
page: 1,
|
||||
size: 100,
|
||||
shopId: store.userInfo.shopId,
|
||||
shopId: store.shopInfo.id,
|
||||
callTableId: '',
|
||||
state: ''
|
||||
})
|
||||
@@ -138,7 +137,7 @@ const config = ref({})
|
||||
const UploadImgRef = ref(null)
|
||||
async function callTableConfigAjax() {
|
||||
try {
|
||||
const res = await callTableConfig({ shopId: store.userInfo.shopId })
|
||||
const res = await callTableConfig({ shopId: store.shopInfo.id })
|
||||
config.value = res
|
||||
form.value.nearNum = res.nearNum
|
||||
if (res.bgCover) {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<el-empty description="暂无数据~" v-if="!queueList.list.length" style="width: 100%;" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<div class="pagination" style="display: flex;justify-content: flex-end;">
|
||||
<el-pagination v-model:current-page="queueList.page" v-model:page-size="queueList.size"
|
||||
layout="total, prev, pager, next" :total="queueList.total" background
|
||||
@current-change="queueListChange" @size-change="queueListChange">
|
||||
@@ -64,7 +64,7 @@ import Record from './components/record.vue'
|
||||
import GetNumber from './components/getNumber.vue'
|
||||
import ResultModal from './components/resultModal.vue'
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { callRecord, callTable, callTableQueue, updateState, callTableCall } from '@/api/queue.js'
|
||||
import { callTableQueue, getCallTable, callTableCall, callTableCallState } from '@/api/account.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
const store = useUser()
|
||||
|
||||
@@ -78,10 +78,9 @@ const tabHeader = ref([])
|
||||
const tabActive = ref('')
|
||||
async function callTableAjax() {
|
||||
try {
|
||||
const res = await callTable({
|
||||
const res = await getCallTable({
|
||||
page: 1,
|
||||
size: 100,
|
||||
shopId: store.userInfo.shopId,
|
||||
callTableId: '',
|
||||
state: ''
|
||||
})
|
||||
@@ -111,17 +110,16 @@ async function callTableQueueAjax() {
|
||||
const res = await callTableQueue({
|
||||
page: queueList.page,
|
||||
size: queueList.size,
|
||||
shopId: store.userInfo.shopId,
|
||||
shopId: store.shopInfo.id,
|
||||
callTableId: tabActive.value,
|
||||
state: ''
|
||||
})
|
||||
queueList.loading = false
|
||||
queueList.list = res.records
|
||||
queueList.total = res.total
|
||||
queueList.total = +res.totalRow
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
queueList.loading = false
|
||||
}
|
||||
queueList.loading = false
|
||||
}
|
||||
// 取号 排队列表获取 end
|
||||
|
||||
@@ -129,8 +127,7 @@ async function callTableQueueAjax() {
|
||||
function cancaleHandle(item) {
|
||||
ElMessageBox.confirm('确定要取消排队吗?', '注意').then(async () => {
|
||||
try {
|
||||
await updateState({
|
||||
shopId: store.userInfo.shopId,
|
||||
await callTableCallState({
|
||||
callQueueId: item.id,
|
||||
state: '-1'
|
||||
})
|
||||
@@ -147,7 +144,6 @@ async function callHandle(item) {
|
||||
try {
|
||||
startSpeech(`请${item.callNum}用餐`)
|
||||
const res = await callTableCall({
|
||||
shopId: store.userInfo.shopId,
|
||||
callQueueId: item.id,
|
||||
})
|
||||
ResultModalRef.value.show({
|
||||
|
||||
Reference in New Issue
Block a user