Ver código fonte

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 anos atrás
pai
commit
60ad4b081b

+ 159 - 225
src/xt_pages/user/components/EditGroupAdvice.vue Ver arquivo

202
       </el-form>
202
       </el-form>
203
     </el-dialog>
203
     </el-dialog>
204
 
204
 
205
+
206
+   <!-- 编辑选则医嘱模版 -->
205
     <el-dialog
207
     <el-dialog
206
       title="选择医嘱模板"
208
       title="选择医嘱模板"
207
       :visible.sync="templateFormVisible"
209
       :visible.sync="templateFormVisible"
331
         </el-button>
333
         </el-button>
332
       </div>
334
       </div>
333
     </el-dialog>
335
     </el-dialog>
336
+
337
+
334
     <el-dialog
338
     <el-dialog
335
       title="选择医嘱模板"
339
       title="选择医嘱模板"
336
       :visible.sync="oldTemplateFormVisible"
340
       :visible.sync="oldTemplateFormVisible"
407
                   v-model="nameForm.advice_desc"
411
                   v-model="nameForm.advice_desc"
408
                   :fetch-suggestions="querySearch1"
412
                   :fetch-suggestions="querySearch1"
409
                   placeholder="请输入内容"
413
                   placeholder="请输入内容"
410
-                  @select="handleSelect1"
411
                   @input="changeDrugDesc"
414
                   @input="changeDrugDesc"
412
                 ></el-autocomplete>
415
                 ></el-autocomplete>
413
               </el-col>
416
               </el-col>
626
         index: 0,
629
         index: 0,
627
         id: 0,
630
         id: 0,
628
         children: [],
631
         children: [],
629
-        way:"",
630
-        drug_id:"",
631
-        src_type:""
632
+        way:0,
633
+        drug_id:0,
634
+        src_type:"",
635
+        drug_name_id:0
632
       },
636
       },
633
 
637
 
634
       drugOptions: [],
638
       drugOptions: [],
841
         .catch(() => {});
845
         .catch(() => {});
842
     },
846
     },
843
     submitNameForm(formName) {
847
     submitNameForm(formName) {
844
-     
848
+       console.log("888888",this.nameForm)
845
       if(this.src_type == ""){
849
       if(this.src_type == ""){
846
           this.nameForm.way = 0
850
           this.nameForm.way = 0
847
           this.nameForm.drug_id = 0
851
           this.nameForm.drug_id = 0
851
           var arr = this.nameForm.advice_name.split("(自备药)")
855
           var arr = this.nameForm.advice_name.split("(自备药)")
852
           this.nameForm.advice_name = arr[0]
856
           this.nameForm.advice_name = arr[0]
853
        }
857
        }
854
-
855
-      //  if(typeof(this.nameForm.advice_name) == "string"){
856
-         
857
-      //     this.nameForm.advice_name == this.nameForm.advice_name
858
-      // }
859
-
860
-      // if(typeof(this.nameForm.advice_name) == "number"){
861
-      //     var drug_name = ""
862
-      //     var name = ""
863
-      //     var way = 0
864
-      //     this.nameForm.drug_id = this.nameForm.advice_name
865
-      //     for(let i=0;i<this.medicals.length;i++){
866
-      //       if(this.nameForm.advice_name == this.medicals[i].id){
867
-      //         name = this.medicals[i].drug_name
868
-      //         way  = this.medicals[i].way
869
-      //       }
870
-      //     }
871
-      //     if(way == 1){
872
-      //       drug_name = name
873
-      //     }
874
-      //     if(way == 2){
875
-      //       var arr = name.split("(自备药)")
876
-      //       drug_name = arr[0]
877
-      //     }
878
-          
879
-      //     this.nameForm.advice_name = drug_name
880
-      //     this.nameForm.way = way
881
-      // }
858
+      console.log("新增医嘱内容")
882
       var _this = this;
859
       var _this = this;
883
       this.$refs[formName].validate(valid => {
860
       this.$refs[formName].validate(valid => {
884
         if (valid) {
861
         if (valid) {
885
           if (_this.nameForm.isEdit) {
862
           if (_this.nameForm.isEdit) {
886
             var submitForm = null;
863
             var submitForm = null;
887
             if (!this.isChild) {
864
             if (!this.isChild) {
865
+              console.log("进来了吗")
888
               submitForm = {
866
               submitForm = {
889
                 advice_type: _this.groupForm.advice_type,
867
                 advice_type: _this.groupForm.advice_type,
890
                 advice_date: _this.groupForm.advice_date,
868
                 advice_date: _this.groupForm.advice_date,
899
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
877
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
900
                 delivery_way: _this.nameForm.delivery_way,
878
                 delivery_way: _this.nameForm.delivery_way,
901
                 execution_frequency: _this.nameForm.execution_frequency,
879
                 execution_frequency: _this.nameForm.execution_frequency,
880
+                way:_this.nameForm.way,
881
+                drug_name_id:_this.nameForm.drug_name_id,
882
+                drug_id:_this.nameForm.drug_id,
902
                 isEdit: 0,
883
                 isEdit: 0,
903
                 id: 0,
884
                 id: 0,
904
                 advice_doctor: "",
885
                 advice_doctor: "",
928
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
909
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
929
                 delivery_way: _this.nameForm.delivery_way,
910
                 delivery_way: _this.nameForm.delivery_way,
930
                 execution_frequency: _this.nameForm.execution_frequency,
911
                 execution_frequency: _this.nameForm.execution_frequency,
912
+                way:_this.nameForm.way,
913
+                drug_name_id:_this.nameForm.drug_name_id,
914
+                drug_id:_this.nameForm.drug_id,
931
                 isEdit: 0,
915
                 isEdit: 0,
932
                 id: 0,
916
                 id: 0,
933
                 advice_doctor: "",
917
                 advice_doctor: "",
936
                 groupno: _this.groupForm.groupno,
920
                 groupno: _this.groupForm.groupno,
937
                 frequency_type: 0,
921
                 frequency_type: 0,
938
                 day_count: "0",
922
                 day_count: "0",
939
-                week_days: ""
923
+                week_days: "",
924
+              
940
               };
925
               };
941
             }
926
             }
942
             let mode = "";
927
             let mode = "";
943
 
928
 
944
             if (_this.groupForm.advice_type == 1) {
929
             if (_this.groupForm.advice_type == 1) {
945
-              // if(_this.nameForm.)
930
+            
946
               mode = "1-3";
931
               mode = "1-3";
947
               if (
932
               if (
948
                 _this.groupForm.doctor != _this.$store.getters.xt_user.user.id
933
                 _this.groupForm.doctor != _this.$store.getters.xt_user.user.id
957
                 mode = "3-1";
942
                 mode = "3-1";
958
               }
943
               }
959
             }
944
             }
960
-
945
+            console.log("编辑",submitForm)
961
             EditNewDoctorAdvice(
946
             EditNewDoctorAdvice(
962
               this.patientID,
947
               this.patientID,
963
               this.groupSelectRow.id,
948
               this.groupSelectRow.id,
983
                   ) {
968
                   ) {
984
                     var advice = response.data.data.advice;
969
                     var advice = response.data.data.advice;
985
                     _this.adviceTableData[index].drug_spec = advice.drug_spec;
970
                     _this.adviceTableData[index].drug_spec = advice.drug_spec;
986
-                    _this.adviceTableData[index].drug_spec_unit =
987
-                      advice.drug_spec_unit;
971
+                    _this.adviceTableData[index].drug_spec_unit = advice.drug_spec_unit;
988
                     _this.adviceTableData[index].start_time = advice.start_time;
972
                     _this.adviceTableData[index].start_time = advice.start_time;
989
-                    _this.adviceTableData[index].advice_name =
990
-                      advice.advice_name;
991
-                    _this.adviceTableData[index].advice_desc =
992
-                      advice.advice_desc;
993
-                    _this.adviceTableData[index].single_dose =
994
-                      advice.single_dose;
995
-                    _this.adviceTableData[index].single_dose_unit =
996
-                      advice.single_dose_unit;
997
-                    _this.adviceTableData[index].delivery_way =
998
-                      advice.delivery_way;
999
-                    _this.adviceTableData[index].execution_frequency =
1000
-                      advice.execution_frequency;
1001
-                    _this.adviceTableData[index].prescribing_number =
1002
-                      advice.prescribing_number;
1003
-                    _this.adviceTableData[index].prescribing_number_unit =
1004
-                      advice.prescribing_number_unit;
1005
-
1006
-                    _this.adviceTableData[index].frequency_type =
1007
-                      advice.frequency_type;
973
+                    _this.adviceTableData[index].advice_name =advice.advice_name;
974
+                    _this.adviceTableData[index].advice_desc = advice.advice_desc;
975
+                    _this.adviceTableData[index].single_dose = advice.single_dose;
976
+                    _this.adviceTableData[index].single_dose_unit = advice.single_dose_unit;
977
+                    _this.adviceTableData[index].delivery_way = advice.delivery_way;
978
+                    _this.adviceTableData[index].execution_frequency = advice.execution_frequency;
979
+                    _this.adviceTableData[index].prescribing_number = advice.prescribing_number;
980
+                    _this.adviceTableData[index].prescribing_number_unit = advice.prescribing_number_unit;
981
+                    _this.adviceTableData[index].frequency_type = advice.frequency_type;
1008
                     _this.adviceTableData[index].day_count = advice.day_count;
982
                     _this.adviceTableData[index].day_count = advice.day_count;
1009
                     _this.adviceTableData[index].week_day = advice.week_day;
983
                     _this.adviceTableData[index].week_day = advice.week_day;
1010
-
984
+                    _this.adviceTableData[index].way = advice.way,
985
+                    _this.adviceTableData[index].drug_id = advice.drug_id,
986
+                    _this.adviceTableData[index].drug_name_id = advice.drug_name_id
1011
                     break;
987
                     break;
1012
                   }
988
                   }
1013
                 }
989
                 }
1023
                       var children =
999
                       var children =
1024
                         _this.groupForm.adviceNames[index].children;
1000
                         _this.groupForm.adviceNames[index].children;
1025
                       for (let j = 0; j < ale; j++) {
1001
                       for (let j = 0; j < ale; j++) {
1026
-                        if (
1027
-                          _this.groupSelectRow.row_key == children[j].row_key
1028
-                        ) {
1029
-                          _this.groupForm.adviceNames[index].children[
1030
-                            j
1031
-                          ].advice_name = _this.nameForm.advice_name;
1032
-                          _this.groupForm.adviceNames[index].children[
1033
-                            j
1034
-                          ].advice_desc = _this.nameForm.advice_desc;
1035
-                          _this.groupForm.adviceNames[index].children[
1036
-                            j
1037
-                          ].single_dose = "" + _this.nameForm.single_dose;
1038
-                          _this.groupForm.adviceNames[index].children[
1039
-                            j
1040
-                          ].single_dose_unit = _this.nameForm.single_dose_unit;
1041
-                          _this.groupForm.adviceNames[index].children[
1042
-                            j
1043
-                          ].drug_spec = "" + _this.nameForm.drug_spec;
1044
-                          _this.groupForm.adviceNames[index].children[
1045
-                            j
1046
-                          ].drug_spec_unit = _this.nameForm.drug_spec_unit;
1047
-                          _this.groupForm.adviceNames[index].children[
1048
-                            j
1049
-                          ].prescribing_number =
1050
-                            "" + _this.nameForm.prescribing_number;
1051
-                          _this.groupForm.adviceNames[index].children[
1052
-                            j
1053
-                          ].prescribing_number_unit =
1054
-                            _this.nameForm.prescribing_number_unit;
1055
-                          _this.groupForm.adviceNames[index].children[
1056
-                            j
1057
-                          ].delivery_way = _this.nameForm.delivery_way;
1058
-                          _this.groupForm.adviceNames[index].children[
1059
-                            j
1060
-                          ].execution_frequency =
1061
-                            _this.nameForm.execution_frequency;
1002
+                        if (_this.groupSelectRow.row_key == children[j].row_key) {
1003
+                          _this.groupForm.adviceNames[index].children[j].advice_name = _this.nameForm.advice_name;
1004
+                          _this.groupForm.adviceNames[index].children[j].advice_desc = _this.nameForm.advice_desc;
1005
+                          _this.groupForm.adviceNames[index].children[j].single_dose = "" + _this.nameForm.single_dose;
1006
+                          _this.groupForm.adviceNames[index].children[j].single_dose_unit = _this.nameForm.single_dose_unit;
1007
+                          _this.groupForm.adviceNames[index].children[j].drug_spec = "" + _this.nameForm.drug_spec;
1008
+                          _this.groupForm.adviceNames[index].children[j].drug_spec_unit = _this.nameForm.drug_spec_unit;
1009
+                          _this.groupForm.adviceNames[index].children[j].prescribing_number ="" + _this.nameForm.prescribing_number;
1010
+                          _this.groupForm.adviceNames[index].children[j].prescribing_number_unit =
1011
+                          _this.nameForm.prescribing_number_unit;
1012
+                          _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
1013
+                          _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
1014
+                          _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way
1015
+                          _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id
1016
+                          _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id
1062
                           _this.$set(
1017
                           _this.$set(
1063
                             _this.groupForm.adviceNames[index].children,
1018
                             _this.groupForm.adviceNames[index].children,
1064
                             j,
1019
                             j,
1071
                   }
1026
                   }
1072
                 } else {
1027
                 } else {
1073
                   for (let index = 0; index < ale; index++) {
1028
                   for (let index = 0; index < ale; index++) {
1074
-                    if (
1075
-                      _this.groupSelectRow.row_key ==
1076
-                      _this.groupForm.adviceNames[index].row_key
1077
-                    ) {
1078
-                      _this.groupForm.adviceNames[index].advice_name =
1079
-                        _this.nameForm.advice_name;
1080
-                      _this.groupForm.adviceNames[index].advice_desc =
1081
-                        "" + _this.nameForm.advice_desc;
1082
-                      _this.groupForm.adviceNames[index].single_dose =
1083
-                        "" + _this.nameForm.single_dose;
1084
-                      _this.groupForm.adviceNames[index].single_dose_unit =
1085
-                        _this.nameForm.single_dose_unit;
1086
-                      _this.groupForm.adviceNames[index].drug_spec =
1087
-                        "" + _this.nameForm.drug_spec;
1088
-                      _this.groupForm.adviceNames[index].drug_spec_unit =
1089
-                        _this.nameForm.drug_spec_unit;
1090
-                      _this.groupForm.adviceNames[index].prescribing_number =
1091
-                        "" + _this.nameForm.prescribing_number;
1092
-                      _this.groupForm.adviceNames[
1093
-                        index
1094
-                      ].prescribing_number_unit =
1095
-                        _this.nameForm.prescribing_number_unit;
1096
-                      _this.groupForm.adviceNames[index].delivery_way =
1097
-                        _this.nameForm.delivery_way;
1098
-                      _this.groupForm.adviceNames[index].execution_frequency =
1099
-                        _this.nameForm.execution_frequency;
1100
-
1101
-                      _this.groupForm.adviceNames[index].frequency_type =
1102
-                        _this.nameForm.frequency_type;
1103
-                      _this.groupForm.adviceNames[index].day_count =
1104
-                        _this.nameForm.day_count;
1105
-                      _this.groupForm.adviceNames[
1106
-                        index
1107
-                      ].week_day = _this.weeks.join(",");
1029
+                    if ( _this.groupSelectRow.row_key ==_this.groupForm.adviceNames[index].row_key) {
1030
+                      _this.groupForm.adviceNames[index].advice_name =_this.nameForm.advice_name;
1031
+                      _this.groupForm.adviceNames[index].advice_desc = "" + _this.nameForm.advice_desc;
1032
+                      _this.groupForm.adviceNames[index].single_dose ="" + _this.nameForm.single_dose;
1033
+                      _this.groupForm.adviceNames[index].single_dose_unit =_this.nameForm.single_dose_unit;
1034
+                      _this.groupForm.adviceNames[index].drug_spec ="" + _this.nameForm.drug_spec;
1035
+                      _this.groupForm.adviceNames[index].drug_spec_unit =_this.nameForm.drug_spec_unit;
1036
+                      _this.groupForm.adviceNames[index].prescribing_number ="" + _this.nameForm.prescribing_number;
1037
+                      _this.groupForm.adviceNames[index].prescribing_number_unit =_this.nameForm.prescribing_number_unit;
1038
+                      _this.groupForm.adviceNames[index].delivery_way =_this.nameForm.delivery_way;
1039
+                      _this.groupForm.adviceNames[index].execution_frequency =_this.nameForm.execution_frequency;
1040
+                      _this.groupForm.adviceNames[index].frequency_type =_this.nameForm.frequency_type;
1041
+                      _this.groupForm.adviceNames[index].drug_name_id = _this.nameForm.drug_name_id
1042
+                      _this.groupForm.adviceNames[index].drug_id = _this.nameForm.drug_id
1043
+                      _this.groupForm.adviceNames[index].way = _this.nameForm.way
1044
+                      _this.groupForm.adviceNames[index].day_count = _this.nameForm.day_count;
1045
+                      _this.groupForm.adviceNames[index].week_day = _this.weeks.join(",");
1108
                       console.log(_this.weeks);
1046
                       console.log(_this.weeks);
1109
                       _this.$set(
1047
                       _this.$set(
1110
                         _this.groupForm.adviceNames,
1048
                         _this.groupForm.adviceNames,
1134
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1072
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1135
                 delivery_way: _this.nameForm.delivery_way,
1073
                 delivery_way: _this.nameForm.delivery_way,
1136
                 execution_frequency: _this.nameForm.execution_frequency,
1074
                 execution_frequency: _this.nameForm.execution_frequency,
1075
+                way:_this.nameForm.way,
1076
+                drug_id:_this.nameForm.drug_id,
1077
+                drug_name_id:_this.nameForm.drug_name_id,
1137
                 isEdit: 0,
1078
                 isEdit: 0,
1138
                 id: 0,
1079
                 id: 0,
1139
                 advice_doctor: "",
1080
                 advice_doctor: "",
1140
                 remark: _this.groupForm.remark,
1081
                 remark: _this.groupForm.remark,
1141
                 parent_id: _this.groupSelectRow.id,
1082
                 parent_id: _this.groupSelectRow.id,
1142
-                groupno: _this.groupForm.groupno
1083
+                groupno: _this.groupForm.groupno,
1084
+               
1143
               };
1085
               };
1144
 
1086
 
1145
               let mode = "";
1087
               let mode = "";
1148
               } else {
1090
               } else {
1149
                 mode = "1-1";
1091
                 mode = "1-1";
1150
               }
1092
               }
1151
-
1093
+              console.log("submitFort",submitForm)
1152
               CreateNewDoctorAdvice(this.patientID, submitForm, mode).then(
1094
               CreateNewDoctorAdvice(this.patientID, submitForm, mode).then(
1153
                 response => {
1095
                 response => {
1154
                   if (response.data.state == 0) {
1096
                   if (response.data.state == 0) {
1242
                     drug_spec: "" + _this.nameForm.drug_spec,
1184
                     drug_spec: "" + _this.nameForm.drug_spec,
1243
                     drug_spec_unit: _this.nameForm.drug_spec_unit,
1185
                     drug_spec_unit: _this.nameForm.drug_spec_unit,
1244
                     prescribing_number: "" + _this.nameForm.prescribing_number,
1186
                     prescribing_number: "" + _this.nameForm.prescribing_number,
1245
-                    prescribing_number_unit:
1246
-                      _this.nameForm.prescribing_number_unit,
1187
+                    prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1247
                     delivery_way: _this.nameForm.delivery_way,
1188
                     delivery_way: _this.nameForm.delivery_way,
1248
                     execution_frequency: _this.nameForm.execution_frequency,
1189
                     execution_frequency: _this.nameForm.execution_frequency,
1249
-                    template_id:
1250
-                      "D" + new Date().getTime() + this.getRandValue(),
1251
-
1190
+                    template_id:"D" + new Date().getTime() + this.getRandValue(),
1252
                     frequency_type: _this.nameForm.frequency_type,
1191
                     frequency_type: _this.nameForm.frequency_type,
1253
                     day_count: _this.nameForm.day_count.toString(),
1192
                     day_count: _this.nameForm.day_count.toString(),
1254
                     week_days: _this.nameForm.week_days,
1193
                     week_days: _this.nameForm.week_days,
1255
-
1194
+                    drug_id:_this.nameForm.drug_id,
1195
+                    way:_this.nameForm.way,
1196
+                    drug_name_id:_this.nameForm.drug_name_id,
1256
                     isEdit: 0,
1197
                     isEdit: 0,
1257
                     id: 0,
1198
                     id: 0,
1258
                     children: [],
1199
                     children: [],
1271
               } else {
1212
               } else {
1272
                 mode = "1-1";
1213
                 mode = "1-1";
1273
               }
1214
               }
1215
+              console.log("触发了吗",_this.patientID,_this.submitGroupForm)
1216
+              CreateNewGroupAdvice(_this.patientID, _this.groupForm.groupno,_this.submitGroupForm, mode).then(response => {
1274
 
1217
 
1275
-              CreateNewGroupAdvice(
1276
-                _this.patientID,
1277
-                _this.groupForm.groupno,
1278
-                _this.submitGroupForm,
1279
-                mode
1280
-              ).then(response => {
1281
                 if (response.data.state == 0) {
1218
                 if (response.data.state == 0) {
1282
                   _this.$message.error(response.data.msg);
1219
                   _this.$message.error(response.data.msg);
1283
                   return false;
1220
                   return false;
1362
                         frequency_type: groups[index].frequency_type,
1299
                         frequency_type: groups[index].frequency_type,
1363
                         day_count: groups[index].day_count,
1300
                         day_count: groups[index].day_count,
1364
                         week_day: groups[index].week_day,
1301
                         week_day: groups[index].week_day,
1365
-
1302
+                        drug_name_id:0,
1303
+                        way:0,
1304
+                        drug_id:0,
1366
                         isEdit: 0,
1305
                         isEdit: 0,
1367
                         index: 0,
1306
                         index: 0,
1368
                         id: groups[index].id,
1307
                         id: groups[index].id,
1492
 
1431
 
1493
           day_count: this.groupSelectRow.day_count,
1432
           day_count: this.groupSelectRow.day_count,
1494
           week_days: this.groupSelectRow.week_day,
1433
           week_days: this.groupSelectRow.week_day,
1495
-          frequency_type: this.groupSelectRow.frequency_type
1434
+          frequency_type: this.groupSelectRow.frequency_type,
1435
+          drug_id:0,
1436
+          drug_name_id:0,
1437
+          way:0,
1496
         };
1438
         };
1497
 
1439
 
1498
         if (!this.isChild) {
1440
         if (!this.isChild) {
1513
           delivery_way: "",
1455
           delivery_way: "",
1514
           execution_frequency: "",
1456
           execution_frequency: "",
1515
           template_id: "",
1457
           template_id: "",
1458
+          way:0,
1459
+          drug_id:0,
1460
+          drug_name_id:0,
1516
           isEdit: 0,
1461
           isEdit: 0,
1517
           index: 0,
1462
           index: 0,
1518
           id: 0,
1463
           id: 0,
1718
         }
1663
         }
1719
       }
1664
       }
1720
     },
1665
     },
1666
+
1667
+
1721
     newAddTempForm() {
1668
     newAddTempForm() {
1669
+      console.log("9999888")
1722
       this.allSelectedTemplate = [];
1670
       this.allSelectedTemplate = [];
1723
       var thisRowKey = 0;
1671
       var thisRowKey = 0;
1724
       for (const indexs in this.adviceTemplateMaps) {
1672
       for (const indexs in this.adviceTemplateMaps) {
1727
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1675
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1728
             thisRowKey++;
1676
             thisRowKey++;
1729
             var item = {
1677
             var item = {
1730
-              advice_name:
1731
-                adviceTemplate.DoctorAdviceTemplate[index].advice_name,
1732
-              advice_desc:
1733
-                adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
1734
-              single_dose:
1735
-                "" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
1736
-              single_dose_unit:
1737
-                adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
1738
-              drug_spec:
1739
-                "" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
1740
-              drug_spec_unit:
1741
-                adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
1742
-              prescribing_number:
1743
-                "" +
1744
-                adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
1745
-              prescribing_number_unit:
1746
-                adviceTemplate.DoctorAdviceTemplate[index]
1747
-                  .prescribing_number_unit,
1748
-              delivery_way:
1749
-                adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
1750
-              execution_frequency:
1751
-                adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1678
+              advice_name:adviceTemplate.DoctorAdviceTemplate[index].advice_name,
1679
+              advice_desc:adviceTemplate.DoctorAdviceTemplate[index].advice_desc,
1680
+              single_dose:"" + adviceTemplate.DoctorAdviceTemplate[index].single_dose,
1681
+              single_dose_unit:adviceTemplate.DoctorAdviceTemplate[index].single_dose_unit,
1682
+              drug_spec:"" + adviceTemplate.DoctorAdviceTemplate[index].drug_spec,
1683
+              drug_spec_unit:adviceTemplate.DoctorAdviceTemplate[index].drug_spec_unit,
1684
+              prescribing_number:"" +adviceTemplate.DoctorAdviceTemplate[index].prescribing_number,
1685
+              prescribing_number_unit:adviceTemplate.DoctorAdviceTemplate[index].prescribing_number_unit,
1686
+              delivery_way:adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
1687
+              execution_frequency:adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1752
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1688
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1753
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1689
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1754
               day_count: adviceTemplate.DoctorAdviceTemplate[index].day_count,
1690
               day_count: adviceTemplate.DoctorAdviceTemplate[index].day_count,
1755
-              frequency_type:
1756
-                adviceTemplate.DoctorAdviceTemplate[index].frequency_type,
1691
+              frequency_type:adviceTemplate.DoctorAdviceTemplate[index].frequency_type,
1757
               week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
1692
               week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
1758
               template_id: "T" + adviceTemplate.DoctorAdviceTemplate[index].id,
1693
               template_id: "T" + adviceTemplate.DoctorAdviceTemplate[index].id,
1759
-
1694
+              way:adviceTemplate.DoctorAdviceTemplate[index].way,
1695
+              drug_id:adviceTemplate.DoctorAdviceTemplate[index].drug_id,
1696
+              drug_name_id:adviceTemplate.DoctorAdviceTemplate[index].drug_name_id,
1760
               isEdit: 0,
1697
               isEdit: 0,
1761
               id: 0,
1698
               id: 0,
1762
               children: [],
1699
               children: [],
1785
                     children[key].prescribing_number_unit,
1722
                     children[key].prescribing_number_unit,
1786
                   delivery_way: children[key].delivery_way,
1723
                   delivery_way: children[key].delivery_way,
1787
                   execution_frequency: children[key].execution_frequency,
1724
                   execution_frequency: children[key].execution_frequency,
1725
+                  way:children[key].way,
1726
+                  drug_id:children[key].drug_id,
1727
+                  drug_name_id:children[key].drug_name_id,
1788
                   isEdit: 0,
1728
                   isEdit: 0,
1789
                   id: 0,
1729
                   id: 0,
1790
                   children: [],
1730
                   children: [],
1836
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1776
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1837
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1777
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1838
           drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
1778
           drug_spec_unit: this.allSelectedTemplate[index].drug_spec_unit,
1839
-          prescribing_number:
1840
-            "" + this.allSelectedTemplate[index].prescribing_number,
1841
-          prescribing_number_unit: this.allSelectedTemplate[index]
1842
-            .prescribing_number_unit,
1779
+          prescribing_number:"" + this.allSelectedTemplate[index].prescribing_number,
1780
+          prescribing_number_unit: this.allSelectedTemplate[index].prescribing_number_unit,
1843
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1781
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1844
-          execution_frequency: this.allSelectedTemplate[index]
1845
-            .execution_frequency,
1846
-
1782
+          execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1847
           day_count: this.allSelectedTemplate[index].day_count.toString(),
1783
           day_count: this.allSelectedTemplate[index].day_count.toString(),
1848
           frequency_type: this.allSelectedTemplate[index].frequency_type,
1784
           frequency_type: this.allSelectedTemplate[index].frequency_type,
1849
           week_days: this.allSelectedTemplate[index].week_days,
1785
           week_days: this.allSelectedTemplate[index].week_days,
1850
           template_id: this.allSelectedTemplate[index].template_id,
1786
           template_id: this.allSelectedTemplate[index].template_id,
1851
-
1787
+          way:this.allSelectedTemplate[index].way,
1788
+          drug_id:this.allSelectedTemplate[index].drug_id,
1789
+          drug_name_id:this.allSelectedTemplate[index].drug_name_id,
1852
           isEdit: 0,
1790
           isEdit: 0,
1853
           id: 0,
1791
           id: 0,
1854
           children: [],
1792
           children: [],
1872
                 prescribing_number_unit: children[key].prescribing_number_unit,
1810
                 prescribing_number_unit: children[key].prescribing_number_unit,
1873
                 delivery_way: children[key].delivery_way,
1811
                 delivery_way: children[key].delivery_way,
1874
                 execution_frequency: children[key].execution_frequency,
1812
                 execution_frequency: children[key].execution_frequency,
1813
+                way:children[key].way,
1814
+                drug_id:children[key].drug_id,
1815
+                drug_name_id:children[key].drug_name_id,
1875
                 isEdit: 0,
1816
                 isEdit: 0,
1876
                 id: 0,
1817
                 id: 0,
1877
                 children: [],
1818
                 children: [],
1972
               frequency_type: groups[index].frequency_type,
1913
               frequency_type: groups[index].frequency_type,
1973
               week_day: groups[index].week_day,
1914
               week_day: groups[index].week_day,
1974
               template_id: groups[index].template_id,
1915
               template_id: groups[index].template_id,
1975
-
1916
+              way:groups[index].way,
1917
+              drug_id:groups[index].drug_id,
1918
+              drug_name_id:groups[index].drug_name_id,
1976
               isEdit: 0,
1919
               isEdit: 0,
1977
               index: 0,
1920
               index: 0,
1978
               id: groups[index].id,
1921
               id: groups[index].id,
2000
                   isEdit: 0,
1943
                   isEdit: 0,
2001
                   index: 0,
1944
                   index: 0,
2002
                   id: childMap[item.id][key].id,
1945
                   id: childMap[item.id][key].id,
1946
+                  drug_id:childMap[item.id][key].drug_id,
1947
+                  way:childMap[item.id][key].way,
1948
+                  drug_name_id:childMap[item.id][key].drug_name_id,
2003
                   children: [],
1949
                   children: [],
2004
                   parent_row: item.row_key,
1950
                   parent_row: item.row_key,
2005
                   row_key: this.editRowKey
1951
                   row_key: this.editRowKey
2036
               .DoctorAdviceTemplate) {
1982
               .DoctorAdviceTemplate) {
2037
               _this.editRowKey++;
1983
               _this.editRowKey++;
2038
               var item = {
1984
               var item = {
2039
-                advice_name:
2040
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2041
-                    .advice_name,
2042
-                advice_desc:
2043
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2044
-                    .advice_desc,
2045
-                single_dose:
2046
-                  "" +
2047
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2048
-                    .single_dose,
2049
-                single_dose_unit:
2050
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2051
-                    .single_dose_unit,
2052
-                drug_spec:
2053
-                  "" +
2054
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2055
-                    .drug_spec,
2056
-                drug_spec_unit:
2057
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2058
-                    .drug_spec_unit,
2059
-                prescribing_number:
2060
-                  "" +
2061
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2062
-                    .prescribing_number,
2063
-                prescribing_number_unit:
2064
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2065
-                    .prescribing_number_unit,
2066
-                delivery_way:
2067
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2068
-                    .delivery_way,
2069
-                execution_frequency:
2070
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2071
-                    .execution_frequency,
1985
+                advice_name:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
1986
+                advice_desc:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_desc,
1987
+                single_dose:"" +_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose,
1988
+                single_dose_unit:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].single_dose_unit,
1989
+                drug_spec:"" +_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec,
1990
+                drug_spec_unit:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_spec_unit,
1991
+                prescribing_number:"" +_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number,
1992
+                prescribing_number_unit:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].prescribing_number_unit,
1993
+                delivery_way:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].delivery_way,
1994
+                execution_frequency:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
1995
+                way:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].way,
1996
+                drug_id:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_id,
1997
+                drug_name_id:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_name_id,
2072
                 isEdit: 0,
1998
                 isEdit: 0,
2073
                 id: 0,
1999
                 id: 0,
2074
                 children: [],
2000
                 children: [],
2095
                     drug_spec: "" + children[key].drug_spec,
2021
                     drug_spec: "" + children[key].drug_spec,
2096
                     drug_spec_unit: children[key].drug_spec_unit,
2022
                     drug_spec_unit: children[key].drug_spec_unit,
2097
                     prescribing_number: "" + children[key].prescribing_number,
2023
                     prescribing_number: "" + children[key].prescribing_number,
2098
-                    prescribing_number_unit:
2099
-                      children[key].prescribing_number_unit,
2024
+                    prescribing_number_unit:children[key].prescribing_number_unit,
2100
                     delivery_way: children[key].delivery_way,
2025
                     delivery_way: children[key].delivery_way,
2101
                     execution_frequency: children[key].execution_frequency,
2026
                     execution_frequency: children[key].execution_frequency,
2027
+                    way:children[key].way,
2028
+                    drug_id:children[key].drug_id,
2029
+                    drug_name_id:children[key].drug_name_id,
2102
                     isEdit: 0,
2030
                     isEdit: 0,
2103
                     id: 0,
2031
                     id: 0,
2104
                     children: [],
2032
                     children: [],
2323
       }
2251
       }
2324
     },
2252
     },
2325
     getAdviceConfig(type) {
2253
     getAdviceConfig(type) {
2254
+       console.log("type",type)
2326
       getAdviceConfig(type).then(response => {
2255
       getAdviceConfig(type).then(response => {
2327
         if (response.data.state == 1) {
2256
         if (response.data.state == 1) {
2328
-          this.deliveryWayOptions =
2329
-            response.data.data.drugways === null
2330
-              ? []
2331
-              : response.data.data.drugways;
2332
-          this.executionFrequencyOptions =
2333
-            response.data.data.efs === null ? [] : response.data.data.efs;
2334
-          this.adviceTemplates =
2335
-            response.data.data.advice_templates === null
2336
-              ? []
2337
-              : response.data.data.advice_templates;
2257
+          this.deliveryWayOptions =response.data.data.drugways === null? []: response.data.data.drugways;
2258
+          console.log("给药途径",this.deliveryWayOptions)
2259
+          this.executionFrequencyOptions = response.data.data.efs === null ? [] : response.data.data.efs;
2260
+          this.adviceTemplates = response.data.data.advice_templates === null? []: response.data.data.advice_templates;
2338
 
2261
 
2339
           var templateLen = this.adviceTemplates.length;
2262
           var templateLen = this.adviceTemplates.length;
2340
           for (let index = 0; index < templateLen; index++) {
2263
           for (let index = 0; index < templateLen; index++) {
2342
               continue;
2265
               continue;
2343
             }
2266
             }
2344
 
2267
 
2345
-            var DoctorAdviceTemplate = this.adviceTemplates[index]
2346
-              .DoctorAdviceTemplate;
2268
+            var DoctorAdviceTemplate = this.adviceTemplates[index].DoctorAdviceTemplate;
2347
             for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
2269
             for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
2348
               DoctorAdviceTemplate[i].selection = false;
2270
               DoctorAdviceTemplate[i].selection = false;
2349
             }
2271
             }
2503
             this.src_type = this.drugSpec[i].type
2425
             this.src_type = this.drugSpec[i].type
2504
             this.nameForm.drug_id = this.drugSpec[i].id
2426
             this.nameForm.drug_id = this.drugSpec[i].id
2505
             this.nameForm.way = this.drugSpec[i].type
2427
             this.nameForm.way = this.drugSpec[i].type
2428
+            this.nameForm.single_dose_unit = this.drugSpec[i].min_unit
2429
+            this.nameForm.prescribing_number_unit = this.drugSpec[i].min_unit
2430
+            this.nameForm.drug_spec_unit = this.drugSpec[i].min_unit
2431
+
2432
+            if(this.drugSpec[i].drug_name_id){
2433
+               this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
2434
+            }else{
2435
+              this.nameForm.drug_name_id = 0
2436
+            }
2506
           }
2437
           }
2507
         }
2438
         }
2508
       },
2439
       },
2509
       handleSelect1(){
2440
       handleSelect1(){
2510
         
2441
         
2442
+      },
2443
+      handleSelect(){
2444
+
2511
       },
2445
       },
2512
 
2446
 
2513
        querySearch(queryString, cb) {
2447
        querySearch(queryString, cb) {

+ 16 - 22
src/xt_pages/user/doctorAdvice.vue Ver arquivo

963
             <el-col :span="14">
963
             <el-col :span="14">
964
               <el-form-item label="药品规格 :" prop="advice_desc">
964
               <el-form-item label="药品规格 :" prop="advice_desc">
965
                 <el-col :span="6">
965
                 <el-col :span="6">
966
-
966
+               
967
                 <el-autocomplete
967
                 <el-autocomplete
968
                   style="width:100px;"
968
                   style="width:100px;"
969
                   class="inline-input"
969
                   class="inline-input"
1044
                     >
1044
                     >
1045
                     </el-option>
1045
                     </el-option>
1046
                   </el-select>
1046
                   </el-select>
1047
-
1047
+                
1048
                 </el-col>
1048
                 </el-col>
1049
               </el-form-item>
1049
               </el-form-item>
1050
             </el-col>
1050
             </el-col>
2239
               this.adviceForm.advice_name = arr[0]
2239
               this.adviceForm.advice_name = arr[0]
2240
           }
2240
           }
2241
 
2241
 
2242
-
2242
+       
2243
           EditNewDoctorAdvice(
2243
           EditNewDoctorAdvice(
2244
             this.patientID,
2244
             this.patientID,
2245
             this.adviceForm.id,
2245
             this.adviceForm.id,
2293
       });
2293
       });
2294
     },
2294
     },
2295
     submitgroupAdvice(formName) {
2295
     submitgroupAdvice(formName) {
2296
-
2296
+     
2297
       this.addLoading = true;
2297
       this.addLoading = true;
2298
       this.$refs[formName].validate(valid => {
2298
       this.$refs[formName].validate(valid => {
2299
         if (valid) {
2299
         if (valid) {
2306
             remark: this.groupForm.remark,
2306
             remark: this.groupForm.remark,
2307
             parent_id: this.groupForm.parent_id,
2307
             parent_id: this.groupForm.parent_id,
2308
           };
2308
           };
2309
-          console.log("22222",submitForm)
2310
-          console.log("33333",this.private_drug_config.drug_start)
2311
-          console.log("44444",this.medicals)
2312
-
2313
-
2314
-
2309
+        
2310
+         
2315
           var adviceNames = [];
2311
           var adviceNames = [];
2316
           for (const index in this.groupForm.adviceNames) {
2312
           for (const index in this.groupForm.adviceNames) {
2317
             this.groupForm.adviceNames[
2313
             this.groupForm.adviceNames[
2323
           }
2319
           }
2324
           submitForm.adviceNames = adviceNames;
2320
           submitForm.adviceNames = adviceNames;
2325
 
2321
 
2326
-
2327
-
2328
-
2329
           let mode = "";
2322
           let mode = "";
2330
           if (this.groupForm.advice_type == 1) {
2323
           if (this.groupForm.advice_type == 1) {
2331
             mode = "1-2";
2324
             mode = "1-2";
2334
           }
2327
           }
2335
         console.log("长期医嘱2222",this.medicals)
2328
         console.log("长期医嘱2222",this.medicals)
2336
         console.log("长期医嘱3333",submitForm)
2329
         console.log("长期医嘱3333",submitForm)
2337
-
2330
+       
2338
         if(this.private_drug_config != null&&this.private_drug_config.drug_start == 1){
2331
         if(this.private_drug_config != null&&this.private_drug_config.drug_start == 1){
2339
               for(let index=0;index<submitForm.adviceNames.length;index++){
2332
               for(let index=0;index<submitForm.adviceNames.length;index++){
2340
                   for(let i=0;i<this.medicals.length;i++){
2333
                   for(let i=0;i<this.medicals.length;i++){
2346
               }
2339
               }
2347
           }
2340
           }
2348
           console.log("模板数据",submitForm)
2341
           console.log("模板数据",submitForm)
2349
-
2342
+        
2350
           CreateNewGroupAdvice(this.patientID, 0, submitForm, mode).then(
2343
           CreateNewGroupAdvice(this.patientID, 0, submitForm, mode).then(
2351
             response => {
2344
             response => {
2352
               if (response.data.state == 0) {
2345
               if (response.data.state == 0) {
2439
               this.adviceForm.advice_name = arr[0]
2432
               this.adviceForm.advice_name = arr[0]
2440
           }
2433
           }
2441
           console.log("222222",this.adviceForm)
2434
           console.log("222222",this.adviceForm)
2442
-
2435
+         
2443
           CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
2436
           CreateNewDoctorAdvice(this.patientID, this.adviceForm, mode).then(
2444
             response => {
2437
             response => {
2445
               if (response.data.state == 0) {
2438
               if (response.data.state == 0) {
2976
     },
2969
     },
2977
     openConfig() {},
2970
     openConfig() {},
2978
     openEditGroupAdvice(groupno) {
2971
     openEditGroupAdvice(groupno) {
2979
-
2972
+      console.log("groupno",groupno)
2980
       var groups = [];
2973
       var groups = [];
2981
       this.rowKey = 0;
2974
       this.rowKey = 0;
2982
       for(let i=0;i<this.adviceTableData.length;i++){
2975
       for(let i=0;i<this.adviceTableData.length;i++){
3004
         remark: groups[0].remark,
2997
         remark: groups[0].remark,
3005
         groupno: groupno
2998
         groupno: groupno
3006
       };
2999
       };
3007
-      console.log("2222",groups[0]);
3000
+      console.log("到了",groups[0]);
3008
 
3001
 
3009
       var childMap = {};
3002
       var childMap = {};
3010
       for (const index in groups) {
3003
       for (const index in groups) {
3048
           row_key: this.rowKey,
3041
           row_key: this.rowKey,
3049
           table: []
3042
           table: []
3050
         };
3043
         };
3051
-
3044
+      
3052
         if (item.id in childMap) {
3045
         if (item.id in childMap) {
3053
           for (const key in childMap[item.id]) {
3046
           for (const key in childMap[item.id]) {
3054
             this.rowKey++;
3047
             this.rowKey++;
3088
     },
3081
     },
3089
 
3082
 
3090
     openEdit(index, row) {
3083
     openEdit(index, row) {
3084
+      
3091
       this.currentIndex = index;
3085
       this.currentIndex = index;
3092
       (this.dialogTitle = "修改医嘱"), (this.isEdit = true);
3086
       (this.dialogTitle = "修改医嘱"), (this.isEdit = true);
3093
 
3087
 
4055
       });
4049
       });
4056
     },
4050
     },
4057
     submitNameForm(formName) {
4051
     submitNameForm(formName) {
4058
-
4052
+       
4059
        if(this.src_type == ""){
4053
        if(this.src_type == ""){
4060
           this.nameForm.way = 0
4054
           this.nameForm.way = 0
4061
           this.nameForm.drug_id = 0
4055
           this.nameForm.drug_id = 0
4514
             this.private_drug_config = response.data.data.private_drug_config
4508
             this.private_drug_config = response.data.data.private_drug_config
4515
             console.log("medicals",medicalList)
4509
             console.log("medicals",medicalList)
4516
             this.medicals = medicalList
4510
             this.medicals = medicalList
4517
-
4511
+          
4518
       })
4512
       })
4519
     },
4513
     },
4520
     changeDrugNameTwo(name){
4514
     changeDrugNameTwo(name){
4525
         if (this.all_drug[i].drug_name == name) {
4519
         if (this.all_drug[i].drug_name == name) {
4526
             this.drugSpec = this.all_drug[i].drug_specs
4520
             this.drugSpec = this.all_drug[i].drug_specs
4527
           }
4521
           }
4528
-       }
4522
+       }   
4529
     },
4523
     },
4530
    changeDrugDescTwo(name){
4524
    changeDrugDescTwo(name){
4531
       this.current_drug_spec = name
4525
       this.current_drug_spec = name