Просмотр исходного кода

推荐的方剂 选中状态判断

cc12458 11 месяцев назад
Родитель
Сommit
7e358fa995

+ 1 - 0
src/components/ChineseMedicine.vue

@@ -1038,6 +1038,7 @@ export default {
           isMyMade: true,
           disable: false,
           name: "处方1",
+          id: "", // 当前选择的处方 id(推荐方剂)
           pharmacyID: "", // 药房id
           isPay: false, // 是否支付
           prescribed: 0, // 是否开方 0 否 1是

+ 1 - 0
src/components/SuitScience.vue

@@ -236,6 +236,7 @@ export default {
       isAutoCheck: "0", // 是否自动审核 0 手动 1自动 (自动的时候用his 的是否支付成功字段 判断显示)
       paystate: 0, // 云his 是否支付  0 否 1是(为否可以编辑)
       name: "适宜技术处方",
+      recipeId: "", // 当前选择的处方 id(推荐方剂)
       tableData4: [
         {
           id: 1,

+ 3 - 0
src/store/index.js

@@ -32,6 +32,9 @@ export default new Vuex.Store({
     getDrugInfo(state) {
       return state.drug.drugsInfo
     },
+    getRecipeId(state) {
+      return state.drug.recipeId;
+    },
     getIsSee(state) {
       return state.user.isSeeDoctor
     },

+ 5 - 1
src/store/modules/drug.js

@@ -2,7 +2,7 @@ export default {
   namespaced: true,
   state: {
     drugsInfo: sessionStorage.getItem('drugsInfo') ? JSON.parse(sessionStorage.getItem('drugsInfo')) : {}, // 病人信息
-
+    recipeId: sessionStorage.getItem('recipeId'),
   },
   mutations: {
     setDrugsInfo(state, data) {
@@ -10,6 +10,10 @@ export default {
       sessionStorage.setItem('drugsInfo', JSON.stringify(data))
       state.drugsInfo = data
     },
+    setRecipeId(state, id) {
+      sessionStorage.setItem('recipeId', id)
+      state.recipeId = id
+    }
 
   },
   getters: {

+ 40 - 17
src/views/diagnosis/Prescribing.vue

@@ -444,8 +444,8 @@
               v-for="(item1,index1) in rRecomendR"
               :key="'c'+index1"
             >
-              <div
-                :class="['med-name med-name-bg',tjRecipeId==item1.preid ||tjRecipeId==item1.pid || tjRecipeId==item1.acupreid ?'active':'',]"
+              <div class="med-name med-name-bg"
+                   :class="{active: tjRecipeId && (tjRecipeId==item1.preid ||tjRecipeId==item1.pid || tjRecipeId==item1.acupreid)}"
                 v-if="item1.showType==0"
                 @click.stop="getPreDetal(item1.preid || item1,1)"
               >
@@ -456,8 +456,8 @@
                 <!-- {{item1.prename?item1.prename+'('+item1.book?item1.book:'暂无'+')': item1.acupretype==1?'针灸':item1.acupretype==2?'艾灸':item1.acupretype==3?'推拿':'拔罐'}} -->
               </div>
               <!-- 经验方 -->
-              <div
-                :class="['med-name med-name-bg',tjRecipeId==item1.preid ||tjRecipeId==item1.pid  ?'active':'',]"
+              <div class="med-name med-name-bg"
+                   :class="{active: tjRecipeId && (tjRecipeId==item1.preid ||tjRecipeId==item1.pid) }"
                 v-else
                 @click="getExperinceDetail(item1.pid)"
               >
@@ -1464,10 +1464,11 @@ export default {
       if (isauto) {
         this.inferRecipe(2);
       }
-
+      let id = '';
+      try { id = this.contentTabs[this.container_i].id; } catch (e) {}
       setTimeout(() => {
-        this.inferRecipe(4, "1");
-        this.inferRecipe(4, "3");
+        this.inferRecipe(4, "1").then(() => { if (id === '0') this.isTuiDaoZy = true });
+        this.inferRecipe(4, "3").then(() => { if (id === '1') this.isTuiDaoSuit = true });
         if (this.getPatiensInfo.pid) {
           this.getPatiensBasisM();
         }
@@ -2711,12 +2712,20 @@ export default {
     },
 
     // 顶部tab 改变
-    changeContainer(item, type) {
+    async changeContainer(item, type) {
       this.container_i = type;
       item.check = true;
       if (item.id === '1') return;
       // if (this.contentTabs[type].color == 'red') {
-      this.inferRecipe(3, item.businesstype);
+      await this.inferRecipe(3, item.businesstype);
+
+      const child = this.$children.find(child => child.name === item.name);
+      if (!child) return
+      if (item.id === '0') {
+        try { this.tjRecipeId = child.recipe_tabs[child.recipe_tabs_c].id; } catch (e) { this.tjRecipeId = "" }
+      } else if (item.id === '2') {
+        try { this.tjRecipeId = child.recipeId; } catch (e) { this.tjRecipeId = "" }
+      }
       // }
 
       // if (type == 2) {
@@ -2761,6 +2770,7 @@ export default {
     // 名家验案转方
     turnRecipe(item) {
       this.setDrugsInfo(item.verpreitemlist);
+      this.setRecipeId('');
       this.changeAndJoin();
       this.addRecipeFrom("5");
     },
@@ -2792,6 +2802,7 @@ export default {
        });
        if (recipe.__RecipeFrom__ === '2') this.agreeAssignToTCM(recipe, void 0, true);
        this.setDrugsInfo(medicines);
+       this.setRecipeId('');
        this.changeAndJoin(1);
      } else if (recipe.__RecipeFrom__ === '2') {
        this.agreeInfo = recipe;
@@ -2943,6 +2954,9 @@ export default {
       });
 
       let drugs = this.getDrugInfo;
+      const recipeId = +type !== 1 ? this.getRecipeId : "";
+      this.setRecipeId('');
+      this.tjRecipeId = recipeId
 
       if (type == "") {
         child.bottom_form.caozuo = '';
@@ -2994,7 +3008,7 @@ export default {
           return (item.id = index + 1);
         });
       }
-
+      child.recipeId = recipeId
       this.showDialog = false;
 
       loading.close();
@@ -3005,6 +3019,7 @@ export default {
       this.addRecipeFrom("4", 2);
       if (type == 1 && type1 == 1) {
         this.setDrugsInfo(item.items);
+        this.setRecipeId('');
         this.suitChnageOrJoin();
         return;
       }
@@ -3021,6 +3036,7 @@ export default {
       this.addRecipeFrom("4", 2);
       if (type == 1 && type1 == 1) {
         this.setDrugsInfo(item.items);
+        this.setRecipeId('');
         this.suitChnageOrJoin(1);
         return;
       }
@@ -3041,6 +3057,7 @@ export default {
       }
       this.addRecipeFrom("4");
       this.setDrugsInfo(this.preInfo.items);
+      this.setRecipeId('');
       this.changeAndJoin(2);
     },
     // 方剂换方
@@ -3812,8 +3829,8 @@ export default {
 
         if (this.$route.query.type != "tuidao" && type == 1) return;
         if (type === 3) {
-          try { if (this.contentTabs.find(tab => tab.id === '0') && this.isTuiDaoZy) return; } catch (e) {}
-          try { if (this.contentTabs.find(tab => tab.id === '2') && this.isTuiDaoSuit) return; } catch (e) {}
+          try { if (this.contentTabs[this.container_i].id === '0' && this.isTuiDaoZy) return; } catch (e) {}
+          try { if (this.contentTabs[this.container_i].id === '2' && this.isTuiDaoSuit) return; } catch (e) {}
         }
         if (this.rRecomendR.length == 0) return;
 
@@ -3866,6 +3883,7 @@ export default {
             //  && child2.tableData4.length == 1
             if (arr2.length > 0) {
               this.setDrugsInfo(arr2[0].items);
+              this.setRecipeId(arr2[0].acupreid);
             }
 
             this.addRecipeFrom("4", 2);
@@ -3947,6 +3965,9 @@ export default {
       let child = children[0];
       child.recipe_tabs[child.recipe_tabs_c].disable = false;
       let drugs = this.getDrugInfo;
+      const recipeId = +type === 1 ? this.getRecipeId : "";
+      this.setRecipeId('');
+      this.tjRecipeId = recipeId;
 
       // let type1 = 0
       let type1 = child.recipe_tabs[child.recipe_tabs_c].radio.split("@")[1];
@@ -4211,6 +4232,7 @@ export default {
           this.showPresc = false;
           this.showUnifyPresc = false;
           loading.close();
+          try { child.recipe_tabs[child.recipe_tabs_c].id = recipeId; } catch (e) {}
         }
       } else if (this.container_i == 2) {
         // 适宜技术处方
@@ -4278,8 +4300,8 @@ export default {
         // 适宜技术处方
         this.preInfo = id;
         this.setDrugsInfo(id.items);
+        this.setRecipeId(id.acupreid);
         this.showDialog = true;
-        this.tjRecipeId = id.acupreid;
         return;
       }
 
@@ -4289,11 +4311,11 @@ export default {
 
       if (res.code === 0) {
         this.preInfo = res.data;
-        if (type == 1 || type == "") {
+        /*if (type == 1 || type == "") {
           this.tjRecipeId = id;
-        }
-
+        }*/
         this.setDrugsInfo(res.data.items);
+        this.setRecipeId(id);
         if (!type || type == 2) {
           // console.log(res.data, 'RES.datas');
           if (type == "") {
@@ -4378,6 +4400,7 @@ export default {
       return this.$route.query && this.$route.query.recipeType === "edit" ? this.$route.query.recipeID : this.getPreNo;
     },
     ...mapMutations({
+      setRecipeId: "drug/setRecipeId",
       setDrugsInfo: "drug/setDrugsInfo"
     })
   },
@@ -4393,7 +4416,7 @@ export default {
         : 0
       ).toFixed(2);
     },
-    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee", "getPreNo"])
+    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getRecipeId", "getIsSee", "getPreNo"])
   },
   filters: {
     ftsjj(value) {