|
@@ -88,6 +88,116 @@ export function template60_40(model = {}, title = '') {
|
|
|
this.SET_PRINT_STYLEA(0, 'Alignment', 2);
|
|
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, '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, 170, h, template(`{{record.remark}}`));
|
|
|
|
|
+ this.SET_PRINT_STYLEA(0, 'FontSize', 9);
|
|
|
|
|
+ this.SET_PRINT_STYLEA(0, 'Alignment', 1);
|
|
|
|
|
+ if (model.record.orderNo) this.ADD_PRINT_BARCODE(y + (32 + 20 - 46) / 2, 175, 46, 46, 'QRCode', model.record.orderNo);
|
|
|
|
|
+
|
|
|
|
|
+ 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 = 100;
|
|
|
|
|
+ this.ADD_PRINT_TEXT(y, 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 = '') {
|
|
export function template80_50(model = {}, title = '') {
|
|
|
const template = renderTemplate.bind(this, model);
|
|
const template = renderTemplate.bind(this, model);
|
|
|
|
|
|