[{"data":1,"prerenderedAt":613},["ShallowReactive",2],{"note:/notes/receipt-printer-half-meter-blank-paper":3,"notes-summary":542},[4],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"updated":11,"category":12,"product":13,"body":14,"_type":535,"_id":536,"_source":537,"_file":538,"_stem":539,"_extension":540,"sitemap":541},"/notes/receipt-printer-half-meter-blank-paper","notes",false,"","「我就改一个字」，然后小票打印机吐了半卷白纸","记一次帮客户微调 80mm 热敏小票打印模板的踩坑：只加了行收款账号，为什么每次打单后面都跟着半米空白纸？聊聊网页打印和热敏机的纸张脾气。","2026-11-19","开发趣事","/cloud-erp",{"type":15,"children":16,"toc":531},"root",[17,25,38,43,48,53,60,65,70,99,104,109,115,120,265,515,520,525],{"type":18,"tag":19,"props":20,"children":21},"element","p",{},[22],{"type":23,"value":24},"text","做企业软件，最容易让人放松警惕的一句话就是：「师傅，这个单据模板挺好的，不用大改，帮我最底下加一行收款账号就行。」",{"type":18,"tag":19,"props":26,"children":27},{},[28,30,36],{"type":23,"value":29},"听起来就是两分钟的活。我们在",{"type":18,"tag":31,"props":32,"children":33},"a",{"href":13},[34],{"type":23,"value":35},"翼程云ERP",{"type":23,"value":37},"的 80mm 热敏小票打印模板最下面，老老实实加了一行「微信/支付宝同号：138xxxx」，在电脑浏览器里点开打印预览，齐整、漂亮、一页刚好，顺手就给客户推了更新。",{"type":18,"tag":19,"props":39,"children":40},{},[41],{"type":23,"value":42},"结果下午三点，客户发来一段十秒钟的短视频。",{"type":18,"tag":19,"props":44,"children":45},{},[46],{"type":23,"value":47},"视频里，仓库桌子上那台 80mm 热敏小票机「滋滋滋滋」响个不停——前十厘米把发货单打得清清楚楚，后面紧跟着又往外吐了快半米纯白的热敏纸，最后「咔哒」一刀切下来，像一条白色的哈达飘在地上。",{"type":18,"tag":19,"props":49,"children":50},{},[51],{"type":23,"value":52},"客户在语音里笑得直喘气：「你们这更新挺费纸啊，打一张单子送一张草稿纸？」",{"type":18,"tag":54,"props":55,"children":57},"h2",{"id":56},"浏览器以为你塞进去的是-a4-纸",[58],{"type":23,"value":59},"浏览器以为你塞进去的是 A4 纸",{"type":18,"tag":19,"props":61,"children":62},{},[63],{"type":23,"value":64},"连上客户电脑一看，毛病出在两头凑到一块儿了。",{"type":18,"tag":19,"props":66,"children":67},{},[68],{"type":23,"value":69},"热敏小票机跟办公室里的 A4 激光打印机不一样，它装的是连续卷纸，正常情况下「内容打到哪儿，切刀就在哪儿落」。但客户电脑的打印驱动里，默认纸张设成了「80mm × 297mm」（也就是按 A4 的高度定死了每页纸的长度）。",{"type":18,"tag":19,"props":71,"children":72},{},[73,75,82,84,90,92,97],{"type":23,"value":74},"之前模板内容少，高度大概 180mm，稳稳落在第一页里；热敏机驱动开启了「自动裁切空白」，打完 180mm 就停了。偏偏我们加完那一行收款账号，再算上底部的 ",{"type":18,"tag":76,"props":77,"children":79},"code",{"className":78},[],[80],{"type":23,"value":81},"margin-bottom",{"type":23,"value":83},"，整张单子的高度变成了 ",{"type":18,"tag":85,"props":86,"children":87},"strong",{},[88],{"type":23,"value":89},"298mm",{"type":23,"value":91},"——就比 297mm 超出了 ",{"type":18,"tag":85,"props":93,"children":94},{},[95],{"type":23,"value":96},"1 毫米",{"type":23,"value":98},"。",{"type":18,"tag":19,"props":100,"children":101},{},[102],{"type":23,"value":103},"浏览器一看：「哎呀，第一页装不下了！」非常尽职地把最后那 1 毫米的空白边距挪到了「第二页」。于是打印任务变成了 2 页：第一页满满当当，第二页啥也没有，但因为驱动里定死了每页 297mm，热敏机只好老老实实把这整整一页 297mm 的白纸全吐出来，再优雅地切一刀。",{"type":18,"tag":19,"props":105,"children":106},{},[107],{"type":23,"value":108},"加一行字，多费了一张纸的钱。",{"type":18,"tag":54,"props":110,"children":112},{"id":111},"网页打印的三个隐形坑",[113],{"type":23,"value":114},"网页打印的三个「隐形坑」",{"type":18,"tag":19,"props":116,"children":117},{},[118],{"type":23,"value":119},"顺着这半米白纸，我们把小票打印的 CSS 样式翻了个底朝天，顺便清掉了另外两个平时在电脑预览里看不出来、一上热敏机就现原形的坑：",{"type":18,"tag":121,"props":122,"children":123},"ul",{},[124,174,231],{"type":18,"tag":125,"props":126,"children":127},"li",{},[128,141,143,149,151,157,159,165,167,173],{"type":18,"tag":85,"props":129,"children":130},{},[131,133,139],{"type":23,"value":132},"别用 ",{"type":18,"tag":76,"props":134,"children":136},{"className":135},[],[137],{"type":23,"value":138},"height: 100vh",{"type":23,"value":140}," 或固定像素高度。",{"type":23,"value":142}," 很多后台页面为了平时布局好看，外层容器带了 ",{"type":18,"tag":76,"props":144,"children":146},{"className":145},[],[147],{"type":23,"value":148},"min-height: 100vh",{"type":23,"value":150},"。平时在屏幕上没感觉，一旦点了打印，",{"type":18,"tag":76,"props":152,"children":154},{"className":153},[],[155],{"type":23,"value":156},"100vh",{"type":23,"value":158}," 会被浏览器算成一整页纸的高度，就算你只买了两颗螺丝，它也能给你撑满一整页。",{"type":18,"tag":76,"props":160,"children":162},{"className":161},[],[163],{"type":23,"value":164},"@media print",{"type":23,"value":166}," 里第一件事就是把外层高度全部重置成 ",{"type":18,"tag":76,"props":168,"children":170},{"className":169},[],[171],{"type":23,"value":172},"auto",{"type":23,"value":98},{"type":18,"tag":125,"props":175,"children":176},{},[177,182,184,190,192,198,200,206,207,213,215,221,223,229],{"type":18,"tag":85,"props":178,"children":179},{},[180],{"type":23,"value":181},"中文字体别太细，字号别太小。",{"type":23,"value":183}," 电脑高分屏上看 ",{"type":18,"tag":76,"props":185,"children":187},{"className":186},[],[188],{"type":23,"value":189},"11px",{"type":23,"value":191}," 的灰色细体字挺有设计感，放到 203 DPI 的热敏小票机上，油墨一糊，数字 ",{"type":18,"tag":76,"props":193,"children":195},{"className":194},[],[196],{"type":23,"value":197},"8",{"type":23,"value":199},"、",{"type":18,"tag":76,"props":201,"children":203},{"className":202},[],[204],{"type":23,"value":205},"6",{"type":23,"value":199},{"type":18,"tag":76,"props":208,"children":210},{"className":209},[],[211],{"type":23,"value":212},"0",{"type":23,"value":214}," 和 ",{"type":18,"tag":76,"props":216,"children":218},{"className":217},[],[219],{"type":23,"value":220},"9",{"type":23,"value":222}," 长得跟四胞胎一样。热敏小票模板就得老老实实用纯黑 ",{"type":18,"tag":76,"props":224,"children":226},{"className":225},[],[227],{"type":23,"value":228},"#000",{"type":23,"value":230},"、加粗无衬线字体，金额和数量宁可大两号，仓管在昏暗的仓库里瞄一眼就能分清。",{"type":18,"tag":125,"props":232,"children":233},{},[234,247,249,255,257,263],{"type":18,"tag":85,"props":235,"children":236},{},[237,239,245],{"type":23,"value":238},"页边距交给 ",{"type":18,"tag":76,"props":240,"children":242},{"className":241},[],[243],{"type":23,"value":244},"@page",{"type":23,"value":246}," 清零。",{"type":23,"value":248}," 浏览器默认打印会自带上下左右十几毫米的页边距，80mm 的小票本来有效打印宽度就只有 72mm，再被浏览器左右各啃掉 10mm，商品名称一行只能显示六个字，全折成麻花了。直接在打印样式里写死 ",{"type":18,"tag":76,"props":250,"children":252},{"className":251},[],[253],{"type":23,"value":254},"@page { margin: 0; }",{"type":23,"value":256},"，自己用 ",{"type":18,"tag":76,"props":258,"children":260},{"className":259},[],[261],{"type":23,"value":262},"padding",{"type":23,"value":264}," 精确控制留白。",{"type":18,"tag":266,"props":267,"children":271},"pre",{"className":268,"code":269,"language":270,"meta":8,"style":8},"language-css shiki shiki-themes github-dark","@media print {\n  @page {\n    size: 80mm auto;\n    margin: 0;\n  }\n  html, body {\n    width: 72mm;\n    height: auto !important;\n    min-height: 0 !important;\n    color: #000;\n  }\n}\n","css",[272],{"type":18,"tag":76,"props":273,"children":274},{"__ignoreMap":8},[275,299,312,346,367,376,400,426,452,477,498,506],{"type":18,"tag":276,"props":277,"children":280},"span",{"class":278,"line":279},"line",1,[281,287,293],{"type":18,"tag":276,"props":282,"children":284},{"style":283},"--shiki-default:#F97583",[285],{"type":23,"value":286},"@media",{"type":18,"tag":276,"props":288,"children":290},{"style":289},"--shiki-default:#79B8FF",[291],{"type":23,"value":292}," print",{"type":18,"tag":276,"props":294,"children":296},{"style":295},"--shiki-default:#E1E4E8",[297],{"type":23,"value":298}," {\n",{"type":18,"tag":276,"props":300,"children":302},{"class":278,"line":301},2,[303,308],{"type":18,"tag":276,"props":304,"children":305},{"style":283},[306],{"type":23,"value":307},"  @page",{"type":18,"tag":276,"props":309,"children":310},{"style":295},[311],{"type":23,"value":298},{"type":18,"tag":276,"props":313,"children":315},{"class":278,"line":314},3,[316,321,326,331,336,341],{"type":18,"tag":276,"props":317,"children":318},{"style":289},[319],{"type":23,"value":320},"    size",{"type":18,"tag":276,"props":322,"children":323},{"style":295},[324],{"type":23,"value":325},": ",{"type":18,"tag":276,"props":327,"children":328},{"style":289},[329],{"type":23,"value":330},"80",{"type":18,"tag":276,"props":332,"children":333},{"style":283},[334],{"type":23,"value":335},"mm",{"type":18,"tag":276,"props":337,"children":338},{"style":289},[339],{"type":23,"value":340}," auto",{"type":18,"tag":276,"props":342,"children":343},{"style":295},[344],{"type":23,"value":345},";\n",{"type":18,"tag":276,"props":347,"children":349},{"class":278,"line":348},4,[350,355,359,363],{"type":18,"tag":276,"props":351,"children":352},{"style":289},[353],{"type":23,"value":354},"    margin",{"type":18,"tag":276,"props":356,"children":357},{"style":295},[358],{"type":23,"value":325},{"type":18,"tag":276,"props":360,"children":361},{"style":289},[362],{"type":23,"value":212},{"type":18,"tag":276,"props":364,"children":365},{"style":295},[366],{"type":23,"value":345},{"type":18,"tag":276,"props":368,"children":370},{"class":278,"line":369},5,[371],{"type":18,"tag":276,"props":372,"children":373},{"style":295},[374],{"type":23,"value":375},"  }\n",{"type":18,"tag":276,"props":377,"children":379},{"class":278,"line":378},6,[380,386,391,396],{"type":18,"tag":276,"props":381,"children":383},{"style":382},"--shiki-default:#85E89D",[384],{"type":23,"value":385},"  html",{"type":18,"tag":276,"props":387,"children":388},{"style":295},[389],{"type":23,"value":390},", ",{"type":18,"tag":276,"props":392,"children":393},{"style":382},[394],{"type":23,"value":395},"body",{"type":18,"tag":276,"props":397,"children":398},{"style":295},[399],{"type":23,"value":298},{"type":18,"tag":276,"props":401,"children":403},{"class":278,"line":402},7,[404,409,413,418,422],{"type":18,"tag":276,"props":405,"children":406},{"style":289},[407],{"type":23,"value":408},"    width",{"type":18,"tag":276,"props":410,"children":411},{"style":295},[412],{"type":23,"value":325},{"type":18,"tag":276,"props":414,"children":415},{"style":289},[416],{"type":23,"value":417},"72",{"type":18,"tag":276,"props":419,"children":420},{"style":283},[421],{"type":23,"value":335},{"type":18,"tag":276,"props":423,"children":424},{"style":295},[425],{"type":23,"value":345},{"type":18,"tag":276,"props":427,"children":429},{"class":278,"line":428},8,[430,435,439,443,448],{"type":18,"tag":276,"props":431,"children":432},{"style":289},[433],{"type":23,"value":434},"    height",{"type":18,"tag":276,"props":436,"children":437},{"style":295},[438],{"type":23,"value":325},{"type":18,"tag":276,"props":440,"children":441},{"style":289},[442],{"type":23,"value":172},{"type":18,"tag":276,"props":444,"children":445},{"style":283},[446],{"type":23,"value":447}," !important",{"type":18,"tag":276,"props":449,"children":450},{"style":295},[451],{"type":23,"value":345},{"type":18,"tag":276,"props":453,"children":455},{"class":278,"line":454},9,[456,461,465,469,473],{"type":18,"tag":276,"props":457,"children":458},{"style":289},[459],{"type":23,"value":460},"    min-height",{"type":18,"tag":276,"props":462,"children":463},{"style":295},[464],{"type":23,"value":325},{"type":18,"tag":276,"props":466,"children":467},{"style":289},[468],{"type":23,"value":212},{"type":18,"tag":276,"props":470,"children":471},{"style":283},[472],{"type":23,"value":447},{"type":18,"tag":276,"props":474,"children":475},{"style":295},[476],{"type":23,"value":345},{"type":18,"tag":276,"props":478,"children":480},{"class":278,"line":479},10,[481,486,490,494],{"type":18,"tag":276,"props":482,"children":483},{"style":289},[484],{"type":23,"value":485},"    color",{"type":18,"tag":276,"props":487,"children":488},{"style":295},[489],{"type":23,"value":325},{"type":18,"tag":276,"props":491,"children":492},{"style":289},[493],{"type":23,"value":228},{"type":18,"tag":276,"props":495,"children":496},{"style":295},[497],{"type":23,"value":345},{"type":18,"tag":276,"props":499,"children":501},{"class":278,"line":500},11,[502],{"type":18,"tag":276,"props":503,"children":504},{"style":295},[505],{"type":23,"value":375},{"type":18,"tag":276,"props":507,"children":509},{"class":278,"line":508},12,[510],{"type":18,"tag":276,"props":511,"children":512},{"style":295},[513],{"type":23,"value":514},"}\n",{"type":18,"tag":19,"props":516,"children":517},{},[518],{"type":23,"value":519},"改完把驱动里的「连续卷纸」模式也帮客户勾上，再点打印——「滋」的一声，单子打完最后一行收款账号，往下多留了一厘米白边，「咔哒」一刀切得干干净净。",{"type":18,"tag":19,"props":521,"children":522},{},[523],{"type":23,"value":524},"那天之后，我们工作室也买了一台 80mm 热敏小票机放桌角。跟抽屉里那把扫码枪作伴，凑齐了「软件公司硬核测试两件套」：以后再有人说「我就改一个字」，先实打实出一张小票再发版。",{"type":18,"tag":526,"props":527,"children":528},"style",{},[529],{"type":23,"value":530},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":8,"searchDepth":301,"depth":301,"links":532},[533,534],{"id":56,"depth":301,"text":59},{"id":111,"depth":301,"text":114},"markdown","content:notes:receipt-printer-half-meter-blank-paper.md","content","notes/receipt-printer-half-meter-blank-paper.md","notes/receipt-printer-half-meter-blank-paper","md",{"loc":5,"lastmod":11},[543,548,553,559,564,568,573,577,581,586,590,594,599,600,604,608],{"_path":544,"title":545,"description":546,"updated":11,"category":547},"/notes/ai-chat-stale-replies","买家连发两条消息，AI 客服怎样避免答过时？","用一段电商客服对话解释模型结果过期的原因，给出按会话校验发送、处理人工接管和核对超时回执的办法，并附可复现的验收场景。","AI 客服",{"_path":549,"title":550,"description":551,"updated":11,"category":12,"product":552},"/notes/ai-studio-changed-part-number","给画册加了个「一键白底」，AI 顺手把滤芯上的型号改了","翼程画册上线 AI 产品摄影棚时的真实插曲：手机拍的滤芯背景太乱，一键抠图换白底效果惊艳，放大一看，产品身上的印字怎么变成外星文了？","/e-album",{"_path":554,"title":555,"description":556,"updated":557,"category":558},"/notes/auto-parts-oe-number-alias","同一个滤芯三四个 OE 号和原厂编码，仓库怎么查才不拿错货？","针对汽配和滤芯厂同一零件对应多个 OE 号、同行对照号和车型俗称的情况，拆解一码一档建重账的坑，给出唯一主编码加别名检索和带图拣货的做法。","2026-11-20","ERP 实务",{"_path":560,"title":561,"description":562,"updated":563,"category":558},"/notes/auto-parts-returns-and-warranty","汽配退换货和三包索赔，为什么总把库存和应收账搞花？","针对汽配和滤芯批发中常见的买错退回、等价换货与质量三包索赔，拆解直接删原单和良品坏件混入库导致账实不符的原因，给出分流记账、坏件隔离和冲减应收的实操做法。","2026-11-23",{"_path":565,"title":566,"description":567,"updated":11,"category":12},"/notes/barcode-scanner-auto-enter-story","扫码枪「滴」一声之后，自己替仓管敲了个回车","记一次仓库现场调试扫码枪的乌龙：商品刚扫上去，发货单怎么自己就提交过账了？聊聊几十块钱的 USB 扫码枪在浏览器里到底干了什么。",{"_path":569,"title":570,"description":571,"updated":572,"category":558},"/notes/customer-tiered-pricing-chaos","老客户、散客、批发商价格不一样，开单时总报串价怎么办？","针对汽配、滤芯批发中老客户协议价、等级阶梯价与散客零售价并存的接单场景，拆解靠人脑记价和翻聊天记录导致报串价的原因，说明进销存记忆客户上次售价、三级取价优先级与异常低价提醒的实操做法。","2026-11-21",{"_path":574,"title":575,"description":576,"updated":11,"category":558},"/notes/erp-opening-balance-order","进销存建账顺序搞反，为什么后面的库存和欠款全对不上？","以汽配、滤芯厂首次建账为例，算清先开单后录期初、分箱和散件混录、既是客户又是供应商拆成两条时账面怎么算错，给出建账当天就能核对的检查步。",{"_path":578,"title":579,"description":580,"updated":557,"category":558},"/notes/filter-box-to-piece-inventory","滤芯厂按箱入库、按个出货，库存账怎么算才不乱？","结合滤芯与汽配仓库常见的整箱入库、拆箱散卖场景，拆解建两个商品档案导致串账的原因，说明基本单位、辅助单位换算与装箱数变动时的库存记账办法。",{"_path":582,"title":583,"description":584,"updated":11,"category":585},"/notes/markdown-article-urls","用 Markdown 发文章，怎样保留原来的网址？","官网文章用 Markdown 文件管理。标题改了为什么网址可以不变？从文件名、标题和更新日期说起，分享让文章方便维护的做法。","开发心得",{"_path":587,"title":588,"description":589,"updated":11,"category":585},"/notes/nuxt-content-static-notes","用 Nuxt Content 给翼程官网做一个静态 Markdown 栏目","拆解翼程笔记的实际实现，说明 Nuxt Content 查询与渲染、动态路由预渲染、站点地图日期同步，以及排查草稿进入静态缓存的过程。",{"_path":591,"title":592,"description":593,"updated":11,"category":12,"product":13},"/notes/one-billion-order-in-demo-erp","当业务员在示例账套里开了张「一个亿」的发货单","翼程云ERP 加上「示例数据」功能后，我们在试用后台见过各种放飞自我的测试单。讲讲怎么让用户随便折腾，又能随时一键回到干净的起跑线。",{"_path":595,"title":596,"description":597,"updated":11,"category":598},"/notes/pdf-catalog-vs-e-album-search","给客户发了 30 页 PDF 报价册，为什么对方还是直接问「有没有这款」？","对比微信里发 PDF 画册与在线翻页电子画册的实际打开体验，说明图片转曲导致搜不到型号、手机端来回缩放、改价后旧文件失控三个问题及解决办法。","翼程画册",{"_path":5,"title":9,"description":10,"updated":11,"category":12,"product":13},{"_path":601,"title":602,"description":603,"updated":11,"category":585},"/notes/static-site-release-checks","静态官网构建成功了，为什么还要检查生成的 HTML？","以翼程官网的 Markdown 发文流程为例，说明如何检查静态正文、导航、规范链接与站点地图，以及哪些错误要到部署后才能发现。",{"_path":605,"title":606,"description":607,"updated":11,"category":558},"/notes/stocktake-while-shipping","仓库不停工，盘点差异应该怎么算？","用一笔先移货、后补单的算例，算清不停工盘点时的账面数量、实盘数量与真实差异，并给出仓库现场可以执行的复核步骤。",{"_path":609,"title":610,"description":611,"updated":11,"category":612},"/notes/wechat-message-to-erp-order","把微信里的报价明细粘进 ERP，自动匹配商品时要防哪些错？","拆解汽配业务员用微信接单时的常见写法，说明商品名称模糊、单位未换算、价格带错三类风险，以及 AI 识别草稿在入单前必须保留的核对环节。","AI 与开单",1795421279015]