|
|
@@ -74,7 +74,7 @@ export function template60_40(model = {}, title = '') {
|
|
|
|
|
|
this.ADD_PRINT_TEXT(86, margin, 170, 44, template(`{{record.remark}}`));
|
|
|
this.SET_PRINT_STYLEA(0, 'FontSize', 9);
|
|
|
- if (model.record.no) this.ADD_PRINT_BARCODE(99, 175, 46, 46, 'QRCode', model.record.no);
|
|
|
+ if (model.record.orderNo) this.ADD_PRINT_BARCODE(99, 175, 46, 46, 'QRCode', model.record.orderNo);
|
|
|
|
|
|
y = 130;
|
|
|
x = margin;
|
|
|
@@ -88,6 +88,117 @@ export function template60_40(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
}
|
|
|
|
|
|
+export function template60_60(model = {}, title = '') {
|
|
|
+ const template = renderTemplate.bind(this, model);
|
|
|
+
|
|
|
+ const width = 227;
|
|
|
+ const height = 227;
|
|
|
+ const margin = 6;
|
|
|
+
|
|
|
+ this.PRINT_INITA(0, 0, width, height, title);
|
|
|
+ // 宽度按纸张的整宽缩放
|
|
|
+ this.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Full-Width');
|
|
|
+ this.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true);
|
|
|
+ this.SET_PRINT_MODE('FULL_HEIGHT_OVERFLOW', true);
|
|
|
+ // 设置输出位置以纸张边缘为基点
|
|
|
+ this.SET_PRINT_MODE('POS_BASEON_PAPER', true);
|
|
|
+
|
|
|
+ let x = margin, y = margin;
|
|
|
+ let w = 0, h = 0;
|
|
|
+
|
|
|
+ this.SET_PRINT_STYLE('Alignment', 2);
|
|
|
+ this.SET_PRINT_STYLE('FontSize', 12);
|
|
|
+
|
|
|
+ w = 215;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{record.title}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ h = 16;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{record.no}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 9);
|
|
|
+
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ w = 115;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{patient.name}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 15);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x += w;
|
|
|
+ w = 30;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{recipe.count}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x += w;
|
|
|
+ w = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, '帖');
|
|
|
+
|
|
|
+ if (model.recipe.total) {
|
|
|
+ x += w;
|
|
|
+ w = 30;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{recipe.total}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x += w;
|
|
|
+ w = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, '包');
|
|
|
+ }
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ x = margin;
|
|
|
+ w = 60;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, '备注:');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 1);
|
|
|
+ x += w - 2;
|
|
|
+ w = 60;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{recipe.volume}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x += w;
|
|
|
+ w = 50;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{recipe.method}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ x += w;
|
|
|
+ this.ADD_PRINT_TEXT(y, x - 3, w, h, template(`{{recipe.decoction}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ h = 32;
|
|
|
+ this.ADD_PRINT_TEXT(y, margin, width - margin, h, template(`{{record.remark}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 1);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'LineSpacing', -2);
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ x = margin;
|
|
|
+ w = 70;
|
|
|
+ h = 20;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, w, h, template(`{{recipe.delivery}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 1);
|
|
|
+ x += w;
|
|
|
+ w = width - margin - x;
|
|
|
+ this.ADD_PRINT_TEXT(y + 4, x, w, h, template(`{{record.date}}`));
|
|
|
+
|
|
|
+ y += h;
|
|
|
+ x = 0;
|
|
|
+ h = 16;
|
|
|
+ this.ADD_PRINT_TEXT(y, x, width, h, template(`{{patient.phone}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ y += h + 2;
|
|
|
+ h = 24;
|
|
|
+ this.ADD_PRINT_SHAPE(4, y, x, width, h, 0, 1, '#000000');
|
|
|
+ this.ADD_PRINT_TEXT(y + (24 - 18) / 2, x, width, 18, template(`{{patient.name}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 13.5);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontColor', '#ffffff');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+ y += h + margin / 2;
|
|
|
+ if (model.record.orderNo) {
|
|
|
+ w = 198;
|
|
|
+ this.ADD_PRINT_BARCODE(y, (width - w) / 2, w, 44, '128Auto', model.record.orderNo);
|
|
|
+ this.SET_PRINT_STYLEA(0, 'AlignJustify', 2);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
export function template80_50(model = {}, title = '') {
|
|
|
const template = renderTemplate.bind(this, model);
|
|
|
|
|
|
@@ -183,7 +294,7 @@ export function template80_50(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
|
|
|
- if (model.record.no) this.ADD_PRINT_BARCODE(133, 189, 107, 50, '128Auto', model.record.no);
|
|
|
+ if (model.record.orderNo) this.ADD_PRINT_BARCODE(133, 189, 107, 50, '128Auto', model.record.orderNo);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -224,6 +335,7 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLE('FontSize', 15);
|
|
|
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);
|
|
|
|
|
|
y += h + 10;
|
|
|
x = margin;
|
|
|
@@ -233,13 +345,14 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLEA(0, 'FontSize', 12);
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
|
|
|
- this.ADD_PRINT_TEXT(y, x, 100, h, template(`{{recipe.decoction}}`));
|
|
|
+ this.ADD_PRINT_TEXT(y - 2, x, 100, h + 2, template(`{{recipe.decoction}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 15);
|
|
|
this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
this.ADD_PRINT_TEXT(y, w - 100 + x, 100, h, template(`{{record.serialNumber}}`));
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
|
this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
|
|
|
- if (model.record.no) this.ADD_PRINT_BARCODE(margin, width - margin - 216, 216, 50, '128Auto', model.record.no);
|
|
|
+ if (model.record.orderNo) this.ADD_PRINT_BARCODE(margin, width - margin - 216, 216, 50, '128Auto', model.record.orderNo);
|
|
|
|
|
|
// 绘制顶部信息
|
|
|
y = margin + 50 + offset;
|
|
|
@@ -251,7 +364,8 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.ADD_PRINT_TEXT(y, x, w, h, '姓名:');
|
|
|
x += w - offset;
|
|
|
w = 100;
|
|
|
- this.ADD_PRINT_TEXT(y, x, w + offset, h, template(`{{patient.name}}`));
|
|
|
+ this.ADD_PRINT_TEXT(y - 2, x - 2, w + 20, h + 2, template(`{{patient.name}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 15);
|
|
|
this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
x += w;
|
|
|
w = 58;
|
|
|
@@ -342,7 +456,7 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.ADD_PRINT_TEXT(y, 158, 72, h, '单帖量');
|
|
|
this.ADD_PRINT_TEXT(y, 220, 62, h, '用法');
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
- const H = 36;
|
|
|
+ const H = 36 - 4;
|
|
|
y -= H - h;
|
|
|
h = H;
|
|
|
}
|
|
|
@@ -352,6 +466,7 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLE('LineSpacing', -4);
|
|
|
|
|
|
// 循环输出药品
|
|
|
+ const max = y + (Math.round(size / 2) + 1) * h;
|
|
|
for (let i = 0; i < chunk.length; i++) {
|
|
|
if (i % 2) {
|
|
|
x = 277;
|
|
|
@@ -368,7 +483,7 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
}
|
|
|
|
|
|
- y = 666;
|
|
|
+ y = Math.max(y, max);
|
|
|
this.ADD_PRINT_SHAPE(4, y, margin, width - margin * 2, 1, 0, 1, '#000000');
|
|
|
this.SET_PRINT_STYLE('LineSpacing', 0);
|
|
|
|
|
|
@@ -376,18 +491,26 @@ export function templateA5(model = {}, title = '') {
|
|
|
y += offset;
|
|
|
|
|
|
h = 16;
|
|
|
+ this.ADD_PRINT_TEXT(y, 6, 74, h, '备注:');
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
+ this.ADD_PRINT_TEXT(y, 80, width - margin - 80 + 6, h, template(`{{record.remark}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
+
|
|
|
+ y += h + 4;
|
|
|
this.ADD_PRINT_TEXT(y, 6, 74, h, '用法:');
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
this.ADD_PRINT_TEXT(y, 80, 192, h, template(`{{recipe.method}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
this.ADD_PRINT_TEXT(y, 287 - 16, 266 + 16, h, template(`{{recipe.volume}}`));
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
|
|
|
- y += h + offset;
|
|
|
+ y += h + 4;
|
|
|
this.ADD_PRINT_TEXT(y, 6, 74, h, '金额:');
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
this.ADD_PRINT_TEXT(y, 80, 192, h, template(`{{recipe.totalFees}} 元`));
|
|
|
this.ADD_PRINT_TEXT(y, 287 - 16, 266 + 16, h, template(`共 {{recipe.count}} 剂,煎 {{recipe.count}} 剂`));
|
|
|
|
|
|
- y += h + offset;
|
|
|
+ y += h + 4;
|
|
|
this.ADD_PRINT_TEXT(y, 6, 74, h, '医生:');
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
this.ADD_PRINT_TEXT(y, 80, 192, h, template(`{{sign.field1}}`));
|
|
|
@@ -396,7 +519,7 @@ export function templateA5(model = {}, title = '') {
|
|
|
|
|
|
this.ADD_PRINT_SHAPE(4, y + h + offset, margin, width - margin * 2, 1, 0, 1, '#000000');
|
|
|
|
|
|
- y += h + offset * 2;
|
|
|
+ y += h + offset * 4;
|
|
|
this.ADD_PRINT_TEXT(y, 6, 74, h, '审方人:');
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
this.ADD_PRINT_TEXT(y, 80, 192, h, template(`{{sign.field2}}`));
|
|
|
@@ -406,7 +529,7 @@ export function templateA5(model = {}, title = '') {
|
|
|
this.ADD_PRINT_TEXT(y, 361, 192, h, template(`{{sign.field3}}`));
|
|
|
this.SET_PRINT_STYLEA(0, 'Bold', 1);
|
|
|
|
|
|
- y += h + offset;
|
|
|
+ y += h + offset * 3;
|
|
|
this.ADD_PRINT_TEXT(y, 6, 74, h, '复核人:');
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 3);
|
|
|
this.ADD_PRINT_TEXT(y, 80, 192, h, template(`{{sign.field4}}`));
|
|
|
@@ -480,7 +603,7 @@ export function template72(model, title) {
|
|
|
y += h;
|
|
|
x = margin;
|
|
|
h = 96;
|
|
|
- if (model.record.no) this.ADD_PRINT_BARCODE(y, x, h, h, 'QRCode', model.record.no);
|
|
|
+ if (model.record.orderNo) this.ADD_PRINT_BARCODE(y, x, h, h, 'QRCode', model.record.orderNo);
|
|
|
|
|
|
x = 94;
|
|
|
h = 45;
|