Sfoglia il codice sorgente

Merge tag '20250206-06' into develop

cc12458 1 anno fa
parent
commit
f2b4f2bfc9
2 ha cambiato i file con 23 aggiunte e 10 eliminazioni
  1. 17 9
      src/components/ChineseMedicine.vue
  2. 6 1
      src/utils/minix/prescribing.js

+ 17 - 9
src/components/ChineseMedicine.vue

@@ -1118,7 +1118,7 @@ export default {
     // this.getAccordShareList()
     // this.getPharmacyID()
     // this.getTableDrug('', 1, 0)
-    this.customerQuery();
+    this.loaded();
     // this._getPharmacyIDS();
     this.getProver();
     this.getSelectType("中药药品用法", 0);
@@ -1130,7 +1130,21 @@ export default {
   mounted() {},
   methods: {
     async loaded(props) {
-      if (!this.pharmacyTypes.length) await this.customerQuery(props).catch(() => void 0);
+      if (!this.pharmacyTypes.length) await this.customerQuery().catch(() => void 0);
+
+      let defaultProps = {};
+      try {
+        this.recipe_tabs_c = props.recipe_tabs_c || 0;
+        defaultProps = props.recipe_tabs[this.recipe_tabs_c];
+      } catch(e) {}
+      try {
+        defaultProps = {...this.pharmacyTypes[0], ...defaultProps};
+        this.recipe_tabs[this.recipe_tabs_c].pharmacyID = defaultProps.pharmacyID || this.pharmacyList[0].pid;
+        this.recipe_tabs[this.recipe_tabs_c].radio = defaultProps.radio || defaultProps.ptype;
+        this.recipe_tabs[this.recipe_tabs_c].lastType = defaultProps.radio || defaultProps.ptype;
+      } catch (e) {}
+      this.$forceUpdate();
+      await this.getPharmacyMsg(this.recipe_tabs[this.recipe_tabs_c].pharmacyID);
       return this;
     },
     _splitDataToView(totalData) {
@@ -2351,7 +2365,7 @@ export default {
       }
     },
     // 选择药房
-    async customerQuery(defaultProps = {}) {
+    async customerQuery() {
       let res = await customerQuery({
         type: 0
       });
@@ -2367,14 +2381,8 @@ 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 = defaultProps.ptype;
-        this.recipe_tabs[this.recipe_tabs_c].lastType = defaultProps.ptype;
         this.pharmacyList = res.Data;
         this.pharmacyTypes = pharmacyTypes;
-        this.$forceUpdate();
-        this.getPharmacyMsg(res.Data[0].pid);
       }
     },
     // 获取药房id

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

@@ -1,5 +1,7 @@
 import { getMaxMinDoaseNumber, getRationalSafeUse } from '@/api/diagnosis.js'
 
+let hack_openAddress_true;
+
 export default {
     data() {
         return {
@@ -152,13 +154,14 @@ export default {
 
         },
         openAddress() {
+            clearTimeout(hack_openAddress_true);
             if (!this.isShowPs) this.isPs = 1;
             if (!this.isShowDj) this.isDaiJian = 2;
 
             if (this.isShowDj || this.isShowPs) {
                 this.showAddress = true;
 
-                setTimeout(() => {
+                hack_openAddress_true = setTimeout(() => {
                     let children = this.$children.filter(item => {
                         return (
                             item.name == "中药处方" ||
@@ -171,6 +174,8 @@ export default {
                     this.isDaiJian = child.recipe_tabs[child.recipe_tabs_c].bottom_form.isDaiJian
                     this.isPs = child.recipe_tabs[child.recipe_tabs_c].bottom_form.radio
                 }, 200)
+            } else {
+                this.showAddress = false;
             }
         },
         // 提交地址信息