Browse Source

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 years ago
parent
commit
60ad4b081b
2 changed files with 175 additions and 247 deletions
  1. 159 225
      src/xt_pages/user/components/EditGroupAdvice.vue
  2. 16 22
      src/xt_pages/user/doctorAdvice.vue

+ 159 - 225
src/xt_pages/user/components/EditGroupAdvice.vue View File

@@ -202,6 +202,8 @@
202 202
       </el-form>
203 203
     </el-dialog>
204 204
 
205
+
206
+   <!-- 编辑选则医嘱模版 -->
205 207
     <el-dialog
206 208
       title="选择医嘱模板"
207 209
       :visible.sync="templateFormVisible"
@@ -331,6 +333,8 @@
331 333
         </el-button>
332 334
       </div>
333 335
     </el-dialog>
336
+
337
+
334 338
     <el-dialog
335 339
       title="选择医嘱模板"
336 340
       :visible.sync="oldTemplateFormVisible"
@@ -407,7 +411,6 @@
407 411
                   v-model="nameForm.advice_desc"
408 412
                   :fetch-suggestions="querySearch1"
409 413
                   placeholder="请输入内容"
410
-                  @select="handleSelect1"
411 414
                   @input="changeDrugDesc"
412 415
                 ></el-autocomplete>
413 416
               </el-col>
@@ -626,9 +629,10 @@ export default {
626 629
         index: 0,
627 630
         id: 0,
628 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 638
       drugOptions: [],
@@ -841,7 +845,7 @@ export default {
841 845
         .catch(() => {});
842 846
     },
843 847
     submitNameForm(formName) {
844
-     
848
+       console.log("888888",this.nameForm)
845 849
       if(this.src_type == ""){
846 850
           this.nameForm.way = 0
847 851
           this.nameForm.drug_id = 0
@@ -851,40 +855,14 @@ export default {
851 855
           var arr = this.nameForm.advice_name.split("(自备药)")
852 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 859
       var _this = this;
883 860
       this.$refs[formName].validate(valid => {
884 861
         if (valid) {
885 862
           if (_this.nameForm.isEdit) {
886 863
             var submitForm = null;
887 864
             if (!this.isChild) {
865
+              console.log("进来了吗")
888 866
               submitForm = {
889 867
                 advice_type: _this.groupForm.advice_type,
890 868
                 advice_date: _this.groupForm.advice_date,
@@ -899,6 +877,9 @@ export default {
899 877
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
900 878
                 delivery_way: _this.nameForm.delivery_way,
901 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 883
                 isEdit: 0,
903 884
                 id: 0,
904 885
                 advice_doctor: "",
@@ -928,6 +909,9 @@ export default {
928 909
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
929 910
                 delivery_way: _this.nameForm.delivery_way,
930 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 915
                 isEdit: 0,
932 916
                 id: 0,
933 917
                 advice_doctor: "",
@@ -936,13 +920,14 @@ export default {
936 920
                 groupno: _this.groupForm.groupno,
937 921
                 frequency_type: 0,
938 922
                 day_count: "0",
939
-                week_days: ""
923
+                week_days: "",
924
+              
940 925
               };
941 926
             }
942 927
             let mode = "";
943 928
 
944 929
             if (_this.groupForm.advice_type == 1) {
945
-              // if(_this.nameForm.)
930
+            
946 931
               mode = "1-3";
947 932
               if (
948 933
                 _this.groupForm.doctor != _this.$store.getters.xt_user.user.id
@@ -957,7 +942,7 @@ export default {
957 942
                 mode = "3-1";
958 943
               }
959 944
             }
960
-
945
+            console.log("编辑",submitForm)
961 946
             EditNewDoctorAdvice(
962 947
               this.patientID,
963 948
               this.groupSelectRow.id,
@@ -983,31 +968,22 @@ export default {
983 968
                   ) {
984 969
                     var advice = response.data.data.advice;
985 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 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 982
                     _this.adviceTableData[index].day_count = advice.day_count;
1009 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 987
                     break;
1012 988
                   }
1013 989
                 }
@@ -1023,42 +999,21 @@ export default {
1023 999
                       var children =
1024 1000
                         _this.groupForm.adviceNames[index].children;
1025 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 1017
                           _this.$set(
1063 1018
                             _this.groupForm.adviceNames[index].children,
1064 1019
                             j,
@@ -1071,40 +1026,23 @@ export default {
1071 1026
                   }
1072 1027
                 } else {
1073 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 1046
                       console.log(_this.weeks);
1109 1047
                       _this.$set(
1110 1048
                         _this.groupForm.adviceNames,
@@ -1134,12 +1072,16 @@ export default {
1134 1072
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1135 1073
                 delivery_way: _this.nameForm.delivery_way,
1136 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 1078
                 isEdit: 0,
1138 1079
                 id: 0,
1139 1080
                 advice_doctor: "",
1140 1081
                 remark: _this.groupForm.remark,
1141 1082
                 parent_id: _this.groupSelectRow.id,
1142
-                groupno: _this.groupForm.groupno
1083
+                groupno: _this.groupForm.groupno,
1084
+               
1143 1085
               };
1144 1086
 
1145 1087
               let mode = "";
@@ -1148,7 +1090,7 @@ export default {
1148 1090
               } else {
1149 1091
                 mode = "1-1";
1150 1092
               }
1151
-
1093
+              console.log("submitFort",submitForm)
1152 1094
               CreateNewDoctorAdvice(this.patientID, submitForm, mode).then(
1153 1095
                 response => {
1154 1096
                   if (response.data.state == 0) {
@@ -1242,17 +1184,16 @@ export default {
1242 1184
                     drug_spec: "" + _this.nameForm.drug_spec,
1243 1185
                     drug_spec_unit: _this.nameForm.drug_spec_unit,
1244 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 1188
                     delivery_way: _this.nameForm.delivery_way,
1248 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 1191
                     frequency_type: _this.nameForm.frequency_type,
1253 1192
                     day_count: _this.nameForm.day_count.toString(),
1254 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 1197
                     isEdit: 0,
1257 1198
                     id: 0,
1258 1199
                     children: [],
@@ -1271,13 +1212,9 @@ export default {
1271 1212
               } else {
1272 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 1218
                 if (response.data.state == 0) {
1282 1219
                   _this.$message.error(response.data.msg);
1283 1220
                   return false;
@@ -1362,7 +1299,9 @@ export default {
1362 1299
                         frequency_type: groups[index].frequency_type,
1363 1300
                         day_count: groups[index].day_count,
1364 1301
                         week_day: groups[index].week_day,
1365
-
1302
+                        drug_name_id:0,
1303
+                        way:0,
1304
+                        drug_id:0,
1366 1305
                         isEdit: 0,
1367 1306
                         index: 0,
1368 1307
                         id: groups[index].id,
@@ -1492,7 +1431,10 @@ export default {
1492 1431
 
1493 1432
           day_count: this.groupSelectRow.day_count,
1494 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 1440
         if (!this.isChild) {
@@ -1513,6 +1455,9 @@ export default {
1513 1455
           delivery_way: "",
1514 1456
           execution_frequency: "",
1515 1457
           template_id: "",
1458
+          way:0,
1459
+          drug_id:0,
1460
+          drug_name_id:0,
1516 1461
           isEdit: 0,
1517 1462
           index: 0,
1518 1463
           id: 0,
@@ -1718,7 +1663,10 @@ export default {
1718 1663
         }
1719 1664
       }
1720 1665
     },
1666
+
1667
+
1721 1668
     newAddTempForm() {
1669
+      console.log("9999888")
1722 1670
       this.allSelectedTemplate = [];
1723 1671
       var thisRowKey = 0;
1724 1672
       for (const indexs in this.adviceTemplateMaps) {
@@ -1727,36 +1675,25 @@ export default {
1727 1675
           if (adviceTemplate.DoctorAdviceTemplate[index].selection) {
1728 1676
             thisRowKey++;
1729 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 1688
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1753 1689
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1754 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 1692
               week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
1758 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 1697
               isEdit: 0,
1761 1698
               id: 0,
1762 1699
               children: [],
@@ -1785,6 +1722,9 @@ export default {
1785 1722
                     children[key].prescribing_number_unit,
1786 1723
                   delivery_way: children[key].delivery_way,
1787 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 1728
                   isEdit: 0,
1789 1729
                   id: 0,
1790 1730
                   children: [],
@@ -1836,19 +1776,17 @@ export default {
1836 1776
           single_dose_unit: this.allSelectedTemplate[index].single_dose_unit,
1837 1777
           drug_spec: "" + this.allSelectedTemplate[index].drug_spec,
1838 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 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 1783
           day_count: this.allSelectedTemplate[index].day_count.toString(),
1848 1784
           frequency_type: this.allSelectedTemplate[index].frequency_type,
1849 1785
           week_days: this.allSelectedTemplate[index].week_days,
1850 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 1790
           isEdit: 0,
1853 1791
           id: 0,
1854 1792
           children: [],
@@ -1872,6 +1810,9 @@ export default {
1872 1810
                 prescribing_number_unit: children[key].prescribing_number_unit,
1873 1811
                 delivery_way: children[key].delivery_way,
1874 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 1816
                 isEdit: 0,
1876 1817
                 id: 0,
1877 1818
                 children: [],
@@ -1972,7 +1913,9 @@ export default {
1972 1913
               frequency_type: groups[index].frequency_type,
1973 1914
               week_day: groups[index].week_day,
1974 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 1919
               isEdit: 0,
1977 1920
               index: 0,
1978 1921
               id: groups[index].id,
@@ -2000,6 +1943,9 @@ export default {
2000 1943
                   isEdit: 0,
2001 1944
                   index: 0,
2002 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 1949
                   children: [],
2004 1950
                   parent_row: item.row_key,
2005 1951
                   row_key: this.editRowKey
@@ -2036,39 +1982,19 @@ export default {
2036 1982
               .DoctorAdviceTemplate) {
2037 1983
               _this.editRowKey++;
2038 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 1998
                 isEdit: 0,
2073 1999
                 id: 0,
2074 2000
                 children: [],
@@ -2095,10 +2021,12 @@ export default {
2095 2021
                     drug_spec: "" + children[key].drug_spec,
2096 2022
                     drug_spec_unit: children[key].drug_spec_unit,
2097 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 2025
                     delivery_way: children[key].delivery_way,
2101 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 2030
                     isEdit: 0,
2103 2031
                     id: 0,
2104 2032
                     children: [],
@@ -2323,18 +2251,13 @@ export default {
2323 2251
       }
2324 2252
     },
2325 2253
     getAdviceConfig(type) {
2254
+       console.log("type",type)
2326 2255
       getAdviceConfig(type).then(response => {
2327 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 2262
           var templateLen = this.adviceTemplates.length;
2340 2263
           for (let index = 0; index < templateLen; index++) {
@@ -2342,8 +2265,7 @@ export default {
2342 2265
               continue;
2343 2266
             }
2344 2267
 
2345
-            var DoctorAdviceTemplate = this.adviceTemplates[index]
2346
-              .DoctorAdviceTemplate;
2268
+            var DoctorAdviceTemplate = this.adviceTemplates[index].DoctorAdviceTemplate;
2347 2269
             for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
2348 2270
               DoctorAdviceTemplate[i].selection = false;
2349 2271
             }
@@ -2503,11 +2425,23 @@ export default {
2503 2425
             this.src_type = this.drugSpec[i].type
2504 2426
             this.nameForm.drug_id = this.drugSpec[i].id
2505 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 2440
       handleSelect1(){
2510 2441
         
2442
+      },
2443
+      handleSelect(){
2444
+
2511 2445
       },
2512 2446
 
2513 2447
        querySearch(queryString, cb) {

+ 16 - 22
src/xt_pages/user/doctorAdvice.vue View File

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