XMLWAN 4 lat temu
rodzic
commit
a08406a24a

+ 61 - 73
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue Wyświetl plik

647
       current_drug_name:"",
647
       current_drug_name:"",
648
       current_drug_spec: "",
648
       current_drug_spec: "",
649
       drug_id: 0,
649
       drug_id: 0,
650
-      src_type:""
650
+      src_type:"",
651
+      private_drug_config:{},
651
     };
652
     };
652
   },
653
   },
653
   props: {
654
   props: {
699
   },
700
   },
700
   methods: {
701
   methods: {
701
     submitgroupAdvice(formName) {
702
     submitgroupAdvice(formName) {
702
-      
703
       this.$refs[formName].validate(valid => {
703
       this.$refs[formName].validate(valid => {
704
         if (valid) {
704
         if (valid) {
705
-          var submitForm = {
705
+         var submitForm = {
706
             advice_type: this.groupForm.advice_type,
706
             advice_type: this.groupForm.advice_type,
707
             advice_date: this.groupForm.advice_date,
707
             advice_date: this.groupForm.advice_date,
708
             start_time: this.groupForm.start_time,
708
             start_time: this.groupForm.start_time,
711
             remark: this.groupForm.remark,
711
             remark: this.groupForm.remark,
712
             parent_id: this.groupForm.parent_id
712
             parent_id: this.groupForm.parent_id
713
           };
713
           };
714
-          
715
-          console.log("888888",this.groupForm.adviceNames)
714
+         
716
           var adviceNames = [];
715
           var adviceNames = [];
717
           for (const index in this.groupForm.adviceNames) {
716
           for (const index in this.groupForm.adviceNames) {
718
             adviceNames.unshift(this.groupForm.adviceNames[index]);
717
             adviceNames.unshift(this.groupForm.adviceNames[index]);
720
           submitForm.adviceNames = adviceNames;
719
           submitForm.adviceNames = adviceNames;
721
           let mode = "1";
720
           let mode = "1";
722
           
721
           
723
-     
724
           console.log("88888888",submitForm)
722
           console.log("88888888",submitForm)
725
-          
723
+          console.log("99999",this.medicals)
724
+          if(this.private_drug_config.drug_start == 1){
725
+           
726
+             for(let index=0;index<submitForm.adviceNames.length;index++){
727
+                for(let i=0;i<this.medicals.length;i++){
728
+                   if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
729
+                      submitForm.adviceNames[index].way = 2
730
+                   }
731
+                }
732
+             }
733
+          }
726
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
734
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
727
             response => {
735
             response => {
728
               if (response.data.state == 0) {
736
               if (response.data.state == 0) {
1134
       }
1142
       }
1135
     },
1143
     },
1136
     templateTableChange(currentRow, oldCurrentRow) {
1144
     templateTableChange(currentRow, oldCurrentRow) {
1145
+      console.log("params -----",currentRow)
1137
       this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
1146
       this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
1138
       if (currentRow == null) {
1147
       if (currentRow == null) {
1139
         return false;
1148
         return false;
1148
           .DoctorAdviceTemplate) {
1157
           .DoctorAdviceTemplate) {
1149
           thisRowKey++;
1158
           thisRowKey++;
1150
           var item = {
1159
           var item = {
1151
-            advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1152
-              index
1153
-            ].advice_name,
1154
-            advice_desc: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1155
-              index
1156
-            ].advice_desc,
1157
-            single_dose:
1158
-              "" +
1159
-              this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
1160
-                .single_dose,
1161
-            single_dose_unit: this.adviceTemplateMaps[mapid]
1162
-              .DoctorAdviceTemplate[index].single_dose_unit,
1163
-            drug_spec:
1164
-              "" +
1165
-              this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
1160
+            advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
1161
+            advice_desc: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_desc,
1162
+            single_dose:"" +this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
1163
+            single_dose_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
1164
+            drug_spec:"" +this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
1166
             drug_spec_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
1165
             drug_spec_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
1167
-            prescribing_number:
1168
-              "" +
1169
-              this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
1170
-                .prescribing_number,
1171
-            prescribing_number_unit: this.adviceTemplateMaps[mapid]
1172
-              .DoctorAdviceTemplate[index].prescribing_number_unit,
1173
-            delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1174
-              index
1175
-            ].delivery_way,
1176
-            execution_frequency: this.adviceTemplateMaps[mapid]
1177
-              .DoctorAdviceTemplate[index].execution_frequency,
1178
-            selection: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1179
-              index
1180
-            ].selection,
1181
-            advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1182
-              index
1183
-            ].id,
1184
-
1166
+            prescribing_number:"" +this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
1167
+            prescribing_number_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
1168
+            delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
1169
+            execution_frequency: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
1170
+            selection: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].selection,
1171
+            advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].id,
1172
+            drug_id:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_id,
1173
+            way:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].way,
1185
             isEdit: 0,
1174
             isEdit: 0,
1186
             id: 0,
1175
             id: 0,
1187
             children: [],
1176
             children: [],
1212
                 prescribing_number_unit: children[key].prescribing_number_unit,
1201
                 prescribing_number_unit: children[key].prescribing_number_unit,
1213
                 delivery_way: children[key].delivery_way,
1202
                 delivery_way: children[key].delivery_way,
1214
                 execution_frequency: children[key].execution_frequency,
1203
                 execution_frequency: children[key].execution_frequency,
1204
+                drug_id:children[key].drug_id,
1205
+                way:children[key].way,
1215
                 isEdit: 0,
1206
                 isEdit: 0,
1216
                 id: 0,
1207
                 id: 0,
1217
                 children: [],
1208
                 children: [],
1218
                 parent_row: parentRow,
1209
                 parent_row: parentRow,
1219
-                row_key: thisRowKey
1210
+                row_key: thisRowKey,
1211
+               
1220
               };
1212
               };
1221
               item.children.push(child);
1213
               item.children.push(child);
1222
             }
1214
             }
1236
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1228
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1237
             thisRowKey++;
1229
             thisRowKey++;
1238
             var item = {
1230
             var item = {
1239
-              advice_name:
1240
-                adviceTemplate.DoctorAdviceTemplate[index].advice_name,
1241
-              advice_desc:
1242
-                adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
1243
-              single_dose:
1244
-                "" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
1245
-              single_dose_unit:
1246
-                adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
1247
-              drug_spec:
1248
-                "" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
1249
-              drug_spec_unit:
1250
-                adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
1251
-              prescribing_number:
1252
-                "" +
1253
-                adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
1254
-              prescribing_number_unit:
1255
-                adviceTemplate.DoctorAdviceTemplate[index]
1256
-                  .prescribing_number_unit,
1257
-              delivery_way:
1258
-                adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
1259
-              execution_frequency:
1260
-                adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1231
+              advice_name:adviceTemplate.DoctorAdviceTemplate[index].advice_name,
1232
+              advice_desc:adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
1233
+              single_dose:"" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
1234
+              single_dose_unit:adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
1235
+              drug_spec:"" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
1236
+              drug_spec_unit:adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
1237
+              prescribing_number:"" +adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
1238
+              prescribing_number_unit:adviceTemplate.DoctorAdviceTemplate[index].prescribing_number_unit,
1239
+              delivery_way:adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
1240
+              execution_frequency:adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1261
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1241
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1262
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1242
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1243
+              drug_id: adviceTemplate.DoctorAdviceTemplate[index].drug_id,
1244
+              way:adviceTemplate.DoctorAdviceTemplate[index].way,
1263
               isEdit: 0,
1245
               isEdit: 0,
1264
               id: 0,
1246
               id: 0,
1265
               children: [],
1247
               children: [],
1266
               parent_row: 0,
1248
               parent_row: 0,
1267
               row_key: thisRowKey
1249
               row_key: thisRowKey
1268
             };
1250
             };
1251
+            console.log("items========",item)
1269
             if (
1252
             if (
1270
               "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
1253
               "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
1271
               adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
1254
               adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
1284
                   drug_spec: "" + children[key].drug_spec,
1267
                   drug_spec: "" + children[key].drug_spec,
1285
                   drug_spec_unit: children[key].drug_spec_unit,
1268
                   drug_spec_unit: children[key].drug_spec_unit,
1286
                   prescribing_number: "" + children[key].prescribing_number,
1269
                   prescribing_number: "" + children[key].prescribing_number,
1287
-                  prescribing_number_unit:
1288
-                    children[key].prescribing_number_unit,
1270
+                  prescribing_number_unit:children[key].prescribing_number_unit,
1289
                   delivery_way: children[key].delivery_way,
1271
                   delivery_way: children[key].delivery_way,
1290
                   execution_frequency: children[key].execution_frequency,
1272
                   execution_frequency: children[key].execution_frequency,
1273
+                  drug_id:children[key].drug_id,
1274
+                  way:children[key].way,
1291
                   isEdit: 0,
1275
                   isEdit: 0,
1292
                   id: 0,
1276
                   id: 0,
1293
                   children: [],
1277
                   children: [],
1294
                   parent_row: parentRow,
1278
                   parent_row: parentRow,
1295
                   row_key: thisRowKey
1279
                   row_key: thisRowKey
1296
                 };
1280
                 };
1281
+                conosle.log("item======",child)
1297
                 item.children.push(child);
1282
                 item.children.push(child);
1298
                 this.allSelectedTemplate.unshift(child);
1283
                 this.allSelectedTemplate.unshift(child);
1299
               }
1284
               }
1329
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1314
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1330
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1315
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1331
           drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
1316
           drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
1332
-          prescribing_number:
1333
-            "" + this.allSelectedTemplate[index].prescribing_number,
1334
-          prescribing_number_unit: this.allSelectedTemplate[index]
1335
-            .prescribing_number_unit,
1317
+          prescribing_number:"" + this.allSelectedTemplate[index].prescribing_number,
1318
+          prescribing_number_unit: this.allSelectedTemplate[index].prescribing_number_unit,
1336
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1319
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1337
-          execution_frequency: this.allSelectedTemplate[index]
1338
-            .execution_frequency,
1320
+          execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1321
+          drug_id:this.allSelectedTemplate[index].drug_id,
1322
+          way:this.allSelectedTemplate[index].way,
1339
           isEdit: 0,
1323
           isEdit: 0,
1340
           id: 0,
1324
           id: 0,
1341
           children: [],
1325
           children: [],
1360
                 prescribing_number_unit: children[key].prescribing_number_unit,
1344
                 prescribing_number_unit: children[key].prescribing_number_unit,
1361
                 delivery_way: children[key].delivery_way,
1345
                 delivery_way: children[key].delivery_way,
1362
                 execution_frequency: children[key].execution_frequency,
1346
                 execution_frequency: children[key].execution_frequency,
1347
+                drug_id:children[key].drug_id,
1348
+                way:children[key].way,
1363
                 isEdit: 0,
1349
                 isEdit: 0,
1364
                 id: 0,
1350
                 id: 0,
1365
                 children: [],
1351
                 children: [],
1524
             var base_drug_list = response.data.data.base_drug_list
1510
             var base_drug_list = response.data.data.base_drug_list
1525
             var base_drug_cofig = response.data.data.base_drug_config
1511
             var base_drug_cofig = response.data.data.base_drug_config
1526
             var private_drug_cofig = response.data.data.private_drug_config
1512
             var private_drug_cofig = response.data.data.private_drug_config
1527
-
1528
-
1513
+       
1514
+        
1529
             if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
1515
             if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
1530
 
1516
 
1531
               for (let i = 0; i < medicalList.length; i++) {
1517
               for (let i = 0; i < medicalList.length; i++) {
1596
                 obj.drug_specs = base_drug_list[i].drug_specs
1582
                 obj.drug_specs = base_drug_list[i].drug_specs
1597
                 this.all_drug.push(obj)
1583
                 this.all_drug.push(obj)
1598
               }
1584
               }
1585
+              this.private_drug_config = response.data.data.private_drug_config
1586
+              this.medicals = medicalList
1599
             }   
1587
             }   
1600
         })
1588
         })
1601
        
1589
        

+ 47 - 34
src/xt_pages/user/doctorAdvice.vue Wyświetl plik

2188
       doctorAdvice: [],
2188
       doctorAdvice: [],
2189
       dataAdvice: [],
2189
       dataAdvice: [],
2190
       medicals:[],
2190
       medicals:[],
2191
+      private_drug_config:{},
2191
       patient_id:"",
2192
       patient_id:"",
2192
       drugSpec:[],
2193
       drugSpec:[],
2193
       all_drug:[],
2194
       all_drug:[],
2287
       });
2288
       });
2288
     },
2289
     },
2289
     submitgroupAdvice(formName) {
2290
     submitgroupAdvice(formName) {
2291
+     
2290
       this.addLoading = true;
2292
       this.addLoading = true;
2291
       this.$refs[formName].validate(valid => {
2293
       this.$refs[formName].validate(valid => {
2292
         if (valid) {
2294
         if (valid) {
2299
             remark: this.groupForm.remark,
2301
             remark: this.groupForm.remark,
2300
             parent_id: this.groupForm.parent_id
2302
             parent_id: this.groupForm.parent_id
2301
           };
2303
           };
2302
-
2304
+       
2303
           var adviceNames = [];
2305
           var adviceNames = [];
2304
           for (const index in this.groupForm.adviceNames) {
2306
           for (const index in this.groupForm.adviceNames) {
2305
             this.groupForm.adviceNames[
2307
             this.groupForm.adviceNames[
2310
             adviceNames.unshift(this.groupForm.adviceNames[index]);
2312
             adviceNames.unshift(this.groupForm.adviceNames[index]);
2311
           }
2313
           }
2312
           submitForm.adviceNames = adviceNames;
2314
           submitForm.adviceNames = adviceNames;
2315
+
2316
+
2317
+          console.log("22222",submitForm)
2318
+          if(this.private_drug_config.drug_start == 1){
2319
+              for(let index=0;index<submitForm.adviceNames.length;index++){
2320
+                  for(let i=0;i<this.medicals.length;i++){
2321
+                    if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
2322
+                        submitForm.adviceNames[index].way = 2
2323
+                    }
2324
+                  }
2325
+              }
2326
+            }
2327
+
2313
           let mode = "";
2328
           let mode = "";
2314
           if (this.groupForm.advice_type == 1) {
2329
           if (this.groupForm.advice_type == 1) {
2315
             mode = "1-2";
2330
             mode = "1-2";
2987
           frequency_type: groups[index].frequency_type,
3002
           frequency_type: groups[index].frequency_type,
2988
           day_count: groups[index].day_count,
3003
           day_count: groups[index].day_count,
2989
           week_day: groups[index].week_day,
3004
           week_day: groups[index].week_day,
2990
-
3005
+          drug_id:groups[index].drug_id,
3006
+          wary:groups[index].way,
2991
           isEdit: 0,
3007
           isEdit: 0,
2992
           index: 0,
3008
           index: 0,
2993
           id: groups[index].id,
3009
           id: groups[index].id,
3012
                 childMap[item.id][key].prescribing_number_unit,
3028
                 childMap[item.id][key].prescribing_number_unit,
3013
               delivery_way: childMap[item.id][key].delivery_way,
3029
               delivery_way: childMap[item.id][key].delivery_way,
3014
               execution_frequency: childMap[item.id][key].execution_frequency,
3030
               execution_frequency: childMap[item.id][key].execution_frequency,
3031
+              drug_id:childMap[item.id][key].drug_id,
3032
+              way:childMap[item.id][key].way,
3015
               isEdit: 0,
3033
               isEdit: 0,
3016
               index: 0,
3034
               index: 0,
3017
               id: childMap[item.id][key].id,
3035
               id: childMap[item.id][key].id,
3662
             frequency_type: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
3680
             frequency_type: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
3663
               index
3681
               index
3664
             ].frequency_type,
3682
             ].frequency_type,
3665
-
3683
+            drug_id:this.adviceTemplateMaps[mapid].drug_id,
3684
+            way:this.adviceTemplateMaps[mapid].way,
3666
             isEdit: 0,
3685
             isEdit: 0,
3667
             id: 0,
3686
             id: 0,
3668
             children: [],
3687
             children: [],
3693
                 prescribing_number_unit: children[key].prescribing_number_unit,
3712
                 prescribing_number_unit: children[key].prescribing_number_unit,
3694
                 delivery_way: children[key].delivery_way,
3713
                 delivery_way: children[key].delivery_way,
3695
                 execution_frequency: children[key].execution_frequency,
3714
                 execution_frequency: children[key].execution_frequency,
3696
-
3715
+                drug_id:children[key].drug_id,
3716
+                way:children[key].way,
3697
                 isEdit: 0,
3717
                 isEdit: 0,
3698
                 id: 0,
3718
                 id: 0,
3699
                 children: [],
3719
                 children: [],
3749
                 adviceTemplate.DoctorAdviceTemplate[index].frequency_type,
3769
                 adviceTemplate.DoctorAdviceTemplate[index].frequency_type,
3750
               week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
3770
               week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
3751
               template_id: "T" + adviceTemplate.DoctorAdviceTemplate[index].id,
3771
               template_id: "T" + adviceTemplate.DoctorAdviceTemplate[index].id,
3752
-
3772
+              drug_id: adviceTemplate.DoctorAdviceTemplate[index].drug_id,
3773
+              way:adviceTemplate.DoctorAdviceTemplate[index].way,
3753
               isEdit: 0,
3774
               isEdit: 0,
3754
               id: 0,
3775
               id: 0,
3755
               children: [],
3776
               children: [],
3756
               parent_row: 0,
3777
               parent_row: 0,
3757
               row_key: thisRowKey
3778
               row_key: thisRowKey
3758
             };
3779
             };
3780
+            console.log("item22222222",item)
3759
             if (
3781
             if (
3760
               "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
3782
               "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
3761
               adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
3783
               adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
3780
                     children[key].prescribing_number_unit,
3802
                     children[key].prescribing_number_unit,
3781
                   delivery_way: children[key].delivery_way,
3803
                   delivery_way: children[key].delivery_way,
3782
                   execution_frequency: children[key].execution_frequency,
3804
                   execution_frequency: children[key].execution_frequency,
3805
+                  drug_id:children[key].drug_id,
3806
+                  way:children[key].way,
3783
                   isEdit: 0,
3807
                   isEdit: 0,
3784
                   id: 0,
3808
                   id: 0,
3785
                   children: [],
3809
                   children: [],
3786
                   parent_row: parentRow,
3810
                   parent_row: parentRow,
3787
                   row_key: thisRowKey
3811
                   row_key: thisRowKey
3788
                 };
3812
                 };
3813
+                console.log("child",child)
3789
                 item.children.push(child);
3814
                 item.children.push(child);
3790
                 this.allSelectedTemplate.unshift(child);
3815
                 this.allSelectedTemplate.unshift(child);
3791
               }
3816
               }
3834
           day_count: this.allSelectedTemplate[index].day_count,
3859
           day_count: this.allSelectedTemplate[index].day_count,
3835
           frequency_type: this.allSelectedTemplate[index].frequency_type,
3860
           frequency_type: this.allSelectedTemplate[index].frequency_type,
3836
           week_days: this.allSelectedTemplate[index].week_days,
3861
           week_days: this.allSelectedTemplate[index].week_days,
3837
-
3862
+          drug_id:this.allSelectedTemplate[index].drug_id,
3863
+          way:this.allSelectedTemplate[index].way,
3838
           isEdit: 0,
3864
           isEdit: 0,
3839
           id: 0,
3865
           id: 0,
3840
           children: [],
3866
           children: [],
3860
                 prescribing_number_unit: children[key].prescribing_number_unit,
3886
                 prescribing_number_unit: children[key].prescribing_number_unit,
3861
                 delivery_way: children[key].delivery_way,
3887
                 delivery_way: children[key].delivery_way,
3862
                 execution_frequency: children[key].execution_frequency,
3888
                 execution_frequency: children[key].execution_frequency,
3889
+                drug_id:children[key].drug_id,
3890
+                way:children[key].way,
3863
                 isEdit: 0,
3891
                 isEdit: 0,
3864
                 id: 0,
3892
                 id: 0,
3865
                 children: [],
3893
                 children: [],
3866
                 parent_row: parentRow,
3894
                 parent_row: parentRow,
3867
                 row_key: this.rowKey
3895
                 row_key: this.rowKey
3868
               };
3896
               };
3897
+              console.log("child",child)
3869
               item.children.push(child);
3898
               item.children.push(child);
3870
             }
3899
             }
3871
             this.$set(item, "children", item.children);
3900
             this.$set(item, "children", item.children);
3956
                       children[key].prescribing_number_unit,
3985
                       children[key].prescribing_number_unit,
3957
                     delivery_way: children[key].delivery_way,
3986
                     delivery_way: children[key].delivery_way,
3958
                     execution_frequency: children[key].execution_frequency,
3987
                     execution_frequency: children[key].execution_frequency,
3988
+                    drug_id:children[key].drug_id,
3989
+                    way:children[key].way,
3959
                     isEdit: 0,
3990
                     isEdit: 0,
3960
                     id: 0,
3991
                     id: 0,
3961
                     children: [],
3992
                     children: [],
3979
       });
4010
       });
3980
     },
4011
     },
3981
     submitNameForm(formName) {
4012
     submitNameForm(formName) {
3982
-
4013
+       
3983
        if(this.src_type == ""){
4014
        if(this.src_type == ""){
3984
           this.nameForm.way = 0
4015
           this.nameForm.way = 0
3985
           this.nameForm.drug_id = 0
4016
           this.nameForm.drug_id = 0
3989
           var arr = this.nameForm.advice_name.split("(自备药)")
4020
           var arr = this.nameForm.advice_name.split("(自备药)")
3990
           this.nameForm.advice_name = arr[0]
4021
           this.nameForm.advice_name = arr[0]
3991
        }
4022
        }
3992
-      // var drug_name = ""
3993
-      // var name = ""
3994
-      // var way = 0
3995
-      // this.nameForm.drug_id = this.nameForm.advice_name
3996
-      // for(let i=0;i<this.medicals.length;i++){
3997
-      //   if(this.nameForm.advice_name == this.medicals[i].id){
3998
-      //     name = this.medicals[i].drug_name
3999
-      //     way  = this.medicals[i].way
4000
-      //   }
4001
-      // }
4002
-      // if(way == 1){
4003
-      //   drug_name = name
4004
-      // }
4005
-      // if(way == 2){
4006
-      //   var arr = name.split("(自备药)")
4007
-      //   drug_name = arr[0]
4008
-      // }
4009
       
4023
       
4010
-      // this.nameForm.advice_name = drug_name
4011
-      // this.nameForm.way = way
4012
       var _this = this;
4024
       var _this = this;
4013
       this.$refs[formName].validate(valid => {
4025
       this.$refs[formName].validate(valid => {
4014
         if (valid) {
4026
         if (valid) {
4034
                       _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
4046
                       _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
4035
                       _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
4047
                       _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
4036
                       _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
4048
                       _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
4037
-                      _this.groupForm.adviceNames[index].children[j].way = this.nameForm.way;
4049
+                      _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
4038
                       _this.$set(
4050
                       _this.$set(
4039
                         _this.groupForm.adviceNames[index].children,
4051
                         _this.groupForm.adviceNames[index].children,
4040
                         j,
4052
                         j,
4052
                   _this.groupSelectRow.row_key ==
4064
                   _this.groupSelectRow.row_key ==
4053
                   _this.groupForm.adviceNames[index].row_key
4065
                   _this.groupForm.adviceNames[index].row_key
4054
                 ) {
4066
                 ) {
4055
-                  _this.groupForm.adviceNames[index].advice_name =
4056
-                    _this.nameForm.advice_name;
4067
+                  _this.groupForm.adviceNames[index].advice_name =_this.nameForm.advice_name;
4057
                   _this.groupForm.adviceNames[index].advice_desc =
4068
                   _this.groupForm.adviceNames[index].advice_desc =
4058
                     _this.nameForm.advice_desc;
4069
                     _this.nameForm.advice_desc;
4059
 
4070
 
4088
                   } else if (_this.nameForm.frequency_type == 3) {
4099
                   } else if (_this.nameForm.frequency_type == 3) {
4089
                     _this.groupForm.adviceNames[index].frequency_type =
4100
                     _this.groupForm.adviceNames[index].frequency_type =
4090
                       _this.nameForm.frequency_type;
4101
                       _this.nameForm.frequency_type;
4102
+                   _this.groupForm.adviceNames[index].drug_id = _this.nameForm.drug_id
4103
+                   _this.groupForm.adviceNames[index].way = _this.nameForm.way
4091
                     _this.groupForm.adviceNames[index].day_count = "0";
4104
                     _this.groupForm.adviceNames[index].day_count = "0";
4092
                     _this.groupForm.adviceNames[index].week_days = this.weeks
4105
                     _this.groupForm.adviceNames[index].week_days = this.weeks
4093
                       .filter(function(s) {
4106
                       .filter(function(s) {
4146
                 _this.nameForm.week_days = "";
4159
                 _this.nameForm.week_days = "";
4147
               } else if (this.nameForm.frequency_type == 3) {
4160
               } else if (this.nameForm.frequency_type == 3) {
4148
                 _this.nameForm.frequency_type = _this.nameForm.frequency_type;
4161
                 _this.nameForm.frequency_type = _this.nameForm.frequency_type;
4162
+
4149
                 _this.nameForm.day_count = "0";
4163
                 _this.nameForm.day_count = "0";
4150
                 _this.nameForm.week_days = this.weeks
4164
                 _this.nameForm.week_days = this.weeks
4151
                   .filter(function(s) {
4165
                   .filter(function(s) {
4450
                 this.all_drug.push(obj)
4464
                 this.all_drug.push(obj)
4451
               }
4465
               }
4452
             }
4466
             }
4453
-            console.log("999999999",this.all_drug)
4454
-            console.log("medicalist",this.medicalList)
4455
-            console.log("base_drug_list",base_drug_list)
4456
-            console.log("private_drug_config",private_drug_cofig)
4457
-            console.log("base",base_drug_cofig)
4467
+
4468
+            this.private_drug_config = response.data.data.private_drug_config
4469
+            this.medicals = medicalList
4470
+          
4458
       })
4471
       })
4459
     },
4472
     },
4460
    changeDrugName(name){
4473
    changeDrugName(name){