ソースを参照

从 his 进入智能开方 暂存 preNo 数据,始终为修改处方

cc12458 1 年間 前
コミット
830a9fba7e

+ 3 - 0
src/store/index.js

@@ -32,6 +32,9 @@ export default new Vuex.Store({
     getIsSee(state) {
       return state.user.isSeeDoctor
     },
+    getPreNo(state) {
+      return state.user.preNo
+    },
     getOutpatientDiagnosis(state) {
       return state.user.outpatientDiagnosis
     },

+ 6 - 1
src/store/modules/user.js

@@ -5,12 +5,13 @@ export default {
         // userInfo: sessionStorage.getItem('userinfo') ? JSON.parse(sessionStorage.getItem('userinfo')) : {}, // 当前登录用户信息
         userInfo: sessionStorage.getItem('userinfo') ? JSON.parse(sessionStorage.getItem('userinfo')) : {}, // 当前登录用户信息
         isSeeDoctor: sessionStorage.getItem('isSeeDoctor') ? sessionStorage.getItem('isSeeDoctor') : true, // 当前状态是就诊还是查看 
+        preNo: sessionStorage.getItem('edit_preNo') ? sessionStorage.getItem('edit_preNo') : '', // 当前(进入)状态是修改处方还是创建处方
         outpatientDiagnosis: sessionStorage.getItem('outpatientDiagnosis') ? sessionStorage.getItem('outpatientDiagnosis') : null, // 转病例到中医诊断
         emr: sessionStorage.getItem('emrDiagnosis') ? sessionStorage.getItem('emrDiagnosis') : null // 转病历到电子病历
     },
     mutations: {
         setPatiensInfo(state, data) {
-
+            this.commit('user/setPreNo', '')
             sessionStorage.setItem('patiensInfo', JSON.stringify(data))
             state.patiensInfo = data
         },
@@ -22,6 +23,10 @@ export default {
             sessionStorage.setItem('isSeeDoctor', data)
             state.isSeeDoctor = data
         },
+        setPreNo(state, value) {
+            sessionStorage.setItem('edit_preNo', value)
+            state.preNo = value
+        },
 
         // 患者转病历
         setOutpatientDiagnosis(state, data) {

+ 15 - 22
src/views/diagnosis/Prescribing.vue

@@ -1823,9 +1823,7 @@ export default {
               unit: item1.unit,
               unitprice: item1.price,
               usagestr: item1.usage,
-              preDetailId: this.$route.query.recipeID
-                ? this.$route.query.recipeID
-                : ""
+              preDetailId: this.getEditPreNo(),
             };
             obj.zhongdetail.push(obj1);
           }
@@ -1941,9 +1939,7 @@ export default {
             specification: item.spec,
             unit: item.unit,
             usagestr: item.usage,
-            preDetailId: this.$route.query.recipeID
-              ? this.$route.query.recipeID
-              : "",
+            preDetailId: this.getEditPreNo(),
             bzdw: item.doseUnit,
             zxdw: item.timesUnit
           };
@@ -2027,9 +2023,7 @@ export default {
             pointname: item.acuname,
             price: data1.bottom_form.doseType,
             seqn: item.id,
-            preDetailId: this.$route.query.recipeID
-              ? this.$route.query.recipeID
-              : ""
+            preDetailId: this.getEditPreNo(),
           };
           obj.detail.push(obj1);
         }
@@ -2139,10 +2133,7 @@ export default {
           obj.bottom_form.caozuo = item.useexplain;
           obj.bottom_form.zhutuo = item.command;
 
-          if (
-            this.$route.query.recipeType &&
-            this.$route.query.recipeType == "edit"
-          ) {
+          if (!!this.getEditPreNo()) {
             if (item.revierwstate == 1 && isAutoCheck == 0) {
               obj.prescribed = 0;
             } else {
@@ -2306,10 +2297,7 @@ export default {
 
         data1.bottom_form.zhutuo = data.command;
         data1.preId = data.preId ? data.preId : "";
-        if (
-          this.$route.query.recipeType &&
-          this.$route.query.recipeType == "edit"
-        ) {
+        if (!!this.getEditPreNo()) {
           data1.bottom_form.radio = Number(data.isdelivery);
           data1.bottom_form.savename = data.consigneeName;
           data1.bottom_form.phone = data.consigneePhone;
@@ -2418,7 +2406,7 @@ export default {
         data1.allMoney = data.allprice;
         data1.nowMoney = data.thisRecipePrice;
 
-        if (this.$route.query && this.$route.query.recipeType == "edit") {
+        if (!!this.getEditPreNo()) {
           if (data.revierwstate == 1) {
             data1.prescribed = 0; // 是否已开方 0否 1是
             data1.paystate = 0;
@@ -3048,13 +3036,15 @@ export default {
             this._showDataFromStorage();
           }
 
-          if (this.$route.query.recipeID) {
+          const recipeID = this.getEditPreNo();
+
+          if (!!recipeID) {
             if (this.$route.query.kjType) {
               if (this.$route.query.kjType == "kj-fj") {
-                this.getPreDetal(this.$route.query.recipeID);
+                this.getPreDetal(recipeID);
               }
             } else {
-              this.getRecipeDataByid(this.$route.query.recipeID);
+              this.getRecipeDataByid(recipeID);
             }
           } else if (this.$route.query.doctorCase) {
             setTimeout(() => {
@@ -4294,6 +4284,9 @@ export default {
       this.$forceUpdate();
       this.raDoseShow = show;
     },
+    getEditPreNo() {
+      return this.$route.query && this.$route.query.recipeType === "edit" ? this.$route.query.recipeID : this.getPreNo;
+    },
     ...mapMutations({
       setDrugsInfo: "drug/setDrugsInfo"
     })
@@ -4310,7 +4303,7 @@ export default {
         : 0
       ).toFixed(2);
     },
-    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee"])
+    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee", "getPreNo"])
   },
   filters: {
     ftsjj(value) {

+ 9 - 8
src/views/diagnosis/components/submitRecipe.vue

@@ -422,13 +422,16 @@ export default {
 
       return isPs;
     },
-    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee"])
+    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee", "getPreNo"])
   },
   created() {
     this.showDialog = this.show;
     this.dealPriviewData();
   },
   methods: {
+    getEditPreNo() {
+      return this.$route.query && this.$route.query.recipeType === "edit" ? this.$route.query.recipeID : this.getPreNo;
+    },
     signToRecipt() {
       this.recipes.forEach(item => {
         if (item.pid == this.recipeItem.pid) {
@@ -595,10 +598,7 @@ export default {
       let zhongchengyao = data.zhongchengyao;
       let technology = data.technology;
 
-      if (
-        this.$route.query.recipeType &&
-        this.$route.query.recipeType == "edit"
-      ) {
+      if (!!this.getEditPreNo()) {
         this.updateRecipe(zhongyao, zhongchengyao, technology);
       } else {
         this.addRecipe(zhongyao, zhongchengyao, technology);
@@ -653,11 +653,12 @@ export default {
         spinner: "el-icon-loading",
         background: "rgba(0, 0, 0, 0.7)"
       });
+      const recipeID = this.getEditPreNo();
       zhongyao.forEach(item => {
-        item.preId = this.$route.query.recipeID || "";
+        item.preId = recipeID;
       });
-      zhongchengyao.preId = this.$route.query.recipeID || "";
-      technology.preId = this.$route.query.recipeID || "";
+      zhongchengyao.preId = recipeID;
+      technology.preId = recipeID;
       let params = {
         recordid: this.$route.query.recordsId || this.getPatiensInfo.pid,
         technology: technology,

+ 4 - 2
src/views/hisEnter.vue

@@ -58,11 +58,12 @@ export default {
         let path = preNo
           ? `/index/prescribing?recipeID=${preNo}&recipeType=edit`
           : "/index/prescribing";
-        this.$router.push({
+        this.setIsSee(true);
+        this.setPreNo(preNo || '');
+        await this.$router.push({
           path: path
           // path: this.routePath
         });
-        this.setIsSee(true);
       }
     },
     // 获取页面跳转配置
@@ -83,6 +84,7 @@ export default {
     },
     ...mapMutations({
       setPatients: "user/setPatiensInfo",
+      setPreNo: "user/setPreNo",
       setIsSee: "user/setIsSee"
     })
   }