Kaynağa Gözat

Merge branch 'hotfix/efb7535'

cc12458 1 yıl önce
ebeveyn
işleme
8a27512aba

+ 38 - 2
src/api/diagnosis.js

@@ -1,5 +1,5 @@
 import request from '@/utils/request.js'
-import {fromTongueAndFaceAnalysisModel} from "@/model/tongue-analysis,model";
+import {fromAnalysisModel} from "@/model/tongue-analysis.model";
 
 // 获取就诊病人信息
 export function getPatiiensMsg(data) {
@@ -451,7 +451,43 @@ export function getTongueAndFaceAnalysis(data) {
         params: {recordsId: data.recordsId},
     }).then(res => {
         if (res.ResultCode == 0) {
-            return res.Data = fromTongueAndFaceAnalysisModel(res.Data), res;
+            const tongue = fromAnalysisModel('tongue', res.Data);
+            const face = fromAnalysisModel('face', res.Data);
+            return res.Data = {
+                id: res.Data.recordsid,
+                time: res.Data.recordstime,
+                tongue,
+                face,
+                cover: [tongue ? tongue.cover : null, face ? face.cover : null].filter(Boolean).flatMap(item => item),
+            }, res;
+        } else {
+            throw res
+        }
+    })
+}
+
+export function getTongueAndFaceAnalysisRecords(patientId, page = 1, limit = 6) {
+    // patientId = '8d12c55e-7a29-45f3-804d-ed12b0e27660'
+    return request({
+        url: '/outpatient/electronicmedicalrecordMgr/getRecordTfs',
+        method: 'post',
+        params: {patientId, page, limit},
+    }).then(res => {
+        if (res.ResultCode == 0) {
+            return {
+                total: res.Data.TotalRecordCount,
+                data: res.Data.Items.map(item => {
+                    const tongue = fromAnalysisModel('tongue', item);
+                    const face = fromAnalysisModel('face', item);
+                    return {
+                        id: item.recordsid,
+                        time: item.recordstime,
+                        tongue,
+                        face,
+                        cover: [tongue ? tongue.cover : null, face ? face.cover : null].filter(Boolean).flatMap(item => item),
+                    }
+                }),
+            }
         } else {
             throw res
         }

+ 1 - 0
src/assets/face.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734592524739" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8401" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M110.9 326.9c17 0 30.9-13.8 30.9-30.9v-92.6c0-34.1 27.6-61.7 61.7-61.7H296c17 0 30.9-13.8 30.9-30.9 0-17-13.8-30.9-30.9-30.9h-92.6C135.3 80 80 135.3 80 203.4V296c0 17 13.8 30.9 30.9 30.9zM296 882.3h-92.6c-34.1 0-61.7-27.6-61.7-61.7V728c0-17-13.8-30.9-30.9-30.9-17 0-30.8 13.9-30.8 30.9v92.6C80 888.7 135.3 944 203.4 944H296c17 0 30.9-13.8 30.9-30.9 0-17-13.9-30.8-30.9-30.8z m617.1-185.2c-17 0-30.9 13.8-30.9 30.9v92.6c0 34.1-27.6 61.7-61.7 61.7H728c-17 0-30.9 13.8-30.9 30.9 0 17 13.8 30.9 30.9 30.9h92.6c68.2 0 123.4-55.3 123.4-123.4V728c0-17-13.8-30.9-30.9-30.9zM820.6 80H728c-17 0-30.9 13.8-30.9 30.9 0 17 13.8 30.9 30.9 30.9h92.6c34.1 0 61.7 27.6 61.7 61.7V296c0 17 13.8 30.9 30.9 30.9 17 0 30.9-13.8 30.9-30.9v-92.6C944 135.3 888.7 80 820.6 80zM296 357.7v61.7c0 17 13.8 30.9 30.9 30.9 17 0 30.9-13.8 30.9-30.9v-61.7c0-17-13.8-30.9-30.9-30.9-17.1 0.1-30.9 13.9-30.9 30.9z m432 92.6c17 0 30.9-13.8 30.9-30.9v-61.7c0-17-13.8-30.9-30.9-30.9s-30.9 13.8-30.9 30.9v61.7c0 17.1 13.9 30.9 30.9 30.9zM481.1 604.6c51.1 0 92.6-41.5 92.6-92.6V357.7s-3.6-30.9-30.9-30.9c-24.7 0-30.9 30.9-30.9 30.9V512c0 17-13.8 30.9-30.9 30.9 0 0-30.9 4.2-30.9 30.9 0.2 22.4 31 30.8 31 30.8z m216 30.8c-18.9 0-39.8 30.9-39.8 30.9-31.1 37.4-77.4 61.7-129.9 61.7s-98.8-24.3-129.9-61.7c0 0-20.1-31.4-39.8-30.9-34.8 1-34.9 30.9-34.9 30.9 38.8 73.4 115.8 123.4 204.6 123.4s165.8-50 204.6-123.4c0 0 1-30.9-34.9-30.9z" fill="#5386F6" p-id="8402"></path></svg>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/assets/tongue.svg


+ 66 - 149
src/components/ChineseMedicine.vue

@@ -1143,6 +1143,24 @@ export default {
   },
   mounted() {},
   methods: {
+    async loaded(props) {
+      if (!this.pharmacyTypes.length) await this.customerQuery(props).catch(() => void 0);
+      return this;
+    },
+    _splitDataToView(totalData) {
+      if (!Array.isArray(totalData)) totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
+      const forceUpdate = (data) => Object.assign({}, data);
+      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
+        (item, index) => {
+          return item.id % 2 !== 0;
+        }
+      ).map(forceUpdate);
+      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
+        (item, index) => {
+          return item.id % 2 === 0;
+        }
+      ).map(forceUpdate);
+    },
     // 打开父级安全合理用药监测
     openSafeDrug() {
       this.$parent.opensafeD();
@@ -1209,6 +1227,8 @@ export default {
     },
     // 监听键盘事件
     drugDown(e, scope) {
+      e.stopPropagation();
+      e.preventDefault();
       let index = scope.row.id ? scope.row.id - 1 : 0;
 
       let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
@@ -1233,15 +1253,8 @@ export default {
       // 表格 fixed 时 去 下标 为 1
 
       if (totalData[index].drugList.length > 5) {
-        document.querySelectorAll(
-          `#infiniteList${scope.row.id}`
-        )[1].scrollTop += 36;
-
-        console.log(
-          document.querySelectorAll(`#infiniteList${scope.row.id}`)[1]
-            .scrollTop,
-          "top"
-        );
+        const el = document.querySelectorAll(`#infiniteList${scope.row.id}`)[0];
+        if (el) el.scrollTop += 36;
       }
       this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
       totalData.filter((item, index) => {
@@ -1249,19 +1262,12 @@ export default {
         return (item.id = index + 1);
       });
 
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      );
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      );
+      this._splitDataToView(totalData);
       this.$forceUpdate();
     },
     drugUp(e, scope) {
+      e.stopPropagation();
+      e.preventDefault();
       let index = scope.row.id ? scope.row.id - 1 : 0;
       let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
       // 如果到最后一个 判断是否需要分页
@@ -1271,30 +1277,16 @@ export default {
         totalData[index].search_i -= 1;
       }
 
-      if (
-        document.querySelectorAll(`#infiniteList${scope.row.id}`)[1].scrollTop >
-        0
-      ) {
-        document.querySelectorAll(
-          `#infiniteList${scope.row.id}`
-        )[1].scrollTop -= 36;
-      }
+
+      const el = document.querySelectorAll(`#infiniteList${scope.row.id}`)[0];
+      if (el && el.scrollTop > 0) el.scrollTop -= 36;
       this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
       totalData.filter((item, index) => {
         // this.getSelectType('中药药品用法', index)
         return (item.id = index + 1);
       });
 
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      );
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      );
+      this._splitDataToView(totalData);
     },
     drugEnter(scope) {
       this.chooseDis1(
@@ -1309,16 +1301,7 @@ export default {
 
       this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usage = e;
 
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      );
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      );
+      this._splitDataToView(totalData);
     },
     doseFocus(scope) {
       let width = window.innerWidth;
@@ -1810,17 +1793,7 @@ export default {
         scope.row.id - 1
       ].total = total;
 
-      const forceUpdate = (data) => Object.assign({}, data);
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      ).map(forceUpdate);
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      ).map(forceUpdate);
+      this._splitDataToView(totalData);
 
       if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum) {
         // this.countNowRecipeMoney();
@@ -1905,16 +1878,7 @@ export default {
         return (item.id = index + 1);
       });
 
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      );
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      );
+      this._splitDataToView(totalData);
 
       if (from != "now") return;
       setTimeout(() => {
@@ -1965,16 +1929,7 @@ export default {
 
       this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
 
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      );
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      );
+      this._splitDataToView(totalData);
       if (type != "click") return;
       setTimeout(() => {
         if (
@@ -2017,16 +1972,7 @@ export default {
         // father.getRationalMed(item.medid)
         return (item.id = index + 1);
       });
-      this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
-        (item, index) => {
-          return item.id % 2 != 0;
-        }
-      );
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
-        (item, index) => {
-          return item.id % 2 == 0;
-        }
-      );
+      this._splitDataToView(totalData);
       this.countNowRecipeMoney();
     },
     clickName(scope) {
@@ -2057,10 +2003,6 @@ export default {
       ].search_i = 0;
 
       debounce(this.getTableDrug(scope.row.key, 1, scope.row.id - 1), 10000);
-      setTimeout(() => {
-        // console.log(document.querySelectorAll('#searchD' + scope.row.id));
-        document.querySelectorAll("#searchD" + scope.row.id)[0].focus();
-      }, 800);
     },
     // 输入框获取 药品列表
     searchDrug(e, scope) {
@@ -2077,7 +2019,6 @@ export default {
       let index = scope.row.id ? scope.row.id - 1 : 0;
       // console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD[index], '我是key')
 
-      this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = e;
       let ids = document.querySelectorAll("#operate2");
       ids.forEach((item, index) => {
         item.style["z-index"] = "auto";
@@ -2092,21 +2033,15 @@ export default {
       //     ].showSearch = false
       // }
 
-      this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
-        this.recipe_tabs_c
-      ].totalTableD.filter((item, index) => {
-        return item.id % 2 != 0;
-      });
-      this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
-        this.recipe_tabs_c
-      ].totalTableD.filter((item, index) => {
-        return item.id % 2 == 0;
-      });
+      const totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
+      totalData[index].key = e;
+      totalData[index].search_i = 0;
+      this._splitDataToView(totalData);
       this.index = scope.row.id - 1;
 
       // this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
 
-      debounce(this.getTableDrug(scope.row.key, 1, index), 10000);
+      debounce(this.getTableDrug(e, 1, index), 10000);
     },
     drugFocus(scope) {
       this.medIndex = scope.$index;
@@ -2137,16 +2072,7 @@ export default {
         this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
           item.drugList = [];
         });
-        this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
-          this.recipe_tabs_c
-        ].totalTableD.filter((item, index) => {
-          return item.id % 2 != 0;
-        });
-        this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
-          this.recipe_tabs_c
-        ].totalTableD.filter((item, index) => {
-          return item.id % 2 == 0;
-        });
+        this._splitDataToView();
       }, 500);
     },
     drugBlur1(e, scope) {
@@ -2176,16 +2102,7 @@ export default {
         this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
           item.drugList = [];
         });
-        this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
-          this.recipe_tabs_c
-        ].totalTableD.filter((item, index) => {
-          return item.id % 2 != 0;
-        });
-        this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
-          this.recipe_tabs_c
-        ].totalTableD.filter((item, index) => {
-          return item.id % 2 == 0;
-        });
+        this._splitDataToView();
       }, 500);
     },
     // 合并表一 表二
@@ -2492,7 +2409,7 @@ export default {
       }
     },
     // 选择药房
-    async customerQuery() {
+    async customerQuery(defaultProps = {}) {
       let res = await customerQuery({
         type: 0
       });
@@ -2508,10 +2425,10 @@ export default {
             });
           });
         });
-
+        defaultProps = {...pharmacyTypes[0], ...defaultProps};
         this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.Data[0].pid;
-        this.recipe_tabs[this.recipe_tabs_c].radio = pharmacyTypes[0].ptype;
-        this.recipe_tabs[this.recipe_tabs_c].lastType = pharmacyTypes[0].ptype;
+        this.recipe_tabs[this.recipe_tabs_c].radio = defaultProps.ptype;
+        this.recipe_tabs[this.recipe_tabs_c].lastType = defaultProps.ptype;
         this.pharmacyList = res.Data;
         this.pharmacyTypes = pharmacyTypes;
         this.$forceUpdate();
@@ -2535,6 +2452,7 @@ export default {
 
     // 切换中药类型时 切换 药房 获取 药品里面有没有这条数据
     async changePharmacy(type, val) {
+      // TODO 此处 if 不会调用 触发在 [this.$emit("updateDp", res.Data)](src/components/ChineseMedicine.vue:2831)
       if (this.recipe_tabs[this.recipe_tabs_c].radio == val) {
         this.$parent.openAddress();
         return;
@@ -2584,6 +2502,12 @@ export default {
         this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(
           (item1, index1) => {
             if (item1.name) {
+              const getUsage = (function (list = [], value = '') {
+                if (!Array.isArray(list) || list.length === 0) return void 0;
+                const option = value && list.find(item => item.value === value || item.key == value);
+                return option ? option.key : list[0].key;
+              }).bind(null, this.usageList);
+
               res.Data.forEach((item, index) => {
                 if (item == item1.medid) {
                   item1.color = "red";
@@ -2598,7 +2522,7 @@ export default {
                     spec: item.gg, // 规格
                     dose: item.dose, // 剂量
                     unit: item.dw, // 单位
-                    usage: item.usagestr || item.usage || this.usegeList[0].key, // 用法
+                    usage: item.usagestr || item.usage, // || this.usegeList[0].key, // 用法
                     // usage: "",
                     // price: item.lsjg,
                     price: item.price,
@@ -2612,6 +2536,7 @@ export default {
                     usageList: [],
                     oldDose: item1.oldDose
                   };
+                  /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
 
                   item1.color = "#000";
                 }
@@ -2631,16 +2556,7 @@ export default {
             return (item.id = index + 1);
           }
         );
-        this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
-          this.recipe_tabs_c
-        ].totalTableD.filter((item, index) => {
-          return item.id % 2 != 0;
-        });
-        this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
-          this.recipe_tabs_c
-        ].totalTableD.filter((item, index) => {
-          return item.id % 2 == 0;
-        });
+        this._splitDataToView();
 
         // this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[this.recipe_tabs_c]
         //     .radio // 存储这一次的 药房类型
@@ -2724,22 +2640,23 @@ export default {
               return (item.id = index + 1);
             }
           );
-          this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
-            this.recipe_tabs_c
-          ].totalTableD.filter((item, index) => {
-            return item.id % 2 != 0;
-          });
-          this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
-            this.recipe_tabs_c
-          ].totalTableD.filter((item, index) => {
-            return item.id % 2 == 0;
-          });
+          this._splitDataToView();
         } else {
           this.recipe_tabs[this.recipe_tabs_c].totalTableD[
             index
           ].loadMore = false;
         }
+
+        if (page === 1) {
+          const el = document.querySelectorAll(`#infiniteList${index+1}`)[0];
+          if (el && el.scrollTop > 0) el.scrollTop = 0;
+        }
       }
+      setTimeout(() => {
+        const el = document.querySelectorAll(`#searchD${index+1}`)[0];
+        console.log(el);
+        if (el) el.focus();
+      }, 100);
     },
     // 获取省数据
     async getProver() {

+ 5 - 0
src/components/Propup.vue

@@ -4,6 +4,7 @@
       :visible.sync="showDialog"
       :show-close="false"
       :width="width"
+      :modal="modal"
       :close-on-click-modal="false"
       :top="distanceTop"
       :destroy-on-close="true"
@@ -72,6 +73,10 @@ export default {
       type: Boolean,
       default: true
     },
+    modal: {
+      type: Boolean,
+      default: true
+    },
     destroyOnClose: {
       type: Boolean,
       default: false

+ 0 - 61
src/model/tongue-analysis,model.js

@@ -1,61 +0,0 @@
-/**
- * 解析舌象异常数据
- * @param {{title: string; cover: string; descriptions: string[]; tags: string[];}[]} exception
- * @param {{actualList: Record<string, any>[]}} [data]
- * @return {string}
- */
-function fromReportTongueExceptionData(exception, data) {
-    if (data == null || !Array.isArray(data.actualList)) return '';
-    return data.actualList.map(item => {
-        if (!item) return '';
-        let title = item.actualValue || '';
-        const suffix = item.contrast || 's';
-        if (suffix !== 's') {
-            title += ` (${suffix || ''}) `;
-            exception.push({
-                title, cover: item.splitImage,
-                descriptions: [
-                    item.features ? `【特征】${item.features}` : '',
-                    item.clinicalSignificance ? `【临床意义】${item.clinicalSignificance}` : '',
-                ].filter(Boolean),
-                tags: item.attrs ?? [],
-            });
-        }
-        return title;
-    }).join('<br>');
-}
-
-/**
- * 解析舌面象数据
- * @param {Record<string, any>} data
- */
-export function fromTongueAndFaceAnalysisModel(data) {
-    if (data == null || typeof data !== 'object') data = {};
-    const tongueException = [];
-    const fromTongueException = fromReportTongueExceptionData.bind(null, tongueException);
-    const fromTongueValue = (data) => data && typeof data === 'object' ? data.standardValue || '' : '';
-
-    return {
-        tongueTable: {
-            column: ['舌象维度', '检测结果', '标准值'],
-            data: [
-                ['舌色', fromTongueException(data.tongueColor), fromTongueValue(data.tongueColor)],
-                ['苔色', fromTongueException(data.tongueCoatingColor), fromTongueValue(data.tongueCoatingColor)],
-                ['舌形', fromTongueException(data.tongueShape), fromTongueValue(data.tongueShape)],
-                ['苔质', fromTongueException(data.tongueCoating), fromTongueValue(data.tongueCoating)],
-                ['津液', fromTongueException(data.bodyFluid), fromTongueValue(data.bodyFluid)],
-                ['舌下', fromTongueException(data.sublingualVein), fromTongueValue(data.sublingualVein)],
-            ],
-        },
-        tongueException,
-        tongueAnalysis: {
-            ['结果']: data.tongueAnalysisResult,
-            ['舌上']: data.upImg,
-            ['舌下']: data.downImg,
-        },
-        faceAnalysis: {
-            ['结果']: data.faceAnalysisResult,
-            ['面象']: data.faceImg,
-        },
-    }
-}

+ 159 - 0
src/model/tongue-analysis.model.js

@@ -0,0 +1,159 @@
+/**
+ * @typedef {Object} AnalysisModel
+ * @property {Object} table
+ * @property {string[]} table.columns
+ * @property {Array} table.data
+ * @property {string} table.data.exception
+ * @property {boolean=} table.data.invalid
+ * @property {AnalysisException[]} exception
+ * @property {Array} exceptionGroup
+ * @property {string} exceptionGroup.key
+ * @property {AnalysisException[]} exceptionGroup.exception
+ * @property {string[]} cover
+ * @property {string} result
+ */
+
+/**
+ * @typedef {Object} AnalysisException
+ * @property {string} title
+ * @property {string=} cover
+ * @property {string=} description
+ * @property {Array} descriptions
+ * @property {string} descriptions.label
+ * @property {string} descriptions.value
+ * @property {string[]} tags
+ */
+
+/**
+ * @param {"tongue" | "face"} mode
+ * @param {Object} data
+ * @returns {AnalysisModel | null}
+ */
+export function fromAnalysisModel(mode, data) {
+  if (!data || typeof data !== 'object') return null;
+  let model;
+  switch (mode) {
+    case 'tongue':
+      model = fromTongueAnalysisModel(data);
+      break;
+    case 'face':
+      model = fromFaceAnalysisModel(data);
+      break;
+  }
+  return model;
+}
+
+/**
+ * @param {Object} data
+ * @returns {AnalysisModel}
+ */
+function fromTongueAnalysisModel(data) {
+  const exception = [];
+  const fromTongueException = fromAnalysisException(exception);
+  const c1 = data.upImg || data.tongueImgUrl;
+  const c2 = data.downImg || data.tongueBackImgUrl;
+  return {
+    table: {
+      columns: ['舌象维度', '检测结果', '标准值'],
+      data: [
+        fromTongueException(data.tongueColor, '舌色'),
+        fromTongueException(data.tongueCoatingColor, '苔色'),
+        fromTongueException(data.tongueShape, '舌形'),
+        fromTongueException(data.tongueCoating, '苔质'),
+        fromTongueException(data.bodyFluid, '津液'),
+        fromTongueException(data.sublingualVein, '舌下'),
+      ],
+    },
+    exception,
+    exceptionGroup: [],
+    result: data.tongueAnalysisResult || data.tongue || '',
+    cover: Object.assign([c1, c2].filter(Boolean), {
+      ['舌上']: c1,
+      ['舌下']: c2,
+    }),
+  };
+}
+
+/**
+ * @param {Object} data
+ * @returns {AnalysisModel}
+ */
+function fromFaceAnalysisModel(data) {
+  const exception = [];
+  const fromFaceException = fromAnalysisException(exception, (label, value) => `${label}${value}`);
+  const c1 = data.faceImg || data.faceImgUrl;
+  const c2 = data.faceLeft || data.faceLeftImgUrl;
+  const c3 = data.faceRight || data.faceRightImgUrl;
+  return {
+    table: {
+      columns: ['面象维度', '检测结果', '标准值'],
+      data: [
+        fromFaceException(data.faceColor, '面色'),
+        fromFaceException(data.mainColor, '主色'),
+        fromFaceException(data.shine, '光泽'),
+        fromFaceException(data.leftBlackEye, '左黑眼圈'),
+        fromFaceException(data.rightBlackEye, '右黑眼圈'),
+        fromFaceException(data.lipColor, '唇色'),
+        fromFaceException(data.eyeContact, '眼神'),
+        fromFaceException(data.leftEyeColor, '左目色'),
+        fromFaceException(data.rightEyeColor, '右目色'),
+        fromFaceException(data.hecticCheek, '两颧红'),
+        fromFaceException(data.noseFold, '鼻褶'),
+        fromFaceException(data.cyanGlabella, '眉间/鼻柱青色'),
+        fromFaceException(data.faceSkinDefects, '面部皮损'),
+      ],
+    },
+    exception,
+    exceptionGroup: [],
+    result: data.faceAnalysisResult || data.face || '',
+    cover: Object.assign([c1, c2, c3].filter(Boolean), {
+      ['正面']: c1,
+      ['左面']: c2,
+      ['右面']: c3,
+    }),
+  };
+}
+
+/**
+ * @param {AnalysisException[]} exception
+ * @param {Function=} $title
+ * @returns {Function}
+ */
+function fromAnalysisException(exception, $title = (label, value) => value) {
+  return function (data, label) {
+    if (!data || typeof data !== 'object') data = {actualList: [], standardValue: ''};
+
+    const rowProps = {exception: false, invalid: false};
+
+    const standard = data.standardValue || '';
+    const values = Array.isArray(data.actualList) ? data.actualList.map(item => {
+      const props = {
+        value: item.actualValue || '',
+        exception: null, invalid: false,
+      }
+      const suffix = item.contrast || 's';
+      if (props.value.endsWith('不符合检测要求')) {
+        props.invalid = rowProps.invalid = true;
+      } else if (suffix !== 's') {
+        if (suffix !== 'r') props.value += ` (${suffix || ''}) `;
+        rowProps.exception = true;
+        props.exception = {
+          title: $title(label, props.value),
+          cover: item.splitImage,
+          descriptions: [
+            item.features ? {label: '【特征】', value: item.features} : null,
+            item.clinicalSignificance ? {label: '【临床意义】', value: item.clinicalSignificance} : null,
+          ].filter((v) => !!v),
+          tags: item.attrs || [],
+        }
+        exception.push(props.exception);
+      }
+      return props;
+    }) : [];
+    return Object.assign([
+      [{value: label}],
+      values,
+      [{value: standard}],
+    ], rowProps);
+  };
+}

+ 4 - 3
src/utils/minix/prescribing.js

@@ -59,7 +59,7 @@ export default {
         })
     },
     mounted() {
-        this.isShrink = window.localStorage.getItem('isShrink') == 0 ? false : true
+        this.isShrink = window.sessionStorage.getItem('isShrink') == 1
         this.getMaxMinDoaseNumber()
     },
     methods: {
@@ -87,7 +87,7 @@ export default {
         // 设置收缩模式
         setShrink() {
             this.isShrink = !this.isShrink
-            window.localStorage.setItem('isShrink', this.isShrink ? 1 : 0)
+            window.sessionStorage.setItem('isShrink', this.isShrink ? 1 : 0)
             this.setWidth()
         },
         // 
@@ -99,7 +99,7 @@ export default {
                 document.body.style.width = '1280px'
             }
             if (width < 800) {
-                let isShrink = window.localStorage.getItem('isShrink')
+                let isShrink = window.sessionStorage.getItem('isShrink')
                 isShrink = Number(isShrink)
                 if (!isShrink) {
                     // 扩展状态
@@ -145,6 +145,7 @@ export default {
             this.isShowDj = isShowDj
             this.isShowPs = isShowPs
 
+            if (!this.isShowDj) this.isPs = 1;
             this.openAddress()
 
         },

+ 3 - 2
src/utils/picture.js

@@ -1,4 +1,5 @@
 export function formatPicture(picture) {
-    if (!picture) return [];
-    return picture.split(',').filter(Boolean).map(url => /https?/.test(url) ? url : `${process.env.VUE_APP_UPLOAD}file/${url}`);
+    if (typeof picture === 'string') picture = picture.split(',');
+    if (!picture || !Array.isArray(picture)) return [];
+    return picture.filter(Boolean).map(url => /https?/.test(url) ? url : `${process.env.VUE_APP_UPLOAD}file/${url}`);
 }

+ 269 - 20
src/views/diagnosis/DialecticalQ.vue

@@ -1,8 +1,75 @@
 <template>
   <div class="dialecticalq">
     <div class="flex flex-row-left flex-col-top top-questions">
-      <div class="dialecticalq-left">
+      <div class="dialectical-left" v-if="!isShrink">
+        <!-- 标题信息 -->
+        <div class="pre-title">
+          <div class="flex-vertical-center-l title-container">
+            <span></span>
+            <div>患者信息</div>
+          </div>
+        </div>
+        <div class="patiens-msg" v-if="Object.keys(patiensMsg).length>0">
+          <p v-if="patiensMsg.sex">患者性别:{{patiensMsg.sex}}</p>
+          <p v-if="patiensMsg.age">患者年龄:{{patiensMsg.age}}</p>
+          <p
+              v-if="patiensMsg.isGravidity && patiensMsg.isGravidity=='2'"
+          >是否怀孕:{{patiensMsg.isGravidity=='1'?'否':patiensMsg.isGravidity=='2'?'是':'无'}}</p>
+          <p
+              v-if="patiensMsg.isBreastFeeding && patiensMsg.isBreastFeeding==1"
+          >是否哺乳:{{patiensMsg.isBreastFeeding==1?'是':patiensMsg.isBreastFeeding==2?'否':'无'}}</p>
+        </div>
+        <div class="pre-title mr-t10">
+          <div class="flex-vertical-center-l title-container">
+            <span></span>
+            <div>中医电子病历</div>
+          </div>
+        </div>
+        <div class="patiens-msg" v-if="patiensMsg.outpatientElectronicmedicalrecord">
+          <p v-if="patiensMsg.outpatientElectronicmedicalrecord.chiefcomplaint">
+            <span>主诉:</span>
+            {{patiensMsg.outpatientElectronicmedicalrecord.chiefcomplaint}}
+          </p>
+          <p v-if="patiensMsg.outpatientElectronicmedicalrecord.historypresent">
+            <span>现病史:</span>
+            {{patiensMsg.outpatientElectronicmedicalrecord.historypresent}}
+          </p>
+          <p v-if="patiensMsg.outpatientElectronicmedicalrecord.pasthistory">
+            <span>既往史:</span>
+            {{patiensMsg.outpatientElectronicmedicalrecord.pasthistory}}
+          </p>
+          <p v-if="patiensMsg.outpatientElectronicmedicalrecord.fourmedicine">
+            <span>中医四诊:</span>
+            {{patiensMsg.outpatientElectronicmedicalrecord.fourmedicine}}
+          </p>
+          <p v-if="patiensMsg.outpatientElectronicmedicalrecord.physicalexamination">
+            <span>体格检查:</span>
+            {{patiensMsg.outpatientElectronicmedicalrecord.physicalexamination}}
+          </p>
+          <p v-if="patiensMsg.outpatientElectronicmedicalrecord.supplementaryexamination">
+            <span>辅助检查:</span>
+            {{patiensMsg.outpatientElectronicmedicalrecord.supplementaryexamination}}
+          </p>
+          <div v-if="patiensMsg.outpatientElectronicmedicalrecord.image1.length>0">
+            <div style="margin: 4px 0 8px;">报告上传:</div>
+            <el-image
+                :preview-src-list="patiensMsg.outpatientElectronicmedicalrecord.image1"
+                :src="item"
+                :key="index"
+                style="width:64px;height: 64px;margin-right: 10px;"
+                alt
+                v-for="(item,index) in patiensMsg.outpatientElectronicmedicalrecord.image1"
+            />
+          </div>
+        </div>
+      </div>
+      <div class="dialectical-center">
         <div class="now-title">
+          <!-- 扩展icon -->
+          <div class="kz-icon" @click="setShrink">
+            <i class="el-icon-d-arrow-right" v-if="!isShrink"></i>
+            <i class="el-icon-d-arrow-left" v-if="isShrink"></i>
+          </div>
           当前疾病:
           <span>{{info.groupname}}</span>
         </div>
@@ -139,21 +206,30 @@
       <el-button type="primary" @click="submit" size="small" v-if="pageType!=3">推导</el-button>
       <el-button type="primary" @click="submit" size="small" v-if="pageType==3">自动生成病历</el-button>
     </div>
+
+    <Emr ref="emr" v-if="hack__show_EMR" style="display: none"></Emr>
   </div>
 </template>
 <script>
 import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
 import { getDialecticalq, submitDialetQ } from "@/api/knowledge.js";
 import {
+  getPatiensBasisM,
   addDiagnosisData,
   znQuestionSave,
   znQusetionShow
 } from "@/api/diagnosis.js";
 import { addRecipeFrom } from "@/api/dataAnalysis.js";
 import { setTimeout } from "timers";
+import Emr from "@/views/diagnosis/Emr.vue";
+import {formatPicture} from "@/utils/picture";
 export default {
+  components: {Emr},
   data() {
     return {
+      hack__show_EMR: false,
+      isShrink: false, // 是否是收缩状态
+      patiensMsg: {}, // 患者信息
       year: "",
       month: "",
       day: "",
@@ -196,6 +272,13 @@ export default {
         this._znQusetionShow();
       }, 500);
     }
+
+    if (this.getPatiensInfo.pid) {
+      this.getPatiensBasisM();
+    }
+  },
+  mounted() {
+    this.isShrink = window.sessionStorage.getItem('dia_isShrink') == 1
   },
   beforeRouteLeave(to, from, next) {
     if (this.isEdit) {
@@ -215,6 +298,30 @@ export default {
     }
   },
   methods: {
+    // 设置收缩模式
+    setShrink() {
+      this.isShrink = !this.isShrink
+      window.sessionStorage.setItem('dia_isShrink', this.isShrink ? 1 : 0)
+    },
+    // 获取病人 左侧信息
+    async getPatiensBasisM() {
+      let res = await getPatiensBasisM({
+        patientId: this.getPatiensInfo.pid
+      });
+      if (res.ResultCode == 0) {
+        this.agree_key1 = res.Data.maindiagnosis
+          ? res.Data.maindiagnosis.namemedicine
+            ? res.Data.maindiagnosis.namemedicine
+            : ""
+          : "";
+        res.Data.secondarydiagnosis = res.Data.secondarydiagnosis
+          ? res.Data.secondarydiagnosis
+          : [];
+        this.patiensMsg = res.Data;
+
+        this.patiensMsg.outpatientElectronicmedicalrecord.image1 = formatPicture(this.patiensMsg.outpatientElectronicmedicalrecord.image1);
+      }
+    },
     // 返回
     backPage() {
       // this.$router.go(-1)
@@ -275,14 +382,16 @@ export default {
       let arr = [];
       let arr1 = [];
 
-      this.info.asks.forEach(item1 => {
-        item1.answers.forEach(item2 => {
-          if (item2.checked) {
-            arr.push(item2);
-            arr1.push(item1.askname);
-          }
+      try {
+        this.info.asks.forEach(item1 => {
+          item1.answers.forEach(item2 => {
+            if (item2.checked) {
+              arr.push(item2);
+              arr1.push(item1.askname);
+            }
+          });
         });
-      });
+      } catch (e) {}
       let set = new Set(arr1);
 
       let arr2 = Array.from(set);
@@ -342,13 +451,11 @@ export default {
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)"
       });
-      let res = await submitDialetQ(params).catch(err => {
-        loading.close();
-      });
-
-      if (res.ResultCode == 0) {
+      let res = await submitDialetQ(params).catch(err => {});
+      if (res && res.ResultCode == 0) {
         this.addRecipeFrom();
         if (this.pageType != 3) {
+          await this.hackLoadEMR();
           this.addDiagnosisData(res.Data, loading);
           this._znQuestionSave(null);
         } else {
@@ -363,6 +470,7 @@ export default {
           return;
         }
       }
+      loading.close();
     },
     // 提交中医诊断
     async addDiagnosisData(obj, loading) {
@@ -454,13 +562,15 @@ export default {
 
         // this.form.checkList1 = res.Data.itemids.split(',')
         let ids = res.Data.itemids.split(",");
-        this.info.asks.forEach(item1 => {
-          item1.answers.forEach(item2 => {
-            if (ids.indexOf(item2.answered) != -1) {
-              item2.checked = true;
-            }
+        try {
+          this.info.asks.forEach(item1 => {
+            item1.answers.forEach(item2 => {
+              if (ids.indexOf(item2.answered) != -1) {
+                item2.checked = true;
+              }
+            });
           });
-        });
+        } catch (e) { }
 
         this.answerClick();
         setTimeout(() => {
@@ -469,6 +579,19 @@ export default {
       } else {
         this.$message.error(res.ResultInfo);
       }
+    },
+
+    async hackLoadEMR() {
+      this.hack__show_EMR = true;
+      const event = (type) => new Promise((resolve) => this.$nextTick(() => {
+        this.$refs.emr.$on(type, (payload) => resolve({ref: this.$refs.emr, payload}));
+      }))
+
+      let { ref } = await event('hack_loaded');
+      ref.isSkip = false;
+      ref.submit(null);
+      await event('hack_save');
+      this.hack__show_EMR = false;
     }
   },
   computed: {
@@ -486,7 +609,7 @@ export default {
 .dialecticalq {
   height: 100%;
 
-  .dialecticalq-left {
+  .dialectical-center {
     flex: 1;
     height: 100%;
     min-height: 420px;
@@ -497,6 +620,7 @@ export default {
     box-sizing: border-box;
 
     .now-title {
+      display: flex;
       font-size: 18px;
       font-family: PingFang SC;
       font-weight: 400;
@@ -595,6 +719,131 @@ export default {
     }
   }
 
+  .kz-icon {
+    margin-right: 8px;
+  }
+
+  .dialectical-left {
+    height: 100%;
+    width: 200px;
+    padding: 10px 12px;
+    background: #fff;
+    box-sizing: border-box;
+    margin-right: 20px;
+    overflow-y: auto;
+
+    .patiens-msg {
+      font-size: 14px;
+      font-family: PingFang SC;
+      font-weight: 400;
+      color: #333333;
+
+      h4 {
+        font-size: 16px;
+        font-family: PingFang SC;
+        font-weight: 500;
+        color: #333333;
+        margin-bottom: 5px;
+      }
+
+      p {
+        span {
+          display: inline-block;
+          width: 70px;
+          text-align: right;
+        }
+
+        margin-bottom: 5px;
+      }
+    }
+
+    .pre-steps {
+      .find-more {
+        cursor: pointer;
+
+        img {
+          width: 12px;
+        }
+
+        span {
+          font-size: 12px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #ffae45;
+          margin-left: 7px;
+        }
+      }
+
+      .icon {
+        width: 22px;
+      }
+
+      .step-body:hover {
+        background: #d8d8d8;
+      }
+
+      .step-name {
+        font-size: 14px;
+        font-family: PingFang SC;
+        font-weight: 400;
+        color: #333333;
+        cursor: pointer;
+      }
+    }
+
+    .pre-title {
+      margin-bottom: 10px;
+
+      .title-container {
+        span {
+          width: 3px;
+          height: 14px;
+          background: #5386f6;
+          border-radius: 1px;
+          display: inline-block;
+        }
+
+        div {
+          font-size: 18px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #5386f6;
+          margin-left: 9px;
+        }
+      }
+
+      .patiens-msg {
+        font-size: 14px;
+        font-family: PingFang SC;
+        font-weight: 400;
+        color: #333333;
+
+        .p {
+          margin-bottom: 5px;
+          cursor: default;
+
+          .patiens-name {
+            color: #5386f6;
+            font-weight: bold;
+            font-size: 16px;
+          }
+
+          .patiens-desc {
+            display: inline-block;
+
+            .matname {
+              color: #5386f6;
+            }
+          }
+
+          .patiens-cate {
+            font-weight: bold;
+          }
+        }
+      }
+    }
+  }
+
   .dialectical-right {
     height: 100%;
     min-height: 420px;

+ 9 - 12
src/views/diagnosis/Emr.vue

@@ -63,6 +63,7 @@ export default {
   },
   data() {
     return {
+      isSkip: true,
       isEdit: false, // 是否修改
       activeId: "",
       pid: "",
@@ -294,7 +295,6 @@ export default {
           }
         }
       });
-
       if (isReq) {
         this.$message.warning("请完成必填项填写");
         this.setActiveID(this.activeId);
@@ -712,13 +712,10 @@ export default {
         background: "rgba(0, 0, 0, 0.7)"
       });
 
-      let res = await addEMR(params).catch(err => {
-        loading.close();
-      });
-
+      let res = await addEMR(params).catch(err => {});
+      loading.close();
+      if (!this.isSkip) return this.$emit("hack_save", res);
       if (res.ResultCode == 0) {
-        loading.close();
-
         this.$message({
           type: "success",
           message: "保存成功",
@@ -842,6 +839,8 @@ export default {
           console.log(this.$refs.edit.imageUrl, "图片地址");
         }, 1000);
       }
+
+      this.$emit('hack_loaded')
     },
     // 修改 中医电子病历
     async editEMR(next = null) {
@@ -868,13 +867,11 @@ export default {
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)"
       });
-      let res = await editEMR(params).catch(err => {
-        loading.close();
-      });
+      let res = await editEMR(params).catch(err => {});
+      loading.close();
+      if (!this.isSkip) return this.$emit("hack_save", res);
 
       if (res.ResultCode == 0) {
-        loading.close();
-
         this.$message({
           type: "success",
           message: "保存成功",

+ 75 - 95
src/views/diagnosis/Prescribing.vue

@@ -317,7 +317,7 @@
         <!-- 右侧按钮 -->
         <div class="flex-vertical-center-r flex-wrap">
           <el-button size="mini" @click="openUnifyPrescPrec" type="primary">统建处方</el-button>
-          <el-button size="mini" :loading="tongueAndFaceLoading" :disabled="!tongueAndFaceAnalysis" @click="openTongueAndFaceAnalysis" type="primary">舌象分析</el-button>
+          <el-button size="mini" :loading="tongueAndFaceLoading" :disabled="!tongueAndFaceAnalysis" @click="openTongueAndFaceAnalysis" type="primary">萧山区中医健康微管家</el-button>
           <el-button
             size="mini"
             type="primary"
@@ -1078,13 +1078,13 @@
     <Popup
         :showDialog="showTongueAnalysis"
         @cancle="showTongueAnalysis=false"
-        title="分析详情"
+        title="萧山区中医健康微管家"
         :showBtns="false"
-        width="700px"
+        width="70%"
         distanceTop="5vh"
     >
-      <div slot="body">
-        <TongueAnalysis :dataset="tongueAndFaceAnalysis"></TongueAnalysis>
+      <div style="height: 100%" slot="body">
+        <TongueAnalysis v-if="showTongueAnalysis" :dataset="tongueAndFaceAnalysis"></TongueAnalysis>
       </div>
     </Popup>
 
@@ -1146,7 +1146,7 @@ import medAdress from "./components/medAddress.vue";
 import medAdressNew from "./components/medAddressNew.vue";
 import {
   getPatiensBasisM,
-  getTongueAndFaceAnalysis,
+  getTongueAndFaceAnalysisRecords,
   addRecipe,
   getRecipeShowData,
   getRecipeDataByid,
@@ -1375,25 +1375,7 @@ export default {
     }
   },
   mounted() {
-    this._getPreNumber();
-    setTimeout(() => {
-      this.inferRecipe(4, "1");
-      this.inferRecipe(4, "3");
-    }, 1000);
-
-    return;
-    if (this.$route.query.recipeID) {
-      this.getRecipeDataByid(this.$route.query.recipeID);
-    } else if (this.$route.query.doctorCase) {
-      setTimeout(() => {
-        this.changeAndJoin();
-      }, 1000);
-    } else if (this.$route.query.type == "tuidao") {
-      this.isTuiDaoZy = true;
-      this.inferRecipe();
-    } else {
-      this.getRecipeShowData();
-    }
+    this._processRouteQuery();
   },
   beforeRouteLeave(to, from, next) {
     if (to.path == "/index/recipe") {
@@ -1414,6 +1396,37 @@ export default {
     }
   },
   methods: {
+    // 处理路由参数
+   async _processRouteQuery() {
+      const query = this.$route.query || {};
+      // 暂存处方数据(不含药品)
+      if (sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)) await this._showDataFromStorage(true);
+
+      // 名医名方 —> 方剂查询
+      if (query.recipeID && query.kjType === "kj-fj") await this.getPreDetal(query.recipeID);
+      // 名医名方 —> 名医医案
+      else if (query.doctorCase) await this.changeAndJoin();
+      // 中医诊疗 -> 智能辩证
+      else if (query.type === "tuidao") {
+        await Promise.all([
+          this.inferRecipe(4, "1"),
+          this.inferRecipe(4, "3"),
+          this.inferRecipe(),
+        ])
+        this.isTuiDaoZy = true;
+      }
+      // 处方编辑 recipeType
+      else if (this.getEditPreNo()) await this.getRecipeDataByid(this.getEditPreNo());
+      // 暂存处方
+      else if (sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)) await this._showDataFromStorage();
+      // 历史处方
+      else {
+        // 跟据就诊记录id获取处方号
+        let res = await getPreNumber({pid: this.getPatiensInfo.pid}).catch(() => void 0);
+        const has = res && res.ResultCode == 0 && res.Data.length > 0;
+        if (has) await this.getRecipeShowData();
+      }
+   },
     // 参考医案
     // 中医诊断推导点击
     tcmClick(isauto = true) {
@@ -1505,7 +1518,7 @@ export default {
       // getPatiensInfo
     },
     // 展示系统缓存数据
-    _showDataFromStorage() {
+    async _showDataFromStorage(ignoreTable = false) {
       let storageData = JSON.parse(
         sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)
       );
@@ -1520,6 +1533,8 @@ export default {
       let child2 = children[1];
       let child3 = children[2];
 
+      if (typeof child1.loaded === 'function') await child1.loaded(storageData.child1);
+
       if (storageData.child1.recipe_tabs[0].totalTableD.length > 1) {
         this.isTuiDaoZy = true;
       }
@@ -1528,14 +1543,24 @@ export default {
         this.isTuiDaoZy = true;
       }
 
+      if (ignoreTable) {
+        for (const recipe of storageData.child1.recipe_tabs) {
+          recipe.tableData = [];
+          recipe.tableData1 = [];
+          recipe.totalTableD = [];
+        }
+        storageData.child2.tableData3 = [];
+        storageData.child3.tableData4 = [];
+      }
+
       this.container_i = storageData.container_i;
       child1.recipe_tabs = storageData.child1.recipe_tabs;
       child1.recipe_tabs_c = storageData.child1.recipe_tabs_c;
-      child1.getSelectType("剂型", 0);
-      child1.getSelectType("处方用法");
-      child1.getSelectType("中药服药时间");
-      child1.getSelectType("中药频次");
-      child1.getPharmacyID();
+      // child1.getSelectType("剂型", 0);
+      // child1.getSelectType("处方用法");
+      // child1.getSelectType("中药服药时间");
+      // child1.getSelectType("中药频次");
+      // child1.getPharmacyID();
       child2.tableData3 = storageData.child2.tableData3;
       child2.bottom_form = storageData.child2.bottom_form;
 
@@ -3017,52 +3042,6 @@ export default {
       this.setDrugsInfo(this.preInfo.items);
       this.changeAndJoin(1);
     },
-    // 跟据就诊记录id获取处方号
-    async _getPreNumber() {
-      let res = await getPreNumber({
-        pid: this.getPatiensInfo.pid
-      });
-      if (res.ResultCode == 0) {
-        setTimeout(() => {
-          this.inferRecipe();
-        }, 800);
-        if (res.Data.length == 0) {
-          // 没有处方号
-          let hasStorage = sessionStorage.getItem(
-            "prescr" + this.getPatiensInfo.pid
-          )
-            ? true
-            : false;
-          if (hasStorage) {
-            this._showDataFromStorage();
-          }
-
-          const recipeID = this.getEditPreNo();
-
-          if (!!recipeID) {
-            if (this.$route.query.kjType) {
-              if (this.$route.query.kjType == "kj-fj") {
-                this.getPreDetal(recipeID);
-              }
-            } else {
-              this.getRecipeDataByid(recipeID);
-            }
-          } else if (this.$route.query.doctorCase) {
-            setTimeout(() => {
-              this.changeAndJoin();
-            }, 1000);
-          } else if (this.$route.query.type == "tuidao") {
-            this.isTuiDaoZy = true;
-            // setTimeout(() => {
-            //   this.inferRecipe()
-            // }, 800)
-          }
-        } else {
-          // 有处方号
-          this.getRecipeShowData();
-        }
-      }
-    },
     // 药方是否支付
     async _recipeIsPay(id, type, index) {
       let res = await recipeIsPay({
@@ -3174,12 +3153,12 @@ export default {
     async getPatientBasisTongueAndFaceAnalysis() {
       this.tongueAndFaceLoading = true;
       try {
-        let res = await getTongueAndFaceAnalysis({
-          recordsId: this.getPatiensInfo ? this.getPatiensInfo.pid : ""
-          // recordsId: '8ed63872-6d1f-4fe6-b170-4d36e677a744',
-        });
-        this.tongueAndFaceAnalysis = res.Data && (res.Data.tongueAnalysis.结果 || res.Data.faceAnalysis.结果) ? res.Data : null;
-      } catch (e) {}
+        const get = getTongueAndFaceAnalysisRecords.bind(null, this.getPatiensInfo ? this.getPatiensInfo.pid : "")
+        let result = await get(1, 3);
+        this.tongueAndFaceAnalysis = result.total > 0 ? {...result, get} : null;
+      } catch (e) {
+        this.$message.error(e.ResultInfo);
+      }
       this.tongueAndFaceLoading = false;
     },
     // 获取处方预览数据
@@ -3233,7 +3212,7 @@ export default {
         if (!res.Data.flag) {
           loading.close();
           if (this.getPatiensInfo.pid) {
-            this.getPatiensBasisM();
+            await this.getPatiensBasisM();
           }
           return;
         }
@@ -3273,12 +3252,6 @@ export default {
         if (this.getPatiensInfo.pid) {
           this.getPatiensBasisM();
         }
-
-        if (this.$route.query.doctorCase) {
-          setTimeout(() => {
-            this.changeAndJoin();
-          }, 1000);
-        }
       }
     },
 
@@ -3908,6 +3881,12 @@ export default {
       if (this.container_i == 0) {
         // 中药处方
         if (res.ResultCode == 0) {
+          const getUsage = (function (list = [], value = '') {
+            if (!Array.isArray(list) || list.length === 0) return void 0;
+            const option = value && list.find(item => item.value === value || item.key == value);
+            return option ? option.key : list[0].key;
+          }).bind(null, child.usageList);
+
           let noDrugs = []; // 查找不到的药品
           let hasDrugs = []; // 查找的到的药品
           res.Data.forEach((item, index) => {
@@ -3931,15 +3910,14 @@ export default {
                   pid: item1.matid,
                   color: "red",
                   dose: item1.dose,
-                  useage:
-                    item1.useage || item1.usagestr || child.usegeList[0].key,
+                  usage: item1.useage || item1.usagestr, // child.usegeList[0].key,
                   showSearch: false,
                   matid: item1.matid,
 
                   key: "",
                   search_i: index
                 };
-
+                /* 修正 */ obj.usage = obj.useage = getUsage(obj.usage);
                 noDrugs.push(obj);
                 // noDrugs.push(item1.matname)
               }
@@ -3966,7 +3944,7 @@ export default {
                 dose: item.dose, // 剂量
                 unit: item.dw, // 单位
                 // usage: item.usagestr, // 用法
-                usage: item.useage || item.usagestr || child.usegeList[0].key,
+                usage: item.useage || item.usagestr, // child.usegeList[0].key,
                 // price: item.lsjg,
                 price: item.price ? item.price : 0,
                 total: item.price * item.dose,
@@ -3978,6 +3956,7 @@ export default {
                 showSearch: false,
                 color: item.color ? item.color : "#000"
               };
+              /* 修正 */ obj1.usage = obj1.useage = getUsage(obj1.usage);
 
               child.recipe_tabs[child.recipe_tabs_c].totalTableD.push(obj1);
               child.getSelectType("中药药品用法", index);
@@ -4051,7 +4030,7 @@ export default {
                 dose: item.dose, // 剂量
                 unit: item.dw, // 单位
                 // usage: item.usagestr, // 用法
-                usage: item.useage || child.usegeList[0].key,
+                usage: item.useage || item.usagestr, // child.usegeList[0].key,
                 // price: item.lsjg,
                 price: item.price ? item.price : 0,
                 total: item.price * item.dose,
@@ -4062,6 +4041,7 @@ export default {
                 originname: item.cdmc, // 产地名称
                 showSearch: false
               };
+              /* 修正 */ obj1.usage = obj1.useage = getUsage(obj1.usage);
 
               child.recipe_tabs[child.recipe_tabs_c].totalTableD.push(obj1);
               child.getSelectType("中药药品用法", index);

+ 7 - 7
src/views/diagnosis/components/prescription.vue

@@ -25,20 +25,20 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="共享状态" v-if="activeName==2">
+        <!--<el-form-item label="共享状态" v-if="activeName==2">
           <el-select v-model="form.share" placeholder="请选择" size="small">
-            <!-- <el-option
+            &lt;!&ndash; <el-option
               :label="item.name"
               :value="item.pid"
               v-for="(item,index) in shareSelect"
               :key="index"
-            ></el-option>-->
+            ></el-option>&ndash;&gt;
             <el-option label="个人" :value="0"></el-option>
             <el-option label="二级科室" :value="1"></el-option>
             <el-option label="科室" :value="2"></el-option>
             <el-option label="本院" :value="3"></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item>-->
       </el-form>
       <el-button size="small" type="primary" @click="searchDis">搜索</el-button>
       <el-button size="small" type="warning" @click="clearDis">清空</el-button>
@@ -106,7 +106,7 @@ export default {
       form: {
         name: "", // 方名
         type: "", // 类型
-        share: "" // 共享状态
+        share: 0 // 共享状态
       },
       shareSelect: [],
       types: [],
@@ -137,7 +137,7 @@ export default {
       this.form = {
         name: "", // 方名
         type: "", // 类型
-        share: "" // 共享状态
+        share: 0 // 共享状态
       };
       if (this.activeName == 1) {
         this.getPrescriptionsList();
@@ -167,7 +167,7 @@ export default {
       this.form = {
         name: "", // 方名
         type: "", // 类型
-        share: "" // 共享状态
+        share: 0 // 共享状态
       };
       if (this.activeName == 1) {
         // this.form.name = this.$parent.$parent.$parent.agree_key;

+ 275 - 124
src/views/diagnosis/components/tongue-analysis.vue

@@ -1,80 +1,139 @@
 <template>
-  <!-- 舌象分析详情 -->
-  <div class="tongue-analysis">
-    <template v-if="dataset && (dataset.tongueAnalysis.结果 || dataset.faceAnalysis.结果)">
-      <template v-if="dataset.tongueAnalysis && dataset.tongueAnalysis.结果">
-        <el-card class="tongue-exception-wrapper" v-if="showException">
-          <div slot="header" class="card-header-container">
-            <span>异常舌象分析</span>
-            <el-button size="small" type="primary" plain style="float: right;" @click="showException=false">
-              舌象分析
-            </el-button>
-          </div>
-          <div class="card-body-container">
-            <el-card v-for="item in dataset.tongueException" :key="item.title" class="inner" size="small">
-              <div class="card__title">{{ item.title }}</div>
-              <div class="card__content">
-                <div style="display: flex;">
-                  <el-image :src="item.cover" lazy fit="scale-down" :preview-src-list="[item.cover]"></el-image>
-                  <div>
-                    <el-tag v-for="value in item.tags" :key="value" type="danger">{{ value }}</el-tag>
-                  </div>
-                </div>
-                <p class="my-2 text-grey" v-for="value in item.descriptions" :key="value">{{ value }}</p>
-              </div>
-            </el-card>
-          </div>
-        </el-card>
-        <el-card v-else>
-          <div slot="header" class="card-header-container">
-            <span>舌象分析</span>
-            <el-button
-                v-if="dataset.tongueException && dataset.tongueException.length"
-                size="small" type="danger" plain style="float: right;" @click="showException=true">
-              异常舌象分析
-            </el-button>
-          </div>
-          <div class="card-body-container">
-            <el-table v-if="dataset.tongueTable" class="result-wrapper" :data="dataset.tongueTable.data" border
-                      size="small">
-              <el-table-column
-                  v-for="(col, index) in dataset.tongueTable.column" :key="col"
-                  :prop="index + ''" :label="col" align="center"
-              >
-                <template v-slot="{row, column}">
-                  <div v-html="row[index]"></div>
-                </template>
-              </el-table-column>
-            </el-table>
-            <div v-else class="result-wrapper">{{ dataset.tongueAnalysis.结果 }}</div>
-            <div class="picture-wrapper">
-              <el-image :src="dataset.tongueAnalysis.舌上" lazy fit="scale-down"
-                        :preview-src-list="preview"></el-image>
-              <el-image :src="dataset.tongueAnalysis.舌下" lazy fit="scale-down"
-                        :preview-src-list="preview"></el-image>
+  <!-- 舌象分析记录 -->
+  <div class="tongue-analysis-wrapper" :style="cssVars">
+    <el-tabs ref="tab" type="card">
+      <el-tab-pane v-for="(pane, index) in list" :key="pane.id" :label="pane.time">
+        <div class="area" v-if="pane.tongue.result">
+          <div class="analysis-image">
+            <div>
+              <img src="../../../assets/tongue.svg" alt="">
+              <el-popover title="分析结果" :content="pane.tongue.result" width="200">
+                <span slot="reference" style="cursor: pointer;">舌象分析结果</span>
+              </el-popover>
             </div>
+            <el-image v-for="item in pane.tongue.cover" :src="item" :preview-src-list="pane.cover"></el-image>
           </div>
-        </el-card>
-      </template>
-      <el-card v-if="dataset.faceAnalysis && dataset.faceAnalysis.结果">
-        <div slot="header" class="card-header-container">
-          <span>面象分析</span>
+          <table>
+            <thead>
+            <tr>
+              <th v-for="(value, i) in pane.tongue.table.columns" :key="i" v-html="value"></th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr v-for="(item, i) in pane.tongue.table.data" :key="i"
+                :data-exception="item.exception"
+                :data-invalid="item.invalid"
+            >
+              <td v-for="(col, i) in item" :key="i">
+                <div style="margin: 2px 0;" v-for="item in col" :key="item.value">
+                  <el-popover v-if="item.exception" :title="item.exception.title"
+                              trigger="hover"
+                              popper-class="analysis-exception-popover">
+                    <div class="card__content">
+                      <div style="margin-bottom: 10px;">
+                        <img v-if="item.exception.cover" class="flex-none w-2/4 object-scale-down"
+                             :src="item.exception.cover" alt="分析异常图像"/>
+                        <el-tag style="margin-top: 2px;margin-right: 2px;" type="danger"
+                                v-for="value in item.exception.tags" :key="value">{{ value }}
+                        </el-tag>
+                      </div>
+                      <div style="margin-top: 4px;" v-for="description in item.exception.descriptions"
+                           :key="description.value">
+                        <label>{{ description.label }}</label>
+                        <span v-html="description.value"></span>
+                      </div>
+                    </div>
+                    <span slot="reference" style="cursor: pointer; color: #f87171;">{{ item.value }}</span>
+                  </el-popover>
+                  <template v-else>{{ item.value }}</template>
+                </div>
+              </td>
+            </tr>
+            </tbody>
+          </table>
         </div>
-        <div class="card-body-container">
-          <div class="result-wrapper">{{ dataset.faceAnalysis.结果 }}</div>
-          <div class="picture-wrapper">
-            <el-image :src="dataset.faceAnalysis.面象" lazy fit="scale-down" :preview-src-list="preview"></el-image>
+        <div class="area" v-if="pane.face.result">
+          <div class="analysis-image">
+            <div>
+              <img src="../../../assets/face.svg" alt="">
+              <el-popover title="分析结果" :content="pane.face.result" width="200">
+                <span slot="reference" style="cursor: pointer;">面象分析结果</span>
+              </el-popover>
+            </div>
+            <el-image v-for="item in pane.face.cover" :src="item" :preview-src-list="pane.cover"></el-image>
+            <div></div>
           </div>
+          <table>
+            <thead>
+            <tr>
+              <th v-for="(value, i) in pane.face.table.columns" :key="i" v-html="value"></th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr v-for="(item, i) in pane.face.table.data" :key="i"
+                :data-exception="item.exception"
+                :data-invalid="item.invalid"
+            >
+              <td v-for="(col, i) in item" :key="i">
+                <div style="margin: 2px 0;" v-for="item in col" :key="item.value">
+                  <el-popover v-if="item.exception" :title="item.exception.title"
+                              trigger="hover"
+                              popper-class="analysis-exception-popover">
+                    <div class="card__content">
+                      <div style="margin-bottom: 10px;">
+                        <img v-if="item.exception.cover" class="flex-none w-2/4 object-scale-down"
+                             :src="item.exception.cover" alt="分析异常图像"/>
+                        <div>
+                          <el-tag type="danger" v-for="value in item.exception.tags" :key="value">{{ value }}</el-tag>
+                        </div>
+                      </div>
+                      <div style="margin-top: 4px;" v-for="description in item.exception.descriptions"
+                           :key="description.value">
+                        <label>{{ description.label }}</label>
+                        <span v-html="description.value"></span>
+                      </div>
+                    </div>
+                    <span slot="reference" style="cursor: pointer; color: #f87171;">{{ item.value }}</span>
+                  </el-popover>
+                  <template v-else>{{ item.value }}</template>
+                </div>
+              </td>
+            </tr>
+            </tbody>
+          </table>
         </div>
-      </el-card>
-    </template>
-    <el-empty v-else-if="!loading" description="暂无数据"></el-empty>
+        <el-button style="width: 100%;" type="primary"
+                   :loading="pane.id === caseId" :disabled="!!caseId && caseId !== pane.id"
+                   @click="handle(pane.id)">查看病历详情信息
+        </el-button>
+      </el-tab-pane>
+    </el-tabs>
+    <Popup
+        :showDialog="showCase"
+        @cancle="closeCase"
+        :showBtns="false"
+        width="70%"
+        distanceTop="5vh"
+        :destroyOnClose="true"
+        title=""
+        :modal="false"
+    >
+      <div style="height: 100%" slot="body">
+        <outpatientRecord :info="caseItem"></outpatientRecord>
+      </div>
+    </Popup>
   </div>
 </template>
 <script>
-import {getTongueAndFaceAnalysis} from "@/api/diagnosis.js";
+
+import {getRecordDetail} from "@/api/diagnosis";
+import outpatientRecord from "@/components/ui/outpatientRecords.vue";
+import Popup from "@/components/Propup.vue";
+
+let _keydown_
 
 export default {
+  components: {Popup, outpatientRecord},
   props: {
     dataset: {
       type: Object,
@@ -83,97 +142,189 @@ export default {
   },
   data() {
     return {
-      showException: false
+      page: 1,
+      limit: 3,
+      list: [],
+
+      cardProps: {width: 0},
+
+      caseId: '',
+      caseItem: null,
+      showCase: false,
     };
   },
   computed: {
-    preview: function () {
-      return [
-        this.dataset.tongueAnalysis.舌上,
-        this.dataset.tongueAnalysis.舌下,
-        this.dataset.faceAnalysis.面象,
-      ].filter(Boolean);
+    cssVars() {
+      return {
+        '--w': `${this.cardProps.width}px`,
+      }
+    }
+  },
+  methods: {
+    async load(length) {
+      const {data} = await this.dataset.get(this.page, length);
+      this.list = data;
+    },
+
+    async handle(id) {
+      this.caseId = id;
+      const res = await getRecordDetail({id}).catch(() => {});
+      if (res.ResultCode == 0) {
+        this.caseItem = res.Data;
+        this.showCase = true;
+        const fn = (event) => {
+          event.stopPropagation();
+          event.preventDefault();
+          this.closeCase();
+        };
+        document.addEventListener('keydown', fn, {once: true});
+        _keydown_ = () => document.removeEventListener('keydown', fn);
+      } else {
+        this.$message.error(res.ResultInfo);
+      }
+    },
+    // 关闭就诊 详情
+    closeCase() {
+      this.showCase = false;
+      this.caseId = '';
+      this.caseItem = null;
+      if (typeof _keydown_ === 'function') _keydown_();
+    },
+    _followScroll() {
+      const nav = this.$refs.tab.$el.querySelector(`.el-tabs__nav`);
+      const content = this.$refs.tab.$el.querySelector(`.el-tabs__content`);
+
+      this.cardProps.observer = new MutationObserver(mutations => {
+        try { content.style.transform = mutations[0].target.style.transform; } catch (e) { }
+      })
+      this.cardProps.observer.observe(nav, {attributes: true});
+    }
+  },
+  beforeMount() {
+    if (this.dataset) {
+      this.list = this.dataset.data;
+      this.load(this.dataset.total || this.limit);
     }
   },
+  mounted() {
+    const rect = this.$el.parentElement.getBoundingClientRect();
+    const width = Math.max(Math.floor(rect.width / 3), 250);
+    this.$set(this.cardProps, 'width', width);
+
+    this._followScroll();
+  },
+  unmount() {
+    if (this.cardProps.observer) this.cardProps.observer.disconnect();
+  }
 };
 </script>
 <style lang="scss" scoped>
-.tongue-analysis {
-  .el-card:not(.inner) {
-    margin: 24px 0;
+.tongue-analysis-wrapper {
+  height: 100%;
+  overflow: hidden;
 
-    &:first-of-type { margin-top: 0 }
+  .area {
+    margin-bottom: 12px;
 
-    &:last-of-type { margin-bottom: 0 }
+    .analysis-image {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 8px;
 
-    &.tongue-exception-wrapper {
-      .card-body-container {
-        display: grid;
-        grid-template-rows: repeat(1, minmax(0, 1fr));
-        grid-template-columns: repeat(2, minmax(0, 1fr));
-        gap: 12px;
-      }
+      > div {
+        flex: 0 0 30%;
+        max-height: 128px;
 
-      .card__title {
-        padding: 6px 12px;
-        color: #F56C6C;
-      }
+        &:nth-of-type(1) {
+          display: flex;
+          flex-direction: column;
+          align-items: center;
+          justify-content: space-evenly;
 
-      .card__content {
-        padding: 6px 12px 12px;
+          img {
+            width: 50%;
+            height: 50%;
+          }
+        }
       }
 
-      .el-image {
-        width: 100px;
-        height: 100px;
-        margin-right: 12px;
-        margin-bottom: 12px;
+      img {
+        width: 100%;
+        height: 100%;
+        object-fit: scale-down;
       }
+    }
 
-      .inner ::v-deep .el-card__body {
-        padding: 0;
-      }
+    table {
+      width: 100%;
+      border-collapse: collapse;
+      text-align: center;
 
-      p {
-        line-height: 1.75;
+      th {
+        font-size: 16px;
+        padding: 10px;
+        border: 1px solid #E4E7ED;
+      }
 
-        &:not(:last-of-type) { margin-bottom: 8px; }
+      td {
+        padding: 8px;
+        border: 1px solid #E4E7ED;
+        min-height: 40px;
       }
     }
   }
 
-  .card-header-container {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    height: 100%;
+  ::v-deep {
+    .el-tabs--card {
+      display: flex;
+      flex-direction: column;
+      height: 100%;
+
+      .el-tabs__header { flex: none; }
+
+      .el-tabs__content { flex: auto; }
+    }
   }
 
-  .card-body-container {
-    display: flex;
+  ::v-deep {
+    .el-tabs__item,
+    .el-tab-pane {
+      width: var(--w);
+    }
 
-    .result-wrapper {
-      flex: auto;
+    .el-tabs__header {
+      .el-tabs__item {
+        text-align: center;
+      }
     }
 
-    .picture-wrapper {
-      flex: none;
+    .el-tabs__content {
       display: flex;
-      flex-direction: column;
-      justify-content: space-evenly;
-      margin-left: 12px;
-      max-width: 100px;
+      width: max-content;
+      padding: 0 20px;
 
-      .el-image {
-        width: 100px;
-        height: 100px;
+      .el-tab-pane {
+        flex: none;
+        display: block !important;
+        padding: 0 12px;
+        overflow-y: auto;
+        box-sizing: border-box;
       }
     }
   }
+}
 
-  ::v-deep .el-card__header {
-    padding: 0 20px;
-    height: 56px;
-  }
+tr[data-invalid="true"] td:nth-of-type(2) {
+  color: #9ca3af;
 }
 </style>
+<style lang="scss">
+.analysis-exception-popover {
+  width: 245px;
+
+  img {
+    width: 100%;
+    object-fit: scale-down;
+  }
+}
+</style>

+ 26 - 6
src/views/knowledge/DoctorCaseBefore.vue

@@ -13,12 +13,13 @@
       <div class="content-item" v-for="(item,index) in list" :key="index">
         <div class="en">{{item.pyCode}}</div>
         <div class="list">
-          <div
-            class="list-item"
-            @click="handleItem(item1)"
-            v-for="(item1,index1) in item.children"
-            :key="index1"
-          >{{item1.name}}</div>
+          <div class="list-item" v-for="(item1,index1) in item.children" :key="index1" @click="handleItem(item1)">
+            <el-popover v-if="item1.introduce" :title="item1.name" popper-class="scrollable" trigger="hover">
+              <div class="el-popover__content">{{ item1.introduce }}</div>
+              <div slot="reference">{{ item1.name }}</div>
+            </el-popover>
+            <div v-else>{{ item1.name }}</div>
+          </div>
         </div>
       </div>
     </div>
@@ -164,4 +165,23 @@ export default {
     }
   }
 }
+</style>
+<style lang="scss">
+.el-popover.scrollable {
+  display: flex;
+  flex-direction: column;
+  max-width: 30vmin;
+  max-height: 30vmin;
+  overflow: hidden;
+
+  padding-right: 0;
+  .el-popover__title, .el-popover__content { padding-right: 20px; }
+
+  .el-popover__title { flex: none;}
+
+  .el-popover__content {
+    flex: auto;
+    overflow-y: auto;
+  }
+}
 </style>

+ 5 - 5
src/views/knowledge/Prescription.vue

@@ -66,10 +66,10 @@ export default {
     };
   },
   created() {
-    this.getEffectQuery();
-    setTimeout(() => {
-      this.getPrescriptionsList();
-    }, 500);
+    this.getEffectQuery().then(() => this.getPrescriptionsList());
+    // setTimeout(() => {
+    //   this.getPrescriptionsList();
+    // }, 500);
   },
   methods: {
     clearFilter() {
@@ -95,7 +95,7 @@ export default {
         pagesize: 9999,
         searchtype: "",
         keyword: this.form.name,
-        effected: this.tabs[this.tab_current].effectid,
+        effected: this.tabs[this.tab_current] ? this.tabs[this.tab_current].effectid : null,
         effect: this.form.gongxiao
       };
       let res = await getPrescriptionsList(params);

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor