Pārlūkot izejas kodu

1. 修改药品用法取值
2. 药品剂量计算范围

cc12458 1 gadu atpakaļ
vecāks
revīzija
d7b4d3e3b3

+ 9 - 3
src/components/ChineseMedicine.vue

@@ -635,7 +635,7 @@
                       <el-option
                         :label="item.value"
                         :value="item.key"
-                        v-for="(item,index) in scope.row.usageList"
+                        v-for="(item,index) in usageList"
                         :key="scope.row.id+'h'+index"
                       ></el-option>
                     </el-select>
@@ -993,7 +993,7 @@ import { debounce } from "@/utils/format.js";
 import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
 import popup from "@/components/Propup.vue";
 import accompanied from "./ui/accompanied.vue";
-import {CC_Dosage2Basis} from '@/utils/medicine';
+import {CC_Basis2Dosage, CC_Dosage2Basis} from '@/utils/medicine';
 
 let medicineBlurTimer;
 export default {
@@ -1832,7 +1832,7 @@ export default {
         name: item.ypmc,
         spec: item.gg, // 规格
         // dose: "", // 剂量
-        dose: scope.row.color === "red" || oneself ? scope.row.dose : "",
+        dose: scope.row.color === "red" || oneself ? null : "",
         unit: item.dw, // 单位
         usage:
           oneself ? scope.row.usage : scope.row.color === "red"
@@ -1852,6 +1852,12 @@ export default {
       };
       obj.ggnum = +item.ggnum || 1;
       obj.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj.ggnum : 1;
+      
+      if (obj.dose == null) {
+        obj.oldDose = CC_Dosage2Basis(scope.row)
+        obj.dose = CC_Basis2Dosage(obj)
+      }
+
       Object.assign(totalData[scope.row.id - 1], obj);
 
       // 调用 父级合理用药接口

+ 2 - 2
src/views/diagnosis/Prescribing.vue

@@ -3673,7 +3673,7 @@ export default {
 
         if (item.matmaxdosage && item.matmindosage) {
           try {
-            const dose = +item.__medicine__.dose;
+            const dose = CC_Dosage2Basis(item.__medicine__);
             if (dose && (dose < item.matmindosage || dose > item.matmaxdosage)) item.showDose = true;
           } catch (e) {}
           this.rationalMed10.push(item);
@@ -3777,7 +3777,7 @@ export default {
 
           if (item.matmaxdosage && item.matmindosage) {
             try {
-              const dose = +item.__medicine__.dose;
+              const dose = CC_Dosage2Basis(item.__medicine__);
               if (dose < item.matmindosage || dose > item.matmaxdosage) item.showDose = true;
             } catch (e) {}
             this.rationalMed10.push(item);