Bläddra i källkod

Merge branch '20201014_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201014_pc_vue_new_branch

csx 4 år sedan
förälder
incheckning
2861259552

+ 1 - 1
src/xt_pages/data/components/consumables.vue Visa fil

48
       v-loading="goodInfo.loading"
48
       v-loading="goodInfo.loading"
49
     >
49
     >
50
       <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
50
       <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
51
-      <el-table-column label="名称" align="center">
51
+      <el-table-column label="耗材名称" align="center">
52
         <template slot-scope="scope">
52
         <template slot-scope="scope">
53
           {{ scope.row.good_name }}
53
           {{ scope.row.good_name }}
54
         </template>
54
         </template>

+ 3 - 4
src/xt_pages/data/druguseTemplate.vue Visa fil

319
                         clearable
319
                         clearable
320
                         allow-create
320
                         allow-create
321
                         placeholder="请选择(输入可搜索)"
321
                         placeholder="请选择(输入可搜索)"
322
-                        style="width:200px"
322
+                        style="width:100%"
323
                         @change="changeDrugName"
323
                         @change="changeDrugName"
324
                     >
324
                     >
325
                       <el-option
325
                       <el-option
793
                         clearable
793
                         clearable
794
                         allow-create
794
                         allow-create
795
                         placeholder="请选择(输入可搜索)"
795
                         placeholder="请选择(输入可搜索)"
796
-                        style="width:200px"
796
+                        style="width:100%;"
797
                         @change="changeDrugName"
797
                         @change="changeDrugName"
798
                     >
798
                     >
799
                       <el-option
799
                       <el-option
805
                      </el-select>
805
                      </el-select>
806
                     </el-form-item>
806
                     </el-form-item>
807
                   </el-col>
807
                   </el-col>
808
-                  <el-col :span="15">
808
+                  <el-col :span="12">
809
 
809
 
810
                     <el-form-item label="药品规格 :" prop="advice_desc">
810
                     <el-form-item label="药品规格 :" prop="advice_desc">
811
                       <el-col :span="9">
811
                       <el-col :span="9">
816
                           clearable
816
                           clearable
817
                           allow-create
817
                           allow-create
818
                           placeholder="请选择(输入可搜索)"
818
                           placeholder="请选择(输入可搜索)"
819
-                          style="width:150px"
820
                           @change="changeDrugDesc"
819
                           @change="changeDrugDesc"
821
                         >
820
                         >
822
                         <el-option
821
                         <el-option

+ 66 - 80
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue Visa fil

377
                 allow-create
377
                 allow-create
378
                 :disabled="isChild"
378
                 :disabled="isChild"
379
                 placeholder="请选择(输入可搜索)"
379
                 placeholder="请选择(输入可搜索)"
380
-                style="width:200px"
380
+                style="width:100%"
381
                 @change="changeDrugName"
381
                 @change="changeDrugName"
382
               >
382
               >
383
                 <el-option
383
                 <el-option
396
 
396
 
397
         </el-row>
397
         </el-row>
398
         <el-row>
398
         <el-row>
399
-          <el-col :span="13">
399
+          <el-col :span="12">
400
             <!--<el-form-item label="规格 :" prop="advice_desc">-->
400
             <!--<el-form-item label="规格 :" prop="advice_desc">-->
401
             <!--<el-input v-model="nameForm.advice_desc"></el-input>-->
401
             <!--<el-input v-model="nameForm.advice_desc"></el-input>-->
402
             <!--</el-form-item>-->
402
             <!--</el-form-item>-->
403
             <el-form-item label="药品规格 :" prop="advice_desc">
403
             <el-form-item label="药品规格 :" prop="advice_desc">
404
-              <el-col :span="10">
404
+              <el-col :span="8">
405
                 <!-- <el-input v-model="nameForm.advice_desc"></el-input> -->
405
                 <!-- <el-input v-model="nameForm.advice_desc"></el-input> -->
406
                  <el-select
406
                  <el-select
407
                   v-model="nameForm.advice_desc"
407
                   v-model="nameForm.advice_desc"
410
                   allow-create
410
                   allow-create
411
                   :disabled="isChild"
411
                   :disabled="isChild"
412
                   placeholder="请选择(输入可搜索)"
412
                   placeholder="请选择(输入可搜索)"
413
-                  style="width:150px"
414
                   @change="changeDrugDesc"
413
                   @change="changeDrugDesc"
415
                 >
414
                 >
416
                   <el-option
415
                   <el-option
423
 
422
 
424
               </el-col>
423
               </el-col>
425
               <el-col class="line" :span="2">&nbsp;</el-col>
424
               <el-col class="line" :span="2">&nbsp;</el-col>
426
-              <el-col :span="10">
425
+              <el-col :span="14">
427
                 <el-select
426
                 <el-select
428
                   v-model="nameForm.drug_spec_unit"
427
                   v-model="nameForm.drug_spec_unit"
429
                   filterable
428
                   filterable
430
                   clearable
429
                   clearable
431
                   allow-create
430
                   allow-create
432
                   placeholder="选择"
431
                   placeholder="选择"
433
-                  style="width:120px"
434
                 >
432
                 >
435
                   <el-option
433
                   <el-option
436
                     v-for="item in unitsOption"
434
                     v-for="item in unitsOption"
442
               </el-col>
440
               </el-col>
443
             </el-form-item>
441
             </el-form-item>
444
           </el-col>
442
           </el-col>
445
-          <el-col :span="9">
443
+          <el-col :span="12">
446
             <el-form-item label="开药数量 :" prop="prescribing_number">
444
             <el-form-item label="开药数量 :" prop="prescribing_number">
447
               <el-col :span="8">
445
               <el-col :span="8">
448
                 <el-input v-model="nameForm.prescribing_number"></el-input>
446
                 <el-input v-model="nameForm.prescribing_number"></el-input>
647
       current_drug_name:"",
645
       current_drug_name:"",
648
       current_drug_spec: "",
646
       current_drug_spec: "",
649
       drug_id: 0,
647
       drug_id: 0,
650
-      src_type:""
648
+      src_type:"",
649
+      private_drug_config:{},
651
     };
650
     };
652
   },
651
   },
653
   props: {
652
   props: {
699
   },
698
   },
700
   methods: {
699
   methods: {
701
     submitgroupAdvice(formName) {
700
     submitgroupAdvice(formName) {
702
-      
703
       this.$refs[formName].validate(valid => {
701
       this.$refs[formName].validate(valid => {
704
         if (valid) {
702
         if (valid) {
705
-          var submitForm = {
703
+         var submitForm = {
706
             advice_type: this.groupForm.advice_type,
704
             advice_type: this.groupForm.advice_type,
707
             advice_date: this.groupForm.advice_date,
705
             advice_date: this.groupForm.advice_date,
708
             start_time: this.groupForm.start_time,
706
             start_time: this.groupForm.start_time,
711
             remark: this.groupForm.remark,
709
             remark: this.groupForm.remark,
712
             parent_id: this.groupForm.parent_id
710
             parent_id: this.groupForm.parent_id
713
           };
711
           };
714
-          
715
-          console.log("888888",this.groupForm.adviceNames)
712
+         
716
           var adviceNames = [];
713
           var adviceNames = [];
717
           for (const index in this.groupForm.adviceNames) {
714
           for (const index in this.groupForm.adviceNames) {
718
             adviceNames.unshift(this.groupForm.adviceNames[index]);
715
             adviceNames.unshift(this.groupForm.adviceNames[index]);
720
           submitForm.adviceNames = adviceNames;
717
           submitForm.adviceNames = adviceNames;
721
           let mode = "1";
718
           let mode = "1";
722
           
719
           
723
-     
724
           console.log("88888888",submitForm)
720
           console.log("88888888",submitForm)
725
-          
721
+          console.log("99999",this.medicals)
722
+          if(this.private_drug_config.drug_start == 1){
723
+           
724
+             for(let index=0;index<submitForm.adviceNames.length;index++){
725
+                for(let i=0;i<this.medicals.length;i++){
726
+                   if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
727
+                      submitForm.adviceNames[index].way = 2
728
+                   }
729
+                }
730
+             }
731
+          }
726
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
732
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
727
             response => {
733
             response => {
728
               if (response.data.state == 0) {
734
               if (response.data.state == 0) {
1134
       }
1140
       }
1135
     },
1141
     },
1136
     templateTableChange(currentRow, oldCurrentRow) {
1142
     templateTableChange(currentRow, oldCurrentRow) {
1143
+      console.log("params -----",currentRow)
1137
       this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
1144
       this.selectedTemp = { id: 0, name: "", org_id: 0, list: [], rows: [] };
1138
       if (currentRow == null) {
1145
       if (currentRow == null) {
1139
         return false;
1146
         return false;
1148
           .DoctorAdviceTemplate) {
1155
           .DoctorAdviceTemplate) {
1149
           thisRowKey++;
1156
           thisRowKey++;
1150
           var item = {
1157
           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,
1158
+            advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
1159
+            advice_desc: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_desc,
1160
+            single_dose:"" +this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
1161
+            single_dose_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
1162
+            drug_spec:"" +this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
1166
             drug_spec_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
1163
             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
-
1164
+            prescribing_number:"" +this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
1165
+            prescribing_number_unit: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
1166
+            delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
1167
+            execution_frequency: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
1168
+            selection: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].selection,
1169
+            advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].id,
1170
+            drug_id:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_id,
1171
+            way:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].way,
1185
             isEdit: 0,
1172
             isEdit: 0,
1186
             id: 0,
1173
             id: 0,
1187
             children: [],
1174
             children: [],
1212
                 prescribing_number_unit: children[key].prescribing_number_unit,
1199
                 prescribing_number_unit: children[key].prescribing_number_unit,
1213
                 delivery_way: children[key].delivery_way,
1200
                 delivery_way: children[key].delivery_way,
1214
                 execution_frequency: children[key].execution_frequency,
1201
                 execution_frequency: children[key].execution_frequency,
1202
+                drug_id:children[key].drug_id,
1203
+                way:children[key].way,
1215
                 isEdit: 0,
1204
                 isEdit: 0,
1216
                 id: 0,
1205
                 id: 0,
1217
                 children: [],
1206
                 children: [],
1218
                 parent_row: parentRow,
1207
                 parent_row: parentRow,
1219
-                row_key: thisRowKey
1208
+                row_key: thisRowKey,
1209
+               
1220
               };
1210
               };
1221
               item.children.push(child);
1211
               item.children.push(child);
1222
             }
1212
             }
1236
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1226
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1237
             thisRowKey++;
1227
             thisRowKey++;
1238
             var item = {
1228
             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,
1229
+              advice_name:adviceTemplate.DoctorAdviceTemplate[index].advice_name,
1230
+              advice_desc:adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
1231
+              single_dose:"" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
1232
+              single_dose_unit:adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
1233
+              drug_spec:"" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
1234
+              drug_spec_unit:adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
1235
+              prescribing_number:"" +adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
1236
+              prescribing_number_unit:adviceTemplate.DoctorAdviceTemplate[index].prescribing_number_unit,
1237
+              delivery_way:adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
1238
+              execution_frequency:adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1261
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1239
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1262
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1240
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1241
+              drug_id: adviceTemplate.DoctorAdviceTemplate[index].drug_id,
1242
+              way:adviceTemplate.DoctorAdviceTemplate[index].way,
1263
               isEdit: 0,
1243
               isEdit: 0,
1264
               id: 0,
1244
               id: 0,
1265
               children: [],
1245
               children: [],
1266
               parent_row: 0,
1246
               parent_row: 0,
1267
               row_key: thisRowKey
1247
               row_key: thisRowKey
1268
             };
1248
             };
1249
+            console.log("items========",item)
1269
             if (
1250
             if (
1270
               "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
1251
               "children" in adviceTemplate.DoctorAdviceTemplate[index] &&
1271
               adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
1252
               adviceTemplate.DoctorAdviceTemplate[index].children.length > 0
1284
                   drug_spec: "" + children[key].drug_spec,
1265
                   drug_spec: "" + children[key].drug_spec,
1285
                   drug_spec_unit: children[key].drug_spec_unit,
1266
                   drug_spec_unit: children[key].drug_spec_unit,
1286
                   prescribing_number: "" + children[key].prescribing_number,
1267
                   prescribing_number: "" + children[key].prescribing_number,
1287
-                  prescribing_number_unit:
1288
-                    children[key].prescribing_number_unit,
1268
+                  prescribing_number_unit:children[key].prescribing_number_unit,
1289
                   delivery_way: children[key].delivery_way,
1269
                   delivery_way: children[key].delivery_way,
1290
                   execution_frequency: children[key].execution_frequency,
1270
                   execution_frequency: children[key].execution_frequency,
1271
+                  drug_id:children[key].drug_id,
1272
+                  way:children[key].way,
1291
                   isEdit: 0,
1273
                   isEdit: 0,
1292
                   id: 0,
1274
                   id: 0,
1293
                   children: [],
1275
                   children: [],
1294
                   parent_row: parentRow,
1276
                   parent_row: parentRow,
1295
                   row_key: thisRowKey
1277
                   row_key: thisRowKey
1296
                 };
1278
                 };
1279
+                conosle.log("item======",child)
1297
                 item.children.push(child);
1280
                 item.children.push(child);
1298
                 this.allSelectedTemplate.unshift(child);
1281
                 this.allSelectedTemplate.unshift(child);
1299
               }
1282
               }
1329
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1312
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1330
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1313
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1331
           drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
1314
           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,
1315
+          prescribing_number:"" + this.allSelectedTemplate[index].prescribing_number,
1316
+          prescribing_number_unit: this.allSelectedTemplate[index].prescribing_number_unit,
1336
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1317
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1337
-          execution_frequency: this.allSelectedTemplate[index]
1338
-            .execution_frequency,
1318
+          execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1319
+          drug_id:this.allSelectedTemplate[index].drug_id,
1320
+          way:this.allSelectedTemplate[index].way,
1339
           isEdit: 0,
1321
           isEdit: 0,
1340
           id: 0,
1322
           id: 0,
1341
           children: [],
1323
           children: [],
1360
                 prescribing_number_unit: children[key].prescribing_number_unit,
1342
                 prescribing_number_unit: children[key].prescribing_number_unit,
1361
                 delivery_way: children[key].delivery_way,
1343
                 delivery_way: children[key].delivery_way,
1362
                 execution_frequency: children[key].execution_frequency,
1344
                 execution_frequency: children[key].execution_frequency,
1345
+                drug_id:children[key].drug_id,
1346
+                way:children[key].way,
1363
                 isEdit: 0,
1347
                 isEdit: 0,
1364
                 id: 0,
1348
                 id: 0,
1365
                 children: [],
1349
                 children: [],
1524
             var base_drug_list = response.data.data.base_drug_list
1508
             var base_drug_list = response.data.data.base_drug_list
1525
             var base_drug_cofig = response.data.data.base_drug_config
1509
             var base_drug_cofig = response.data.data.base_drug_config
1526
             var private_drug_cofig = response.data.data.private_drug_config
1510
             var private_drug_cofig = response.data.data.private_drug_config
1527
-
1528
-
1511
+       
1512
+        
1529
             if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
1513
             if(private_drug_cofig != null&&private_drug_cofig.drug_start == 1) {
1530
 
1514
 
1531
               for (let i = 0; i < medicalList.length; i++) {
1515
               for (let i = 0; i < medicalList.length; i++) {
1596
                 obj.drug_specs = base_drug_list[i].drug_specs
1580
                 obj.drug_specs = base_drug_list[i].drug_specs
1597
                 this.all_drug.push(obj)
1581
                 this.all_drug.push(obj)
1598
               }
1582
               }
1583
+              this.private_drug_config = response.data.data.private_drug_config
1584
+              this.medicals = medicalList
1599
             }   
1585
             }   
1600
         })
1586
         })
1601
        
1587
        

+ 47 - 34
src/xt_pages/user/doctorAdvice.vue Visa fil

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){