优化下单
This commit is contained in:
@@ -168,6 +168,19 @@
|
||||
<div class="no_permission" v-if="!store.menus.length || (store.menus.length && !store.menus[0].state)">
|
||||
无操作权限,请联系管理员(;´д`)ゞ
|
||||
</div>
|
||||
<!-- 打印插件是否加载好的提示 -->
|
||||
<div class="print_tip" v-if="!printStore.isPrintService"
|
||||
v-loading="!printStore.isPrintService && !printStore.showPrintNotService" element-loading-text="打印服务加载中...">
|
||||
<el-dialog title="注意" v-model="printStore.showPrintNotService" :modal="false" top="30vh">
|
||||
<span class="print_tip_title">打印服务未启动,请重新加载程序或者退出后重新打开!</span>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="printReloadHandle">重新加载</el-button>
|
||||
<el-button type="primary" @click="quitAPPhandle">退出程序</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 备注 -->
|
||||
<remarkModal ref="remarkRef" @success="(e) => (remark = e)" />
|
||||
@@ -212,6 +225,11 @@ import goods from "@/views/home/components/goods.vue";
|
||||
import member from "@/views/member/index.vue";
|
||||
import { useUser } from '@/store/user.js'
|
||||
import { useSocket } from '@/store/socket.js'
|
||||
import { usePrint } from '@/store/print.js'
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const printStore = usePrint()
|
||||
|
||||
const SelectVipUserRef = ref(null)
|
||||
|
||||
@@ -236,6 +254,15 @@ const cartLoading = ref(false);
|
||||
const orderInfo = ref({});
|
||||
const createOrderLoading = ref(false);
|
||||
|
||||
function quitAPPhandle(params) {
|
||||
ipcRenderer.send("quitHandler", "退出吧");
|
||||
}
|
||||
|
||||
// 重启刷新软件
|
||||
function printReloadHandle() {
|
||||
location.reload()
|
||||
}
|
||||
|
||||
// 选择会员
|
||||
function selectUser(row) {
|
||||
console.log('selectUser===', row);
|
||||
@@ -264,9 +291,6 @@ async function quickCashHandle() {
|
||||
async function createOrderHandle(t = 0) {
|
||||
try {
|
||||
if (goodsStore.cartList.length) {
|
||||
// console.log(goodsStore.allSelected );
|
||||
// console.log(goodsStore.allSelected ? store.shopInfo.eatModel.split(',')[1] : store.shopInfo.eatModel.split(',')[0]);
|
||||
|
||||
const data = {
|
||||
orderId: goodsStore.orderListInfo.id || '', // 订单id
|
||||
shopId: store.shopInfo.id, // 店铺id
|
||||
@@ -284,19 +308,22 @@ async function createOrderHandle(t = 0) {
|
||||
createOrderLoading.value = true;
|
||||
goodsStore.calcCartInfo()
|
||||
const res = await createOrder(data)
|
||||
// 设置订单信息
|
||||
goodsStore.orderListInfo = res
|
||||
|
||||
if (t == 1) {
|
||||
// 向其他端发送清空购物车消息
|
||||
goodsStore.operateCart({ table_code: goodsStore.orderListInfo.tableCode }, "cleanup");
|
||||
settleAccountRef.value.show(t)
|
||||
if (res.id) {
|
||||
// 设置订单信息
|
||||
goodsStore.orderListInfo = res
|
||||
if (t == 1) {
|
||||
// 向其他端发送清空购物车消息
|
||||
goodsStore.operateCart({ table_code: goodsStore.orderListInfo.tableCode }, "cleanup");
|
||||
console.log('生成订单===', res);
|
||||
settleAccountRef.value.show(t)
|
||||
} else {
|
||||
goodsStore.clearCart()
|
||||
}
|
||||
// 清除购物车,更新历史订单
|
||||
goodsStore.updateOrderList()
|
||||
} else {
|
||||
goodsStore.clearCart()
|
||||
ElMessage.error('订单成功失败,请重新下单')
|
||||
}
|
||||
|
||||
// 清除购物车,更新历史订单
|
||||
goodsStore.updateOrderList()
|
||||
} else {
|
||||
settleAccountRef.value.show(t)
|
||||
}
|
||||
@@ -389,6 +416,31 @@ function clearVipUserHandle() {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.print_tip {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
backdrop-filter: blur(5px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
|
||||
.print_tip_title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-danger);
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
padding: var(--el-font-size-base);
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user