Sfoglia il codice sorgente

Merge branch 'hotfix/20241216-01'

cc12458 1 anno fa
parent
commit
9fc5b0edae

+ 3 - 2
src/components/ChineseMedicine.vue

@@ -1810,16 +1810,17 @@ 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);
 
       if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum) {
         // this.countNowRecipeMoney();

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

+ 1 - 1
src/utils/minix/prescribing.js

@@ -141,7 +141,7 @@ export default {
 
             let isShowDj = e.displayAgency == 0 ? true : false // 是否展示代煎 0 展示 1不展示
             let isShowPs = e.displayDelivery == 0 ? true : false // 是否展示配送 0 展示 1不展示
-            // this.isDaiJian = e.defaultAgency == 0 ? 1 : ''
+            this.isDaiJian = e.defaultAgency == 0 ? 1 : 2
             this.isShowDj = isShowDj
             this.isShowPs = isShowPs
 

+ 1 - 1
src/utils/request.js

@@ -96,7 +96,7 @@ service.interceptors.response.use(
 
       } else {
         Vue.prototype.$message({
-          message: res.ResultInfo,
+          message: res.ResultInfo || `API 错误 (${res.ResultCode})`,
           type: 'error',
           showClose: true,
         })

+ 1 - 1
src/views/business/Recipe.vue

@@ -129,7 +129,7 @@
           <el-table-column prop="state" label="状态" width="70">
             <template
               slot-scope="scope"
-            >{{scope.row.paystate==0?'未支付':scope.row.paystate==1?'已支付':scope.row.paystate==2?'已作废':''}}</template>
+            >{{scope.row.paystate==0?'未支付':scope.row.paystate==1?'已支付':scope.row.paystate==2?'已作废':'已作废'}}</template>
           </el-table-column>
           <el-table-column prop="revierwstate" label="审核状态" width="80">
             <template

+ 60 - 46
src/views/diagnosis/Emr.vue

@@ -572,56 +572,58 @@ export default {
           item.inputDefaultValue = paramsData.supplementaryexamination;
         }
       });
-      // console.log(paramsData.echoData);
-      // console.log(tem);
-
-      for (let i in paramsData.echoData) {
-        let labelKey = i.split("-")[1];
-        let flabelKey = i.split("-")[0];
-        let echoItem = paramsData.echoData[i];
-        let otherStr = ""; // 其他选项
-        let isFind = false; // 是否查找到了
-        tem.forEach(item => {
-          // if (labelKey == item.inputValue && item.selectValue == "fill") {
-
-          if (i == flabelKey + "-" + item.inputValue) {
-            if (item.selectValue == "fill") {
-              isFind = true;
-              let radioLabels = item.radioList.map(item1 => item1.label);
-              let diffValues = _this.findDifferences(radioLabels, echoItem);
-
-              otherStr = diffValues.join(";");
-              item.fillValues = [
-                ...item.fillValues,
-                ..._this.findSame(radioLabels, echoItem)
-              ];
-
-              item.fillValues = _this.removeRepate(item.fillValues);
-
-              item.radioList.forEach(item1 => {
-                if (echoItem.includes(item1.label)) {
-                  item1.radioDefault = true;
-                }
-              });
-            }
-          } else {
-            if (!isFind) {
-              otherStr = echoItem.join(";");
+      console.log(paramsData.echoData);
+      //console.log(tem);
+      if (!data.updateTime) {
+        for (let i in paramsData.echoData) {
+          let labelKey = i.split("-")[1];
+          let flabelKey = i.split("-")[0];
+          let echoItem = paramsData.echoData[i];
+          let otherStr = ""; // 其他选项
+          let isFind = false; // 是否查找到了
+          tem.forEach(item => {
+            // if (labelKey == item.inputValue && item.selectValue == "fill") {
+
+            if (i == flabelKey + "-" + item.inputValue) {
+              if (item.selectValue == "fill") {
+                isFind = true;
+                let radioLabels = item.radioList.map(item1 => item1.label);
+                let diffValues = _this.findDifferences(radioLabels, echoItem);
+
+                otherStr = diffValues.join(";");
+                item.fillValues = [
+                  ...item.fillValues,
+                  ..._this.findSame(radioLabels, echoItem)
+                ];
+
+                item.fillValues = _this.removeRepate(item.fillValues);
+
+                item.radioList.forEach(item1 => {
+                  if (echoItem.includes(item1.label)) {
+                    item1.radioDefault = true;
+                  }
+                });
+              }
+            } else {
+              if (!isFind) {
+                otherStr = echoItem.join(";");
+              }
             }
-          }
 
-          if (item.inputValue == flabelKey + "—其他") {
-            if (otherStr) {
-              if (item.inputDefaultValue) {
-                item.inputDefaultValue =
-                  item.inputDefaultValue + ";" + otherStr;
-              } else {
-                item.inputDefaultValue = otherStr;
+            if (item.inputValue == flabelKey + "—其他") {
+              if (otherStr) {
+                if (item.inputDefaultValue) {
+                  item.inputDefaultValue =
+                    item.inputDefaultValue + ";" + otherStr;
+                } else {
+                  item.inputDefaultValue = otherStr;
+                }
               }
             }
-          }
-        });
+          });
+        }
       }
+
       this.temItem.templateContent = [];
       this.temItem.templateContent = tem;
     },
@@ -724,6 +726,14 @@ export default {
         });
         this.isEdit = false;
         if (next) {
+          if (next == "none") {
+            let msg = {
+              origin: "EMR",
+              msg: "刷新数据"
+            };
+            window.parent.postMessage(JSON.stringify(msg), "*");
+            return;
+          }
           next();
         } else {
           setTimeout(() => {
@@ -774,7 +784,11 @@ export default {
           showClose: true
         });
         // this.isEdit = false;
-        this.editEMR("none");
+        if (this.pid) {
+          this.editEMR("none");
+          return;
+        }
+        this.addEMR("none");
 
         // console.log("消息发送成功");
       }

+ 27 - 30
src/views/diagnosis/Prescribing.vue

@@ -285,14 +285,16 @@
       </div>
       <div class="flex-vertical-between center-header">
         <div class="center-tab flex-vertical-center-l">
-          <div
-            :class="container_i==index?'flex-center active':'flex-center'"
-            @click.self="changeContainer(index)"
-            v-for="(item,index) in contentTabs"
-            :key="item.name+index"
-          >
-            <span @click="changeContainer(index)" :style="{color:item.color}">{{item.name}}</span>
-          </div>
+          <template v-for="(item,index) in contentTabs">
+            <div
+              :class="container_i==index?'flex-center active':'flex-center'"
+              @click.self="changeContainer(index)"
+              v-if="!item.hide"
+              :key="item.name+index"
+            >
+              <span @click="changeContainer(index)" :style="{color:item.color}">{{item.name}}</span>
+            </div>
+          </template>
         </div>
         <div class="header-total flex-vertical-center-r flex-wrap" v-if="false">
           <div v-if="contentTabs[0].check">
@@ -1318,11 +1320,13 @@ export default {
         {
           name: "中药制剂",
           check: false,
+          hide: true,
           color: ""
         },
         {
           name: "适宜技术处方",
           check: false,
+          hide: true,
           color: ""
         }
       ],
@@ -1819,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);
           }
@@ -1937,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
           };
@@ -2023,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);
         }
@@ -2135,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 {
@@ -2302,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;
@@ -2414,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;
@@ -3044,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(() => {
@@ -4290,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"
     })
@@ -4306,7 +4303,7 @@ export default {
         : 0
       ).toFixed(2);
     },
-    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee"])
+    ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee", "getPreNo"])
   },
   filters: {
     ftsjj(value) {

+ 5 - 1
src/views/diagnosis/components/medAddressNew.vue

@@ -223,7 +223,11 @@ export default {
       if (data === null) {
         this.form.isDaiJian = this.form.isDaiJian == 1 ? 0 : 1;
       } else {
-        this.form.isDaiJian = data;
+        if (this.form.isDaiJian == data) {
+          this.form.isDaiJian = 2;
+        } else {
+          this.form.isDaiJian = data;
+        }
       }
 
       this.$emit("djChange", this.form.isDaiJian);

+ 21 - 19
src/views/diagnosis/components/submitRecipe.vue

@@ -378,7 +378,7 @@ export default {
       }
     },
     priviewData: {
-      deep: true,
+      deep: false,
       handler: function() {
         if (!this.show) return;
         if (Object.keys(this.priviewData).length == 0) return;
@@ -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);
@@ -619,10 +619,9 @@ export default {
         zhongyao: zhongyao
       };
 
-      let res = await addRecipe(params).catch(err => {
-        loading.close();
-      });
-      if (res.ResultCode == 0) {
+      let res = await addRecipe(params).catch(err => void 0);
+      loading.close();
+      if (res && res.ResultCode == 0) {
         this.$message.success("提交成功");
         let msg = {
           origin: "Recipe",
@@ -644,7 +643,6 @@ export default {
         }
         sessionStorage.setItem("priviewRawData", "");
         sessionStorage.removeItem("prescr" + this.getPatiensInfo.pid);
-      } else {
       }
     },
     // 审核不通过 修改处方
@@ -655,21 +653,26 @@ 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,
         zhongchengyao: zhongchengyao,
         zhongyao: zhongyao
       };
-      let res = await updateRecipe(params).catch(err => {
-        loading.close();
-      });
-      if (res.ResultCode == 0) {
+      let res = await updateRecipe(params).catch(err => void 0);
+      loading.close();
+      if (res && res.ResultCode == 0) {
+        let msg = {
+          origin: "Recipe",
+          msg: "刷新数据"
+        };
+        window.parent.postMessage(JSON.stringify(msg), "*");
         this.$message.success("修改成功");
         setTimeout(() => {
           loading.close();
@@ -679,7 +682,6 @@ export default {
         }, 3000);
 
         sessionStorage.setItem("priviewRawData", "");
-      } else {
       }
     }
   }

+ 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"
     })
   }