1.新增商品编辑
This commit is contained in:
parent
e4a82411ba
commit
b45793ffc9
|
|
@ -1 +1,115 @@
|
||||||
"use strict";const s=require("path"),e=require("electron"),a=require("os");let n;e.app.whenReady().then(()=>{n=new e.BrowserWindow({title:"银收客",width:1024,height:768,fullscreenable:!0,fullscreen:!process.env.VITE_DEV_SERVER_URL,simpleFullscreen:!0,frame:!!process.env.VITE_DEV_SERVER_URL,webPreferences:{nodeIntegration:!0,contextIsolation:!1}}),process.env.VITE_DEV_SERVER_URL?n.loadURL(process.env.VITE_DEV_SERVER_URL):n.loadFile(s.resolve(__dirname,"../dist/index.html")),e.app.on("activate",()=>{e.BrowserWindow.getAllWindows().length===0&&createWindow()}),e.ipcMain.on("quitHandler",(t,o)=>{n=null,e.app.exit()}),e.ipcMain.on("getPrintList",()=>{n.webContents.getPrintersAsync().then(t=>{n.webContents.send("printList",t)})}),e.ipcMain.on("getOSmacSync",()=>{let t="";a.networkInterfaces().WLAN?(t=a.networkInterfaces().WLAN[0].mac,console.log("wlan.mac===",t)):(t=a.networkInterfaces().以太网[0].mac,console.log("以太网.mac===",t)),n.webContents.send("getOSmacRes",t)});const i=new e.BrowserWindow({show:!1,width:360,height:240,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?i.loadFile(s.join(__dirname,"../public/tag_print.html")):i.loadFile(s.resolve(__dirname,"../dist/tag_print.html")),e.ipcMain.on("printerTagSync",(t,o)=>{console.log(o),i.webContents.send("getParams",o)}),e.ipcMain.on("printTagStart",(t,o)=>{let l=JSON.parse(o).deviceName;i.webContents.print({silent:!0,deviceName:l,pageSize:{width:45e3,height:3e4},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})}),e.app.requestSingleInstanceLock()?e.app.on("second-instance",(t,o,r)=>{n&&(n.isMinimized()&&n.restore(),n.focus(),n.show())}):e.app.quit(),n.on("close",t=>{t.preventDefault(),n.webContents.send("showCloseDialog")})});e.app.on("window-all-closed",()=>{process.platform!=="darwin"&&e.app.quit()});
|
"use strict";
|
||||||
|
const path = require("path");
|
||||||
|
const electron = require("electron");
|
||||||
|
const os = require("os");
|
||||||
|
let win;
|
||||||
|
electron.app.whenReady().then(() => {
|
||||||
|
win = new electron.BrowserWindow({
|
||||||
|
title: "银收客",
|
||||||
|
width: 1024,
|
||||||
|
height: 768,
|
||||||
|
fullscreenable: true,
|
||||||
|
fullscreen: process.env.VITE_DEV_SERVER_URL ? false : true,
|
||||||
|
simpleFullscreen: true,
|
||||||
|
frame: process.env.VITE_DEV_SERVER_URL ? true : false,
|
||||||
|
webPreferences: {
|
||||||
|
// 集成网页和 Node.js,也就是在渲染进程中,可以调用 Node.js 方法
|
||||||
|
nodeIntegration: true,
|
||||||
|
contextIsolation: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (process.env.VITE_DEV_SERVER_URL) {
|
||||||
|
win.loadURL(process.env.VITE_DEV_SERVER_URL);
|
||||||
|
} else {
|
||||||
|
win.loadFile(path.resolve(__dirname, "../dist/index.html"));
|
||||||
|
}
|
||||||
|
electron.app.on("activate", () => {
|
||||||
|
if (electron.BrowserWindow.getAllWindows().length === 0) {
|
||||||
|
createWindow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
electron.ipcMain.on("quitHandler", (_, msg) => {
|
||||||
|
win = null;
|
||||||
|
electron.app.exit();
|
||||||
|
});
|
||||||
|
electron.ipcMain.on("getPrintList", () => {
|
||||||
|
win.webContents.getPrintersAsync().then((res) => {
|
||||||
|
win.webContents.send("printList", res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
electron.ipcMain.on("getOSmacSync", () => {
|
||||||
|
let mac = "";
|
||||||
|
if (os.networkInterfaces().WLAN) {
|
||||||
|
mac = os.networkInterfaces().WLAN[0].mac;
|
||||||
|
console.log("wlan.mac===", mac);
|
||||||
|
} else {
|
||||||
|
mac = os.networkInterfaces()["以太网"][0].mac;
|
||||||
|
console.log("以太网.mac===", mac);
|
||||||
|
}
|
||||||
|
win.webContents.send("getOSmacRes", mac);
|
||||||
|
});
|
||||||
|
const tagPrintWin = new electron.BrowserWindow({
|
||||||
|
show: false,
|
||||||
|
width: 360,
|
||||||
|
height: 240,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
contextIsolation: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (process.env.VITE_DEV_SERVER_URL) {
|
||||||
|
tagPrintWin.loadFile(path.join(__dirname, "../public/tag_print.html"));
|
||||||
|
} else {
|
||||||
|
tagPrintWin.loadFile(path.resolve(__dirname, "../dist/tag_print.html"));
|
||||||
|
}
|
||||||
|
electron.ipcMain.on("printerTagSync", (event, arg) => {
|
||||||
|
console.log(arg);
|
||||||
|
tagPrintWin.webContents.send("getParams", arg);
|
||||||
|
});
|
||||||
|
electron.ipcMain.on("printTagStart", (event, arg) => {
|
||||||
|
const _parmas = JSON.parse(arg);
|
||||||
|
let name = _parmas.deviceName;
|
||||||
|
tagPrintWin.webContents.print({
|
||||||
|
silent: true,
|
||||||
|
deviceName: name,
|
||||||
|
pageSize: {
|
||||||
|
width: 45e3,
|
||||||
|
height: 3e4
|
||||||
|
},
|
||||||
|
scaleFactor: 80,
|
||||||
|
landscape: false,
|
||||||
|
margins: {
|
||||||
|
marginType: "none",
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0
|
||||||
|
},
|
||||||
|
dpi: {
|
||||||
|
horizontal: 203,
|
||||||
|
vertical: 203
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const gotTheLock = electron.app.requestSingleInstanceLock();
|
||||||
|
if (!gotTheLock) {
|
||||||
|
electron.app.quit();
|
||||||
|
} else {
|
||||||
|
electron.app.on("second-instance", (event, commandLine, workingDirectory) => {
|
||||||
|
if (win) {
|
||||||
|
if (win.isMinimized())
|
||||||
|
win.restore();
|
||||||
|
win.focus();
|
||||||
|
win.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
win.on("close", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
win.webContents.send("showCloseDialog");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
electron.app.on("window-all-closed", () => {
|
||||||
|
if (process.platform !== "darwin")
|
||||||
|
electron.app.quit();
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "vite-electron",
|
"name": "vite-electron",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.4.14",
|
"version": "1.4.15",
|
||||||
"main": "dist-electron/main.js",
|
"main": "dist-electron/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "chcp 65001 && vite",
|
"dev": "chcp 65001 && vite",
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ function openCall() {
|
||||||
|
|
||||||
// 手动重新连接ws
|
// 手动重新连接ws
|
||||||
function connectWsHandle() {
|
function connectWsHandle() {
|
||||||
if (socketStore.online) return
|
// if (socketStore.online) return
|
||||||
location.reload()
|
location.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@ import { clearNoNum } from '@/utils'
|
||||||
|
|
||||||
import scanModal from '@/components/payCard/scanModal.vue'
|
import scanModal from '@/components/payCard/scanModal.vue'
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
|
import { useGlobal } from '@/store/global.js'
|
||||||
|
|
||||||
|
const global = useGlobal()
|
||||||
|
|
||||||
const store = useUser()
|
const store = useUser()
|
||||||
|
|
||||||
|
|
@ -73,10 +76,6 @@ const props = defineProps({
|
||||||
orderId: {
|
orderId: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: ''
|
default: ''
|
||||||
},
|
|
||||||
member: {
|
|
||||||
type: Object,
|
|
||||||
default: {}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -112,7 +111,7 @@ function payTypeChange(index, item) {
|
||||||
if (item.payType == 'scanCode') {
|
if (item.payType == 'scanCode') {
|
||||||
scanModalRef.value.show()
|
scanModalRef.value.show()
|
||||||
}
|
}
|
||||||
if (payList.value[payActive.value].payType == 'deposit' && !props.member.id) {
|
if (payList.value[payActive.value].payType == 'deposit' && !global.orderMemberInfo.id) {
|
||||||
scanModalRef.value.show()
|
scanModalRef.value.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -133,10 +132,10 @@ async function confirmOrder() {
|
||||||
// } else {
|
// } else {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
if (props.member.id) {
|
if (global.orderMemberInfo.id) {
|
||||||
await accountPay({
|
await accountPay({
|
||||||
orderId: props.orderId,
|
orderId: props.orderId,
|
||||||
memberId: props.member.id,
|
memberId: global.orderMemberInfo.id,
|
||||||
memberAccount: ''
|
memberAccount: ''
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,21 @@ export const useGlobal = defineStore({
|
||||||
state: () => ({
|
state: () => ({
|
||||||
// 是否监听叫号
|
// 是否监听叫号
|
||||||
isCallNumber: true,
|
isCallNumber: true,
|
||||||
|
orderMemberInfo: {},
|
||||||
|
tableInfo: {},
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
// 更新状态
|
// 更新状态
|
||||||
updateData(state) {
|
updateData(state) {
|
||||||
this.isCallNumber = state;
|
this.isCallNumber = state;
|
||||||
},
|
},
|
||||||
|
// 设置订单会员信息
|
||||||
|
setOrderMember(obj) {
|
||||||
|
this.orderMemberInfo = obj;
|
||||||
|
},
|
||||||
|
// 设置订单台桌信息
|
||||||
|
setOrderTable(obj) {
|
||||||
|
this.tableInfo = obj;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="master_id">
|
<div class="master_id">
|
||||||
<span>{{ props.masterId }}</span>
|
<span>{{ props.masterId }}</span>
|
||||||
<span class="member_info" v-if="memberInfo.telephone">会员:{{ memberInfo.telephone }}</span>
|
<span class="member_info" v-if="global.orderMemberInfo.telephone">
|
||||||
|
会员:{{ global.orderMemberInfo.telephone }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="btm">
|
<div class="btm">
|
||||||
<span class="p">服务员:{{ store.userInfo.loginAccount || "暂无" }}</span>
|
<span class="p">服务员:{{ store.userInfo.loginAccount || "暂无" }}</span>
|
||||||
|
|
@ -59,7 +61,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pay_wrap">
|
<div class="pay_wrap">
|
||||||
<payCard :amount="props.amount" :member="props.member" :orderId="props.orderInfo.id" @paySuccess="paySuccess" />
|
<payCard :amount="props.amount" :orderId="props.orderInfo.id" @paySuccess="paySuccess" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
@ -78,8 +80,10 @@ import useStorage from '@/utils/useStorage'
|
||||||
import { ipcRenderer } from "electron";
|
import { ipcRenderer } from "electron";
|
||||||
import { formatDecimal } from '@/utils/index.js'
|
import { formatDecimal } from '@/utils/index.js'
|
||||||
import receiptPrint from "@/components/lodop/receiptPrint.js";
|
import receiptPrint from "@/components/lodop/receiptPrint.js";
|
||||||
|
import { useGlobal } from '@/store/global.js'
|
||||||
import { usePrint } from '@/store/print.js'
|
import { usePrint } from '@/store/print.js'
|
||||||
|
|
||||||
|
const global = useGlobal()
|
||||||
const printStore = usePrint()
|
const printStore = usePrint()
|
||||||
|
|
||||||
const store = useUser();
|
const store = useUser();
|
||||||
|
|
@ -215,37 +219,21 @@ async function printOrderLable() {
|
||||||
|
|
||||||
// 订单已支付
|
// 订单已支付
|
||||||
function paySuccess() {
|
function paySuccess() {
|
||||||
useStorage.del('memberInfo')
|
|
||||||
dialogVisible.value = false;
|
dialogVisible.value = false;
|
||||||
|
global.setOrderMember({})
|
||||||
|
global.setOrderTable({})
|
||||||
printOrderLable()
|
printOrderLable()
|
||||||
|
|
||||||
emit("paySuccess");
|
emit("paySuccess");
|
||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
getLocalMemberInfo()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
show,
|
show,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const memberInfo = ref('')
|
|
||||||
|
|
||||||
// 从本地获取会员信息
|
|
||||||
function getLocalMemberInfo() {
|
|
||||||
let localMemberInfo = useStorage.get('memberInfo')
|
|
||||||
if (localMemberInfo && localMemberInfo.telephone) {
|
|
||||||
memberInfo.value = localMemberInfo
|
|
||||||
} else {
|
|
||||||
memberInfo.value = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getLocalMemberInfo()
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@
|
||||||
<div class="number" @click="takeFoodCodeRef.show()">
|
<div class="number" @click="takeFoodCodeRef.show()">
|
||||||
<el-text class="t">{{ masterId }}</el-text>
|
<el-text class="t">{{ masterId }}</el-text>
|
||||||
</div>
|
</div>
|
||||||
<div class="select_user" @click="fastCashierRef.show()" v-if="!memberInfo.telephone">
|
<div class="select_user" @click="fastCashierRef.show()"
|
||||||
|
v-if="!global.orderMemberInfo.telephone && !global.tableInfo.id">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<el-icon class="icon">
|
<el-icon class="icon">
|
||||||
<WalletFilled />
|
<WalletFilled />
|
||||||
|
|
@ -27,7 +28,12 @@
|
||||||
<el-icon class="icon">
|
<el-icon class="icon">
|
||||||
<UserFilled />
|
<UserFilled />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<el-text class="t">{{ memberInfo.telephone }}</el-text>
|
<div class="t_wrap" :class="{ 'big_text': global.orderMemberInfo.telephone && global.tableInfo.id }">
|
||||||
|
<div class="t" v-if="global.orderMemberInfo.telephone">
|
||||||
|
会员:{{ global.orderMemberInfo.telephone }}
|
||||||
|
</div>
|
||||||
|
<div class="t" v-if="global.tableInfo.id">台桌:{{ global.tableInfo.name }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-icon class="arrow">
|
<el-icon class="arrow">
|
||||||
<Close />
|
<Close />
|
||||||
|
|
@ -116,7 +122,7 @@
|
||||||
<takeFoodCode ref="takeFoodCodeRef" title="修改取餐号" placeholder="请输入取餐号" @success="takeFoodCodeSuccess" />
|
<takeFoodCode ref="takeFoodCodeRef" title="修改取餐号" placeholder="请输入取餐号" @success="takeFoodCodeSuccess" />
|
||||||
<!-- 结算订单 -->
|
<!-- 结算订单 -->
|
||||||
<settleAccount ref="settleAccountRef" :cart="cartList" :amount="cartInfo.totalAmount" :remark="remark"
|
<settleAccount ref="settleAccountRef" :cart="cartList" :amount="cartInfo.totalAmount" :remark="remark"
|
||||||
:masterId="masterId" :orderInfo="orderInfo" :member="memberInfo" @paySuccess="createCodeAjax(1)" />
|
:masterId="masterId" :orderInfo="orderInfo" @paySuccess="createCodeAjax(1)" />
|
||||||
<!-- 快捷收银 -->
|
<!-- 快捷收银 -->
|
||||||
<fastCashier ref="fastCashierRef" type="0" />
|
<fastCashier ref="fastCashierRef" type="0" />
|
||||||
<!-- 挂起订单 -->
|
<!-- 挂起订单 -->
|
||||||
|
|
@ -132,6 +138,7 @@ export default {
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { useUser } from "@/store/user.js";
|
import { useUser } from "@/store/user.js";
|
||||||
|
import { useGlobal } from '@/store/global.js'
|
||||||
import remarkModal from "@/components/remarkModal.vue";
|
import remarkModal from "@/components/remarkModal.vue";
|
||||||
import takeFoodCode from "@/components/takeFoodCode.vue";
|
import takeFoodCode from "@/components/takeFoodCode.vue";
|
||||||
import cartOperation from "@/views/home/components/cartOperation.vue";
|
import cartOperation from "@/views/home/components/cartOperation.vue";
|
||||||
|
|
@ -155,6 +162,8 @@ import {
|
||||||
import goods from "@/views/home/components/goods.vue";
|
import goods from "@/views/home/components/goods.vue";
|
||||||
import member from "@/views/member/index.vue";
|
import member from "@/views/member/index.vue";
|
||||||
|
|
||||||
|
const global = useGlobal()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const membershow = ref(false);
|
const membershow = ref(false);
|
||||||
|
|
@ -177,8 +186,6 @@ const cartLoading = ref(false);
|
||||||
const orderInfo = ref({});
|
const orderInfo = ref({});
|
||||||
const createOrderLoading = ref(false);
|
const createOrderLoading = ref(false);
|
||||||
|
|
||||||
const memberInfo = ref({})
|
|
||||||
|
|
||||||
// 取餐码
|
// 取餐码
|
||||||
const masterId = ref("");
|
const masterId = ref("");
|
||||||
|
|
||||||
|
|
@ -310,6 +317,7 @@ async function addCart(params, type = "add") {
|
||||||
const res = await createCart({
|
const res = await createCart({
|
||||||
productId: params.productId,
|
productId: params.productId,
|
||||||
masterId: masterId.value,
|
masterId: masterId.value,
|
||||||
|
tableId: global.tableInfo.id || '',
|
||||||
shopId: store.userInfo.shopId,
|
shopId: store.userInfo.shopId,
|
||||||
skuId: type == "add" ? params.id : params.skuId,
|
skuId: type == "add" ? params.id : params.skuId,
|
||||||
number: params.number || 1,
|
number: params.number || 1,
|
||||||
|
|
@ -374,7 +382,6 @@ async function createCodeAjax(type = "0") {
|
||||||
});
|
});
|
||||||
masterId.value = res.code;
|
masterId.value = res.code;
|
||||||
queryCartAjax();
|
queryCartAjax();
|
||||||
getLocalMemberInfo()
|
|
||||||
|
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
// 结算订单 清楚商品所有红点
|
// 结算订单 清楚商品所有红点
|
||||||
|
|
@ -385,25 +392,14 @@ async function createCodeAjax(type = "0") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从本地获取会员信息
|
// 清除本地会员/台桌信息
|
||||||
function getLocalMemberInfo() {
|
|
||||||
let localMemberInfo = useStorage.get('memberInfo')
|
|
||||||
if (localMemberInfo && localMemberInfo.telephone) {
|
|
||||||
memberInfo.value = localMemberInfo
|
|
||||||
} else {
|
|
||||||
memberInfo.value = {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 清除本地会员
|
|
||||||
function clearMember() {
|
function clearMember() {
|
||||||
useStorage.del('memberInfo')
|
global.setOrderMember({})
|
||||||
getLocalMemberInfo()
|
global.setOrderTable({})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
createCodeAjax();
|
createCodeAjax();
|
||||||
getLocalMemberInfo()
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -459,7 +455,7 @@ onMounted(() => {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background-color: var(--el-color-info-light-8);
|
background-color: var(--el-color-info-light-8);
|
||||||
padding: 0 var(--el-font-size-base);
|
padding: 0 10px;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -470,6 +466,18 @@ onMounted(() => {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.t_wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
&.big_text {
|
||||||
|
.t {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.t {
|
.t {
|
||||||
font-size: var(--el-font-size-base);
|
font-size: var(--el-font-size-base);
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
|
|
||||||
|
|
@ -418,8 +418,10 @@ const createMembermemberSubmit = async () => { ///添加会员
|
||||||
}
|
}
|
||||||
const moneys = ref('')// 钱数
|
const moneys = ref('')// 钱数
|
||||||
|
|
||||||
|
// 创建会员订单
|
||||||
const toHome = () => {
|
const toHome = () => {
|
||||||
useStorage.set('memberInfo', tableData.list[datarow.value])
|
// useStorage.set('memberInfo', tableData.list[datarow.value])
|
||||||
|
global.setOrderMember(tableData.list[datarow.value])
|
||||||
router.push({
|
router.push({
|
||||||
name: 'home'
|
name: 'home'
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="demo_tabs_boxitem_onetow">
|
<div class="demo_tabs_boxitem_onetow">
|
||||||
<div style="font-size: 16px; color: #757575;">{{ item.orderNo }}</div>
|
<div style="font-size: 16px; color: #757575;">{{ item.orderNo }}</div>
|
||||||
<div>
|
<div class="order_info">
|
||||||
<span>{{ item.names && item.names[0] }} </span>
|
<span class="sp1">{{
|
||||||
|
item.names &&
|
||||||
|
item.names[0] }} </span>
|
||||||
<span style="margin-left: 6px;">{{ item.names && item.names.length }}项</span>
|
<span style="margin-left: 6px;">{{ item.names && item.names.length }}项</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -115,6 +117,19 @@ const clickitemboxshow = (e) => {
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
|
||||||
|
.order_info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.sp1 {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100px;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1091,8 +1091,8 @@ onMounted(() => {
|
||||||
|
|
||||||
.tableDataclass {
|
.tableDataclass {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: auto;
|
overflow-y: auto;
|
||||||
height: 90%;
|
height: 70%;
|
||||||
|
|
||||||
.orderbox_right_item {
|
.orderbox_right_item {
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
|
|
|
||||||
|
|
@ -16,21 +16,67 @@
|
||||||
<span class="t">{{ status[props.tableInfo.status] }}</span>
|
<span class="t">{{ status[props.tableInfo.status] }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="place_order">
|
<div class="place_order">
|
||||||
<router-link class="btn" :to="{ name: 'home', query: { table_code: 1 } }">
|
<div class="btn">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<el-icon class="icon">
|
<el-icon class="icon">
|
||||||
<TakeawayBox />
|
<TakeawayBox />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span class="t">点单</span>
|
<span class="t">点单</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="tips">开始新订单</span>
|
<!-- <span class="tips">开始新订单</span> -->
|
||||||
</router-link>
|
<div class="btn_wrap">
|
||||||
|
<el-button type="primary" style="width: 100%;" @click="toOrderMeal(1)">直接点单</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="btn_wrap">
|
||||||
|
<el-button type="primary" style="width: 100%;" @click="toOrderMeal(2)">选择会员点单</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<el-dialog :title="`台桌:${props.tableInfo.name} - 选择会员`" v-model="showDialog" width="80%">
|
||||||
|
<el-form inline>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input placeholder="请输入手机号搜索会员" v-model="tableData.phone" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getMemberList">搜索</el-button>
|
||||||
|
<el-button @click="resetTable">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table :data="tableData.list" height="300px" border stripe v-loading="tableData.loading">
|
||||||
|
<el-table-column prop="name" label="昵称" width="120px" />
|
||||||
|
<el-table-column prop="telephone" label="手机" width="150px" />
|
||||||
|
<el-table-column prop="code" label="编号" width="120px" />
|
||||||
|
<el-table-column prop="level" label="等级" />
|
||||||
|
<el-table-column prop="levelConsume" label="积分" />
|
||||||
|
<el-table-column prop="amount" label="余额" width="100px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
¥{{ formatDecimal(scope.row.amount) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="120px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="primary" @click="toHomeMember(scope.row)">选择</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { useUser } from "@/store/user.js"
|
||||||
|
import { useGlobal } from '@/store/global.js'
|
||||||
|
import { queryMembermember } from '@/api/member/index.js'
|
||||||
|
import { formatDecimal } from '@/utils/index.js'
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
const global = useGlobal()
|
||||||
|
const store = useUser()
|
||||||
|
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
|
|
@ -52,6 +98,65 @@ const status = ref({
|
||||||
function close() {
|
function close() {
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 点单
|
||||||
|
function toOrderMeal(t) {
|
||||||
|
if (t == 1) {
|
||||||
|
// 直接点单
|
||||||
|
global.setOrderTable(props.tableInfo)
|
||||||
|
router.push({
|
||||||
|
name: 'home',
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 选择会员点单
|
||||||
|
showDialog.value = true
|
||||||
|
getMemberList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
const tableData = reactive({
|
||||||
|
phone: '',
|
||||||
|
loading: false,
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// 重置表格
|
||||||
|
function resetTable() {
|
||||||
|
tableData.phone = ''
|
||||||
|
tableData.page = 1
|
||||||
|
getMemberList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取会员列表
|
||||||
|
async function getMemberList() {
|
||||||
|
try {
|
||||||
|
tableData.loading = true
|
||||||
|
const res = await queryMembermember({
|
||||||
|
shopId: store.userInfo.shopId,
|
||||||
|
phone: tableData.phone,
|
||||||
|
page: tableData.page,
|
||||||
|
pageSize: tableData.size
|
||||||
|
})
|
||||||
|
tableData.loading = false
|
||||||
|
tableData.list = res.list
|
||||||
|
tableData.total = res.total
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择会员去下单
|
||||||
|
function toHomeMember(row) {
|
||||||
|
global.setOrderTable(props.tableInfo)
|
||||||
|
global.setOrderMember(row)
|
||||||
|
router.push({
|
||||||
|
name: 'home',
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
@ -104,17 +209,21 @@ function close() {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
$size: 150px;
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
background-color: var(--el-color-danger);
|
background-color: var(--el-color-danger);
|
||||||
width: 130px;
|
width: $size;
|
||||||
height: 130px;
|
height: $size;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -135,6 +244,10 @@ function close() {
|
||||||
color: #999;
|
color: #999;
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn_wrap {
|
||||||
|
width: $size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue