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

Merge branch 'feature/story-55' into develop

cc12458 1 год назад
Родитель
Сommit
ad90c4966b

+ 67 - 7
src/components/ChineseMedicine.vue

@@ -56,7 +56,7 @@
         </div>
         </div>
         <!-- @change="getPharmacyID" -->
         <!-- @change="getPharmacyID" -->
         <!-- @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)" -->
         <!-- @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)" -->
-        <div class="t-con-radio flex-vertical-center-l">
+        <div class="t-con-radio flex-vertical-center-l" v-if="false">
           <div class="t-radio-group">
           <div class="t-radio-group">
             <el-radio-group
             <el-radio-group
               v-model="recipe_tabs[recipe_tabs_c].radio"
               v-model="recipe_tabs[recipe_tabs_c].radio"
@@ -73,6 +73,17 @@
             </el-radio-group>
             </el-radio-group>
           </div>
           </div>
         </div>
         </div>
+        <div class="t-con-radio flex-vertical-center-l" style="flex-wrap: wrap;align-items: center;">
+          <div class="t-radio-group2" :class="{multiple: group.options.length > 1}" v-for="group in pharmacyTypeGroup" :key="group.name">
+            <label v-if="group.options.length > 1">{{group.name}}</label>
+            <el-radio v-for="item in group.options" :key="item.ptype"
+                      v-model="recipe_tabs[recipe_tabs_c].radio"
+                      :disabled="recipe_tabs[recipe_tabs_c].disable"
+                      :label="item.ptype"
+                      @click.native.prevent="changePharmacy(recipe_tabs[recipe_tabs_c].lastType,item.ptype)"
+            >{{item.name}}</el-radio>
+          </div>
+        </div>
 
 
         <!-- <div class="add-presc1 flex-center" @click="clearRecipe()">清空处方</div> -->
         <!-- <div class="add-presc1 flex-center" @click="clearRecipe()">清空处方</div> -->
       </div>
       </div>
@@ -347,7 +358,7 @@
                 </el-table-column>
                 </el-table-column>
 
 
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
-                <el-table-column prop="dose" label="剂量" width="40">
+                <el-table-column prop="dose" label="剂量" width="60">
                   <template slot-scope="scope" v-if="scope.row.name">
                   <template slot-scope="scope" v-if="scope.row.name">
                     <div class="t_dose">
                     <div class="t_dose">
                       <el-input
                       <el-input
@@ -583,7 +594,7 @@
                 </el-table-column>
                 </el-table-column>
                 <!-- fixed="left" -->
                 <!-- fixed="left" -->
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
-                <el-table-column prop="dose" label="剂量" width="40">
+                <el-table-column prop="dose" label="剂量" width="60">
                   <template slot-scope="scope" v-if="scope.row.name">
                   <template slot-scope="scope" v-if="scope.row.name">
                     <div class="t_dose">
                     <div class="t_dose">
                       <el-input
                       <el-input
@@ -982,6 +993,7 @@ import { debounce } from "@/utils/format.js";
 import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
 import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
 import popup from "@/components/Propup.vue";
 import popup from "@/components/Propup.vue";
 import accompanied from "./ui/accompanied.vue";
 import accompanied from "./ui/accompanied.vue";
+import {CC_Dosage2Basis} from '@/utils/medicine';
 
 
 let medicineBlurTimer;
 let medicineBlurTimer;
 export default {
 export default {
@@ -1102,6 +1114,7 @@ export default {
       isAutoCheck: "0", // 是否自动审核 0 手动 1自动 (自动的时候用his 的是否支付成功字段 判断显示)
       isAutoCheck: "0", // 是否自动审核 0 手动 1自动 (自动的时候用his 的是否支付成功字段 判断显示)
       pharmacyList: [], // 药房选择器 数据
       pharmacyList: [], // 药房选择器 数据
       pharmacyTypes: [],
       pharmacyTypes: [],
+      pharmacyTypeGroup: [],
       clickPid: "", // 点击的药品id
       clickPid: "", // 点击的药品id
       maxDose: null,
       maxDose: null,
       minDose: null,
       minDose: null,
@@ -1837,6 +1850,8 @@ export default {
         showSearch: false,
         showSearch: false,
         showDoseSection: false // 展示剂量区间
         showDoseSection: false // 展示剂量区间
       };
       };
+      obj.ggnum = +item.ggnum || 1;
+      obj.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj.ggnum : 1;
       Object.assign(totalData[scope.row.id - 1], obj);
       Object.assign(totalData[scope.row.id - 1], obj);
 
 
       // 调用 父级合理用药接口
       // 调用 父级合理用药接口
@@ -2373,18 +2388,43 @@ export default {
       });
       });
       if (res.ResultCode == 0) {
       if (res.ResultCode == 0) {
         let pharmacyTypes = [];
         let pharmacyTypes = [];
+        let pharmacyTypeGroup = [];
         res.Data.forEach(item => {
         res.Data.forEach(item => {
           item.dosageForms = item.dosageForms.split(",");
           item.dosageForms = item.dosageForms.split(",");
           item.dosageForms.forEach(item1 => {
           item.dosageForms.forEach(item1 => {
             pharmacyTypes.push({
             pharmacyTypes.push({
               type: item1,
               type: item1,
               ptype: item.pid + "@" + item1,
               ptype: item.pid + "@" + item1,
-              name: item.displayName //+ this.getRadioName(item1)
+              name: item.displayName + (item.dosageForms.length > 1 ? ` (${this.getRadioName(item1)})` : '')
             });
             });
           });
           });
+          if (item.dosageForms.length > 1) {
+            pharmacyTypeGroup.push({
+              name: item.displayName,
+              options: item.dosageForms.map(item1 => {
+                return {
+                  type: item1,
+                  ptype: item.pid + "@" + item1,
+                  name: this.getRadioName(item1),
+                }
+              })
+            })
+          } else if (item.dosageForms.length === 1) {
+            pharmacyTypeGroup.push({
+              name: item.displayName,
+              options: item.dosageForms.map(item1 => {
+                return {
+                  type: item1,
+                  ptype: item.pid + "@" + item1,
+                  name: item.displayName,
+                }
+              })
+            })
+          }
         });
         });
         this.pharmacyList = res.Data;
         this.pharmacyList = res.Data;
         this.pharmacyTypes = pharmacyTypes;
         this.pharmacyTypes = pharmacyTypes;
+        this.pharmacyTypeGroup = pharmacyTypeGroup;
       }
       }
     },
     },
     // 获取药房id
     // 获取药房id
@@ -2422,14 +2462,14 @@ export default {
 
 
       this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
       this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
         if (item.name) {
         if (item.name) {
+          item.oldDose = CC_Dosage2Basis(item);
           let idDose =
           let idDose =
             item.medid +
             item.medid +
             "&" +
             "&" +
-            (item.dose || item.oldDose) +
+            item.oldDose +
             "&" +
             "&" +
             (item.usage || "");
             (item.usage || "");
           // drugIds.push(item.medid)
           // drugIds.push(item.medid)
-          item.oldDose = item.dose;
           drugIds.push(idDose);
           drugIds.push(idDose);
         }
         }
       });
       });
@@ -2489,7 +2529,8 @@ export default {
                     oldDose: item1.oldDose
                     oldDose: item1.oldDose
                   };
                   };
                   /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
                   /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
-
+                  item1.ggnum = +item.ggnum || 1;
+                  item1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? item1.ggnum : 1;
                   item1.color = item.kc > 0 ? "#000" : 'red';
                   item1.color = item.kc > 0 ? "#000" : 'red';
                 }
                 }
 
 
@@ -2643,6 +2684,7 @@ export default {
 
 
     // 根据表格获取数据类型
     // 根据表格获取数据类型
     async getSelectType(data, index) {
     async getSelectType(data, index) {
+      if (data === '中药药品用法' && this.usageList.length) return;
       let res = await getSelectType(data);
       let res = await getSelectType(data);
 
 
       if (data == "中药药品用法") {
       if (data == "中药药品用法") {
@@ -2935,6 +2977,24 @@ export default {
         flex: 1;
         flex: 1;
       }
       }
 
 
+      .t-radio-group2 {
+        padding: 4px 8px;
+
+        &.multiple {
+          border: 2px dashed #5386f6;
+
+          > label:first-of-type {
+            margin-right: 8px;
+            color: rgba(0, 0, 0, 0.6);
+
+            &:after {
+              margin-left: 2px;
+              content: ":";
+            }
+          }
+        }
+      }
+
       .add-presc1 {
       .add-presc1 {
         width: 84px;
         width: 84px;
         height: 34px;
         height: 34px;

+ 77 - 17
src/components/MedicineAccord.vue

@@ -21,21 +21,34 @@
           </div>
           </div>
         </div>
         </div>
         <!-- @change="getPharmacyID" -->
         <!-- @change="getPharmacyID" -->
-        <div class="t-con-radio flex-vertical-center-l" v-if="!isPurposeType">
-          <div class="t-radio-group">
-            <el-radio-group
-              v-model="recipe_tabs[recipe_tabs_c].radio"
-              :disabled="recipe_tabs[recipe_tabs_c].disable"
-              @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)"
-            >
-              <el-radio
-                :label="item.ptype"
-                v-for="(item,index) in pharmacyTypes"
-                :key="index"
+        <template v-if="!isPurposeType">
+          <div class="t-con-radio flex-vertical-center-l" v-if="false">
+            <div class="t-radio-group">
+              <el-radio-group
+                  v-model="recipe_tabs[recipe_tabs_c].radio"
+                  :disabled="recipe_tabs[recipe_tabs_c].disable"
+                  @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)"
+              >
+                <el-radio
+                    :label="item.ptype"
+                    v-for="(item,index) in pharmacyTypes"
+                    :key="index"
+                >{{item.name}}</el-radio>
+              </el-radio-group>
+            </div>
+          </div>
+          <div class="t-con-radio flex-vertical-center-l" style="flex-wrap: wrap;align-items: center;">
+            <div class="t-radio-group2" :class="{multiple: group.options.length > 1}" v-for="group in pharmacyTypeGroup" :key="group.name">
+              <label v-if="group.options.length > 1">{{group.name}}</label>
+              <el-radio v-for="item in group.options" :key="item.ptype"
+                        v-model="recipe_tabs[recipe_tabs_c].radio"
+                        :disabled="recipe_tabs[recipe_tabs_c].disable"
+                        :label="item.ptype"
+                        @click.native.prevent="changePharmacy(recipe_tabs[recipe_tabs_c].lastType,item.ptype)"
               >{{item.name}}</el-radio>
               >{{item.name}}</el-radio>
-            </el-radio-group>
+            </div>
           </div>
           </div>
-        </div>
+        </template>
 
 
         <!-- <div class="add-presc1 flex-center" @click="clearRecipe()">清空处方</div> -->
         <!-- <div class="add-presc1 flex-center" @click="clearRecipe()">清空处方</div> -->
       </div>
       </div>
@@ -176,7 +189,7 @@
                 </el-table-column>
                 </el-table-column>
 
 
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
-                <el-table-column prop="dose" label="剂量" width="40">
+                <el-table-column prop="dose" label="剂量" width="60">
                   <template slot-scope="scope" v-if="scope.row.name">
                   <template slot-scope="scope" v-if="scope.row.name">
                     <div class="t_dose">
                     <div class="t_dose">
                       <el-input
                       <el-input
@@ -412,7 +425,7 @@
                 </el-table-column>
                 </el-table-column>
                 <!-- fixed="left" -->
                 <!-- fixed="left" -->
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
                 <el-table-column prop="spec" label="规格" width="100"></el-table-column>
-                <el-table-column prop="dose" label="剂量" width="40">
+                <el-table-column prop="dose" label="剂量" width="60">
                   <template slot-scope="scope" v-if="scope.row.name">
                   <template slot-scope="scope" v-if="scope.row.name">
                     <div class="t_dose">
                     <div class="t_dose">
                       <el-input
                       <el-input
@@ -667,6 +680,7 @@ export default {
       countWay: "1", // 计算方式
       countWay: "1", // 计算方式
       pharmacyList: [], // 药房选择器 数据
       pharmacyList: [], // 药房选择器 数据
       pharmacyTypes: [],
       pharmacyTypes: [],
+      pharmacyTypeGroup: [],
       clickPid: "", // 点击的药品id
       clickPid: "", // 点击的药品id
       maxDose: null,
       maxDose: null,
       minDose: null,
       minDose: null,
@@ -1315,6 +1329,8 @@ export default {
         showSearch: false,
         showSearch: false,
         showDoseSection: false // 展示剂量区间
         showDoseSection: false // 展示剂量区间
       };
       };
+      obj.ggnum = +item.ggnum || 1;
+      obj.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj.ggnum : 1;
       Object.assign(totalData[scope.row.id - 1], obj);
       Object.assign(totalData[scope.row.id - 1], obj);
 
 
       // 调用 父级合理用药接口
       // 调用 父级合理用药接口
@@ -1826,15 +1842,39 @@ export default {
       });
       });
       if (res.ResultCode == 0) {
       if (res.ResultCode == 0) {
         let pharmacyTypes = [];
         let pharmacyTypes = [];
+        let pharmacyTypeGroup = [];
         res.Data.forEach(item => {
         res.Data.forEach(item => {
           item.dosageForms = item.dosageForms.split(",");
           item.dosageForms = item.dosageForms.split(",");
           item.dosageForms.forEach(item1 => {
           item.dosageForms.forEach(item1 => {
             pharmacyTypes.push({
             pharmacyTypes.push({
               type: item1,
               type: item1,
               ptype: item.pid + "@" + item1,
               ptype: item.pid + "@" + item1,
-              name: item.displayName //+ this.getRadioName(item1)
+              name: item.displayName + (item.dosageForms.length > 1 ? ` (${this.getRadioName(item1)})` : '')
             });
             });
           });
           });
+          if (item.dosageForms.length > 1) {
+            pharmacyTypeGroup.push({
+              name: item.displayName,
+              options: item.dosageForms.map(item1 => {
+                return {
+                  type: item1,
+                  ptype: item.pid + "@" + item1,
+                  name: this.getRadioName(item1),
+                }
+              })
+            })
+          } else if (item.dosageForms.length === 1) {
+            pharmacyTypeGroup.push({
+              name: item.displayName,
+              options: item.dosageForms.map(item1 => {
+                return {
+                  type: item1,
+                  ptype: item.pid + "@" + item1,
+                  name: item.displayName,
+                }
+              })
+            })
+          }
         });
         });
 
 
         this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.Data[0].pid;
         this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.Data[0].pid;
@@ -1842,6 +1882,7 @@ export default {
         this.recipe_tabs[this.recipe_tabs_c].lastType = pharmacyTypes[0].ptype;
         this.recipe_tabs[this.recipe_tabs_c].lastType = pharmacyTypes[0].ptype;
         this.pharmacyList = res.Data;
         this.pharmacyList = res.Data;
         this.pharmacyTypes = pharmacyTypes;
         this.pharmacyTypes = pharmacyTypes;
+        this.pharmacyTypeGroup = pharmacyTypeGroup;
         this.$forceUpdate();
         this.$forceUpdate();
         this.getPharmacyMsg(res.Data[0].pid);
         this.getPharmacyMsg(res.Data[0].pid);
       }
       }
@@ -1941,7 +1982,8 @@ export default {
                     oldDose: item1.oldDose
                     oldDose: item1.oldDose
                   };
                   };
                   /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
                   /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
-
+                  item1.ggnum = +item.ggnum || 1;
+                  item1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? item1.ggnum : 1;
                   item1.color = "#000";
                   item1.color = "#000";
                 }
                 }
 
 
@@ -2297,6 +2339,24 @@ export default {
       flex: 1;
       flex: 1;
     }
     }
 
 
+    .t-radio-group2 {
+      padding: 4px 8px;
+
+      &.multiple {
+        border: 2px dashed #5386f6;
+
+        > label:first-of-type {
+          margin-right: 8px;
+          color: rgba(0, 0, 0, 0.6);
+
+          &:after {
+            margin-left: 2px;
+            content: ":";
+          }
+        }
+      }
+    }
+
     .add-presc1 {
     .add-presc1 {
       width: 84px;
       width: 84px;
       height: 34px;
       height: 34px;

+ 8 - 3
src/components/ui/accompanied.vue

@@ -31,6 +31,7 @@
         changeAndJoin,
         changeAndJoin,
 
 
     } from "@/api/knowledge.js";
     } from "@/api/knowledge.js";
+    import {CC_Dosage2Basis} from '@/utils/medicine';
     accompaniedData.forEach(item => {
     accompaniedData.forEach(item => {
         item.child.forEach(item1 => {
         item.child.forEach(item1 => {
             item1.child.forEach(item2 => {
             item1.child.forEach(item2 => {
@@ -152,7 +153,8 @@
 
 
                 let ids = [];
                 let ids = [];
                 drugs.forEach(item => {
                 drugs.forEach(item => {
-                    let idDose = item.pid + "&" + (item.dose || 0);
+                    item.oldDose = CC_Dosage2Basis(item);
+                    let idDose = item.pid + "&" + (item.oldDose || 0);
                     ids.push(idDose);
                     ids.push(idDose);
                 });
                 });
 
 
@@ -203,12 +205,14 @@
                                     key: "",
                                     key: "",
                                     search_i: index
                                     search_i: index
                                 };
                                 };
-
+                                obj.oldDose = item1.oldDose;
                                 noDrugs.push(obj);
                                 noDrugs.push(obj);
                                 // noDrugs.push(item1.matname)
                                 // noDrugs.push(item1.matname)
                             }
                             }
 
 
                             if (item instanceof Object && item.oldYpid == item1.matid) {
                             if (item instanceof Object && item.oldYpid == item1.matid) {
+                                item.ggnum = +item.ggnum || 1;
+                                item.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? item.ggnum : 1;
                                 hasDrugs.push(item);
                                 hasDrugs.push(item);
                             }
                             }
                         });
                         });
@@ -248,7 +252,8 @@
                                 originname: item.cdmc, // 产地名称
                                 originname: item.cdmc, // 产地名称
                                 showSearch: false
                                 showSearch: false
                             };
                             };
-
+                            obj1.ggnum = +item.ggnum || 1;
+                            obj1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj1.ggnum : 1;
                             parent.recipe_tabs[parent.recipe_tabs_c].totalTableD.push(obj1);
                             parent.recipe_tabs[parent.recipe_tabs_c].totalTableD.push(obj1);
                             parent.getSelectType("中药药品用法", index);
                             parent.getSelectType("中药药品用法", index);
                         });
                         });

+ 26 - 0
src/utils/medicine.js

@@ -0,0 +1,26 @@
+/**
+ * 药品输入剂量通过转换系数成基础剂量
+ * @param medicine 药品
+ * @param {number} medicine.dose 输入剂量
+ * @param {number} medicine.xbzxs 转换系数
+ * @returns {number} 基础剂量
+ */
+export function CC_Dosage2Basis({dose = 0, xbzxs = 1}) {
+    console.log('log-->CC_Dosage2Basis', `dose: ${dose}, xbzxs: ${xbzxs}`);
+    if (!xbzxs || xbzxs === 1) return dose;
+    return dose * xbzxs;
+}
+
+/**
+ * 药品基础剂量通过转换系数成输入剂量
+ * @param medicine 药品
+ * @param {number} medicine.oldDose 基础剂量
+ * @param {number} medicine.xbzxs 转换系数
+ * @param {boolean=false} keep 保留计算结果
+ * @returns {number} 输入剂量
+ */
+export function CC_Basis2Dosage({oldDose = 0, xbzxs = 1}, keep = false) {
+    console.log('log-->CC_Basis2Dosage', `basis: ${oldDose}, xbzxs: ${xbzxs}`);
+    if (!xbzxs || xbzxs === 1) return oldDose;
+    return oldDose / xbzxs;
+}

+ 5 - 1
src/views/business/ExperienceAdd.vue

@@ -263,6 +263,7 @@ import {
   getExperinceDetail,
   getExperinceDetail,
   editExperince
   editExperince
 } from "@/api/business";
 } from "@/api/business";
+import {CC_Dosage2Basis} from '@/utils/medicine';
 
 
 export default {
 export default {
   components: {
   components: {
@@ -863,7 +864,8 @@ export default {
 
 
       this.totalTableD.forEach(item => {
       this.totalTableD.forEach(item => {
         if (item.name) {
         if (item.name) {
-          let idDose = item.medid + "&" + item.dose;
+          item.oldDose = CC_Dosage2Basis(item);
+          let idDose = item.medid + "&" + item.oldDose;
           // drugIds.push(item.medid)
           // drugIds.push(item.medid)
           drugIds.push(idDose);
           drugIds.push(idDose);
         }
         }
@@ -923,6 +925,8 @@ export default {
                 item1.showSearch = false;
                 item1.showSearch = false;
 
 
                 item1.color = "#000";
                 item1.color = "#000";
+                item1.ggnum = +item.ggnum || 1;
+                item1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? item1.ggnum : 1;
               }
               }
 
 
               this.$set(this.totalTableD, index1, item1);
               this.$set(this.totalTableD, index1, item1);

+ 20 - 6
src/views/diagnosis/Prescribing.vue

@@ -1183,6 +1183,7 @@ import { setTimeout } from "timers";
 import prescribing from "../../utils/minix/prescribing";
 import prescribing from "../../utils/minix/prescribing";
 
 
 import {formatPicture} from "@/utils/picture";
 import {formatPicture} from "@/utils/picture";
+import {CC_Dosage2Basis} from '@/utils/medicine';
 
 
 export default {
 export default {
   mixins: [prescribing],
   mixins: [prescribing],
@@ -2542,7 +2543,8 @@ export default {
           originname: item.cdmc, // 产地名称
           originname: item.cdmc, // 产地名称
           showSearch: false
           showSearch: false
         };
         };
-
+        obj1.ggnum = +item.ggnum || 1;
+        obj1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj1.ggnum : 1;
         data1.recipe_tabs[data1.recipe_tabs_c].totalTableD.push(obj1);
         data1.recipe_tabs[data1.recipe_tabs_c].totalTableD.push(obj1);
         data1.getSelectType("中药药品用法", index);
         data1.getSelectType("中药药品用法", index);
       });
       });
@@ -2829,8 +2831,8 @@ export default {
      const is = recipe.medicine.every(m => m.matid);
      const is = recipe.medicine.every(m => m.matid);
      if (is) {
      if (is) {
        // 调用 方剂 换方
        // 调用 方剂 换方
-       const medicine = recipe.medicine.map((m, i) => {
-         return {
+       const medicines = recipe.medicine.map((m, i) => {
+         const medicine = {
            matid: m.matid,
            matid: m.matid,
            matname: m.ypmc,
            matname: m.ypmc,
            dose: m.dose,
            dose: m.dose,
@@ -2838,9 +2840,12 @@ export default {
            useage: m.usagestr,
            useage: m.usagestr,
            seqn: i + 1,
            seqn: i + 1,
          }
          }
+         medicine.ggnum = +m.ggnum || 1;
+         medicine.xbzxs = +m.xbzxs || '34'.includes(m.zylx) ? medicine.ggnum : 1;
+         return medicine;
        });
        });
        if (recipe.__RecipeFrom__ === '2') this.agreeAssignToTCM(recipe, void 0, true);
        if (recipe.__RecipeFrom__ === '2') this.agreeAssignToTCM(recipe, void 0, true);
-       this.setDrugsInfo(medicine);
+       this.setDrugsInfo(medicines);
        this.changeAndJoin(1);
        this.changeAndJoin(1);
      } else if (recipe.__RecipeFrom__ === '2') {
      } else if (recipe.__RecipeFrom__ === '2') {
        this.agreeInfo = recipe;
        this.agreeInfo = recipe;
@@ -2931,7 +2936,8 @@ export default {
           originname: item.cdmc, // 产地名称
           originname: item.cdmc, // 产地名称
           showSearch: false
           showSearch: false
         };
         };
-
+        obj1.ggnum = +item.ggnum || 1;
+        obj1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj1.ggnum : 1;
         data1.recipe_tabs[data1.recipe_tabs_c].totalTableD.push(obj1);
         data1.recipe_tabs[data1.recipe_tabs_c].totalTableD.push(obj1);
         data1.getSelectType("中药药品用法", index);
         data1.getSelectType("中药药品用法", index);
       });
       });
@@ -4010,7 +4016,8 @@ export default {
 
 
       let ids = [];
       let ids = [];
       drugs.forEach(item => {
       drugs.forEach(item => {
-        let idDose = item.matid + "&" + item.dose + "&" + (item.useage || "");
+        item.oldDose = CC_Dosage2Basis(item);
+        let idDose = item.matid + "&" + item.oldDose + "&" + (item.useage || "");
         ids.push(idDose);
         ids.push(idDose);
       });
       });
 
 
@@ -4068,12 +4075,15 @@ export default {
                   key: "",
                   key: "",
                   search_i: index
                   search_i: index
                 };
                 };
+                obj.oldDose = item1.oldDose;
                 /* 修正 */ obj.usage = obj.useage = getUsage(obj.usage);
                 /* 修正 */ obj.usage = obj.useage = getUsage(obj.usage);
                 noDrugs.push(obj);
                 noDrugs.push(obj);
                 // noDrugs.push(item1.matname)
                 // noDrugs.push(item1.matname)
               }
               }
 
 
               if (item instanceof Object && item.oldYpid == item1.matid) {
               if (item instanceof Object && item.oldYpid == item1.matid) {
+                item.ggnum = +item.ggnum || 1;
+                item.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? item.ggnum : 1;
                 if (item.kc > 0) hasDrugs.push(item);
                 if (item.kc > 0) hasDrugs.push(item);
                 else {
                 else {
                   item.color = 'red';
                   item.color = 'red';
@@ -4112,6 +4122,8 @@ export default {
                 color: item.color ? item.color : "#000"
                 color: item.color ? item.color : "#000"
               };
               };
               /* 修正 */ obj1.usage = obj1.useage = getUsage(obj1.usage);
               /* 修正 */ obj1.usage = obj1.useage = getUsage(obj1.usage);
+              obj1.ggnum = +item.ggnum || 1;
+              obj1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj1.ggnum : 1;
 
 
               child.recipe_tabs[child.recipe_tabs_c].totalTableD.push(obj1);
               child.recipe_tabs[child.recipe_tabs_c].totalTableD.push(obj1);
               child.getSelectType("中药药品用法", index);
               child.getSelectType("中药药品用法", index);
@@ -4197,6 +4209,8 @@ export default {
                 showSearch: false
                 showSearch: false
               };
               };
               /* 修正 */ obj1.usage = obj1.useage = getUsage(obj1.usage);
               /* 修正 */ obj1.usage = obj1.useage = getUsage(obj1.usage);
+              obj1.ggnum = +item.ggnum || 1;
+              obj1.xbzxs = +item.xbzxs || '34'.includes(item.zylx) ? obj1.ggnum : 1;
 
 
               child.recipe_tabs[child.recipe_tabs_c].totalTableD.push(obj1);
               child.recipe_tabs[child.recipe_tabs_c].totalTableD.push(obj1);
               child.getSelectType("中药药品用法", index);
               child.getSelectType("中药药品用法", index);

+ 3 - 2
src/views/diagnosis/components/submitRecipe.vue

@@ -453,10 +453,11 @@ export default {
     },
     },
     // 处理数据
     // 处理数据
     dealPriviewData() {
     dealPriviewData() {
+      if (!this.priviewData) return;
       // this.isPs = false;
       // this.isPs = false;
       // this.isDj = false;
       // this.isDj = false;
       // 中药处方
       // 中药处方
-      if (this.priviewData.tcmPrescriptionFormVos.length > 0) {
+      if (Array.isArray(this.priviewData.tcmPrescriptionFormVos) && this.priviewData.tcmPrescriptionFormVos.length > 0) {
         this.priviewData.tcmPrescriptionFormVos.forEach((item, index) => {
         this.priviewData.tcmPrescriptionFormVos.forEach((item, index) => {
           item.showSign = true;
           item.showSign = true;
           item.recipeType = 1;
           item.recipeType = 1;
@@ -483,7 +484,7 @@ export default {
         }
         }
       }
       }
 
 
-      this.recipeItem = this.recipes[0];
+      this.recipeItem = this.recipes[0] || {};
       // this.recipes.forEach(item => {
       // this.recipes.forEach(item => {
       //   if (item.recipeType == 1 && item.fried == "代煎") {
       //   if (item.recipeType == 1 && item.fried == "代煎") {
       //     this.isDj = true;
       //     this.isDj = true;