1.对接会员列表 2.对接排队叫号
This commit is contained in:
parent
db3fc1f6dc
commit
5cf2355d28
|
|
@ -454,4 +454,8 @@ html {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.height_auto {
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -100,3 +100,135 @@ export function shopStaffInfo() {
|
|||
url: "/account/admin/shopStaff/info",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺用户充值记录
|
||||
*/
|
||||
export function shopUserChargeFlow(params) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/account/admin/shopUser/flow",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺用户充值记录
|
||||
*/
|
||||
export function addShopUser(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/account/admin/shopUser",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取叫号队列
|
||||
*/
|
||||
export function callTableQueue(params) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/account/admin/callTable/queue",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取叫号配置
|
||||
*/
|
||||
export function callTableConfig(params) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/account/admin/callTable/config",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改叫号配置
|
||||
*/
|
||||
export function callTableConfigPut(data) {
|
||||
return request({
|
||||
method: "put",
|
||||
url: "/account/admin/callTable/config",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号桌型新增
|
||||
*/
|
||||
export function addCallTable(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/account/admin/callTable",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 叫号桌型删除
|
||||
*/
|
||||
export function delCallTable(data) {
|
||||
return request({
|
||||
method: "delete",
|
||||
url: "/account/admin/callTable",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取桌型列表
|
||||
*/
|
||||
export function getCallTable(params) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/account/admin/callTable",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增叫号号码
|
||||
*/
|
||||
export function takeNumber(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/account/admin/callTable/takeNumber",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取桌型列表
|
||||
*/
|
||||
export function callRecord(params) {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/account/admin/callTable/callRecord",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行叫号
|
||||
*/
|
||||
export function callTableCall(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/account/admin/callTable/call",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改叫号队列状态
|
||||
*/
|
||||
export function callTableCallState(data) {
|
||||
return request({
|
||||
method: "put",
|
||||
url: "/account/admin/callTable/updateState",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,3 +104,54 @@ export function getOrderById(params) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员充值 - 现金充值
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function cashPayVip(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/order/pay/cashPayVip",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员充值 - 反扫
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function microPayVip(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/order/pay/microPayVip",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员充值 - 会员退款前置接口
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function refundVipBefore(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/order/pay/refundVipBefore",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员充值 - 会员退款
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function refundVip(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
url: "/order/pay/refundVip",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
</div>
|
||||
<div class="t1" v-else>
|
||||
<span class="title">会员:</span>
|
||||
<span class="num">{{
|
||||
props.userInfo.id && props.userInfo.telephone
|
||||
}}</span>
|
||||
<span class="num">
|
||||
{{ props.userInfo.id && props.userInfo.phone }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="t2">
|
||||
<span>已付:¥0.00</span>
|
||||
|
|
@ -59,29 +59,24 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<scanModal ref="scanModalRef" fast :amount="money" :money="money" :selecttype="props.type" :orderId="props.userInfo.id"
|
||||
@success="scanCodeSuccess" />
|
||||
<scanModal ref="scanModalRef" fast :amount="money" :money="money" :selecttype="props.type"
|
||||
:orderId="props.userInfo.id" @success="scanCodeSuccess" />
|
||||
<takeFoodCode ref="takeFoodCodeRef" title="支付密码" :type="2" input-type="password" placeholder="请输入支付密码"
|
||||
@success="passwordSuccess" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { queryPayType, quickPay } from "@/api/pay";
|
||||
import {
|
||||
queryMembermember,
|
||||
createMembermember,
|
||||
membermemberScanPay,
|
||||
accountPaymember,
|
||||
} from "@/api/member/index.js";
|
||||
import { useUser } from "@/store/user.js";
|
||||
import { getPayType } from '@/api/account.js'
|
||||
import { cashPayVip } from "@/api/order.js";
|
||||
import { clearNoNum } from "@/utils";
|
||||
import md5 from "js-md5";
|
||||
|
||||
import { queryPwdInfo } from '@/api/user.js'
|
||||
import scanModal from "@/components/payCard/scanModal.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import takeFoodCode from "@/components/takeFoodCode.vue";
|
||||
import { useUser } from '@/store/user.js'
|
||||
|
||||
const takeFoodCodeRef = ref(null);
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -132,14 +127,17 @@ function payTypeChange(index, item) {
|
|||
async function passwordSuccess(e = '') {
|
||||
try {
|
||||
payLoading.value = true;
|
||||
await accountPaymember({
|
||||
shopId: store.userInfo.shopId,
|
||||
memberId: props.userInfo.id,
|
||||
await cashPayVip({
|
||||
shopId: store.shopInfo.id,
|
||||
shopUserId: props.userInfo.id,
|
||||
amount: money.value,
|
||||
pwd: e ? md5(e) : '',
|
||||
// pwd: e ? md5(e) : '',
|
||||
pwd: e,
|
||||
orderId: '',
|
||||
allPack: ''
|
||||
});
|
||||
payLoading.value = false;
|
||||
ElMessage.success("支付成功");
|
||||
ElMessage.success("充值成功");
|
||||
emit("paySuccess");
|
||||
} catch (error) {
|
||||
payLoading.value = false;
|
||||
|
|
@ -176,15 +174,12 @@ async function confirmOrder() {
|
|||
emit("paySuccess");
|
||||
} else {
|
||||
// 会员充值
|
||||
|
||||
let res = await queryPwdInfo()
|
||||
if (res.isMemberIn == 1) {
|
||||
await store.getShopInfo()
|
||||
if (store.shopInfo.isMemberInPwd == 1) {
|
||||
takeFoodCodeRef.value.show();
|
||||
} else {
|
||||
passwordSuccess()
|
||||
}
|
||||
// takeFoodCodeRef.value.show();
|
||||
// // passwordSuccess()
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -215,9 +210,7 @@ function delHandle() {
|
|||
// 获取支付方式
|
||||
async function queryPayTypeAjax() {
|
||||
try {
|
||||
const res = await queryPayType({
|
||||
shopId: store.userInfo.shopId,
|
||||
});
|
||||
const res = await getPayType();
|
||||
|
||||
const arr = [];
|
||||
res.map((item) => {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
<template>
|
||||
<div class="card">
|
||||
<div class="header">
|
||||
<div class="t1">
|
||||
<span class="title">应收:¥</span>
|
||||
<span class="num">{{ money }}</span>
|
||||
</div>
|
||||
<div class="t2">
|
||||
<span>原价:¥{{ formatDecimal(props.amount) }}</span>
|
||||
<span style="margin-left: 20px;">优惠:¥{{ formatDecimal(props.amount - money) }}</span>
|
||||
<span style="margin-left: 20px;" v-if="props.discount" @click="cancelDiscount">折扣:{{
|
||||
formatDecimal(props.discount * 10, 1, true) }}折
|
||||
<el-icon style="margin-left: 6px;">
|
||||
<CircleClose />
|
||||
</el-icon>
|
||||
</span>
|
||||
<div class="left">
|
||||
<div class="t1">
|
||||
<span class="title">应收:¥</span>
|
||||
<span class="num">{{ money }}</span>
|
||||
</div>
|
||||
<div class="t2">
|
||||
<span>原价:¥{{ formatDecimal(props.amount) }}</span>
|
||||
<span style="margin-left: 20px">优惠:¥{{ formatDecimal(props.amount - money) }}</span>
|
||||
<span style="margin-left: 20px" v-if="props.discount" @click="cancelDiscount">折扣:{{
|
||||
formatDecimal(props.discount * 10, 1, true) }}折
|
||||
<el-icon style="margin-left: 6px">
|
||||
<CircleClose />
|
||||
</el-icon>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="number_wrap">
|
||||
|
|
@ -37,15 +39,18 @@
|
|||
</div> -->
|
||||
</div>
|
||||
<div class="input_wrap">
|
||||
<div class="input" style="flex: 1;">储值:¥{{ money }}</div>
|
||||
<!-- <div class="input" v-if="waitPayMoney > 0">待支付:¥{{ waitPayMoney }}</div> -->
|
||||
<div class="input" style="flex: 1">储值:¥{{ money }}</div>
|
||||
<el-button type="primary" style="width: 120px;border-radius: 6px; height: 60px;"
|
||||
@click="showCouponHandle">添加优惠</el-button>
|
||||
</div>
|
||||
<div class="blance">
|
||||
<!-- 可用余额:0.00 -->
|
||||
</div>
|
||||
<div class="keybord_wrap">
|
||||
<div class="left">
|
||||
<div class="item" v-for="item in 9" :key="item" @click="amountInput(`${item}`)">{{ item }}</div>
|
||||
<div class="item" v-for="item in 9" :key="item" @click="amountInput(`${item}`)">
|
||||
{{ item }}
|
||||
</div>
|
||||
<div class="item" @click="amountInput('.')">.</div>
|
||||
<div class="item" @click="amountInput('0')">0</div>
|
||||
<div class="item" @click="delHandle">
|
||||
|
|
@ -90,7 +95,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination layout="prev, pager, next, total" background style="margin-top: 20px;"
|
||||
<el-pagination layout="prev, pager, next, total" background style="margin-top: 20px"
|
||||
:total="Number(tableData.total)" v-model:current-page="tableData.page" @current-change="getMemberList" />
|
||||
</el-dialog>
|
||||
<!-- 选择挂账人员 -->
|
||||
|
|
@ -135,64 +140,84 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination layout="prev, pager, next, total" background style="margin-top: 20px;"
|
||||
<el-pagination layout="prev, pager, next, total" background style="margin-top: 20px"
|
||||
:total="Number(buyerTable.total)" v-model:current-page="buyerTable.page" @current-change="getBuyerList" />
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showCoupon" title="添加优惠">
|
||||
<el-form ref="couponFormRef" :model="couponForm">
|
||||
<el-form-item label="会员">
|
||||
<el-select>
|
||||
<el-option label="会员1" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, computed, watch, reactive } from 'vue'
|
||||
import { queryPayType, accountPay, vipPay, buyerPage, payCreditPay } from '@/api/pay'
|
||||
import { queryMembermember, createMembermember, membermemberScanPay, accountPaymember } from '@/api/member/index.js'
|
||||
import { useUser } from "@/store/user.js"
|
||||
import { clearNoNum, formatDecimal } from '@/utils'
|
||||
import { onMounted, ref, computed, watch, reactive } from "vue";
|
||||
import {
|
||||
queryPayType,
|
||||
accountPay,
|
||||
vipPay,
|
||||
buyerPage,
|
||||
payCreditPay,
|
||||
} from "@/api/pay";
|
||||
import {
|
||||
queryMembermember,
|
||||
createMembermember,
|
||||
membermemberScanPay,
|
||||
accountPaymember,
|
||||
} from "@/api/member/index.js";
|
||||
import { useUser } from "@/store/user.js";
|
||||
import { clearNoNum, formatDecimal } from "@/utils";
|
||||
|
||||
import { getPayType } from '@/api/account.js'
|
||||
import { getPayType } from "@/api/account.js";
|
||||
|
||||
import scanModal from '@/components/payCard/scanModal.vue'
|
||||
import scanModal from "@/components/payCard/scanModal.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
import { staffPermission } from '@/api/user.js'
|
||||
import { cashPay } from '@/api/order.js'
|
||||
import { useGlobal } from "@/store/global.js";
|
||||
import { staffPermission } from "@/api/user.js";
|
||||
import { cashPay } from "@/api/order.js";
|
||||
|
||||
import { useGoods } from '@/store/goods.js'
|
||||
import { useGoods } from "@/store/goods.js";
|
||||
|
||||
const goodsStore = useGoods()
|
||||
const goodsStore = useGoods();
|
||||
|
||||
const global = useGlobal()
|
||||
const global = useGlobal();
|
||||
|
||||
const store = useUser()
|
||||
const store = useUser();
|
||||
|
||||
const props = defineProps({
|
||||
amount: {
|
||||
type: Number,
|
||||
default: 0
|
||||
default: 0,
|
||||
},
|
||||
selecttype: {
|
||||
type: Number,
|
||||
default: 0
|
||||
default: 0,
|
||||
},
|
||||
orderId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
default: "",
|
||||
},
|
||||
discount: {
|
||||
type: [String, Number],
|
||||
default: 0
|
||||
}
|
||||
})
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['paySuccess', 'cancelDiscount'])
|
||||
const emit = defineEmits(["paySuccess", "cancelDiscount"]);
|
||||
|
||||
const money = ref('0')
|
||||
const scanModalRef = ref(null)
|
||||
const money = ref("0");
|
||||
const scanModalRef = ref(null);
|
||||
|
||||
watch(props, (value) => {
|
||||
money.value = `${formatDecimal(props.amount)}`
|
||||
money.value = `${formatDecimal(props.amount)}`;
|
||||
if (props.discount > 0) {
|
||||
money.value = `${formatDecimal(props.amount * props.discount)}`
|
||||
money.value = `${formatDecimal(props.amount * props.discount)}`;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// const waitPayMoney = computed(() => {
|
||||
// let num = JSON.stringify(props.amount - money.value)
|
||||
|
|
@ -200,54 +225,54 @@ watch(props, (value) => {
|
|||
// return num
|
||||
// })
|
||||
|
||||
const payActive = ref(0)
|
||||
const payType = ref('')
|
||||
const payList = ref([])
|
||||
const payLoading = ref(false)
|
||||
const payData = ref({})
|
||||
const payActive = ref(0);
|
||||
const payType = ref("");
|
||||
const payList = ref([]);
|
||||
const payLoading = ref(false);
|
||||
const payData = ref({});
|
||||
|
||||
// 挂账人 start
|
||||
const showBuyer = ref(false)
|
||||
const showBuyer = ref(false);
|
||||
const buyerTable = reactive({
|
||||
keywords: '',
|
||||
keywords: "",
|
||||
loading: false,
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
list: []
|
||||
})
|
||||
list: [],
|
||||
});
|
||||
|
||||
// 显示挂账人
|
||||
function showBuyerHandle() {
|
||||
showBuyer.value = true
|
||||
getBuyerList()
|
||||
showBuyer.value = true;
|
||||
getBuyerList();
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
function resetBuyerTable() {
|
||||
buyerTable.keywords = ''
|
||||
buyerTable.page = 1
|
||||
getBuyerList()
|
||||
buyerTable.keywords = "";
|
||||
buyerTable.page = 1;
|
||||
getBuyerList();
|
||||
}
|
||||
|
||||
// 获取挂账人列表
|
||||
async function getBuyerList() {
|
||||
try {
|
||||
buyerTable.loading = true
|
||||
buyerTable.loading = true;
|
||||
const res = await buyerPage({
|
||||
page: buyerTable.page,
|
||||
size: buyerTable.size,
|
||||
shopId: store.userInfo.shopId,
|
||||
keywords: buyerTable.keywords,
|
||||
status: 1,
|
||||
responsiblePerson: '',
|
||||
repaymentStatus: ''
|
||||
})
|
||||
buyerTable.loading = false
|
||||
buyerTable.list = res.list
|
||||
buyerTable.total = res.total
|
||||
responsiblePerson: "",
|
||||
repaymentStatus: "",
|
||||
});
|
||||
buyerTable.loading = false;
|
||||
buyerTable.list = res.list;
|
||||
buyerTable.total = res.total;
|
||||
} catch (error) {
|
||||
buyerTable.loading = false
|
||||
buyerTable.loading = false;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
|
@ -255,22 +280,23 @@ async function getBuyerList() {
|
|||
// 选择挂账人支付
|
||||
async function payCreditPayHandle(row) {
|
||||
try {
|
||||
payLoading.value = true
|
||||
buyerTable.loading = true
|
||||
payLoading.value = true;
|
||||
buyerTable.loading = true;
|
||||
const res = await payCreditPay({
|
||||
creditBuyerId: row.id,
|
||||
orderId: props.orderId,
|
||||
payAmount: props.discount > 0 ? money.value : '',
|
||||
discountAmount: props.discount > 0 ? formatDecimal(props.amount - money.value) : ''
|
||||
})
|
||||
showBuyer.value = false
|
||||
payLoading.value = false
|
||||
buyerTable.loading = false
|
||||
ElMessage.success('支付成功')
|
||||
emit('paySuccess')
|
||||
payAmount: props.discount > 0 ? money.value : "",
|
||||
discountAmount:
|
||||
props.discount > 0 ? formatDecimal(props.amount - money.value) : "",
|
||||
});
|
||||
showBuyer.value = false;
|
||||
payLoading.value = false;
|
||||
buyerTable.loading = false;
|
||||
ElMessage.success("支付成功");
|
||||
emit("paySuccess");
|
||||
} catch (error) {
|
||||
buyerTable.loading = false
|
||||
payLoading.value = false
|
||||
buyerTable.loading = false;
|
||||
payLoading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
|
@ -278,7 +304,7 @@ async function payCreditPayHandle(row) {
|
|||
|
||||
// 获得扫码值
|
||||
function scanCodeSuccess() {
|
||||
emit('paySuccess')
|
||||
emit("paySuccess");
|
||||
}
|
||||
|
||||
// 切换支付类型
|
||||
|
|
@ -286,21 +312,21 @@ async function payTypeChange(index, item) {
|
|||
try {
|
||||
// await staffPermission('yun_xu_shou_kuan')
|
||||
// if (item.disabled) return
|
||||
payActive.value = index
|
||||
payType.value = item.payType
|
||||
if (item.payType == 'scanCode') {
|
||||
scanModalRef.value.show()
|
||||
payActive.value = index;
|
||||
payType.value = item.payType;
|
||||
if (item.payType == "scanCode") {
|
||||
scanModalRef.value.show();
|
||||
}
|
||||
if (item.payType == 'vipPay') {
|
||||
showDialog.value = true
|
||||
getMemberList()
|
||||
if (item.payType == "vipPay") {
|
||||
showDialog.value = true;
|
||||
getMemberList();
|
||||
}
|
||||
if (item.payType == 'buyer') {
|
||||
showBuyerHandle()
|
||||
if (item.payType == "buyer") {
|
||||
showBuyerHandle();
|
||||
}
|
||||
if (payActive.value != 'buyer') {
|
||||
if (payList.value[payActive.value].payType == 'deposit') {
|
||||
scanModalRef.value.show()
|
||||
if (payActive.value != "buyer") {
|
||||
if (payList.value[payActive.value].payType == "deposit") {
|
||||
scanModalRef.value.show();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
@ -311,27 +337,27 @@ async function payTypeChange(index, item) {
|
|||
// 结算支付
|
||||
async function confirmOrder() {
|
||||
try {
|
||||
payLoading.value = true
|
||||
payLoading.value = true;
|
||||
// 暂时使用现金支付
|
||||
payData.value.checkOrderPay.orderAmount = formatDecimal(+money.value)
|
||||
payData.value.checkOrderPay.roundAmount = formatDecimal(props.amount - money.value)
|
||||
payData.value.checkOrderPay.userId = goodsStore.vipUserInfo.userId ? goodsStore.vipUserInfo.userId : ''
|
||||
payData.value.checkOrderPay.vipPrice = goodsStore.vipUserInfo.userId ? 1 : 0
|
||||
await cashPay(payData.value)
|
||||
payLoading.value = false
|
||||
emit('paySuccess')
|
||||
return
|
||||
await staffPermission('yun_xu_shou_kuan')
|
||||
if (payLoading.value) return
|
||||
if (payActive.value == 'buyer') {
|
||||
showBuyerHandle()
|
||||
} else if (payList.value[payActive.value].payType == 'scanCode') {
|
||||
scanModalRef.value.show()
|
||||
payData.value.checkOrderPay.orderAmount = formatDecimal(+money.value);
|
||||
payData.value.checkOrderPay.roundAmount = formatDecimal(props.amount - money.value);
|
||||
payData.value.checkOrderPay.userId = goodsStore.vipUserInfo.userId ? goodsStore.vipUserInfo.userId : "";
|
||||
payData.value.checkOrderPay.vipPrice = goodsStore.vipUserInfo.userId ? 1 : 0;
|
||||
await cashPay(payData.value);
|
||||
payLoading.value = false;
|
||||
emit("paySuccess");
|
||||
return;
|
||||
await staffPermission("yun_xu_shou_kuan");
|
||||
if (payLoading.value) return;
|
||||
if (payActive.value == "buyer") {
|
||||
showBuyerHandle();
|
||||
} else if (payList.value[payActive.value].payType == "scanCode") {
|
||||
scanModalRef.value.show();
|
||||
} else {
|
||||
// if (money.value < props.amount) return
|
||||
payLoading.value = true
|
||||
payLoading.value = true;
|
||||
switch (payList.value[payActive.value].payType) {
|
||||
case 'deposit'://储值卡
|
||||
case "deposit": //储值卡
|
||||
// if (props.selecttype == 1) {
|
||||
|
||||
// } else {
|
||||
|
|
@ -341,122 +367,125 @@ async function confirmOrder() {
|
|||
await accountPay({
|
||||
orderId: props.orderId,
|
||||
memberId: global.orderMemberInfo.id,
|
||||
memberAccount: ''
|
||||
})
|
||||
memberAccount: "",
|
||||
});
|
||||
} else {
|
||||
payLoading.value = false
|
||||
scanModalRef.value.show()
|
||||
return
|
||||
payLoading.value = false;
|
||||
scanModalRef.value.show();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'cash'://现金
|
||||
case "cash": //现金
|
||||
if (props.selecttype == 1) {
|
||||
await accountPaymember({
|
||||
shopId: store.userInfo.shopId,
|
||||
memberId: props.orderId,
|
||||
amount: props.amount
|
||||
})
|
||||
amount: props.amount,
|
||||
});
|
||||
} else {
|
||||
await cashPay({
|
||||
orderId: props.orderId,
|
||||
payAmount: props.discount > 0 ? money.value : '',
|
||||
discountAmount: props.discount > 0 ? formatDecimal(props.amount - money.value) : ''
|
||||
})
|
||||
payAmount: props.discount > 0 ? money.value : "",
|
||||
discountAmount:
|
||||
props.discount > 0
|
||||
? formatDecimal(props.amount - money.value)
|
||||
: "",
|
||||
});
|
||||
}
|
||||
break;
|
||||
case 'vipPay':
|
||||
case "vipPay":
|
||||
// 会员支付
|
||||
console.log('使用会员id支付');
|
||||
payLoading.value = false
|
||||
showDialog.value = true
|
||||
return
|
||||
console.log("使用会员id支付");
|
||||
payLoading.value = false;
|
||||
showDialog.value = true;
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
payLoading.value = false
|
||||
ElMessage.success('支付成功')
|
||||
emit('paySuccess')
|
||||
payLoading.value = false;
|
||||
ElMessage.success("支付成功");
|
||||
emit("paySuccess");
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
payLoading.value = false
|
||||
scanModalRef.value.loading = false
|
||||
console.log(error);
|
||||
payLoading.value = false;
|
||||
scanModalRef.value.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 输入
|
||||
function amountInput(num) {
|
||||
if (money.value + num <= props.amount) {
|
||||
money.value = clearNoNum({ value: (money.value += num) })
|
||||
money.value = clearNoNum({ value: (money.value += num) });
|
||||
} else {
|
||||
money.value = clearNoNum({ value: `${props.amount}` })
|
||||
money.value = clearNoNum({ value: `${props.amount}` });
|
||||
}
|
||||
}
|
||||
|
||||
// 删除
|
||||
function delHandle() {
|
||||
if (!money.value) return
|
||||
money.value = money.value.substring(0, money.value.length - 1)
|
||||
if (!money.value) return;
|
||||
money.value = money.value.substring(0, money.value.length - 1);
|
||||
if (!money.value) {
|
||||
money.value = '0'
|
||||
money.value = "0";
|
||||
}
|
||||
}
|
||||
|
||||
// 获取支付方式
|
||||
async function queryPayTypeAjax() {
|
||||
try {
|
||||
const res = await getPayType()
|
||||
const res = await getPayType();
|
||||
|
||||
res.map(item => {
|
||||
if (props.amount <= 0 && item.payType == 'scanCode') {
|
||||
item.disabled = true
|
||||
res.map((item) => {
|
||||
if (props.amount <= 0 && item.payType == "scanCode") {
|
||||
item.disabled = true;
|
||||
} else {
|
||||
item.disabled = false
|
||||
item.disabled = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
payList.value = res
|
||||
if (res[0].payType == 'scanCode' && !res[0].disabled) {
|
||||
scanModalRef.value.show()
|
||||
payType.value = res[0].payType
|
||||
payList.value = res;
|
||||
if (res[0].payType == "scanCode" && !res[0].disabled) {
|
||||
scanModalRef.value.show();
|
||||
payType.value = res[0].payType;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const showDialog = ref(false);
|
||||
const tableData = reactive({
|
||||
phone: '',
|
||||
phone: "",
|
||||
loading: false,
|
||||
list: [],
|
||||
page: 1,
|
||||
size: 10,
|
||||
total: 0
|
||||
})
|
||||
total: 0,
|
||||
});
|
||||
|
||||
// 重置表格
|
||||
function resetTable() {
|
||||
tableData.phone = ''
|
||||
tableData.page = 1
|
||||
getMemberList()
|
||||
tableData.phone = "";
|
||||
tableData.page = 1;
|
||||
getMemberList();
|
||||
}
|
||||
|
||||
// 获取会员列表
|
||||
async function getMemberList() {
|
||||
try {
|
||||
tableData.loading = true
|
||||
tableData.loading = true;
|
||||
const res = await queryMembermember({
|
||||
shopId: store.userInfo.shopId,
|
||||
phone: tableData.phone,
|
||||
page: tableData.page,
|
||||
pageSize: tableData.size,
|
||||
isFlag: 1
|
||||
})
|
||||
tableData.loading = false
|
||||
tableData.list = res.list
|
||||
tableData.total = res.total
|
||||
isFlag: 1,
|
||||
});
|
||||
tableData.loading = false;
|
||||
tableData.list = res.list;
|
||||
tableData.total = res.total;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -465,57 +494,76 @@ async function getMemberList() {
|
|||
// 选择会员去下单
|
||||
async function toHomeMember(row) {
|
||||
try {
|
||||
showDialog.value = false
|
||||
payLoading.value = true
|
||||
showDialog.value = false;
|
||||
payLoading.value = true;
|
||||
const res = await vipPay({
|
||||
orderId: props.orderId,
|
||||
vipUserId: row.id,
|
||||
payAmount: props.discount > 0 ? money.value : '',
|
||||
discountAmount: props.discount > 0 ? formatDecimal(props.amount - money.value) : ''
|
||||
})
|
||||
global.setOrderTable()
|
||||
global.setOrderMember()
|
||||
payAmount: props.discount > 0 ? money.value : "",
|
||||
discountAmount:
|
||||
props.discount > 0 ? formatDecimal(props.amount - money.value) : "",
|
||||
});
|
||||
global.setOrderTable();
|
||||
global.setOrderMember();
|
||||
|
||||
payLoading.value = false
|
||||
ElMessage.success('支付成功')
|
||||
emit('paySuccess')
|
||||
payLoading.value = false;
|
||||
ElMessage.success("支付成功");
|
||||
emit("paySuccess");
|
||||
} catch (error) {
|
||||
payLoading.value = false
|
||||
payLoading.value = false;
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 取消折扣
|
||||
function cancelDiscount() {
|
||||
emit('cancelDiscount')
|
||||
emit("cancelDiscount");
|
||||
}
|
||||
|
||||
/** 添加优惠 start */
|
||||
const showCoupon = ref(false)
|
||||
const couponFormRef = ref(null)
|
||||
const couponForm = ref({
|
||||
userId: '',
|
||||
discountRatio: '',
|
||||
|
||||
})
|
||||
|
||||
// 显示添加优惠
|
||||
function showCouponHandle() {
|
||||
showCoupon.value = true
|
||||
}
|
||||
|
||||
|
||||
/** 添加优惠 end */
|
||||
|
||||
onMounted(() => {
|
||||
money.value = `${formatDecimal(props.amount)}`
|
||||
money.value = `${formatDecimal(props.amount)}`;
|
||||
payData.value = {
|
||||
shopId: store.shopInfo.id,
|
||||
buyerRemark: '', // 订单备注
|
||||
buyerRemark: "", // 订单备注
|
||||
checkOrderPay: {
|
||||
orderId: goodsStore.orderListInfo.id,
|
||||
vipPrice: 0, // 是否使用会员价
|
||||
allPack: 0,// 是否整单打包
|
||||
allPack: 0, // 是否整单打包
|
||||
userId: goodsStore.vipUserInfo.id,
|
||||
seatNum: goodsStore.tableInfo.num, // 用餐人数
|
||||
originAmount: formatDecimal(+goodsStore.cartInfo.totalAmount), // 订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
discountRatio: 1, // 折扣比例(计算时 向上取整保留 两位小数)
|
||||
discountAmount: 0, // 手动优惠金额
|
||||
productCouponDiscountAmount: 0, // 商品优惠券抵扣金额
|
||||
fullCouponDiscountAmount: 0, // 满减优惠券抵扣金额
|
||||
couponList: [], // 用户使用的卡券
|
||||
orderAmount: formatDecimal(+goodsStore.cartInfo.totalAmount - goodsStore.cartInfo.packFee), // 订单金额
|
||||
roundAmount: 0, // 抹零金额 减免多少钱
|
||||
pointsDiscountAmount: 0, // 积分抵扣金额(tb_points_basic_setting表)
|
||||
pointsNum: 0 // 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
|
||||
}
|
||||
}
|
||||
queryPayTypeAjax()
|
||||
})
|
||||
|
||||
seatNum: goodsStore.tableInfo.num, // 用餐人数
|
||||
originAmount: formatDecimal(+goodsStore.cartInfo.totalAmount), // 订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
discountRatio: 1, // 折扣比例(计算时 向上取整保留 两位小数)
|
||||
discountAmount: 0, // 手动优惠金额
|
||||
productCouponDiscountAmount: 0, // 商品优惠券抵扣金额
|
||||
fullCouponDiscountAmount: 0, // 满减优惠券抵扣金额
|
||||
couponList: [], // 用户使用的卡券
|
||||
orderAmount: formatDecimal(
|
||||
+goodsStore.cartInfo.totalAmount - goodsStore.cartInfo.packFee
|
||||
), // 订单金额
|
||||
roundAmount: 0, // 抹零金额 减免多少钱
|
||||
pointsDiscountAmount: 0, // 积分抵扣金额(tb_points_basic_setting表)
|
||||
pointsNum: 0, // 使用的积分数量 (扣除各类折扣 enable_deduction后使用)
|
||||
},
|
||||
};
|
||||
queryPayTypeAjax();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
@ -527,31 +575,36 @@ onMounted(() => {
|
|||
.header {
|
||||
padding-bottom: var(--el-font-size-base);
|
||||
border-bottom: 1px solid #ececec;
|
||||
display: flex;
|
||||
|
||||
.t1 {
|
||||
display: flex;
|
||||
color: var(--el-color-danger);
|
||||
font-weight: bold;
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.title {
|
||||
font-size: var(--el-font-size-base);
|
||||
position: relative;
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.t2 {
|
||||
display: flex;
|
||||
color: #999;
|
||||
padding-top: 10px;
|
||||
|
||||
span {
|
||||
.t1 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--el-color-danger);
|
||||
font-weight: bold;
|
||||
|
||||
.title {
|
||||
font-size: var(--el-font-size-base);
|
||||
position: relative;
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.t2 {
|
||||
display: flex;
|
||||
color: #999;
|
||||
padding-top: 10px;
|
||||
|
||||
span {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -665,4 +718,4 @@ onMounted(() => {
|
|||
font-size: calc(var(--el-font-size-base) + 10px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ import { scanpay, queryOrder, quickPay, queryQuickPayStatus, accountPay, querySc
|
|||
import { useUser } from "@/store/user.js";
|
||||
import { useGlobal } from '@/store/global.js'
|
||||
import { formatDecimal } from '@/utils'
|
||||
import { microPay, queryOrderStatus } from '@/api/order.js'
|
||||
import { microPay, queryOrderStatus, microPayVip } from '@/api/order.js'
|
||||
|
||||
const store = useUser();
|
||||
const global = useGlobal()
|
||||
|
|
@ -76,6 +76,7 @@ const props = defineProps({
|
|||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
// 0 订单支付 1 会员充值 2 快捷收款
|
||||
selecttype: {
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
|
|
@ -117,8 +118,20 @@ async function submitHandle() {
|
|||
try {
|
||||
if (!scanCode.value) return;
|
||||
loading.value = true;
|
||||
if (props.selecttype == 1) {
|
||||
await microPay(props.payData);
|
||||
if (props.selecttype == 0) {
|
||||
// 正常下单扫码支付
|
||||
await microPay({
|
||||
...props.payData,
|
||||
authCode: scanCode.value
|
||||
});
|
||||
} else if (props.selecttype == 1) {
|
||||
// 会员扫码充值
|
||||
await microPayVip({
|
||||
shopId: store.shopInfo.id,
|
||||
shopUserId: props.orderId,
|
||||
amount: props.amount,
|
||||
authCode: scanCode.value
|
||||
})
|
||||
} else {
|
||||
if (props.fast) {
|
||||
await quickPay({
|
||||
|
|
@ -128,11 +141,11 @@ async function submitHandle() {
|
|||
});
|
||||
} else {
|
||||
if (props.payType == 'scanCode') {
|
||||
// 正常下单扫码支付
|
||||
await microPay({
|
||||
...props.payData,
|
||||
authCode: scanCode.value
|
||||
});
|
||||
if (props.selecttype == 1) {
|
||||
|
||||
} else if (props.selecttype == 2) {
|
||||
|
||||
}
|
||||
emits('success')
|
||||
}
|
||||
if (props.payType == 'deposit') {
|
||||
|
|
|
|||
|
|
@ -14,22 +14,23 @@
|
|||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import useStorage from '@/utils/useStorage'
|
||||
import userStore from '@/utils/useStorage.js'
|
||||
import { ElUpload, ElMessage } from 'element-plus';
|
||||
|
||||
|
||||
const fileList = ref([])
|
||||
|
||||
// 定义接收的外部属性
|
||||
const props = defineProps({
|
||||
uploadUrl: {
|
||||
type: String,
|
||||
default: import.meta.env.MODE == 'development' ? '/api/shopInfo/upload' : import.meta.env.VITE_API_URL + '/shopInfo/upload',
|
||||
default: import.meta.env.MODE == 'development' ? '/api/account/admin/common/upload' : import.meta.env.VITE_API_URL + '/account/admin/common/upload',
|
||||
},
|
||||
headers: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
token: useStorage.get("token"),
|
||||
loginName: useStorage.get("userInfo").loginName,
|
||||
token: userStore.get('token'),
|
||||
shopId: userStore.get('shopInfo').id,
|
||||
clientType: 'pc'
|
||||
}),
|
||||
},
|
||||
|
|
@ -109,6 +110,4 @@ function init(arr) {
|
|||
defineExpose({
|
||||
init
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
</script>
|
||||
|
|
@ -110,6 +110,44 @@ export const useGlobal = defineStore("global", {
|
|||
label: "现金支付",
|
||||
},
|
||||
],
|
||||
bizCodes: [
|
||||
{
|
||||
type: "cashIn",
|
||||
label: "现金充值",
|
||||
},
|
||||
{
|
||||
type: "wechatIn",
|
||||
label: "微信小程序充值",
|
||||
},
|
||||
{
|
||||
type: "alipayIn",
|
||||
label: "支付宝小程序充值",
|
||||
},
|
||||
{
|
||||
type: "awardIn",
|
||||
label: "充值奖励",
|
||||
},
|
||||
{
|
||||
type: "rechargeRefund",
|
||||
label: "充值退款",
|
||||
},
|
||||
{
|
||||
type: "orderPay",
|
||||
label: "订单消费",
|
||||
},
|
||||
{
|
||||
type: "orderRefund",
|
||||
label: "订单退款",
|
||||
},
|
||||
{
|
||||
type: "adminIn",
|
||||
label: "管理员充值",
|
||||
},
|
||||
{
|
||||
type: "adminOut",
|
||||
label: "管理员消费",
|
||||
},
|
||||
],
|
||||
}),
|
||||
actions: {
|
||||
// 更新状态
|
||||
|
|
|
|||
|
|
@ -385,12 +385,13 @@ export const useGoods = defineStore("goods", {
|
|||
this.operateCart({ table_code: tableCode }, "cleanup");
|
||||
},
|
||||
// 清空购物车回执操作
|
||||
successClearCart() {
|
||||
successClearCart(clearOrder = false) {
|
||||
this.cartList = [];
|
||||
this.cartInfo = {};
|
||||
|
||||
this.orderList = [];
|
||||
this.orderListInfo = "";
|
||||
if (clearOrder) {
|
||||
this.orderList = [];
|
||||
this.orderListInfo = "";
|
||||
}
|
||||
this.calcCartInfo();
|
||||
},
|
||||
// 下单成功清除购物车,重新加载订单
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ export const useSocket = defineStore("socket", {
|
|||
// console.log("接收消息", data);
|
||||
goodsStore.getCartList(data.data);
|
||||
}
|
||||
|
||||
|
||||
this.ws.send(
|
||||
JSON.stringify({
|
||||
type: "receipt",
|
||||
|
|
@ -171,7 +171,7 @@ export const useSocket = defineStore("socket", {
|
|||
startheartbeat() {
|
||||
this.heartbeatTimer = setInterval(() => {
|
||||
if (this.log) console.log("发送心跳");
|
||||
this.ws.send(JSON.stringify({ type: "heartbeat" }));
|
||||
this.ws.send(JSON.stringify({ type: "ping_interval" }));
|
||||
}, 10000);
|
||||
},
|
||||
// 清除心跳
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { login, shopStaffInfo } from "@/api/account.js";
|
||||
import { login, shopStaffInfo, shopInfo_detail } from "@/api/account.js";
|
||||
import useStorage from "@/utils/useStorage";
|
||||
|
||||
export const useUser = defineStore("user", {
|
||||
|
|
@ -29,5 +29,15 @@ export const useUser = defineStore("user", {
|
|||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 更新店铺信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const res = await shopInfo_detail();
|
||||
useStorage.set("shopInfo", res);
|
||||
this.shopInfo = useStorage.get("shopInfo");
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -178,3 +178,13 @@ export function commOrderPrintData(orderInfo) {
|
|||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验手机号
|
||||
* @param {*} phone
|
||||
* @returns
|
||||
*/
|
||||
export function regPhone(phone) {
|
||||
let reg = /^(?:(?:\+|00)86)?1\d{10}$/;
|
||||
return reg.test(phone);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
// })
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue