将销售单据备注与经办人排在同一行

This commit is contained in:
summer committed 2026-10-22 14:10:21 +08:00
1 parent 7269945bc1
commit b49f78b47e
2 files changed
+3 -3

No files matched your search

+2 -3
View File
@@ -62,11 +62,10 @@ function receipt(order,rawSettings={},mode='full'){
<table><colgroup><col style="width:5%"><col style="width:23%"><col style="width:8%"><col style="width:5%"><col style="width:11%"><col style="width:15%"><col style="width:15%"><col style="width:18%"></colgroup><thead><tr>${['序号','商品名称','商品编号','单位','数量/克重','金价/单价说明','销售工费','金额(元)'].map(v=>`<th class="preprinted">${v}</th>`).join('')}</tr></thead><tbody>${rows}</tbody></table>
<div class="totals"><div>合计人民币大写:<strong>${uppercaseMoney(order.total)}</strong>${rounding}</div><div class="amount">${['returned','cancelled'].includes(order.status)?'原单成交额':'合计金额'}:<strong>¥${totalText}</strong></div></div>
<section class="notices preprinted"><h2>注意事项</h2>${numbered(notices)}<h2>珠宝首饰保养须知</h2>${numbered(care)}<p class="promise"><strong>公司承诺:</strong>${escape(promise)}</p></section>
<div class="note">备注:${escape(order.note||'—')}</div>
<div class="signatures">${s.contact?`<span>联系电话:${escape(s.contact)}</span>`:''}<span class="salesperson">经办人:${escape(order.salesperson||'')} ________________</span></div>
<div class="signatures"><div class="note">备注:${escape(order.note||'—')}${s.contact?`<div>联系电话:${escape(s.contact)}</div>`:''}</div><span class="salesperson">经办人:${escape(order.salesperson||'')} ________________</span></div>
</div><svg class="print-canvas" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" aria-hidden="true"><foreignObject x="0" y="0"></foreignObject></svg></div></section>`;
return `<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escape(paper)} · 客户单据</title><style>
*{box-sizing:border-box}body{margin:0;background:#e8e7e4;color:#181818;font-family:"Microsoft YaHei","PingFang SC",sans-serif;font-size:12px}.toolbar{padding:12px 20px;background:white;position:sticky;top:0;z-index:2;display:flex;gap:12px;align-items:center;flex-wrap:wrap;box-shadow:0 1px 5px #aaa}.toolbar button,.toolbar a{padding:9px 16px;border:1px solid #444;border-radius:5px;background:white;color:#222;text-decoration:none;cursor:pointer}.toolbar button{background:#254d42;color:#fff}.toolbar button:disabled{opacity:.5}.toolbar small{color:#555}.sheet{width:${s.width}mm;height:${s.height}mm;background:white;margin:12px auto;position:relative;box-shadow:0 3px 16px #bbb}.print-frame{position:absolute;left:${Math.max(3,12+s.offsetX)}mm;right:${Math.max(3,12-s.offsetX)}mm;top:${Math.max(3,s.contentTop+s.offsetY)}mm;bottom:8mm}.content{width:100%;transform-origin:top left;font-size:${12*CONTENT_SCALE}px}.print-canvas{display:none}header{text-align:center;padding:0 0 6mm}h1{font-size:${25*CONTENT_SCALE}px;letter-spacing:5px;margin:0 0 3px;overflow-wrap:anywhere}.subtitle{letter-spacing:3px;font-size:${16*CONTENT_SCALE}px;overflow-wrap:anywhere}.meta{display:flex;justify-content:space-between;gap:10px;margin:5px 0;overflow-wrap:anywhere}.meta span,.meta strong{max-width:65%}.secondary{font-size:${11*CONTENT_SCALE}px;margin-bottom:8px}table{border-collapse:collapse;width:100%;table-layout:fixed}th,td{border:1px solid #333;padding:4px;overflow-wrap:anywhere;text-align:center}th{height:9mm;font-size:${11*CONTENT_SCALE}px}td{height:${s.rowHeight}mm;font-size:${12*CONTENT_SCALE}px}td:nth-child(2){text-align:left}.totals{display:flex;justify-content:space-between;gap:10px;padding:4px 5px;border:1px solid #333;border-top:0;line-height:1.4;overflow-wrap:anywhere}.amount{flex-shrink:0}.amount strong{font-size:${16*CONTENT_SCALE}px}.notices{border:1px solid #333;border-top:0;padding:3px 6px;font-family:"SimSun","Songti SC",serif;font-size:${12*CONTENT_SCALE}px;line-height:1.35}.notices h2{font-size:${13*CONTENT_SCALE}px;margin:0;font-weight:700}.notices ol{padding-left:20px;margin:0 0 2px}.notices li{padding-left:0}.promise{margin:2px 0 0;font-weight:600}.note{padding:8px 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6}.signatures{display:flex;justify-content:space-between;gap:12px;padding-top:8px;overflow-wrap:anywhere}.signatures .salesperson{margin-left:auto}.overlay .preprinted{visibility:hidden}.overlay th,.overlay td,.overlay .totals,.overlay .notices{border-color:transparent}.compact .blank-row{display:none}.compact td{height:7mm;padding:2px 3px}.compact header{padding-bottom:1mm}.compact .note,.compact .signatures{padding-top:1px;padding-bottom:1px;line-height:1.4}
*{box-sizing:border-box}body{margin:0;background:#e8e7e4;color:#181818;font-family:"Microsoft YaHei","PingFang SC",sans-serif;font-size:12px}.toolbar{padding:12px 20px;background:white;position:sticky;top:0;z-index:2;display:flex;gap:12px;align-items:center;flex-wrap:wrap;box-shadow:0 1px 5px #aaa}.toolbar button,.toolbar a{padding:9px 16px;border:1px solid #444;border-radius:5px;background:white;color:#222;text-decoration:none;cursor:pointer}.toolbar button{background:#254d42;color:#fff}.toolbar button:disabled{opacity:.5}.toolbar small{color:#555}.sheet{width:${s.width}mm;height:${s.height}mm;background:white;margin:12px auto;position:relative;box-shadow:0 3px 16px #bbb}.print-frame{position:absolute;left:${Math.max(3,12+s.offsetX)}mm;right:${Math.max(3,12-s.offsetX)}mm;top:${Math.max(3,s.contentTop+s.offsetY)}mm;bottom:8mm}.content{width:100%;transform-origin:top left;font-size:${12*CONTENT_SCALE}px}.print-canvas{display:none}header{text-align:center;padding:0 0 6mm}h1{font-size:${25*CONTENT_SCALE}px;letter-spacing:5px;margin:0 0 3px;overflow-wrap:anywhere}.subtitle{letter-spacing:3px;font-size:${16*CONTENT_SCALE}px;overflow-wrap:anywhere}.meta{display:flex;justify-content:space-between;gap:10px;margin:5px 0;overflow-wrap:anywhere}.meta span,.meta strong{max-width:65%}.secondary{font-size:${11*CONTENT_SCALE}px;margin-bottom:8px}table{border-collapse:collapse;width:100%;table-layout:fixed}th,td{border:1px solid #333;padding:4px;overflow-wrap:anywhere;text-align:center}th{height:9mm;font-size:${11*CONTENT_SCALE}px}td{height:${s.rowHeight}mm;font-size:${12*CONTENT_SCALE}px}td:nth-child(2){text-align:left}.totals{display:flex;justify-content:space-between;gap:10px;padding:4px 5px;border:1px solid #333;border-top:0;line-height:1.4;overflow-wrap:anywhere}.amount{flex-shrink:0}.amount strong{font-size:${16*CONTENT_SCALE}px}.notices{border:1px solid #333;border-top:0;padding:3px 6px;font-family:"SimSun","Songti SC",serif;font-size:${12*CONTENT_SCALE}px;line-height:1.35}.notices h2{font-size:${13*CONTENT_SCALE}px;margin:0;font-weight:700}.notices ol{padding-left:20px;margin:0 0 2px}.notices li{padding-left:0}.promise{margin:2px 0 0;font-weight:600}.note{flex:1;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:inherit}.signatures{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-top:8px;line-height:1.6;overflow-wrap:anywhere}.signatures .salesperson{margin-left:auto;flex-shrink:0;white-space:nowrap}.overlay .preprinted{visibility:hidden}.overlay th,.overlay td,.overlay .totals,.overlay .notices{border-color:transparent}.compact .blank-row{display:none}.compact td{height:7mm;padding:2px 3px}.compact header{padding-bottom:1mm}.compact .signatures{padding-top:1px;padding-bottom:1px;line-height:1.4}
@page{size:${PAPER_WIDTH}mm ${PAPER_HEIGHT}mm;margin:0}@media print{html,body{width:auto;height:auto;margin:0;padding:0;background:white}.toolbar{display:none}.sheet{width:${PAPER_WIDTH}mm;height:calc(${PAPER_HEIGHT}mm - 1px);max-width:${PAPER_WIDTH}mm;max-height:${PAPER_HEIGHT}mm;box-shadow:none;margin:0;break-inside:avoid;page-break-inside:avoid}.print-frame>.content{display:none}.print-canvas{display:block;width:100%;height:100%;position:absolute;inset:0}body.fit-error .sheet{visibility:hidden}}
</style></head><body><div class="toolbar"><button id="print" disabled>打印/保存 PDF</button><a href="?mode=${overlay?'full':'overlay'}">切换${overlay?'完整单据':'预印纸套打'}模板</a><small>固定241×140mm横版;打印窗口也选241×140mm,关闭页眉页脚。${overlay?'套打位置仍需按实物纸样校准。':''}</small><small id="fit-status" role="status">正在调整为一页…</small></div>${body}<script src="/print.js"></script></body></html>`;
}