Sfoglia il codice sorgente

开方推导优化(tab 红色高亮)

cc12458 11 mesi fa
parent
commit
56c74c39ef

+ 1 - 1
src/components/ChineseMedicine.vue

@@ -30,7 +30,7 @@
         <el-button size="mini" type="primary" @click="openSafeDrug" v-if="isShrink">安全合理用药检测</el-button>
 
         <!-- <div class="add-presc flex-center" @click="clearRecipe()">清空处方</div> -->
-        <el-button size="mini" type="warning" @click="clearRecipe()">清空处方</el-button>
+        <el-button size="mini" type="warning" @click="clearRecipe();$emit('clear')">清空处方</el-button>
       </div>
     </div>
 

+ 1 - 1
src/components/MedicineAndChina.vue

@@ -3,7 +3,7 @@
   <div class="zcy">
     <div class="chinese_medicine">
       <div class="flex flex-row-right">
-        <div class="clearer flex-center" @click="clearData()">清空</div>
+        <div class="clearer flex-center" @click="clearData();$emit('clear')">清空</div>
       </div>
 
       <div class="c-m-table">

+ 4 - 3
src/components/SuitScience.vue

@@ -4,7 +4,7 @@
     <!-- 中成药方 和适宜技术处方 -->
     <div class="chinese_medicine">
       <div class="flex flex-row-right">
-        <div class="clearer flex-center" @click="clear">清空</div>
+        <div class="clearer flex-center" @click="clear();$emit('clear')">清空</div>
       </div>
       <!-- 中成药 -->
       <!-- fixed="left" -->
@@ -40,7 +40,7 @@
               </el-table-column>
 
               <el-table-column label="操作" width="100">
-                <template slot-scope="scope">
+                <template slot-scope="scope" v-if="scope.row.name">
                   <div class="operate">
                     <img v-if="editable" src="../assets/add.png" alt @click="addData(scope)" />
                     <img v-if="editable" src="../assets/delete1.png" alt @click="deleteData(scope)" />
@@ -79,7 +79,7 @@
               </el-table-column>
 
               <el-table-column label="操作" width="100">
-                <template slot-scope="scope">
+                <template slot-scope="scope" v-if="scope.row.name">
                   <div class="operate">
                     <img v-if="editable" src="../assets/add.png" alt @click="addData(scope)" />
                     <img v-if="editable" src="../assets/delete1.png" alt @click="deleteData(scope)" />
@@ -408,6 +408,7 @@ export default {
       });
 
       console.log(price);
+      if (!Array.isArray(price) || price[0] == null) return
 
       let num = this.bottom_form.doseNum1
         ? Number(this.bottom_form.doseNum1)

+ 26 - 7
src/views/diagnosis/Prescribing.vue

@@ -390,6 +390,7 @@
           ref="chineseM"
           :totalAllMoney.sync="chineseM.allMoney"
           @submit="submitRecipe1()"
+          @clear="clearContainer('0')"
           :showSubmit="showSubmit"
           :isShrink="isShrink"
           :isDaiJian="Number(isDaiJian)"
@@ -403,6 +404,7 @@
           ref="medicineC"
           id="medicineC"
           @submit="submitRecipe1()"
+          @clear="clearContainer('1')"
           :totalAllMoney.sync="medicineC.allMoney"
           :showSubmit="showSubmit"
           :isPs="isPs"
@@ -413,6 +415,7 @@
           ref="suitScience"
           id="suitScience"
           @submit="submitRecipe1()"
+          @clear="clearContainer('2')"
           :totalAllMoney.sync="suitScience.allMoney"
           :showSubmit="showSubmit"
         ></suitScience>
@@ -1421,6 +1424,10 @@ export default {
         this.isTuiDaoSuit = false;
         this.isTuiDaoZy = false;
         await this.inferRecipe();
+        const current = this.contentTabs[this.container_i];
+        if (!current) return;
+        if (current.id === '0') this.isTuiDaoZy = true
+        else if (current.id === '2') this.isTuiDaoSuit = true
       }
       // 处方编辑 recipeType
       else if (query.from !== 'his' && this.getEditPreNo()) await this.getRecipeDataByid(this.getEditPreNo());
@@ -1460,15 +1467,23 @@ export default {
       this.rDoctorCase.loadMore = true;
       this.getDoctorCaseL();
       // --end
+      const current = this.contentTabs[this.container_i];
+      if (!current) return;
 
-      if (isauto) {
-        this.inferRecipe(2);
+      if (isauto && current.id !== '1') {
+        this.inferRecipe(2, current.businesstype);
       }
-      let id = '';
-      try { id = this.contentTabs[this.container_i].id; } catch (e) {}
+
       setTimeout(() => {
-        this.inferRecipe(4, "1").then(() => { if (id === '0') this.isTuiDaoZy = true });
-        this.inferRecipe(4, "3").then(() => { if (id === '1') this.isTuiDaoSuit = true });
+        for (const tab of this.contentTabs) {
+          if (tab.id === '1' || tab.hide) continue;
+          this.inferRecipe(4, tab.businesstype).then(() => {
+            if (tab.id === current.id ) {
+              if (current.id === '0') this.isTuiDaoZy = true
+              else if (current.id === '2') this.isTuiDaoSuit = true
+            }
+          })
+        }
         if (this.getPatiensInfo.pid) {
           this.getPatiensBasisM();
         }
@@ -2710,7 +2725,9 @@ export default {
     find(scope) {
       this.getAcupointD(scope.row.acuid);
     },
-
+    clearContainer(id) {
+      try { this.contentTabs.find(tab => tab.id === id).color = ''; } catch (e) {}
+    },
     // 顶部tab 改变
     async changeContainer(item, type) {
       this.container_i = type;
@@ -3806,6 +3823,8 @@ export default {
         if (type == 4) {
           try { this.contentTabs.find(tab => tab.businesstype === businesstype).color = arr2.length > 0 ? "red" : ""; } catch (e) {}
           return;
+        } else if (+type === 1) {
+          for (const tab of this.contentTabs) { if (!tab.hide) tab.color = "" }
         }
         if (arr2.length > 0) {
           this.tjRecipeId = arr2[0].preid || arr2[0].pid || arr2[0].acupreid;