优化小票 新增存酒管理
This commit is contained in:
@@ -5,7 +5,7 @@ import axios from "axios";
|
||||
import os from "os";
|
||||
import fs from "fs";
|
||||
import { exec } from "child_process";
|
||||
import { printReceipt } from "./printService";
|
||||
import { printReceipt, printHandoverReceipt, printRefund } from "./printService";
|
||||
|
||||
// ===== 核心配置:单文件缓存 =====
|
||||
// 固定的缓存文件路径(永远只存这1个文件)
|
||||
@@ -107,6 +107,7 @@ app.whenReady().then(() => {
|
||||
});
|
||||
});
|
||||
|
||||
// 打印结算小票
|
||||
ipcMain.on('networkPrint', async (event, arg) => {
|
||||
try {
|
||||
let _parmas = JSON.parse(arg);
|
||||
@@ -120,6 +121,32 @@ app.whenReady().then(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// 打印交班小票
|
||||
ipcMain.on('printHandoverReceipt', async (event, arg) => {
|
||||
try {
|
||||
let _parmas = JSON.parse(arg);
|
||||
console.log(_parmas);
|
||||
await printHandoverReceipt(_parmas.printerIp, _parmas.handoverData);
|
||||
return { ok: true }
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return { ok: false, msg: e.message }
|
||||
}
|
||||
});
|
||||
|
||||
// 打印退菜单/退款小票
|
||||
ipcMain.on('printRefund', async (event, arg) => {
|
||||
try {
|
||||
let _parmas = JSON.parse(arg);
|
||||
// console.log(_parmas);
|
||||
await printRefund(_parmas.printerIp, _parmas.orderData);
|
||||
return { ok: true }
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return { ok: false, msg: e.message }
|
||||
}
|
||||
});
|
||||
|
||||
app.on("activate", () => {
|
||||
// 在 macOS 系统内, 如果没有已开启的应用窗口
|
||||
// 点击托盘图标时通常会重新创建一个新窗口
|
||||
|
||||
Reference in New Issue
Block a user