浏览代码

自备药

XMLWAN 4 年前
父节点
当前提交
7de5b28e98
共有 2 个文件被更改,包括 120 次插入166 次删除
  1. 117 164
      src/xt_pages/user/components/EditGroupAdvice.vue
  2. 3 2
      src/xt_pages/user/doctorAdvice.vue

+ 117 - 164
src/xt_pages/user/components/EditGroupAdvice.vue 查看文件

411
                   v-model="nameForm.advice_desc"
411
                   v-model="nameForm.advice_desc"
412
                   :fetch-suggestions="querySearch1"
412
                   :fetch-suggestions="querySearch1"
413
                   placeholder="请输入内容"
413
                   placeholder="请输入内容"
414
-                  @select="handleSelect1"
415
                   @input="changeDrugDesc"
414
                   @input="changeDrugDesc"
416
                 ></el-autocomplete>
415
                 ></el-autocomplete>
417
               </el-col>
416
               </el-col>
630
         index: 0,
629
         index: 0,
631
         id: 0,
630
         id: 0,
632
         children: [],
631
         children: [],
633
-        way:"",
634
-        drug_id:"",
635
-        src_type:""
632
+        way:0,
633
+        drug_id:0,
634
+        src_type:"",
635
+        drug_name_id:0
636
       },
636
       },
637
 
637
 
638
       drugOptions: [],
638
       drugOptions: [],
845
         .catch(() => {});
845
         .catch(() => {});
846
     },
846
     },
847
     submitNameForm(formName) {
847
     submitNameForm(formName) {
848
-     
848
+       console.log("888888",this.nameForm)
849
       if(this.src_type == ""){
849
       if(this.src_type == ""){
850
           this.nameForm.way = 0
850
           this.nameForm.way = 0
851
           this.nameForm.drug_id = 0
851
           this.nameForm.drug_id = 0
855
           var arr = this.nameForm.advice_name.split("(自备药)")
855
           var arr = this.nameForm.advice_name.split("(自备药)")
856
           this.nameForm.advice_name = arr[0]
856
           this.nameForm.advice_name = arr[0]
857
        }
857
        }
858
-
858
+      console.log("新增医嘱内容")
859
       var _this = this;
859
       var _this = this;
860
       this.$refs[formName].validate(valid => {
860
       this.$refs[formName].validate(valid => {
861
         if (valid) {
861
         if (valid) {
862
           if (_this.nameForm.isEdit) {
862
           if (_this.nameForm.isEdit) {
863
             var submitForm = null;
863
             var submitForm = null;
864
             if (!this.isChild) {
864
             if (!this.isChild) {
865
+              console.log("进来了吗")
865
               submitForm = {
866
               submitForm = {
866
                 advice_type: _this.groupForm.advice_type,
867
                 advice_type: _this.groupForm.advice_type,
867
                 advice_date: _this.groupForm.advice_date,
868
                 advice_date: _this.groupForm.advice_date,
876
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
877
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
877
                 delivery_way: _this.nameForm.delivery_way,
878
                 delivery_way: _this.nameForm.delivery_way,
878
                 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,
879
                 isEdit: 0,
883
                 isEdit: 0,
880
                 id: 0,
884
                 id: 0,
881
                 advice_doctor: "",
885
                 advice_doctor: "",
905
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
909
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
906
                 delivery_way: _this.nameForm.delivery_way,
910
                 delivery_way: _this.nameForm.delivery_way,
907
                 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,
908
                 isEdit: 0,
915
                 isEdit: 0,
909
                 id: 0,
916
                 id: 0,
910
                 advice_doctor: "",
917
                 advice_doctor: "",
913
                 groupno: _this.groupForm.groupno,
920
                 groupno: _this.groupForm.groupno,
914
                 frequency_type: 0,
921
                 frequency_type: 0,
915
                 day_count: "0",
922
                 day_count: "0",
916
-                week_days: ""
923
+                week_days: "",
924
+              
917
               };
925
               };
918
             }
926
             }
919
             let mode = "";
927
             let mode = "";
920
 
928
 
921
             if (_this.groupForm.advice_type == 1) {
929
             if (_this.groupForm.advice_type == 1) {
922
-              // if(_this.nameForm.)
930
+            
923
               mode = "1-3";
931
               mode = "1-3";
924
               if (
932
               if (
925
                 _this.groupForm.doctor != _this.$store.getters.xt_user.user.id
933
                 _this.groupForm.doctor != _this.$store.getters.xt_user.user.id
934
                 mode = "3-1";
942
                 mode = "3-1";
935
               }
943
               }
936
             }
944
             }
937
-
945
+            console.log("编辑",submitForm)
938
             EditNewDoctorAdvice(
946
             EditNewDoctorAdvice(
939
               this.patientID,
947
               this.patientID,
940
               this.groupSelectRow.id,
948
               this.groupSelectRow.id,
960
                   ) {
968
                   ) {
961
                     var advice = response.data.data.advice;
969
                     var advice = response.data.data.advice;
962
                     _this.adviceTableData[index].drug_spec = advice.drug_spec;
970
                     _this.adviceTableData[index].drug_spec = advice.drug_spec;
963
-                    _this.adviceTableData[index].drug_spec_unit =
964
-                      advice.drug_spec_unit;
971
+                    _this.adviceTableData[index].drug_spec_unit = advice.drug_spec_unit;
965
                     _this.adviceTableData[index].start_time = advice.start_time;
972
                     _this.adviceTableData[index].start_time = advice.start_time;
966
-                    _this.adviceTableData[index].advice_name =
967
-                      advice.advice_name;
968
-                    _this.adviceTableData[index].advice_desc =
969
-                      advice.advice_desc;
970
-                    _this.adviceTableData[index].single_dose =
971
-                      advice.single_dose;
972
-                    _this.adviceTableData[index].single_dose_unit =
973
-                      advice.single_dose_unit;
974
-                    _this.adviceTableData[index].delivery_way =
975
-                      advice.delivery_way;
976
-                    _this.adviceTableData[index].execution_frequency =
977
-                      advice.execution_frequency;
978
-                    _this.adviceTableData[index].prescribing_number =
979
-                      advice.prescribing_number;
980
-                    _this.adviceTableData[index].prescribing_number_unit =
981
-                      advice.prescribing_number_unit;
982
-
983
-                    _this.adviceTableData[index].frequency_type =
984
-                      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;
985
                     _this.adviceTableData[index].day_count = advice.day_count;
982
                     _this.adviceTableData[index].day_count = advice.day_count;
986
                     _this.adviceTableData[index].week_day = advice.week_day;
983
                     _this.adviceTableData[index].week_day = advice.week_day;
987
-
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
988
                     break;
987
                     break;
989
                   }
988
                   }
990
                 }
989
                 }
1000
                       var children =
999
                       var children =
1001
                         _this.groupForm.adviceNames[index].children;
1000
                         _this.groupForm.adviceNames[index].children;
1002
                       for (let j = 0; j < ale; j++) {
1001
                       for (let j = 0; j < ale; j++) {
1003
-                        if (
1004
-                          _this.groupSelectRow.row_key == children[j].row_key
1005
-                        ) {
1006
-                          _this.groupForm.adviceNames[index].children[
1007
-                            j
1008
-                          ].advice_name = _this.nameForm.advice_name;
1009
-                          _this.groupForm.adviceNames[index].children[
1010
-                            j
1011
-                          ].advice_desc = _this.nameForm.advice_desc;
1012
-                          _this.groupForm.adviceNames[index].children[
1013
-                            j
1014
-                          ].single_dose = "" + _this.nameForm.single_dose;
1015
-                          _this.groupForm.adviceNames[index].children[
1016
-                            j
1017
-                          ].single_dose_unit = _this.nameForm.single_dose_unit;
1018
-                          _this.groupForm.adviceNames[index].children[
1019
-                            j
1020
-                          ].drug_spec = "" + _this.nameForm.drug_spec;
1021
-                          _this.groupForm.adviceNames[index].children[
1022
-                            j
1023
-                          ].drug_spec_unit = _this.nameForm.drug_spec_unit;
1024
-                          _this.groupForm.adviceNames[index].children[
1025
-                            j
1026
-                          ].prescribing_number =
1027
-                            "" + _this.nameForm.prescribing_number;
1028
-                          _this.groupForm.adviceNames[index].children[
1029
-                            j
1030
-                          ].prescribing_number_unit =
1031
-                            _this.nameForm.prescribing_number_unit;
1032
-                          _this.groupForm.adviceNames[index].children[
1033
-                            j
1034
-                          ].delivery_way = _this.nameForm.delivery_way;
1035
-                          _this.groupForm.adviceNames[index].children[
1036
-                            j
1037
-                          ].execution_frequency =
1038
-                            _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
1039
                           _this.$set(
1017
                           _this.$set(
1040
                             _this.groupForm.adviceNames[index].children,
1018
                             _this.groupForm.adviceNames[index].children,
1041
                             j,
1019
                             j,
1048
                   }
1026
                   }
1049
                 } else {
1027
                 } else {
1050
                   for (let index = 0; index < ale; index++) {
1028
                   for (let index = 0; index < ale; index++) {
1051
-                    if (
1052
-                      _this.groupSelectRow.row_key ==
1053
-                      _this.groupForm.adviceNames[index].row_key
1054
-                    ) {
1055
-                      _this.groupForm.adviceNames[index].advice_name =
1056
-                        _this.nameForm.advice_name;
1057
-                      _this.groupForm.adviceNames[index].advice_desc =
1058
-                        "" + _this.nameForm.advice_desc;
1059
-                      _this.groupForm.adviceNames[index].single_dose =
1060
-                        "" + _this.nameForm.single_dose;
1061
-                      _this.groupForm.adviceNames[index].single_dose_unit =
1062
-                        _this.nameForm.single_dose_unit;
1063
-                      _this.groupForm.adviceNames[index].drug_spec =
1064
-                        "" + _this.nameForm.drug_spec;
1065
-                      _this.groupForm.adviceNames[index].drug_spec_unit =
1066
-                        _this.nameForm.drug_spec_unit;
1067
-                      _this.groupForm.adviceNames[index].prescribing_number =
1068
-                        "" + _this.nameForm.prescribing_number;
1069
-                      _this.groupForm.adviceNames[
1070
-                        index
1071
-                      ].prescribing_number_unit =
1072
-                        _this.nameForm.prescribing_number_unit;
1073
-                      _this.groupForm.adviceNames[index].delivery_way =
1074
-                        _this.nameForm.delivery_way;
1075
-                      _this.groupForm.adviceNames[index].execution_frequency =
1076
-                        _this.nameForm.execution_frequency;
1077
-
1078
-                      _this.groupForm.adviceNames[index].frequency_type =
1079
-                        _this.nameForm.frequency_type;
1080
-                      _this.groupForm.adviceNames[index].day_count =
1081
-                        _this.nameForm.day_count;
1082
-                      _this.groupForm.adviceNames[
1083
-                        index
1084
-                      ].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(",");
1085
                       console.log(_this.weeks);
1046
                       console.log(_this.weeks);
1086
                       _this.$set(
1047
                       _this.$set(
1087
                         _this.groupForm.adviceNames,
1048
                         _this.groupForm.adviceNames,
1111
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1072
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1112
                 delivery_way: _this.nameForm.delivery_way,
1073
                 delivery_way: _this.nameForm.delivery_way,
1113
                 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,
1114
                 isEdit: 0,
1078
                 isEdit: 0,
1115
                 id: 0,
1079
                 id: 0,
1116
                 advice_doctor: "",
1080
                 advice_doctor: "",
1117
                 remark: _this.groupForm.remark,
1081
                 remark: _this.groupForm.remark,
1118
                 parent_id: _this.groupSelectRow.id,
1082
                 parent_id: _this.groupSelectRow.id,
1119
-                groupno: _this.groupForm.groupno
1083
+                groupno: _this.groupForm.groupno,
1084
+               
1120
               };
1085
               };
1121
 
1086
 
1122
               let mode = "";
1087
               let mode = "";
1125
               } else {
1090
               } else {
1126
                 mode = "1-1";
1091
                 mode = "1-1";
1127
               }
1092
               }
1128
-
1093
+              console.log("submitFort",submitForm)
1129
               CreateNewDoctorAdvice(this.patientID, submitForm, mode).then(
1094
               CreateNewDoctorAdvice(this.patientID, submitForm, mode).then(
1130
                 response => {
1095
                 response => {
1131
                   if (response.data.state == 0) {
1096
                   if (response.data.state == 0) {
1219
                     drug_spec: "" + _this.nameForm.drug_spec,
1184
                     drug_spec: "" + _this.nameForm.drug_spec,
1220
                     drug_spec_unit: _this.nameForm.drug_spec_unit,
1185
                     drug_spec_unit: _this.nameForm.drug_spec_unit,
1221
                     prescribing_number: "" + _this.nameForm.prescribing_number,
1186
                     prescribing_number: "" + _this.nameForm.prescribing_number,
1222
-                    prescribing_number_unit:
1223
-                      _this.nameForm.prescribing_number_unit,
1187
+                    prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1224
                     delivery_way: _this.nameForm.delivery_way,
1188
                     delivery_way: _this.nameForm.delivery_way,
1225
                     execution_frequency: _this.nameForm.execution_frequency,
1189
                     execution_frequency: _this.nameForm.execution_frequency,
1226
-                    template_id:
1227
-                      "D" + new Date().getTime() + this.getRandValue(),
1228
-
1190
+                    template_id:"D" + new Date().getTime() + this.getRandValue(),
1229
                     frequency_type: _this.nameForm.frequency_type,
1191
                     frequency_type: _this.nameForm.frequency_type,
1230
                     day_count: _this.nameForm.day_count.toString(),
1192
                     day_count: _this.nameForm.day_count.toString(),
1231
                     week_days: _this.nameForm.week_days,
1193
                     week_days: _this.nameForm.week_days,
1232
-
1194
+                    drug_id:_this.nameForm.drug_id,
1195
+                    way:_this.nameForm.way,
1196
+                    drug_name_id:_this.nameForm.drug_name_id,
1233
                     isEdit: 0,
1197
                     isEdit: 0,
1234
                     id: 0,
1198
                     id: 0,
1235
                     children: [],
1199
                     children: [],
1248
               } else {
1212
               } else {
1249
                 mode = "1-1";
1213
                 mode = "1-1";
1250
               }
1214
               }
1215
+              console.log("触发了吗",_this.patientID,_this.submitGroupForm)
1216
+              CreateNewGroupAdvice(_this.patientID, _this.groupForm.groupno,_this.submitGroupForm, mode).then(response => {
1251
 
1217
 
1252
-              CreateNewGroupAdvice(
1253
-                _this.patientID,
1254
-                _this.groupForm.groupno,
1255
-                _this.submitGroupForm,
1256
-                mode
1257
-              ).then(response => {
1258
                 if (response.data.state == 0) {
1218
                 if (response.data.state == 0) {
1259
                   _this.$message.error(response.data.msg);
1219
                   _this.$message.error(response.data.msg);
1260
                   return false;
1220
                   return false;
1339
                         frequency_type: groups[index].frequency_type,
1299
                         frequency_type: groups[index].frequency_type,
1340
                         day_count: groups[index].day_count,
1300
                         day_count: groups[index].day_count,
1341
                         week_day: groups[index].week_day,
1301
                         week_day: groups[index].week_day,
1342
-
1302
+                        drug_name_id:0,
1303
+                        way:0,
1304
+                        drug_id:0,
1343
                         isEdit: 0,
1305
                         isEdit: 0,
1344
                         index: 0,
1306
                         index: 0,
1345
                         id: groups[index].id,
1307
                         id: groups[index].id,
1469
 
1431
 
1470
           day_count: this.groupSelectRow.day_count,
1432
           day_count: this.groupSelectRow.day_count,
1471
           week_days: this.groupSelectRow.week_day,
1433
           week_days: this.groupSelectRow.week_day,
1472
-          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,
1473
         };
1438
         };
1474
 
1439
 
1475
         if (!this.isChild) {
1440
         if (!this.isChild) {
1490
           delivery_way: "",
1455
           delivery_way: "",
1491
           execution_frequency: "",
1456
           execution_frequency: "",
1492
           template_id: "",
1457
           template_id: "",
1458
+          way:0,
1459
+          drug_id:0,
1460
+          drug_name_id:0,
1493
           isEdit: 0,
1461
           isEdit: 0,
1494
           index: 0,
1462
           index: 0,
1495
           id: 0,
1463
           id: 0,
2014
               .DoctorAdviceTemplate) {
1982
               .DoctorAdviceTemplate) {
2015
               _this.editRowKey++;
1983
               _this.editRowKey++;
2016
               var item = {
1984
               var item = {
2017
-                advice_name:
2018
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2019
-                    .advice_name,
2020
-                advice_desc:
2021
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2022
-                    .advice_desc,
2023
-                single_dose:
2024
-                  "" +
2025
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2026
-                    .single_dose,
2027
-                single_dose_unit:
2028
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2029
-                    .single_dose_unit,
2030
-                drug_spec:
2031
-                  "" +
2032
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2033
-                    .drug_spec,
2034
-                drug_spec_unit:
2035
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2036
-                    .drug_spec_unit,
2037
-                prescribing_number:
2038
-                  "" +
2039
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2040
-                    .prescribing_number,
2041
-                prescribing_number_unit:
2042
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2043
-                    .prescribing_number_unit,
2044
-                delivery_way:
2045
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2046
-                    .delivery_way,
2047
-                execution_frequency:
2048
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
2049
-                    .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,
2050
                 isEdit: 0,
1998
                 isEdit: 0,
2051
                 id: 0,
1999
                 id: 0,
2052
                 children: [],
2000
                 children: [],
2073
                     drug_spec: "" + children[key].drug_spec,
2021
                     drug_spec: "" + children[key].drug_spec,
2074
                     drug_spec_unit: children[key].drug_spec_unit,
2022
                     drug_spec_unit: children[key].drug_spec_unit,
2075
                     prescribing_number: "" + children[key].prescribing_number,
2023
                     prescribing_number: "" + children[key].prescribing_number,
2076
-                    prescribing_number_unit:
2077
-                      children[key].prescribing_number_unit,
2024
+                    prescribing_number_unit:children[key].prescribing_number_unit,
2078
                     delivery_way: children[key].delivery_way,
2025
                     delivery_way: children[key].delivery_way,
2079
                     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,
2080
                     isEdit: 0,
2030
                     isEdit: 0,
2081
                     id: 0,
2031
                     id: 0,
2082
                     children: [],
2032
                     children: [],
2301
       }
2251
       }
2302
     },
2252
     },
2303
     getAdviceConfig(type) {
2253
     getAdviceConfig(type) {
2254
+       console.log("type",type)
2304
       getAdviceConfig(type).then(response => {
2255
       getAdviceConfig(type).then(response => {
2305
         if (response.data.state == 1) {
2256
         if (response.data.state == 1) {
2306
-          this.deliveryWayOptions =
2307
-            response.data.data.drugways === null
2308
-              ? []
2309
-              : response.data.data.drugways;
2310
-          this.executionFrequencyOptions =
2311
-            response.data.data.efs === null ? [] : response.data.data.efs;
2312
-          this.adviceTemplates =
2313
-            response.data.data.advice_templates === null
2314
-              ? []
2315
-              : 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;
2316
 
2261
 
2317
           var templateLen = this.adviceTemplates.length;
2262
           var templateLen = this.adviceTemplates.length;
2318
           for (let index = 0; index < templateLen; index++) {
2263
           for (let index = 0; index < templateLen; index++) {
2320
               continue;
2265
               continue;
2321
             }
2266
             }
2322
 
2267
 
2323
-            var DoctorAdviceTemplate = this.adviceTemplates[index]
2324
-              .DoctorAdviceTemplate;
2268
+            var DoctorAdviceTemplate = this.adviceTemplates[index].DoctorAdviceTemplate;
2325
             for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
2269
             for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
2326
               DoctorAdviceTemplate[i].selection = false;
2270
               DoctorAdviceTemplate[i].selection = false;
2327
             }
2271
             }
2481
             this.src_type = this.drugSpec[i].type
2425
             this.src_type = this.drugSpec[i].type
2482
             this.nameForm.drug_id = this.drugSpec[i].id
2426
             this.nameForm.drug_id = this.drugSpec[i].id
2483
             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
+            }
2484
           }
2437
           }
2485
         }
2438
         }
2486
       },
2439
       },

+ 3 - 2
src/xt_pages/user/doctorAdvice.vue 查看文件

2969
     },
2969
     },
2970
     openConfig() {},
2970
     openConfig() {},
2971
     openEditGroupAdvice(groupno) {
2971
     openEditGroupAdvice(groupno) {
2972
-    
2972
+      console.log("groupno",groupno)
2973
       var groups = [];
2973
       var groups = [];
2974
       this.rowKey = 0;
2974
       this.rowKey = 0;
2975
       for(let i=0;i<this.adviceTableData.length;i++){
2975
       for(let i=0;i<this.adviceTableData.length;i++){
2997
         remark: groups[0].remark,
2997
         remark: groups[0].remark,
2998
         groupno: groupno
2998
         groupno: groupno
2999
       };
2999
       };
3000
-      console.log("触发了吗----------",groups[0]);
3000
+      console.log("到了",groups[0]);
3001
 
3001
 
3002
       var childMap = {};
3002
       var childMap = {};
3003
       for (const index in groups) {
3003
       for (const index in groups) {
3081
     },
3081
     },
3082
 
3082
 
3083
     openEdit(index, row) {
3083
     openEdit(index, row) {
3084
+      
3084
       this.currentIndex = index;
3085
       this.currentIndex = index;
3085
       (this.dialogTitle = "修改医嘱"), (this.isEdit = true);
3086
       (this.dialogTitle = "修改医嘱"), (this.isEdit = true);
3086
 
3087