优化usb打印机订单小票
This commit is contained in:
29862
dist-electron/main.js
29862
dist-electron/main.js
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@ import getLodop from "./LodopFuncs.js";
|
|||||||
* 打印交班小票
|
* 打印交班小票
|
||||||
*/
|
*/
|
||||||
export default (data) => {
|
export default (data) => {
|
||||||
console.log("data.deviceName===", data.deviceName);
|
console.log("USB.打印交班小票===", data);
|
||||||
let LODOP = getLodop();
|
let LODOP = getLodop();
|
||||||
LODOP.PRINT_INIT("打印小票");
|
LODOP.PRINT_INIT("打印小票");
|
||||||
// 设置打印纸大小D
|
// 设置打印纸大小D
|
||||||
@@ -19,31 +19,31 @@ export default (data) => {
|
|||||||
交班小票
|
交班小票
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top:50px;">
|
<div style="font-size: 12px;margin-top:50px;">
|
||||||
当班时间:${data.loginTime}
|
当班时间:${data.handoverTime }
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;">
|
<div style="font-size: 12px;">
|
||||||
交班时间:${data.handoverTime}
|
交班时间:${data.loginTime || ""} - ${data.handoverTime || ""}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;">
|
<div style="font-size: 12px;">
|
||||||
收银员:${data.staffName}
|
收银员:${data.staffName || ""}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
当班总收入:${data.handAmount}
|
当班总收入:${data.turnover || 0}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
现金收入:${data.cashAmount}
|
现金收入:${data.cash || 0}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
微信收入:${data.wechatAmount}
|
微信收入:${data.wechat || 0}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
支付宝收入:${data.alipayAmount}
|
支付宝收入:${data.alipay || 0}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
会员支付:${data.vipPay}
|
会员支付:${data.balance || 0}
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
会员充值:${data.vipRecharge}
|
会员充值:${data.recharge || 0}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -86,72 +86,74 @@ export default (data) => {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
let productCategoriesTableBody = "";
|
let productCategoriesTableBody = "";
|
||||||
if (data.categoryDataList && data.categoryDataList.length) {
|
if (data.categoryList && data.categoryList.length) {
|
||||||
for (let item of data.categoryDataList) {
|
for (let item of data.categoryList) {
|
||||||
productCategoriesTableBody += `
|
productCategoriesTableBody += `
|
||||||
<tr>
|
<tr>
|
||||||
<td style="font-size: 12px;width:50%;">
|
<td style="font-size: 12px;width:50%;">
|
||||||
<div>${item.categoryName}</div>
|
<div>${item.categoryName}</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="font-size: 12px;width:25%;">${item.num}</td>
|
<td style="font-size: 12px;width:25%;">${item.num || 0}</td>
|
||||||
<td style="font-size: 12px;width:25%;">
|
<td style="font-size: 12px;width:25%;">
|
||||||
${item.amount}
|
${item.amount || 0}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tabHead = `
|
// let tabHead = `
|
||||||
</table>
|
// </table>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">商品数据</div>
|
// <div style="font-size: 12px;margin-top: 4px;">商品数据</div>
|
||||||
<table class="table" style="width: 100%;">
|
// <table class="table" style="width: 100%;">
|
||||||
<tr>
|
// <tr>
|
||||||
<td style="font-size: 12px;width:75%;">商品</td>
|
// <td style="font-size: 12px;width:75%;">商品</td>
|
||||||
<td style="font-size: 12px;width:25%;">数量</td>
|
// <td style="font-size: 12px;width:25%;">数量</td>
|
||||||
</tr>
|
// </tr>
|
||||||
`;
|
// `;
|
||||||
|
|
||||||
|
// let tableBody = "";
|
||||||
|
// if (data.productDataList && data.productDataList.length) {
|
||||||
|
// for (let item of data.productDataList) {
|
||||||
|
// tableBody += `
|
||||||
|
// <tr>
|
||||||
|
// <td style="font-size: 12px;width:75%;">
|
||||||
|
// <div>${item.productName}</div>
|
||||||
|
// </td>
|
||||||
|
// <td style="font-size: 12px;width:25%;">${item.num}</td>
|
||||||
|
// </tr>
|
||||||
|
// `;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (!data.printShop) {
|
||||||
|
// tabHead = "";
|
||||||
|
// tableBody = "";
|
||||||
|
// }
|
||||||
|
let tabHead = "";
|
||||||
let tableBody = "";
|
let tableBody = "";
|
||||||
if (data.productDataList && data.productDataList.length) {
|
|
||||||
for (let item of data.productDataList) {
|
|
||||||
tableBody += `
|
|
||||||
<tr>
|
|
||||||
<td style="font-size: 12px;width:75%;">
|
|
||||||
<div>${item.productName}</div>
|
|
||||||
</td>
|
|
||||||
<td style="font-size: 12px;width:25%;">${item.num}</td>
|
|
||||||
</tr>
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!data.printShop) {
|
|
||||||
tabHead = "";
|
|
||||||
tableBody = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
let str = `
|
let str = `
|
||||||
</table>
|
</table>
|
||||||
<div style="font-size: 12px;margin-top: 4px;">
|
<div style="font-size: 12px;margin-top: 4px;">
|
||||||
<span>快捷收款金额:</span>
|
<span>快捷收款金额:</span>
|
||||||
<span>${data.quickInAmount}</span>
|
<span>${data.barScan || 0}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;">
|
<div style="font-size: 12px;">
|
||||||
<span>退款金额:</span>
|
<span>退款金额:</span>
|
||||||
<span>${data.refundAmount}</span>
|
<span>${data.refundAmount || 0}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;">
|
<div style="font-size: 12px;">
|
||||||
<span>总收入:</span>
|
<span>总收入:</span>
|
||||||
<span>${data.handAmount}</span>
|
<span>${data.turnover || 0}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;">
|
<div style="font-size: 12px;">
|
||||||
<span>挂账金额:</span>
|
<span>挂账金额:</span>
|
||||||
<span>${data.creditAmount}</span>
|
<span>${data.owed || 0}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 20px; font-size: 12px;">
|
<div style="margin-top: 20px; font-size: 12px;">
|
||||||
<span>总订单数:</span>
|
<span>总订单数:</span>
|
||||||
<span>${data.orderCount}</span>
|
<span>${data.orderCount || 0}</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 12px;">
|
<div style="font-size: 12px;">
|
||||||
打印时间:${data.printTime}
|
打印时间:${data.printTime}
|
||||||
|
|||||||
Reference in New Issue
Block a user