Forráskód Böngészése

Merge tag '20250312' into develop

cc12458 1 éve
szülő
commit
7ea451b602

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ ENV='development'
 
 # 中药房管理系统/开发环境
 #VUE_APP_BASE_API='http://8.139.252.178:8001/prod-api/'
-VUE_APP_BASE_API='http://115.236.184.102:62007/prod-api/'
+VUE_APP_BASE_API='/manager/'
 VUE_APP_BASE_API_V2='http://10.250.11.48:3030'
 
 # 路由懒加载

+ 1 - 2
.env.production

@@ -25,7 +25,6 @@ VUE_APP_BASE_API_V2='http://124.112.64.166:2020'
 #VUE_APP_BASE_API = 'http://47.118.22.101:2020'
 #VUE_APP_BASE_API_V2 = 'http://47.118.22.101:2020'
 
-VUE_APP_BASE_API='/prod-api/'
-
+VUE_APP_BASE_API='/manager/'
 VUE_APP_SF_EXPRESS_ENV=pro
 

+ 0 - 12
.env.staging

@@ -1,12 +0,0 @@
-# 页面标题
-VUE_APP_TITLE = 中药房管理系统
-
-NODE_ENV = production
-
-# 测试环境配置
-ENV = 'staging'
-
-# 中药房管理系统/测试环境
-VUE_APP_BASE_API = 'http://106.14.106.155:8005/'
-
-#VUE_APP_BASE_API = 'http://wbivsd.natappfree.cc'

+ 0 - 1
package.json

@@ -7,7 +7,6 @@
   "scripts": {
     "dev": "vue-cli-service serve",
     "build:prod": "vue-cli-service build",
-    "build:stage": "vue-cli-service build --mode staging",
     "build:development": "vue-cli-service build --mode development",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src"

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

@@ -77,10 +77,11 @@ export function selectOrderDetail2(query) {
         date: data['prescriptionTime'],
         no: `${data['preNo']}`,
         bedNo: data['bedNo'],
+        orderNo: data['orderNo'],
         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),

+ 115 - 1
src/api/prescription/prescriptionCore.js

@@ -60,7 +60,11 @@ export function listPrescriptionReception(query) {
   return request({
     url: '/yfc-admin/prescriptionManage/preOrderPage',
     method: 'post',
-    data: query
+    data: query,
+    params: {
+      pageNum: query.pageNum,
+      pageSize: query.pageSize,
+    },
   })
 }
 
@@ -188,6 +192,116 @@ export function getPrescriptionCore2(id) {
   });
 }
 
+export function getPrescriptionRS(id, medicines, {hidePregnant = false} = {}) {
+  const hack = request({
+    url: 'http://121.43.162.141/yf/knowlib/getYfMatInfo',
+    method: 'post',
+    data: medicines.map(item => item.matCode),
+    params: {id},
+    headers: {isToken: false},
+  }).then(res => {
+    if (res.ResultCode === 401) throw {message: res.ResultInfo};
+    if (res.code !== 0) throw res;
+    return res;
+  });
+
+  return hack.then(res => {
+    const data = Array.isArray(res.data) ? res.data : [];
+    return data.reduce((rs, item, index) => {
+      if (item && item.matid && medicines[index]) {
+        const name = medicines[index].matName || item.matname;
+        const dosage = +medicines[index].matDose;
+        const color = '#5AD8A6';
+        if (dosage && item.matdosage) {
+          const ref = {}, i = 1;
+          const child = rs[i] || (rs[i] = {title: '', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">${ref[item.matdosage]}</span>
+          </div>`);
+        }
+        if (item.matsjj) {
+          const ref = {1: '慎用', 2: '忌用', 3: '禁用'}, i = 2;
+          const child = rs[i] || (rs[i] = {title: '慎忌禁用药', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">${ref[item.matsjj]}</span>
+          </div>`);
+        }
+        if (item.matyfsjj && !hidePregnant) {
+          const color = item.matyfsjj === '3' ? 'red' : '#5AD8A6';
+          const ref = {1: '孕妇慎用', 2: '孕妇忌用', 3: '孕妇禁用'}, i = 3;
+          const child = rs[i] || (rs[i] = {title: '孕妇慎忌禁', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">${ref[item.matyfsjj]}</span>
+          </div>`);
+        }
+        if (item.matysjj) {
+          const ref = {}, i = 4;
+          const child = rs[i] || (rs[i] = {title: '服药饮食禁忌', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">${item.matysjj || '无'}</span>
+          </div>`);
+        }
+        if (item.matdxsm) {
+          const color = 'red';
+          const ref = {}, i = 5;
+          const child = rs[i] || (rs[i] = {title: '药物毒性说明', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">${item.matdxsm || '无'}</span>
+          </div>`);
+        }
+        if (item.matbzjj) {
+          const ref = {}, i = 6;
+          const child = rs[i] || (rs[i] = {title: '病证用药禁忌', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">${item.matbzjj || '无'}</span>
+          </div>`);
+        }
+        if (item.matsbf) {
+          const color = 'red';
+          const ref = {}, i = 7;
+          const child = rs[i] || (rs[i] = {title: '十八反', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">反${item.matsbf}</span>
+          </div>`);
+        }
+        if (item.matsjw) {
+          const color = 'red';
+          const ref = {}, i = 8;
+          const child = rs[i] || (rs[i] = {title: '十九畏', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">畏${item.matsjw}</span>
+          </div>`);
+        }
+        if (item.matby) {
+          const ref = {}, i = 9;
+          const child = rs[i] || (rs[i] = {title: '用药不宜', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value">不宜与${item.matby}同用</span>
+          </div>`);
+        }
+        if (dosage && (dosage < item.matmindosage || dosage > item.matmaxdosage)) {
+          const ref = {}, i = 0;
+          const child = rs[i] || (rs[i] = {title: '超剂量药品', collection: []});
+          child.collection.push(`<div>
+            <span class="met-name" style="color: ${color};">${name}</span>
+            <span class="met-value" style="color: red;">(${item.matmindosage}-${item.matmaxdosage})</span>
+          </div>`);
+        }
+      }
+      return rs;
+    }, []).filter(Boolean);
+  });
+}
+
 // 新增处方审核
 export function addPrescriptionCore(data) {
   return request({

+ 2 - 0
src/components/print/tag_60_40.vue

@@ -96,6 +96,8 @@ export default {
             title: data['medicalName'],
             date: data['createTime'],
             no: data['preNo'],
+            orderNo: data['orderNo'],
+            recordNo: data['recipientCode'],
             category: data['preMzZy'] === '1' ? '门诊' : '住院',
             remark: data['remark'] || [data['frequency'], data['medicationTime']].filter(Boolean).join(','),
           },

+ 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);

+ 135 - 12
src/components/print/template.js

@@ -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;

+ 6 - 5
src/layout/components/Navbar.vue

@@ -33,7 +33,7 @@
         <!--        </el-tooltip>el-tooltip-->
 
         <el-select
-          v-if="!hidePharmacyControl"
+          v-if="!hidePharmacyControl || (onePharmacyHideControl && pharmacyList.length === 1)"
           v-model="pharmacyId"
           placeholder="请选择药房"
           style="margin-right: 20px; width: 150px"
@@ -107,7 +107,8 @@ export default {
   data() {
     return {
       pharmacyId: "",
-      hidePharmacyControl: true,
+      hidePharmacyControl: false,
+      onePharmacyHideControl: true,
     };
   },
   created() {
@@ -116,11 +117,11 @@ export default {
       this.pharmacyId = '';
     } else {
       let pharmacyId = window.localStorage.getItem("pharmacyId");
-      if (pharmacyId == null) {
+      if (this.pharmacyList.find(item => item.id == pharmacyId)) {
+        this.pharmacyId = Number(pharmacyId);
+      } else {
         this.pharmacyId = this.pharmacyList[0].id;
         window.localStorage.setItem("pharmacyId", this.pharmacyId);
-      } else {
-        this.pharmacyId = Number(pharmacyId);
       }
     }
 

+ 125 - 6
src/views/rescription/prescriptionCore/edit.vue

@@ -3,7 +3,13 @@ import dayjs from 'dayjs';
 import {listMedicalMechanism} from '@/api/medical/mechanism';
 import {transformFlatObjectToNested, transformNestedObjectToFlat} from '@/tools/object';
 import {bignumber, chain, multiply} from 'mathjs';
-import {addPrescriptionCore2, check, check2, getPrescriptionCore2} from '@/api/prescription/prescriptionCore';
+import {
+  addPrescriptionCore2,
+  check,
+  check2,
+  getPrescriptionCore2,
+  getPrescriptionRS,
+} from '@/api/prescription/prescriptionCore';
 import {mapGetters} from 'vuex';
 
 import regionOptions from '@/utils/options';
@@ -87,6 +93,10 @@ export default {
       saving: false,
 
       tableHeight: 0,
+
+      showRS: false,
+      rsLoading: false,
+      rs: [],
     };
   },
   computed: {
@@ -141,8 +151,10 @@ export default {
     getSchemeList().then((response) => {this.schemeOptions = response.rows;});
   },
   mounted() {
-    const rect = this.$el.getBoundingClientRect();
-    this.tableHeight = rect.height - /* 内边距 */ 12 * 2 - /* 协定方 */ 32 - /* 表尾 */ (20 + 12 * 2) - /* 拒绝原因 */ (this.isCheck ? 54 + 12 : 0) - /* 底部按钮 */ (36 + 12);
+    setTimeout(() => {
+      const rect = this.$el.getBoundingClientRect();
+      this.tableHeight = rect.height - /* 内边距 */ 12 * 2 - /* 协定方 */ 32 - /* 表尾 */ (20 + 12 * 2) - /* 拒绝原因 */ (this.isCheck ? 54 + 12 : 0) - /* 底部按钮 */ (36 + 12);
+    }, 200);
   },
   methods: {
     async load() {
@@ -154,6 +166,7 @@ export default {
         if (!this.isCheck) {
           this.model.id = null;
           this.model.tackleTime = '';
+          delete this.model.checkState;
         }
       } catch (e) {
         this.cancel();
@@ -165,6 +178,23 @@ export default {
 
       if (!this.model.tackleTime) this.model.tackleTime = dayjs().startOf('minute').format('YYYY-MM-DD HH:mm:ss');
     },
+    async loadRS() {
+      const medicines = this.medicines.filter(medicine => Object.keys(medicine).length);
+      if (medicines.length === 0) return this.toggleShowRS(false);
+      this.rsLoading = true;
+      try {
+        const id = this.model.id || this.$props.id;
+        this.rs = await getPrescriptionRS(id, medicines, {hidePregnant: this.model.sex === '男' || this.model.age < 14});
+      } catch (e) {
+        if (e instanceof AggregateError) {
+          this.$message.error(e.errors.map(e=>e.message).join('; '));
+        } else {
+          this.$message.error(e.message);
+        }
+        this.toggleShowRS(false);
+      }
+      this.rsLoading = false;
+    },
     formReset() {
       const pharmacies = Array.isArray(this.pharmacyList) ? this.pharmacyList : [];
       this.model = {
@@ -190,7 +220,7 @@ export default {
         /* 20 浓煎量   */ prescription_concentration: '',
         /* 21 服药频次 */ prescription_frequency: '',
         /* 22 服药时间 */ prescription_medicationTime: '',
-        /* 23 医嘱     */ prescription_remark: '',
+        /* 23 医嘱     */ prescription_entrust: '',
         /* 24 代煎     */ isBehalf: '',
         /* 24 配送     */ takingMethod: '',
 
@@ -323,15 +353,18 @@ export default {
         this.medicines.splice(index, 1, row);
       }
       if (this.getEmptyMedicineRowIndex === -1) this.appendMedicine({}, index + 1);
+      if (this.showRS) this.loadRS();
     },
     appendMedicine(model, index = this.medicines.length) {
       this.medicines.splice(index, 0, model || {});
     },
     deleteMedicine(row, index) {
       this.medicines.splice(index, 1);
+      if (this.showRS) this.loadRS();
     },
     updateMedicine(row, index) {
       this.medicines.splice(index, 1, {...row, subtotalMoney: this.calculationMedicinePrice(row)});
+      if (this.showRS) this.loadRS();
     },
     calculationMedicinePrice(medicine) {
       let price = chain(bignumber(medicine.matXsj || 0));
@@ -343,6 +376,11 @@ export default {
         colspan: 8,
       };
     },
+
+    toggleShowRS(show = true) {
+      this.showRS = show && !this.showRS;
+      if (this.showRS) this.loadRS();
+    },
   },
 };
 </script>
@@ -555,8 +593,8 @@ export default {
               </el-form-item>
             </el-col>
             <el-col :span="showPharmacy ? 16 : 24">
-              <el-form-item label-width="3em" label="医嘱" prop="prescription_remark">
-                <el-input v-model="model.prescription_remark" placeholder="请输入医嘱"/>
+              <el-form-item label-width="3em" label="医嘱" prop="prescription_entrust">
+                <el-input v-model="model.prescription_entrust" placeholder="请输入医嘱"/>
               </el-form-item>
             </el-col>
           </el-row>
@@ -722,6 +760,25 @@ export default {
             </el-col>
           </el-row>
         </div>
+        <transition name="slide-left">
+          <div v-if="showRS" class="drawer-container">
+            <div class="header">智能审方</div>
+            <div class="main" v-loading="rsLoading">
+              <el-empty v-if="!rsLoading && rs.length === 0">
+                <el-button type="primary" @click="toggleShowRS(false)">关闭</el-button>
+              </el-empty>
+              <div v-for="block in rs" :key="block.title">
+                <div class="rs-title">{{ block.title }}</div>
+                <el-row :gutter="20">
+                  <el-col :span="24" v-for="item in block.collection" :key="item.name" style="margin-top: 8px;"
+                          v-html="item"></el-col>
+                </el-row>
+              </div>
+            </div>
+
+            <i class="el-icon-circle-close close" @click="toggleShowRS(false)"></i>
+          </div>
+        </transition>
       </el-col>
       <el-col class="col-container" :span="12">
         <div class="area" style="flex: auto;display: flex;flex-direction: column;">
@@ -824,6 +881,9 @@ export default {
             </template>
           </div>
           <div>
+            <el-button v-if="isCheck" type="primary" plain @click="toggleShowRS()"
+                       :disabled="!getEmptyMedicineRowIndex">{{ showRS ? '关闭' : '' }}智能审方
+            </el-button>
             <el-button v-if="isCheck" type="primary" @click="check('110')" :disabled="saving">审核通过</el-button>
             <el-button v-else type="primary" :loading="saving" @click="handle">保 存</el-button>
             <el-button @click="cancel">取 消</el-button>
@@ -956,6 +1016,65 @@ export default {
   display: flex;
   justify-content: space-between;
 }
+
+.col-container {
+  position: relative;
+
+  .drawer-container {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    display: flex;
+    flex-direction: column;
+    padding: 12px 10px;
+    background-color: #fff;
+
+    .close {
+      position: absolute;
+      top: 12px + 4px;
+      right: 12px;
+      font-size: 24px;
+      cursor: pointer;
+
+      &:hover {
+        color: #5AD8A6;
+      }
+    }
+
+    > .header {
+      flex: none;
+      font-size: 20px;
+      font-weight: 700;
+      text-align: center;
+      line-height: 32px;
+    }
+
+    > .main {
+      flex: auto;
+      overflow-x: hidden;
+      overflow-y: auto;
+
+      .rs-title {
+        margin-top: 12px;
+        font-size: 18px;
+        font-weight: 700;
+      }
+    }
+  }
+
+  /* 动画效果 */
+  .slide-left-enter-active,
+  .slide-left-leave-active {
+    transition: transform 0.3s ease;
+  }
+
+  .slide-left-enter,
+  .slide-left-leave-to {
+    transform: translateX(-100%);
+  }
+}
 </style>
 <style lang="scss">
 .el-dialog {

+ 6 - 4
src/views/rescription/prescriptionCore/index.vue

@@ -1363,6 +1363,7 @@ export default {
       recipeEditId: null,
       recipeEditOpen: false,
       recipeEditShow: false,
+      recipeEditTitle: '',
 
       curPreNo: "",
       curName: "",
@@ -1588,10 +1589,6 @@ export default {
         return "否";
       }
     },
-    recipeEditTitle() {
-      if (this.recipeEditMode === 'check') return '处方审核查看'
-      return this.recipeEditId ? '复制处方' : '新增处方';
-    }
   },
   methods: {
     countDose() {
@@ -2041,6 +2038,11 @@ export default {
         this.recipeEditId = row.id;
         this.recipeEditShow = true;
         this.recipeEditOpen = true;
+        setTimeout(() => {
+          if (this.recipeEditMode === 'check') this.recipeEditTitle = ['处方审核查看', row.orderNo].filter(Boolean).join(' - ');
+          else if (this.recipeEditId) this.recipeEditTitle = '复制处方';
+          else this.recipeEditTitle = '新增处方';
+        }, 20)
         return;
       }
       this.reset();

+ 3 - 3
vue.config.js

@@ -38,11 +38,11 @@ module.exports = {
         //  target: `http://47.118.22.101:8005`, // 公司测试环境
         // target: `http://172.168.10.118:8005`,
         // target: `http://10.250.11.48:2020`, // 铜陵测试环境
-        target: `http://124.112.64.166:2020`, // 阜南
+        target: `https://wx.hzliuzhi.com:4433`, // 阜南
 
-        changeOrigin: true,
+        changeOrigin: false,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
+          // ['^' + process.env.VUE_APP_BASE_API]: ''
         }
       },