优化小票打印
This commit is contained in:
@@ -3,6 +3,8 @@ import getLodop from "./LodopFuncs.js";
|
||||
* 打印订单小票
|
||||
*/
|
||||
export default (data) => {
|
||||
console.log(data);
|
||||
console.log("data.deviceName===", data.deviceName);
|
||||
let LODOP = getLodop();
|
||||
LODOP.PRINT_INIT("打印小票");
|
||||
// 设置打印纸大小D
|
||||
@@ -14,12 +16,14 @@ export default (data) => {
|
||||
let t2 = (100 - t1) / 3;
|
||||
let html = `
|
||||
<div style="font-size: 30px;display:flex;justify-content:center;">
|
||||
${data.shop_name}
|
||||
${data.shop_name}
|
||||
</div>
|
||||
<div style="font-size: 16px;display: flex; justify-content:center;margin-top:6px;">
|
||||
结算单【${data.orderInfo.masterId ? data.orderInfo.masterId : ""}】
|
||||
${data.isBefore ? "预" : ""}结算单【${
|
||||
data.orderInfo.masterId ? data.orderInfo.masterId : ""
|
||||
}】
|
||||
</div>
|
||||
<div style="font-size: 16px;display: flex; justify-content:center;margin-top:6px;">
|
||||
<div style="font-size: 16px;display: flex; justify-content:center;margin-top:20px;">
|
||||
${data.orderInfo.outNumber ? data.orderInfo.outNumber : ""}
|
||||
</div>
|
||||
<div style="margin-top: 30px;font-size: 12px;">
|
||||
@@ -31,7 +35,9 @@ export default (data) => {
|
||||
<div style="margin-top: 4px;font-size: 12px;">
|
||||
收银员:${data.loginAccount}
|
||||
</div>
|
||||
<div style="margin-top: 6px;margin-bottom: 6px;border-bottom:1px dashed #000;"></div>
|
||||
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
||||
<hr/>
|
||||
</div>
|
||||
<table class="table" style="width: 100%;">
|
||||
<tr>
|
||||
<td style="font-size: 12px;width:${t1}%;">品名</td>
|
||||
@@ -47,7 +53,11 @@ export default (data) => {
|
||||
<tr>
|
||||
<td style="font-size: 12px;width:${t1}%;">
|
||||
<div>${item.name}</div>
|
||||
<div class="sku">规格:${item.skuName || ""}</div>
|
||||
${
|
||||
item.skuName
|
||||
? `<div class="sku">规格:${item.skuName}</div>`
|
||||
: ""
|
||||
}
|
||||
</td>
|
||||
<td style="font-size: 12px;width:${t2}%;">${item.salePrice}</td>
|
||||
<td style="font-size: 12px;width:${t2}%;">${item.number}</td>
|
||||
@@ -60,7 +70,9 @@ export default (data) => {
|
||||
|
||||
let str = `
|
||||
</table>
|
||||
<div style="margin-top: 6px; border-bottom:1px dashed #000;"></div>
|
||||
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
||||
<hr/>
|
||||
</div>
|
||||
<div style="margin-top: 6px; font-size: 22px;display:flex;justify-content: space-between;">
|
||||
<span>应收</span>
|
||||
<span>¥${data.amount}</span>
|
||||
@@ -69,12 +81,17 @@ export default (data) => {
|
||||
<span>余额:</span>
|
||||
<span>0.00</span>
|
||||
</div>
|
||||
<div style="margin-top: 6px; border-bottom:1px dashed #000;"></div>
|
||||
<div style="margin-top: 4px; font-size: 12px;">备注:${data.remark}</div>
|
||||
<div style="margin-top: 4px; padding-bottom: 50px;font-size: 12px;">
|
||||
<div style="margin-top: 6px;margin-bottom: 6px;width: 100%">
|
||||
<hr/>
|
||||
</div>
|
||||
<div style="margin-top: 4px; font-size: 16px;font-weight: bold;">备注:${data.remark}</div>
|
||||
<div style="margin-top: 4px; font-size: 12px;">
|
||||
打印时间:${data.printTime}
|
||||
</div>
|
||||
<div style="height: 50px;"></div>
|
||||
<div>.</div>
|
||||
<div>.</div>
|
||||
<div>.</div>
|
||||
<div>.</div>
|
||||
`;
|
||||
|
||||
let lastHtml = `${html}${table}${str}`;
|
||||
|
||||
Reference in New Issue
Block a user