Explorar el Código

增加 60 * 60 的标签,替换 80 * 50

cc12458 hace 1 año
padre
commit
a998b454f4

+ 1 - 1
src/api/prescription/prescriptionAudit.js

@@ -81,7 +81,7 @@ export function selectOrderDetail2(query) {
         recordNo: data['recipientCode'],
         serialNumber: data['recipeSerial'],
         category: data['preMzZy'] === '1' ? '门诊' : '住院',
-        remark: data['remark'] || [data['pharmacistsremarks']].filter(Boolean).join(','),
+        remark: data['remark'] || [data['entrust'], data['pharmacistsremarks']].filter(Boolean).join(','),
       },
       sign: {
         /* 开方专用 */ field1: data['doctor'] || sign(1 - 1),

+ 2 - 2
src/components/print/tag_80_50.vue

@@ -1,7 +1,7 @@
 <script>
 import CLodop from '@/libs/print/CLodop';
 import {getDevice} from '@/tools/print.tool';
-import {template80_50} from '@/components/print/template';
+import {template60_60} from '@/components/print/template';
 import {selectOrderDetail2} from '@/api/prescription/prescriptionAudit';
 
 export default {
@@ -36,7 +36,7 @@ export default {
       const instance = await CLodop();
       const model = await this.getModel();
 
-      template80_50.call(instance, model, `${this.paper}`);
+      template60_60.call(instance, model, `${this.paper}`);
 
       this.device = await getDevice(`paper:${this.paper}`);
       if (this.device) instance['SET_PRINT_PAGESIZE'](1, 0, 0, this.paper);

+ 110 - 0
src/components/print/template.js

@@ -88,6 +88,116 @@ 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, '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 = '') {
   const template = renderTemplate.bind(this, model);