|
|
@@ -0,0 +1,452 @@
|
|
|
+import {renderTemplate} from '@/components/print/tools';
|
|
|
+
|
|
|
+export function template60_40(model = {}, title = '') {
|
|
|
+ const template = renderTemplate.bind(this, model);
|
|
|
+
|
|
|
+ const width = 227;
|
|
|
+ const height = 151;
|
|
|
+ const margin = 6;
|
|
|
+
|
|
|
+ this.PRINT_INITA(0, 0, width, height, title);
|
|
|
+ // 宽度按纸张的整宽缩放
|
|
|
+ this.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width');
|
|
|
+ // 设置输出位置以纸张边缘为基点
|
|
|
+ this.SET_PRINT_MODE('POS_BASEON_PAPER', true);
|
|
|
+
|
|
|
+ let x = margin, y = margin;
|
|
|
+ let w = 0, h = 0;
|
|
|
+
|
|
|
+ w = 180;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{record.title}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ w = 70;
|
|
|
+ this.ADD_PRINT_TEXT(x, width - w - margin, w, h, template(`{{record.date}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+
|
|
|
+ w = 180;
|
|
|
+ y += h;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{patient.name}},{{patient.gender}},{{patient.birthday}}`));
|
|
|
+ x += w;
|
|
|
+ w = width - x - margin;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{record.category}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ y = 50 - 4;
|
|
|
+ if (model.record.no) this.ADD_PRINT_BARCODE(y, x, 110, 60, '128Auto', model.record.no);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 6);
|
|
|
+
|
|
|
+
|
|
|
+ x = width - 100 - margin;
|
|
|
+ w = 54;
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 8);
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`剂数:{{recipe.count}}`));
|
|
|
+ this.ADD_PRINT_TEXT(y, width - w - margin, w, h, template(`包数:{{recipe.total}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ w = 100;
|
|
|
+ y += h;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`包装量:{{recipe.volume}}`));
|
|
|
+ y += h;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`处方用法:{{recipe.method}}`));
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 9);
|
|
|
+
|
|
|
+ x = 6;
|
|
|
+ y += h + 4;
|
|
|
+ w = width - margin * 2;
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 8);
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`科室/病区:{{department}}`));
|
|
|
+ y += h - 1;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`备注:{{record.remark}}`));
|
|
|
+}
|
|
|
+
|
|
|
+export function template80_50(model = {}, title = '') {
|
|
|
+ const template = renderTemplate.bind(this, model);
|
|
|
+
|
|
|
+ const width = 302;
|
|
|
+ const height = 189;
|
|
|
+ const margin = 12;
|
|
|
+
|
|
|
+ this.PRINT_INITA(0, 0, width, height, title);
|
|
|
+ // 宽度按纸张的整宽缩放
|
|
|
+ this.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width');
|
|
|
+ // 设置输出位置以纸张边缘为基点
|
|
|
+ this.SET_PRINT_MODE('POS_BASEON_PAPER', true);
|
|
|
+
|
|
|
+ let x = margin, y = margin;
|
|
|
+ let w = 0, h = 0;
|
|
|
+
|
|
|
+ y -= 2;
|
|
|
+ w = width - margin * 2;
|
|
|
+ h = 30;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{record.title}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+
|
|
|
+ w = 70;
|
|
|
+ h = 20;
|
|
|
+ y = 40;
|
|
|
+ x = width - w - margin;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{record.category}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ w = x - margin;
|
|
|
+ this.ADD_PRINT_TEXT(y, margin, w, h, template(`{{patient.name}},{{patient.gender}},{{patient.birthday}}`));
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+ if (model.record.no) this.ADD_PRINT_BARCODE(y, x, 145, 60, '128Auto', model.record.no);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 6);
|
|
|
+
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 8);
|
|
|
+ w = 130;
|
|
|
+ x = width - w - margin;
|
|
|
+ y += 4;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`手机号:{{patient.phone}}`));
|
|
|
+ y += h;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`处方用法:{{recipe.method}}`));
|
|
|
+ y += h;
|
|
|
+ w = 55;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`剂数:{{recipe.count}}`));
|
|
|
+ x += w;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, width - x - margin, h, template(`是否代煎:{{recipe.decoction}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 9);
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+ w = width - margin * 2;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`科室/病房:{{department}}`));
|
|
|
+ y += h;
|
|
|
+ h += 6;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`药师备注:{{record.remark}}`));
|
|
|
+ y += h;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`打印时间:{{record.date}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * A5 纸 96 PPI (559px * 794px)
|
|
|
+ *
|
|
|
+ * @param model
|
|
|
+ * @param title
|
|
|
+ */
|
|
|
+export function templateA5(model = {}, title = '') {
|
|
|
+ const template = renderTemplate.bind(this, model);
|
|
|
+
|
|
|
+ const width = 559;
|
|
|
+ const height = 794;
|
|
|
+ const margin = 12;
|
|
|
+
|
|
|
+ this.PRINT_INITA(0, 0, width, height, title);
|
|
|
+ // 宽度按纸张的整宽缩放
|
|
|
+ this.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Height');
|
|
|
+ // 设置输出位置以纸张边缘为基点
|
|
|
+ this.SET_PRINT_MODE('POS_BASEON_PAPER', true);
|
|
|
+
|
|
|
+ const chunks = (function (array, size = 32) {
|
|
|
+ let result = [];
|
|
|
+ for (let i = 0; i < array.length; i += size) {result.push(array.slice(i, i + size));}
|
|
|
+ return result;
|
|
|
+ })(model.recipe['medicines']);
|
|
|
+ if (!chunks.length) chunks.push([]);
|
|
|
+ const single = chunks.length === 1;
|
|
|
+
|
|
|
+ for (const chunk of chunks) {
|
|
|
+ // 绘制头部
|
|
|
+ this.ADD_PRINT_TEXT(margin, margin, 310, 30, template(`{{record.title}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 16);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ this.ADD_PRINT_TEXT(47, 12, 310, 20, template(`{{recipe.type}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ if (model.record.no) this.ADD_PRINT_BARCODE(12, 331, 216, 60, '128Auto', model.record.no);
|
|
|
+
|
|
|
+ // 绘制顶部信息
|
|
|
+ let x = 0, y = 80, h = 20;
|
|
|
+ let rows = [
|
|
|
+ [
|
|
|
+ {left: margin, width: 138, height: 20, text: template(`姓名:{{patient.name}}`)},
|
|
|
+ {width: 60, height: 20, text: template(`性别:{{patient.gender}}`)},
|
|
|
+ {width: 80, height: 20, text: template(`年龄:{{patient.age}}`)},
|
|
|
+ {width: 120, height: 20, text: template(`电话:{{patient.phone}}`)},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {left: margin, width: 198, height: 20, text: template(`就诊科室:{{department}}`)},
|
|
|
+ {width: 80, height: 20, text: template(`床号:{{bedNo}}`)},
|
|
|
+ {width: 120, height: 20, text: template(`病历号:{{recordNo}}`)},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {left: margin, width: 350, height: 20, text: template(`临床诊断:{{diagnosis}}`)},
|
|
|
+ {leftOffset: 2, width: 350, height: 20, text: template(`开方时间:{{recipe.date}}`)},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {left: margin, width: 400, height: 20, text: template(`联系地址:{{recipe.address}}`)},
|
|
|
+ {
|
|
|
+ leftOffset: 2, width: 134, height: 20, text: template(`{{recipe.delivery}}`), style: {
|
|
|
+ Alignment: 3,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ rows.forEach((row, r) => {
|
|
|
+ row.forEach((col, c) => {
|
|
|
+ if (col.top != null) y = col.top;
|
|
|
+ else if (r && c === 0) { y += (h + 2); }
|
|
|
+
|
|
|
+ if (col.left != null) x = col.left;
|
|
|
+ else if (c) {x += row[c - 1].width + (col.leftOffset || 0);}
|
|
|
+
|
|
|
+ this.ADD_PRINT_TEXT(y, x, col.width, col.height, col.text);
|
|
|
+ for (const [prop, value] of Object.entries(col.style || {})) {
|
|
|
+ this.SET_PRINT_STYLEA(0, prop, value);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ this.ADD_PRINT_TEXT(80, 410, 128, 42, template(`{{field1}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Italic', 1);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Underline', 1);
|
|
|
+
|
|
|
+
|
|
|
+ // 分割线
|
|
|
+ this.ADD_PRINT_SHAPE(4, 178, 12, 535, 1, 0, 1, '#000000');
|
|
|
+ // RP
|
|
|
+ this.ADD_PRINT_TEXT(192, 12, 50, 30, 'Rp:');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 16);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+
|
|
|
+ // 绘制药品
|
|
|
+ y = 230 - 20 - 2;
|
|
|
+ chunk.forEach((medicine, i) => {
|
|
|
+ const template = renderTemplate.bind(this, medicine);
|
|
|
+ if (i % 2) {
|
|
|
+ x = 291;
|
|
|
+ } else {
|
|
|
+ y += 20 + 2;
|
|
|
+ x = 48;
|
|
|
+ }
|
|
|
+ this.ADD_PRINT_TEXT(y, x, 120, 20, template(`{{name}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ x += 120;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, 50, 20, template(`{{dosage}}{{unit}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ x += 50 + 2;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, 48, 16, template(`{{usage}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 6);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 绘制处方信息
|
|
|
+ y = Math.max(560, y);
|
|
|
+ y += 20 + 8 * 2;
|
|
|
+ this.SET_PRINT_STYLE('Alignment', 2);
|
|
|
+ this.ADD_PRINT_TEXT(y, margin, 111, 20, template(`剂数:{{recipe.count}} ${model.recipe.decoction ? '(代煎)' : ''}`));
|
|
|
+ this.ADD_PRINT_TEXT(y, 120, 100, 20, template(`{{recipe.category}} ${model.recipe.method ? '({{recipe.method}})' : ''}`));
|
|
|
+ this.ADD_PRINT_TEXT(y, 229, 100, 20, template(`{{recipe.volume}}`));
|
|
|
+ this.ADD_PRINT_TEXT(y, 339, 100, 20, template(`{{recipe.frequency}}`));
|
|
|
+ this.ADD_PRINT_TEXT(y, 448, 100, 20, template(`{{recipe.frequencyTime}}`));
|
|
|
+ this.ADD_PRINT_SHAPE(4, 619, 12, 535, 1, 0, 1, '#000000');
|
|
|
+
|
|
|
+ // 绘制矩形
|
|
|
+ this.ADD_PRINT_RECT(620 + 12, 12, 240, 70, 0, 1);
|
|
|
+ // 第一横行线
|
|
|
+ this.ADD_PRINT_SHAPE(4, 654, 12, 240, 1, 0, 1, '#000000');
|
|
|
+ // 第二横行线
|
|
|
+ this.ADD_PRINT_SHAPE(4, 679, 12, 240, 1, 0, 1, '#000000');
|
|
|
+ // 第二行 竖线
|
|
|
+ this.ADD_PRINT_SHAPE(4, 655, 132, 1, 24, 0, 1, '#000000');
|
|
|
+ this.ADD_PRINT_TEXT(637, 13, 238, 12, template(`药品金额:¥{{recipe.medicineFees}}`));
|
|
|
+ this.ADD_PRINT_TEXT(661, 13, 118, 12, template(`煎药费:¥{{recipe.decoctionFees}}`));
|
|
|
+ this.ADD_PRINT_TEXT(661, 133, 118, 12, template(`配送费:¥{{recipe.deliveryFees}}`));
|
|
|
+ this.ADD_PRINT_TEXT(685, 13, 238, 12, template(`总金额:¥{{recipe.totalFees}}`));
|
|
|
+ this.SET_PRINT_STYLE('Alignment', 1);
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 8);
|
|
|
+
|
|
|
+ y = 620 + 12 + 4;
|
|
|
+ rows = [
|
|
|
+ [
|
|
|
+ {left: 266, text: template(`开方:{{sign.field1}}`)},
|
|
|
+ {left: 408, text: template(`审核:{{sign.field2}}`)},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {left: 266, text: template(`调配:{{sign.field3}}`)},
|
|
|
+ {left: 408, text: template(`复核:{{sign.field4}}`)},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {left: 266, text: template(`浸泡:{{sign.field5}}`)},
|
|
|
+ {left: 408, text: template(`煎煮:{{sign.field6}}`)},
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ {left: 266, text: template(`打包:{{sign.field7}}`)},
|
|
|
+ {left: 408, text: template(`发药:{{sign.field8}}`)},
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ for (const row of rows) {
|
|
|
+ for (const col of row) {
|
|
|
+ this.ADD_PRINT_TEXT(y, col.left, 140, 16, col.text);
|
|
|
+ this.ADD_PRINT_TEXT(y, col.left, 140, 16, col.text);
|
|
|
+ }
|
|
|
+ y += 16 + 2;
|
|
|
+ }
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 9);
|
|
|
+ this.ADD_PRINT_SHAPE(4, 714, 12, 535, 1, 0, 1, '#000000');
|
|
|
+
|
|
|
+ if (model.record.remark) {
|
|
|
+ this.ADD_PRINT_TEXT(725, 12, 40, 16, '注:');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Vorient', 1);
|
|
|
+ this.ADD_PRINT_TEXT(725, 48, 500, 55, template(`{{record.remark}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Vorient', 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!single) this.NEWPAGEA();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 药品明细清单
|
|
|
+ * @param model
|
|
|
+ * @param title
|
|
|
+ */
|
|
|
+export function template72(model, title) {
|
|
|
+ const template = renderTemplate.bind(this, model);
|
|
|
+
|
|
|
+ const width = 272;
|
|
|
+ const height = 794;
|
|
|
+ const margin = 0;
|
|
|
+
|
|
|
+ this.PRINT_INITA(0, 0, width, height, title);
|
|
|
+ // 宽度按纸张的整宽缩放
|
|
|
+ this.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width');
|
|
|
+ // 设置输出位置以纸张边缘为基点
|
|
|
+ this.SET_PRINT_MODE('POS_BASEON_PAPER', true);
|
|
|
+
|
|
|
+ let x = margin, y = margin;
|
|
|
+ let w = 0, h = 0;
|
|
|
+
|
|
|
+ w = 70;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{recipe.delivery}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x += w;
|
|
|
+ h = 30;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, width - x - margin, h, template(`{{record.title}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 16);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+ h = 36;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, width - x - margin, h, template(`{{recipe.address}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Underline', 1);
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+ w = 118;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`序号:{{bedNo}}`));
|
|
|
+ x += w;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, width - x - margin, h, template(`处方号:{{record.no}}`));
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ x = margin;
|
|
|
+
|
|
|
+ this.ADD_PRINT_TEXT(y, x, 118, h, template(`姓名:{{patient.name}}`));
|
|
|
+ this.ADD_PRINT_TEXT(y, 118, 75, 20, template(`{{recipe.method}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Underline', 1);
|
|
|
+ this.ADD_PRINT_TEXT(y, 197, 75, 20, template(`{{recipe.decoction}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Underline', 1);
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ x = margin;
|
|
|
+ h = 96;
|
|
|
+ if (model.record.no) this.ADD_PRINT_BARCODE(y, x, h, h, 'QRCode', model.record.no);
|
|
|
+
|
|
|
+ x = 94;
|
|
|
+ h = 45 * 2;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, 178, h, template(`备注:{{record.remark}}`));
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+
|
|
|
+ w = 72;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, `药味:${model.recipe.medicines.length}}`);
|
|
|
+ x += w;
|
|
|
+ w = 100;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`帖重:{{recipe.unitWeight}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ x += w;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`总重:{{recipe.totalWeight}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+ w = 100;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`开单:{{doctor}}`));
|
|
|
+ x += w;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, width - x - margin, h, template(`共 {{recipe.count}}帖 {{recipe.total}}包`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ y += h;
|
|
|
+ w = 178;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, [
|
|
|
+ template(`{{recipe.volume}}`),
|
|
|
+ template(`{{recipe.frequency}}`),
|
|
|
+ template(`{{recipe.frequencyTime}}`),
|
|
|
+ ].filter(Boolean).join(','));
|
|
|
+
|
|
|
+ w = 100;
|
|
|
+ this.ADD_PRINT_TEXT(y, width - w - margin, w, h, '装量: ML');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+
|
|
|
+ this.ADD_PRINT_SHAPE(4, 255, 0, 278, 1, 0, 1, '#000000');
|
|
|
+ this.ADD_PRINT_TEXT(265, 0, 60, 20, '库位号');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.ADD_PRINT_TEXT(265, 53, 86, 20, '药品名');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.ADD_PRINT_TEXT(265, 136, 36, 20, '单帖');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(265, 166, 36, 20, '总量');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(265, 196, 36, 20, '单位');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(265, 228, 44, 20, '特煎');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_SHAPE(4, 285, 0, 278, 1, 0, 1, '#000000');
|
|
|
+ y = 285 + 12;
|
|
|
+
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 8);
|
|
|
+ model.recipe.medicines.forEach((medicine, i) => {
|
|
|
+ const template = renderTemplate.bind(this, medicine);
|
|
|
+
|
|
|
+ x = margin;
|
|
|
+ w = 54;
|
|
|
+ h = 30;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{mark}}`));
|
|
|
+ x += w - 1;
|
|
|
+ w = 86;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{name}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
+ this.ADD_PRINT_TEXT(y, 132, 40, h, template(`{{dosage}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(y, 164, 40, h, template(`{{total}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(y, 200, 22, h, template(`{{unit}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(y, 222, 50, h, template(`{{usage}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ y += h + 2;
|
|
|
+ });
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 9);
|
|
|
+ y += 12;
|
|
|
+ this.ADD_PRINT_SHAPE(4, y, 0, 278, 1, 0, 1, '#000000');
|
|
|
+
|
|
|
+}
|