فهرست منبع

Merge branch 'hotfix/e9b2f48'

cc12458 9 ماه پیش
والد
کامیت
52c21a808e

+ 9 - 1
src/api/system.js

@@ -413,7 +413,15 @@ export function getDataByKey(data) {
         url: '/portal/configMgr/configKey',
         method: 'get',
         params: data
-    })
+    }).then(res => {
+       switch (data.key) {
+           case 'defaultHomePage': return res.ResultInfo || '/index/todaypatients';
+           case 'transitionPr': return {
+               enabled: !res.ResultInfo || res.ResultInfo === '0',
+           }
+           default: return res;
+       }
+    });
 };
 
 // 获取医保规则列表

+ 17 - 1
src/api/user.js

@@ -1,4 +1,5 @@
 import request from '@/utils/request'
+import {getDataByKey} from '@/api/system';
 
 // 登录
 export function login(data) {
@@ -31,4 +32,19 @@ export function getCodeimg() {
     url: '/captchaImage',
     method: 'get'
   })
-};
+};
+
+export async function loginAndUserinfo(data) {
+  const transition = (fn, res) => {
+    if (res == null) [res, fn] = [fn];
+    if (res.ResultCode !== 0) throw res.ResultInfo;
+    return typeof fn === 'function' ? fn(res.Data, res.ResultInfo) : res.Data;
+  };
+  const token = await login(data).then(transition.bind(null, (data) => data.token));
+  localStorage.setItem('token', token);
+
+  const userInfo = await getUserInfo().then(transition);
+  const defaultHomePage = await getDataByKey({key: 'defaultHomePage', organizationid: userInfo.organizationid});
+
+  return {token, userInfo, defaultHomePage };
+}

+ 4 - 2
src/components/SuitScience.vue

@@ -384,14 +384,16 @@ export default {
         return;
       }
       let _self = this;
+      const tag = "\u2060:\u2060"
+      const merge = !this.bottom_form.caozuo || this.bottom_form.caozuo.includes(tag)
       this.acupointList.forEach(item => {
         if (item.acuid == e) {
           _self.tableData4[index].acuname = item.acuname;
           _self.tableData4[index].name = item.acuname;
           _self.tableData4[index].acuid = item.acuid;
 
-          _self.bottom_form.caozuo +=
-            item.acuname + ":" + item.acuoperation + " ";
+          if (merge && item.acuoperation) _self.bottom_form.caozuo +=
+            item.acuname + tag + item.acuoperation + " ";
         }
       });
 

+ 3 - 3
src/router/knowledge.js

@@ -50,13 +50,13 @@ export default [{
             pftitle: '名医名方'
         }
     },
-    // 名医案 前置页面
+    // 名医案 前置页面
      {
         path: 'doctorcaseBefore',
         name: 'doctorcaseBefore',
         component: () => import('@/views/knowledge/DoctorCaseBefore.vue'),
         meta: {
-            title: '名医案',
+            title: '名医案',
             pftitle: '名医名方'
         }
     },
@@ -65,7 +65,7 @@ export default [{
         name: 'doctorcase',
         component: () => import('@/views/knowledge/DoctorCase.vue'),
         meta: {
-            title: '名医案',
+            title: '名医案',
             pftitle: '名医名方'
         }
     },

+ 1 - 1
src/utils/menu.js

@@ -39,7 +39,7 @@ let menus = [{
         name: '知识学习',
         child: [{
             id: 'knowledge1',
-            name: '名医案',
+            name: '名医案',
             path: '/index/doctorcase'
         }, {
             id: 'knowledge2',

+ 14 - 17
src/views/Home.vue

@@ -38,7 +38,8 @@
 </template>
 
 <script>
-import { login, getCode, getCodeimg } from "@/api/user.js";
+import { mapActions } from 'vuex';
+import { login, getCode, getCodeimg, loginAndUserinfo} from '@/api/user.js';
 import { setTimeout } from "timers";
 export default {
   name: "Home",
@@ -94,23 +95,16 @@ export default {
         vercode: this.code
       };
 
-      let res = await login(params).catch(err => {
-        loading.close();
+      try {
+        await this.setInfo({});
+        const { token, userInfo, defaultHomePage } = await loginAndUserinfo(params);
+        await this.setInfo(userInfo);
+        await this.$router.push({ path: defaultHomePage });
+        this.$message.success("登录成功");
+      } catch (e) {
         this.changeImg();
-      });
-      if (res.ResultCode == 0) {
-        loading.close();
-
-        this.$message.success("登陆成功");
-
-        localStorage.setItem("token", res.Data.token);
-
-        setTimeout(() => {
-          this.$router.push({
-            path: "/index/todaypatients"
-          });
-        }, 1500);
       }
+      loading.close();
     },
 
     // 修改验证码
@@ -118,7 +112,10 @@ export default {
       // let time = new Date().getTime()
       // this.src = this.src + '?time=' + time
       this.getCodeimg();
-    }
+    },
+    ...mapActions({
+      setInfo: "user/setUserinfoAndPermissions"
+    }),
   }
 };
 </script>

+ 5 - 3
src/views/Index.vue

@@ -18,11 +18,13 @@ export default {
     pageHeader
   },
   created() {
-    this.getUserInfo();
-    console.log(this.$route, "路由");
+    if (!this.getuserinfo || !this.getuserinfo.pid) this.loadUserInfo();
+  },
+  computed: {
+    ...mapGetters(["getuserinfo"])
   },
   methods: {
-    async getUserInfo() {
+    async loadUserInfo() {
       let res = await getUserInfo();
       if (res.ResultCode == 0) {
         await this.setInfo(res.Data);

+ 1 - 1
src/views/diagnosis/Prescribing copy.vue

@@ -953,7 +953,7 @@ export default {
       showDialog: false, // 方剂详情
       showDrug: false, // 药品详情
       showAgree: false, // 协定方
-      showTestCase: false, // 名医
+      showTestCase: false, // 名医
       showRecord: false, // 就诊记录
       showXuewei: false, // 穴位详情信息
 

+ 14 - 11
src/views/diagnosis/Prescribing.vue

@@ -1209,11 +1209,11 @@ export default {
       showDialog: false, // 方剂详情
       showDrug: false, // 药品详情
       showAgree: false, // 协定方
-      showTestCase: false, // 名医
+      showTestCase: false, // 名医
       showRecord: false, // 就诊记录
       showXuewei: false, // 穴位详情信息
 
-      showTestCase: false, // 名医
+      showTestCase: false, // 名医
       isTuiDaoSuit: false, //适宜技术处方是否推导过
       isTuiDataZy: false, // 中药处方是否推导过
       raDoseShow: false,
@@ -2956,7 +2956,7 @@ export default {
       this.changeExpre(info);
     },
     // 适宜技术处方 专方 和方
-    suitChnageOrJoin(type = "") {
+    suitChnageOrJoin(type = "", info) {
       // type = '' 专访 type == 1 和方
       if (this.container_i == 1) return;
 
@@ -2975,8 +2975,9 @@ export default {
       this.setRecipeId('');
       this.tjRecipeId = recipeId
 
+      const merge = !(info && info.operation)
       if (type == "") {
-        child.bottom_form.caozuo = '';
+        child.bottom_form.caozuo = merge || !info ? '' : info.operation;
         // 转方
         child.tableData4 = [];
         drugs.forEach((item, index) => {
@@ -2987,7 +2988,7 @@ export default {
             acuid: item.acuid
           };
           // 锚点
-          if (item.acuoperation) child.bottom_form.caozuo += obj.acuname + ':' + item.acuoperation + ' ';
+          if (merge && item.acuoperation) child.bottom_form.caozuo += obj.acuname + ':' + item.acuoperation + ' ';
           child.tableData4.push(obj);
         });
         child.tableData4.push({
@@ -3011,7 +3012,7 @@ export default {
             acuid: item.acuid,
           };
           // 锚点
-          if (item.acuoperation) child.bottom_form.caozuo += obj.acuname + ':' + item.acuoperation + ' ';
+          if (merge && item.acuoperation) child.bottom_form.caozuo += obj.acuname + ':' + item.acuoperation + ' ';
           child.tableData4.push(obj);
         }
         child.tableData4.push({
@@ -3037,7 +3038,7 @@ export default {
       if (type == 1 && type1 == 1) {
         this.setDrugsInfo(item.items);
         this.setRecipeId('');
-        this.suitChnageOrJoin();
+        this.suitChnageOrJoin('', item);
         return;
       }
       console.log(item, "item");
@@ -3054,7 +3055,7 @@ export default {
       if (type == 1 && type1 == 1) {
         this.setDrugsInfo(item.items);
         this.setRecipeId('');
-        this.suitChnageOrJoin(1);
+        this.suitChnageOrJoin(1, item);
         return;
       }
 
@@ -3069,7 +3070,7 @@ export default {
       }
       if (!this.preInfo.prename) {
         this.addRecipeFrom("4", 2);
-        this.suitChnageOrJoin(1);
+        this.suitChnageOrJoin(1, this.preInfo);
         return;
       }
       this.addRecipeFrom("4");
@@ -3087,7 +3088,7 @@ export default {
       if (!this.preInfo.prename) {
         this.addRecipeFrom("4", 2);
         // 适宜技术处方
-        this.suitChnageOrJoin();
+        this.suitChnageOrJoin('', this.preInfo);
         return;
       }
       this.addRecipeFrom("4");
@@ -3900,13 +3901,15 @@ export default {
             }
           } else if (this.container_i == 2) {
             //  && child2.tableData4.length == 1
+            let info
             if (arr2.length > 0) {
               this.setDrugsInfo(arr2[0].items);
               this.setRecipeId(arr2[0].acupreid);
+              info = arr2[0]
             }
 
             this.addRecipeFrom("4", 2);
-            this.suitChnageOrJoin();
+            this.suitChnageOrJoin('', info);
             if (type == 3) {
               this.isTuiDaoSuit = true;
             }

+ 5 - 2
src/views/hisEnter.vue

@@ -12,9 +12,10 @@ export default {
       routePath: "/index/diagnosis" // 配置跳转值
     };
   },
-  beforeCreate() {
+  created() {
     sessionStorage.removeItem("activeID");
     sessionStorage.removeItem("active");
+    this.setUserInfo({});
     this.$nextTick(() => {
       let pid = this.$route.query.token;
       let token = this.$route.query.Authorization;
@@ -29,7 +30,6 @@ export default {
       }
     });
   },
-  created() {},
   methods: {
     // 通过就诊id 获取病人信息
     async getPatiiensMsg(id) {
@@ -79,10 +79,13 @@ export default {
           this.routePath = "/index/dialectical";
         } else if (res.ResultInfo == "2") {
           this.routePath = "/index/prescribing";
+        } else if (res.ResultInfo == "3") {
+          this.routePath = "/index/doctorcaseBefore";
         }
       }
     },
     ...mapMutations({
+      setUserInfo: "user/setUserinfo",
       setPatients: "user/setPatiensInfo",
       setPreNo: "user/setPreNo",
       setIsSee: "user/setIsSee"

+ 10 - 1
src/views/knowledge/DoctorCaseD.vue

@@ -80,7 +80,7 @@
             <div class="right" v-for="(item1,index1) in item.fjlist" :key="index1">
               <div class="flex-plane-center-l opinion">
                 <span>{{item1.preusage}}</span>
-                <div class="flex-center zhuanfang" @click="turnRecipe(item1)">转方</div>
+                <div v-if="showTransitionPr" class="flex-center zhuanfang" @click="turnRecipe(item1)">转方</div>
               </div>
               <div class="prescription flex-plane-center-l flex-wrap">
                 <span
@@ -119,9 +119,11 @@
 import { getDCaseDetail } from "@/api/knowledge.js";
 import { numberToUpperCase } from "@/utils/format.js";
 import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
+import { getDataByKey } from '@/api/system';
 export default {
   data() {
     return {
+      showTransitionPr: false,
       radio: 0,
       info: {},
       isCollect: false,
@@ -130,8 +132,15 @@ export default {
     };
   },
   created() {
+    getDataByKey({
+      key: "transitionPr",
+      organizationid: this.getuserinfo.organizationid,
+    }).then(data => { this.showTransitionPr = data.enabled; });
     this.getDCaseDetail();
   },
+  computed: {
+    ...mapGetters(["getuserinfo"])
+  },
   methods: {
     // 转方
     turnRecipe(item) {

+ 11 - 0
src/views/knowledge/PrescriptionD.vue

@@ -12,6 +12,7 @@
         <div class="title">药品明细:</div>
         <div class="right">
           <div
+            v-if="showTransitionPr"
             class="zhuanfag flex-center"
             @click="$router.push({path:'/index/prescribing?recipeID='+$route.query.pried+'&kjType=kj-fj'})"
           >转方</div>
@@ -66,10 +67,13 @@
   </div>
 </template>
 <script>
+import { mapGetters } from 'vuex';
+import { getDataByKey } from '@/api/system';
 import { getPreDetal } from "@/api/knowledge.js";
 export default {
   data() {
     return {
+      showTransitionPr: false,
       info: {},
       isCollect: false,
       isEdit: true,
@@ -77,8 +81,15 @@ export default {
     };
   },
   created() {
+    getDataByKey({
+      key: "transitionPr",
+      organizationid: this.getuserinfo.organizationid,
+    }).then(data => { this.showTransitionPr = data.enabled; });
     this.getPreDetal();
   },
+  computed: {
+    ...mapGetters(["getuserinfo"])
+  },
   methods: {
     // 获取详细信息
     async getPreDetal() {

+ 2 - 0
src/views/patients/TodayPatients.vue

@@ -431,6 +431,8 @@ export default {
           this.routePath = "/index/dialectical";
         } else if (res.ResultInfo == "2") {
           this.routePath = "/index/prescribing";
+        } else if (res.ResultInfo == "3") {
+          this.routePath = "/index/doctorcaseBefore";
         }
       }
     },

+ 45 - 0
src/views/system/Parameter.vue

@@ -54,9 +54,28 @@
           <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>
       </div>
     </div>
+    <div class="code-item flex-vertical-center-l">
+      <span>登录跳转配置:</span>
+      <div class="input">
+        <el-select v-model="defaultHomePage.value" placeholder="请选择">
+          <el-option label="患者就诊" value="/index/todaypatients"></el-option>
+          <el-option label="知识库(名医医案)" value="/index/doctorcaseBefore"></el-option>
+        </el-select>
+      </div>
+    </div>
+    <div class="code-item flex-vertical-center-l">
+      <span>知识库转方按钮:</span>
+      <div class="input">
+        <el-radio-group v-model="transitionPr.value">
+          <el-radio label="0">显示</el-radio>
+          <el-radio label="1">不显示</el-radio>
+        </el-radio-group>
+      </div>
+    </div>
     <!-- <div class="code-item flex-vertical-center-l">
             <span>诊断页配置:</span>
             <div class="input">
@@ -97,6 +116,12 @@ export default {
       diagnosis: {
         key: "diagnosisPage"
       }, // 诊断
+      transitionPr: {
+        key: "transitionPr"
+      }, // 转方
+      defaultHomePage: {
+        key: "defaultHomePage"
+      }, // 登录默认首页
       type: "add"
     };
   },
@@ -107,6 +132,8 @@ export default {
     // 保存 医共体详细信息
     async saveDBParams() {
       let paramList = [
+        this.defaultHomePage,
+        this.transitionPr,
         this.sign,
         this.doctorbody,
         this.way,
@@ -218,6 +245,24 @@ export default {
             value: diagnosisPage[0].value,
             pid: this.$route.query.pid
           };
+          // 转方
+          let transitionPr = res.Data.filter(item => {
+            return item.key === "transitionPr";
+          });
+          this.transitionPr = {
+            key: transitionPr[0].key,
+            value: transitionPr[0].value || '0',
+            pid: this.$route.query.pid
+          };
+          // 登录首页配置
+          let defaultHomePage = res.Data.filter(item => {
+            return item.key === "defaultHomePage";
+          });
+          this.defaultHomePage = {
+            key: defaultHomePage[0].key,
+            value: defaultHomePage[0].value || '/index/todaypatients',
+            pid: this.$route.query.pid
+          };
         }
       }
     }