diff --git a/dist-electron/main.js b/dist-electron/main.js index 6692179..d617e47 100644 --- a/dist-electron/main.js +++ b/dist-electron/main.js @@ -1 +1 @@ -"use strict";const i=require("path"),e=require("electron");let a;e.app.whenReady().then(()=>{a=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?a.loadURL(process.env.VITE_DEV_SERVER_URL):a.loadFile(i.resolve(__dirname,"../dist/index.html")),e.app.on("activate",()=>{e.BrowserWindow.getAllWindows().length===0&&createWindow()}),e.ipcMain.on("quitHandler",(t,n)=>{e.app.quit()}),e.ipcMain.on("getPrintList",()=>{a.webContents.getPrintersAsync().then(t=>{a.webContents.send("printList",t)})});const o=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?o.loadFile(i.join(__dirname,"../public/print.html")):o.loadFile(i.resolve(__dirname,"../dist/print.html")),e.ipcMain.on("printerInfoSync",(t,n)=>{o.webContents.send("getParams",n)}),e.ipcMain.on("printStart",(t,n)=>{console.log(n);let r=JSON.parse(n).deviceName;o.webContents.print({silent:!0,deviceName:r,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})});const s=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?s.loadFile(i.join(__dirname,"../public/work_print.html")):s.loadFile(i.resolve(__dirname,"../dist/work_print.html")),e.ipcMain.on("printerWorkSync",(t,n)=>{s.webContents.send("getParams",n)}),e.ipcMain.on("printWorkStart",(t,n)=>{let r=JSON.parse(n).deviceName;s.webContents.print({silent:!0,deviceName:r,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})});const l=new e.BrowserWindow({show:!0,width:320,height:240,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?l.loadFile(i.join(__dirname,"../public/tag_print.html")):l.loadFile(i.resolve(__dirname,"../dist/tag_print.html")),e.ipcMain.on("printerTagSync",(t,n)=>{console.log(n),l.webContents.send("getParams",n)}),e.ipcMain.on("printTagStart",(t,n)=>{let r=JSON.parse(n).deviceName;l.webContents.print({silent:!0,deviceName:r,pageSize:{width:4e4,height:3e4},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})})});e.app.on("window-all-closed",()=>{process.platform!=="darwin"&&e.app.quit()}); +"use strict";const i=require("path"),e=require("electron");let a;e.app.whenReady().then(()=>{a=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?a.loadURL(process.env.VITE_DEV_SERVER_URL):a.loadFile(i.resolve(__dirname,"../dist/index.html")),e.app.on("activate",()=>{e.BrowserWindow.getAllWindows().length===0&&createWindow()}),e.ipcMain.on("quitHandler",(t,n)=>{e.app.quit()}),e.ipcMain.on("getPrintList",()=>{a.webContents.getPrintersAsync().then(t=>{a.webContents.send("printList",t)})});const o=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?o.loadFile(i.join(__dirname,"../public/print.html")):o.loadFile(i.resolve(__dirname,"../dist/print.html")),e.ipcMain.on("printerInfoSync",(t,n)=>{o.webContents.send("getParams",n)}),e.ipcMain.on("printStart",(t,n)=>{console.log(n);let r=JSON.parse(n).deviceName;o.webContents.print({silent:!0,deviceName:r,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})});const s=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?s.loadFile(i.join(__dirname,"../public/work_print.html")):s.loadFile(i.resolve(__dirname,"../dist/work_print.html")),e.ipcMain.on("printerWorkSync",(t,n)=>{s.webContents.send("getParams",n)}),e.ipcMain.on("printWorkStart",(t,n)=>{let r=JSON.parse(n).deviceName;s.webContents.print({silent:!0,deviceName:r,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})});const l=new e.BrowserWindow({show:!1,width:320,height:240,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?l.loadFile(i.join(__dirname,"../public/tag_print.html")):l.loadFile(i.resolve(__dirname,"../dist/tag_print.html")),e.ipcMain.on("printerTagSync",(t,n)=>{console.log(n),l.webContents.send("getParams",n)}),e.ipcMain.on("printTagStart",(t,n)=>{let r=JSON.parse(n).deviceName;l.webContents.print({silent:!0,deviceName:r,pageSize:{width:4e4,height:3e4},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})})});e.app.on("window-all-closed",()=>{process.platform!=="darwin"&&e.app.quit()}); diff --git a/electron/main.js b/electron/main.js index 5a16fc4..0816753 100644 --- a/electron/main.js +++ b/electron/main.js @@ -164,7 +164,7 @@ app.whenReady().then(() => { // 标签小票的窗口 const tagPrintWin = new BrowserWindow({ - show: true, + show: false, width: 320, height: 240, webPreferences: { diff --git a/package.json b/package.json index 9aee605..97b1779 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vite-electron", "private": true, - "version": "1.3.6", + "version": "1.3.12", "main": "dist-electron/main.js", "scripts": { "dev": "chcp 65001 && vite", diff --git a/public/tag_print.html b/public/tag_print.html index e361471..321281f 100644 --- a/public/tag_print.html +++ b/public/tag_print.html @@ -46,7 +46,7 @@ onMounted(() => { ipcRenderer.on("getParams", (event, arg) => { data.value = JSON.parse(arg); - console.log(data.value); + // console.log(data.value); let size = 46; let qrcode = new QRCode(document.getElementById("ewm"), { @@ -56,17 +56,17 @@ correctLevel: QRCode.CorrectLevel.H, }); - // ipcRenderer.send( - // "printTagStart", - // JSON.stringify({ deviceName: data.value.deviceName }) - // ); + ipcRenderer.send( + "printTagStart", + JSON.stringify({ deviceName: data.value.deviceName }) + ); - setTimeout(() => { - ipcRenderer.send( - "printTagStart", - JSON.stringify({ deviceName: data.value.deviceName }) - ); - }, 100); + // setTimeout(() => { + // ipcRenderer.send( + // "printTagStart", + // JSON.stringify({ deviceName: data.value.deviceName }) + // ); + // }, 100); }); }); diff --git a/src/App.vue b/src/App.vue index 7bdf613..f07b6c6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
- +
- -
注意:扫码请确保输入口获得焦点
+ +
注意:请扫描标签二维码
@@ -59,12 +59,14 @@ import { ElMessage } from 'element-plus' import { onMounted, reactive, ref } from 'vue'; import { useUser } from "@/store/user.js"; import { scanSendMessage, getsendMessage } from '@/api/order/index' +import { useGlobal } from '@/store/global.js' +const global = useGlobal() const store = useUser(); const props = defineProps({ title: { type: String, - default: '叫号取餐' + default: '叫号取餐记录' }, placeholder: { type: String, @@ -96,13 +98,14 @@ function filterCode(t, c = '#') { function show() { dialogVisible.value = true getsendMessageAjax() - setTimeout(() => { - inputRef.value.focus(); - }, 500); + // setTimeout(() => { + // inputRef.value.focus(); + // }, 500); } function opne() { number.value = '' + global.updateData(true) } // 输入 @@ -177,7 +180,8 @@ const confirmHandle = _.throttle(async function () { }, 800, { leading: true, trailing: false }) defineExpose({ - show + show, + getsendMessageAjax }) diff --git a/src/components/fastPayCard.vue b/src/components/fastPayCard.vue index a7f25c9..2777c5b 100644 --- a/src/components/fastPayCard.vue +++ b/src/components/fastPayCard.vue @@ -120,6 +120,10 @@ async function confirmOrder() { if (payLoading.value) return try { if (payList.value[payActive.value].payType == "scanCode") { + if (money.value <= 0) { + ElMessage.error("请输入大于0的金额"); + return; + } scanModalRef.value.show(); } else { if (money.value <= 0) { diff --git a/src/components/leftMenu.vue b/src/components/leftMenu.vue index c5451e1..568afd9 100644 --- a/src/components/leftMenu.vue +++ b/src/components/leftMenu.vue @@ -73,9 +73,18 @@ const menus = ref([ } ]) +// 更新叫号记录 +function updateCallNumber() { + callNumberRef.value.getsendMessageAjax() +} + function openCall() { callNumberRef.value.show() } + +defineExpose({ + updateCallNumber +})