Browse Source

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

See999 4 years ago
parent
commit
152bfc21b0

+ 1 - 0
src/api/advice.js View File

@@ -221,6 +221,7 @@ export function postAdviceTemplate(params, name, advice_type) {
221 221
 }
222 222
 
223 223
 export function CreateGroupAdvice(id, groupno, advices, mode) {
224
+
224 225
   if (advices.remind > 0) {
225 226
     return request({
226 227
       url:

+ 15 - 6
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -755,7 +755,8 @@
755 755
           execution_frequency: '',
756 756
           advice_doctor: '',
757 757
           remark: '',
758
-          parent_id: 0
758
+          parent_id: 0,
759
+          drug_name_id:"",
759 760
         },
760 761
         nameForm: {
761 762
           advice_name: '',
@@ -808,7 +809,6 @@
808 809
         this.form['dialysis_order_id'] = this.dialysis_order.id
809 810
       },
810 811
       doctor_advices: function() {
811
-
812 812
         this.handleSpanTempArr()
813 813
         this.hoverOrderArr = []
814 814
         this.handleStyle()
@@ -980,6 +980,9 @@
980 980
               this.doctor_advices[this.currentIndex].advice_doctor =
981 981
                 advice.advice_doctor
982 982
               this.doctor_advices[this.currentIndex].remark = advice.remark
983
+              this.doctor_advice[this.currentIndex].drug_id = advice.drug_id
984
+              this.doctor_advice[this.currentIndex].drug_name_id = advice.drug_name_id
985
+              this.doctor.advice[this.currentIndex].way = advice.way
983 986
               this.currentIndex = -1
984 987
               return false
985 988
             }
@@ -1134,6 +1137,7 @@
1134 1137
 
1135 1138
             return
1136 1139
           }
1140
+
1137 1141
           this.nameForm = {
1138 1142
             advice_name: this.groupSelectRow.advice_name,
1139 1143
             single_dose: this.groupSelectRow.single_dose,
@@ -1144,9 +1148,11 @@
1144 1148
             prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
1145 1149
             delivery_way: this.groupSelectRow.delivery_way,
1146 1150
             execution_frequency: this.groupSelectRow.execution_frequency,
1151
+
1147 1152
             isEdit: 1,
1148 1153
             index: this.groupSelectRow.index
1149 1154
           }
1155
+          console.log("88888888",this.nameForm)
1150 1156
         } else {
1151 1157
           this.nameForm = {
1152 1158
             advice_name: '',
@@ -1196,9 +1202,10 @@
1196 1202
           this.form.prescribing_number =
1197 1203
             this.adviceTemplateMaps[key].prescribing_number + ''
1198 1204
           this.form.delivery_way = this.adviceTemplateMaps[key].delivery_way
1199
-          this.form.execution_frequency = this.adviceTemplateMaps[
1200
-            key
1201
-            ].execution_frequency
1205
+          this.form.execution_frequency = this.adviceTemplateMaps[key].execution_frequency
1206
+          this.form.drug_name_id = this.adviceTemplateMaps[key].drug_name_id
1207
+          this.form.drug_id = this.adviceTemplateMaps[key].drug_id
1208
+          this.form.way = this.adviceTemplateMaps[key].way
1202 1209
         }
1203 1210
       }
1204 1211
       ,
@@ -1457,6 +1464,7 @@
1457 1464
           parent_id: row.parent_id,
1458 1465
           drug_id:"",
1459 1466
           way:"",
1467
+          drug_name_id:"",
1460 1468
         }
1461 1469
       }
1462 1470
       ,
@@ -1466,7 +1474,7 @@
1466 1474
           this.$message.error('未选择要修改的医嘱内容')
1467 1475
           return
1468 1476
         }
1469
-
1477
+        console.log("22222",this.groupSelectRow.groupno)
1470 1478
         this.$refs.editGroupForm.open(this.groupSelectRow.groupno)
1471 1479
       }
1472 1480
       ,
@@ -2389,6 +2397,7 @@
2389 2397
             this.src_type = this.drugSpec[i].type
2390 2398
             this.form.drug_id = this.drugSpec[i].id
2391 2399
             this.form.way = this.drugSpec[i].type
2400
+            this.form.drug_name_id = this.drugSpec[i].drug_name_id
2392 2401
           }
2393 2402
         }
2394 2403
       },

+ 31 - 3
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue View File

@@ -615,6 +615,7 @@ export default {
615 615
         children: [],
616 616
         drug_id:"",
617 617
         way:"",
618
+        drug_name_id:"",
618 619
       },
619 620
       submitGroupForm: {
620 621
         advice_type: "",
@@ -635,6 +636,7 @@ export default {
635 636
         parent_id: 0,
636 637
         drug_id:"",
637 638
         way:"",
639
+        drug_name_id:"",
638 640
       },
639 641
       selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
640 642
       selectedTemplate: [],
@@ -645,6 +647,7 @@ export default {
645 647
       current_drug_name:"",
646 648
       current_drug_spec: "",
647 649
       drug_id: 0,
650
+      drug_name_id:"",
648 651
       src_type:"",
649 652
       private_drug_config:{},
650 653
     };
@@ -719,16 +722,20 @@ export default {
719 722
           
720 723
           console.log("88888888",submitForm)
721 724
           console.log("99999",this.medicals)
725
+          
722 726
           if(this.private_drug_config.drug_start == 1){
723 727
            
724 728
              for(let index=0;index<submitForm.adviceNames.length;index++){
725 729
                 for(let i=0;i<this.medicals.length;i++){
726 730
                    if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
727 731
                       submitForm.adviceNames[index].way = 2
732
+                      submitForm.adviceNames[index].drug_name_id = this.medicals[i].drug_name_id
728 733
                    }
729 734
                 }
730 735
              }
731 736
           }
737
+          console.log("2222",submitForm)
738
+         
732 739
           CreateGroupAdvice(this.patientID, 0, submitForm, mode).then(
733 740
             response => {
734 741
               if (response.data.state == 0) {
@@ -854,6 +861,7 @@ export default {
854 861
        if(this.src_type == ""){
855 862
           this.nameForm.way = 0
856 863
           this.nameForm.drug_id = 0
864
+          this.nameForm.drug_name_id = 0
857 865
        }
858 866
 
859 867
        if(this.src_type == 2){ //自备药
@@ -888,6 +896,7 @@ export default {
888 896
                       _this.groupForm.adviceNames[index].children[j].remark =_this.nameForm.remark;
889 897
                       _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
890 898
                       _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
899
+                      _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id;
891 900
                       _this.$set(_this.groupForm.adviceNames[index].children,j,_this.groupForm.adviceNames[index].children[j]
892 901
                      
893 902
                       );
@@ -912,6 +921,7 @@ export default {
912 921
                   _this.groupForm.adviceNames[index].remark =_this.nameForm.remark;
913 922
                   _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
914 923
                   _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
924
+                  _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id;
915 925
                   _this.$set(
916 926
                     _this.groupForm.adviceNames,
917 927
                     index,
@@ -1018,7 +1028,10 @@ export default {
1018 1028
           id: this.groupSelectRow.id,
1019 1029
           children: [],
1020 1030
           parent_row: this.groupSelectRow.parent_row,
1021
-          remark: this.groupSelectRow.remark
1031
+          remark: this.groupSelectRow.remark,
1032
+          drug_name_id:this.groupSelectRow.drug_name_id,
1033
+          drug_id:this.groupSelectRow.drug_id,
1034
+          way:this.groupSelectRow.way
1022 1035
           // row_key:this.groupSelectRow.row_key,
1023 1036
         };
1024 1037
         this.nameFormTitle = "修改医嘱内容";
@@ -1151,8 +1164,7 @@ export default {
1151 1164
       if (this.selectedTemp.id in this.adviceTemplateMaps) {
1152 1165
         var mapid = this.selectedTemp.id;
1153 1166
         var thisRowKey = 0;
1154
-        for (const index in this.adviceTemplateMaps[mapid]
1155
-          .DoctorAdviceTemplate) {
1167
+        for (const index in this.adviceTemplateMaps[mapid].DoctorAdviceTemplate) {
1156 1168
           thisRowKey++;
1157 1169
           var item = {
1158 1170
             advice_name: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].advice_name,
@@ -1169,6 +1181,7 @@ export default {
1169 1181
             advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].id,
1170 1182
             drug_id:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_id,
1171 1183
             way:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].way,
1184
+            drug_name_id:this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_name_id,
1172 1185
             isEdit: 0,
1173 1186
             id: 0,
1174 1187
             children: [],
@@ -1201,6 +1214,7 @@ export default {
1201 1214
                 execution_frequency: children[key].execution_frequency,
1202 1215
                 drug_id:children[key].drug_id,
1203 1216
                 way:children[key].way,
1217
+                drug_name_id:children[key].drug_name_id,
1204 1218
                 isEdit: 0,
1205 1219
                 id: 0,
1206 1220
                 children: [],
@@ -1240,6 +1254,7 @@ export default {
1240 1254
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1241 1255
               drug_id: adviceTemplate.DoctorAdviceTemplate[index].drug_id,
1242 1256
               way:adviceTemplate.DoctorAdviceTemplate[index].way,
1257
+              drug_name_id:adviceTemplate.DoctorAdviceTemplate[index].drug_name_id,
1243 1258
               isEdit: 0,
1244 1259
               id: 0,
1245 1260
               children: [],
@@ -1270,6 +1285,7 @@ export default {
1270 1285
                   execution_frequency: children[key].execution_frequency,
1271 1286
                   drug_id:children[key].drug_id,
1272 1287
                   way:children[key].way,
1288
+                  drug_name_id:children[key].drug_name_id,
1273 1289
                   isEdit: 0,
1274 1290
                   id: 0,
1275 1291
                   children: [],
@@ -1318,6 +1334,7 @@ export default {
1318 1334
           execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1319 1335
           drug_id:this.allSelectedTemplate[index].drug_id,
1320 1336
           way:this.allSelectedTemplate[index].way,
1337
+          drug_name_id:this.allSelectedTemplate[index].drug_name_id,
1321 1338
           isEdit: 0,
1322 1339
           id: 0,
1323 1340
           children: [],
@@ -1344,6 +1361,7 @@ export default {
1344 1361
                 execution_frequency: children[key].execution_frequency,
1345 1362
                 drug_id:children[key].drug_id,
1346 1363
                 way:children[key].way,
1364
+                drug_name_id:children[key].drug_name_id,
1347 1365
                 isEdit: 0,
1348 1366
                 id: 0,
1349 1367
                 children: [],
@@ -1579,10 +1597,12 @@ export default {
1579 1597
                 obj.custom_id = this.rand(10000000, 99999999)
1580 1598
                 obj.drug_specs = base_drug_list[i].drug_specs
1581 1599
                 this.all_drug.push(obj)
1600
+
1582 1601
               }
1583 1602
               this.private_drug_config = response.data.data.private_drug_config
1584 1603
               this.medicals = medicalList
1585 1604
             }   
1605
+            console.log("-======",this.all_drug)
1586 1606
         })
1587 1607
        
1588 1608
     },
@@ -1597,6 +1617,7 @@ export default {
1597 1617
        }
1598 1618
     },
1599 1619
     changeDrugDesc(name) {
1620
+      console.log("-----",this.drugSpec)
1600 1621
         this.current_drug_spec = name
1601 1622
         for (let i = 0; i < this.drugSpec.length; i++) {
1602 1623
           if (this.drugSpec[i].drug_spec == name) {
@@ -1609,6 +1630,13 @@ export default {
1609 1630
             this.src_type = this.drugSpec[i].type
1610 1631
             this.nameForm.drug_id = this.drugSpec[i].id
1611 1632
             this.nameForm.way = this.drugSpec[i].type
1633
+            this.drug_name_id = this.drugSpec[i].drug_name_id
1634
+            if(this.drugSpec[i].drug_name_id){
1635
+               this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
1636
+            }else{
1637
+              this.nameForm.drug_name_id = 0
1638
+            }
1639
+           
1612 1640
           }
1613 1641
         }
1614 1642
       }

+ 122 - 64
src/xt_pages/dialysis/details/dialog/adviceDialog/EditGroupAdvice.vue View File

@@ -596,7 +596,10 @@ export default {
596 596
         isEdit: 0,
597 597
         index: 0,
598 598
         id: 0,
599
-        children: []
599
+        children: [],
600
+        drug_id:"",
601
+        way:"",
602
+        drug_name_id:"",
600 603
       },
601 604
       submitGroupForm: {
602 605
         advice_type: "",
@@ -605,7 +608,10 @@ export default {
605 608
         adviceNames: [],
606 609
         advice_doctor: "",
607 610
         remark: "",
608
-        parent_id: 0
611
+        parent_id: 0,
612
+        drug_name_id:"",
613
+        drug_id:"",
614
+        way:""
609 615
       },
610 616
       groupForm: {
611 617
         advice_type: "",
@@ -614,7 +620,10 @@ export default {
614 620
         adviceNames: [],
615 621
         advice_doctor: "",
616 622
         remark: "",
617
-        parent_id: 0
623
+        parent_id: 0,
624
+        way:"",
625
+        drug_id:"",
626
+        drug_name_id:"",
618 627
       },
619 628
       adminusername: "",
620 629
       selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
@@ -626,7 +635,8 @@ export default {
626 635
       current_drug_name:"",
627 636
       current_drug_spec: "",
628 637
       drug_id: 0,
629
-      src_type:""
638
+      src_type:"",
639
+      drug_name_id:0,
630 640
     };
631 641
   },
632 642
   props: {
@@ -835,33 +845,18 @@ export default {
835 845
         .catch(() => {});
836 846
     },
837 847
     submitNameForm(formName) {
838
-       if(typeof(this.nameForm.advice_name) == "string"){
839
-         
840
-          this.nameForm.advice_name == this.nameForm.advice_name
841
-      }
842 848
 
843
-      if(typeof(this.nameForm.advice_name) == "number"){
844
-          var drug_name = ""
845
-          var name = ""
846
-          var way = 0
847
-          this.nameForm.drug_id = this.nameForm.advice_name
848
-          for(let i=0;i<this.medicals.length;i++){
849
-            if(this.nameForm.advice_name == this.medicals[i].id){
850
-              name = this.medicals[i].drug_name
851
-              way  = this.medicals[i].way
852
-            }
853
-          }
854
-          if(way == 1){
855
-            drug_name = name
856
-          }
857
-          if(way == 2){
858
-            var arr = name.split("(自备药)")
859
-            drug_name = arr[0]
860
-          }
861
-          
862
-          this.nameForm.advice_name = drug_name
863
-          this.nameForm.way = way
864
-      }
849
+        if(this.src_type == ""){
850
+          this.nameForm.way = 0
851
+          this.nameForm.drug_id = 0
852
+          this.nameForm.drug_name_id = 0
853
+       }
854
+
855
+       if(this.src_type == 2){ //自备药
856
+          var arr = this.nameForm.advice_name.split("(自备药)")
857
+          this.nameForm.advice_name = arr[0]
858
+       }
859
+   
865 860
       var _this = this;
866 861
       this.$refs[formName].validate(valid => {
867 862
         if (valid) {
@@ -886,7 +881,11 @@ export default {
886 881
               advice_doctor: "",
887 882
               remark: _this.groupForm.remark,
888 883
               parent_id: _this.groupSelectRow.parent_id,
889
-              groupno: _this.groupForm.groupno
884
+              groupno: _this.groupForm.groupno,
885
+              drug_name_id:_this.groupForm.drug_name_id,
886
+              drug_id:_this.groupForm.drug_id,
887
+              way:_this.groupForm.way,
888
+              
890 889
             };
891 890
             let mode = "2";
892 891
             if (
@@ -895,7 +894,8 @@ export default {
895 894
             ) {
896 895
               mode = "3";
897 896
             }
898
-
897
+            console.log("22222",submitForm)
898
+          
899 899
             EditDoctorAdvice(
900 900
               this.patientID,
901 901
               this.groupSelectRow.id,
@@ -920,6 +920,7 @@ export default {
920 920
                     _this.groupSelectRow.id == _this.adviceTableData[index].id
921 921
                   ) {
922 922
                     var advice = response.data.data.advice;
923
+
923 924
                     _this.adviceTableData[index].drug_spec = advice.drug_spec;
924 925
                     _this.adviceTableData[index].drug_spec_unit =
925 926
                       advice.drug_spec_unit;
@@ -938,8 +939,10 @@ export default {
938 939
                       advice.execution_frequency;
939 940
                     _this.adviceTableData[index].prescribing_number =
940 941
                       advice.prescribing_number;
941
-                    _this.adviceTableData[index].prescribing_number_unit =
942
-                      advice.prescribing_number_unit;
942
+                    _this.adviceTableData[index].prescribing_number_unit =advice.prescribing_number_unit;
943
+                    _this.adviceTableData[index].drug_name_id = advice.drug_name_id;
944
+                    _this.adviceTableData[index].drug_id = advice.drug_id,
945
+                    _this.adviceTableData[index].way = advice.way
943 946
                     break;
944 947
                   }
945 948
                 }
@@ -984,13 +987,11 @@ export default {
984 987
                             j
985 988
                           ].prescribing_number_unit =
986 989
                             _this.nameForm.prescribing_number_unit;
987
-                          _this.groupForm.adviceNames[index].children[
988
-                            j
989
-                          ].delivery_way = _this.nameForm.delivery_way;
990
-                          _this.groupForm.adviceNames[index].children[
991
-                            j
992
-                          ].execution_frequency =
993
-                            _this.nameForm.execution_frequency;
990
+                          _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
991
+                          _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
992
+                         _this.groupForm.adviceNames[index].children[j].drug_id =_this.nameForm.drug_id;
993
+                         _this.groupForm.adviceNames[index].children[j].drug_name_id =_this.nameForm.drug_name_id;
994
+                         _this.groupForm.adviceNames[index].children[j].way =_this.nameForm.way;
994 995
                           _this.$set(
995 996
                             _this.groupForm.adviceNames[index].children,
996 997
                             j,
@@ -1027,9 +1028,10 @@ export default {
1027 1028
                         _this.nameForm.prescribing_number_unit;
1028 1029
                       _this.groupForm.adviceNames[index].delivery_way =
1029 1030
                         _this.nameForm.delivery_way;
1030
-                      _this.groupForm.adviceNames[index].execution_frequency =
1031
-                        _this.nameForm.execution_frequency;
1032
-
1031
+                      _this.groupForm.adviceNames[index].execution_frequency =_this.nameForm.execution_frequency;
1032
+                      _this.groupForm.adviceNames[index].drug_name_id =_this.nameForm.drug_name_id;
1033
+                       _this.groupForm.adviceNames[index].drug_id =_this.nameForm.drug_id;
1034
+                        _this.groupForm.adviceNames[index].way =_this.nameForm.way;
1033 1035
                       _this.$set(
1034 1036
                         _this.groupForm.adviceNames,
1035 1037
                         index,
@@ -1057,6 +1059,9 @@ export default {
1057 1059
                 prescribing_number_unit: _this.nameForm.prescribing_number_unit,
1058 1060
                 delivery_way: _this.nameForm.delivery_way,
1059 1061
                 execution_frequency: _this.nameForm.execution_frequency,
1062
+                drug_name_id:_this.nameForm.drug_name_id,
1063
+                drug_id:_this.nameForm.drug_id,
1064
+                way:_this.nameForm.way,
1060 1065
                 isEdit: 0,
1061 1066
                 id: 0,
1062 1067
                 advice_doctor: "",
@@ -1153,6 +1158,9 @@ export default {
1153 1158
                       _this.nameForm.prescribing_number_unit,
1154 1159
                     delivery_way: _this.nameForm.delivery_way,
1155 1160
                     execution_frequency: _this.nameForm.execution_frequency,
1161
+                    drug_name_id:_this.nameForm.drug_name_id,
1162
+                    drug_id:_this.nameForm.drug_id,
1163
+                    way:_this.nameForm.way,
1156 1164
                     isEdit: 0,
1157 1165
                     id: 0,
1158 1166
                     children: [],
@@ -1245,6 +1253,9 @@ export default {
1245 1253
                         groups[index].prescribing_number_unit,
1246 1254
                       delivery_way: groups[index].delivery_way,
1247 1255
                       execution_frequency: groups[index].execution_frequency,
1256
+                      drug_name_id:groups[index].drug_name_id,
1257
+                      drug_id:groups[index].drug_id,
1258
+                      way:groups[index].way,
1248 1259
                       isEdit: 0,
1249 1260
                       index: 0,
1250 1261
                       id: groups[index].id,
@@ -1268,8 +1279,10 @@ export default {
1268 1279
                           prescribing_number_unit:
1269 1280
                             childMap[item.id][key].prescribing_number_unit,
1270 1281
                           delivery_way: childMap[item.id][key].delivery_way,
1271
-                          execution_frequency:
1272
-                            childMap[item.id][key].execution_frequency,
1282
+                          execution_frequency:childMap[item.id][key].execution_frequency,
1283
+                           drug_name_id:childMap[item.id][key].drug_name_id,
1284
+                           drug_id:childMap[item.id][key].drug_id,
1285
+                           way:childMap[item.id][key].way,
1273 1286
                           isEdit: 0,
1274 1287
                           index: 0,
1275 1288
                           id: childMap[item.id][key].id,
@@ -1322,7 +1335,10 @@ export default {
1322 1335
         index: 0,
1323 1336
         children: [],
1324 1337
         parent_row: this.groupSelectRow.row_key,
1325
-        id: 0
1338
+        id: 0,
1339
+        drug_name_id:"",
1340
+        way:"",
1341
+        drug_id:"",
1326 1342
       };
1327 1343
       this.isChild = true;
1328 1344
       this.nameFormVisible = true;
@@ -1358,14 +1374,15 @@ export default {
1358 1374
               : "",
1359 1375
           prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
1360 1376
           delivery_way: this.isChild ? "" : this.groupSelectRow.delivery_way,
1361
-          execution_frequency: this.isChild
1362
-            ? ""
1363
-            : this.groupSelectRow.execution_frequency,
1377
+          execution_frequency: this.isChild? "": this.groupSelectRow.execution_frequency,
1378
+          drug_name_id:this.isChild?"":this.groupSelectRow.drug_name_id,
1379
+          drug_id:this.isChild?"":this.groupSelectRow.drug_id,
1380
+          way:this.isChild?"":this.groupSelectRow.way,
1364 1381
           isEdit: 1,
1365 1382
           index: this.groupSelectRow.index,
1366 1383
           id: this.groupSelectRow.id,
1367 1384
           children: [],
1368
-          parent_row: this.groupSelectRow.parent_row
1385
+          parent_row: this.groupSelectRow.parent_row,
1369 1386
           // row_key:this.groupSelectRow.row_key,
1370 1387
         };
1371 1388
         this.nameFormTitle = "修改医嘱内容";
@@ -1382,6 +1399,9 @@ export default {
1382 1399
           prescribing_number_unit: "",
1383 1400
           delivery_way: "",
1384 1401
           execution_frequency: "",
1402
+          drug_name_id:"",
1403
+          drug_id:"",
1404
+          way:"",
1385 1405
           isEdit: 0,
1386 1406
           index: 0,
1387 1407
           id: 0,
@@ -1549,8 +1569,10 @@ export default {
1549 1569
             delivery_way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1550 1570
               index
1551 1571
             ].delivery_way,
1552
-            execution_frequency: this.adviceTemplateMaps[mapid]
1553
-              .DoctorAdviceTemplate[index].execution_frequency,
1572
+            execution_frequency: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
1573
+            drug_name_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_name_id,
1574
+             way: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].way,
1575
+             drug_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_id,
1554 1576
             advice_id: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[
1555 1577
               index
1556 1578
             ].id,
@@ -1587,6 +1609,9 @@ export default {
1587 1609
                 prescribing_number_unit: children[key].prescribing_number_unit,
1588 1610
                 delivery_way: children[key].delivery_way,
1589 1611
                 execution_frequency: children[key].execution_frequency,
1612
+                drug_name_id:children[key].drug_name_id,
1613
+                drug_id:children[key].drug_id,
1614
+                way:children[key].way,
1590 1615
                 isEdit: 0,
1591 1616
                 id: 0,
1592 1617
                 children: [],
@@ -1632,8 +1657,10 @@ export default {
1632 1657
                   .prescribing_number_unit,
1633 1658
               delivery_way:
1634 1659
                 adviceTemplate.DoctorAdviceTemplate[index].delivery_way,
1635
-              execution_frequency:
1636
-                adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1660
+              execution_frequency:adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1661
+              drug_name_id:adviceTemplate.DoctorAdviceTemplate[index].drug_name_id,
1662
+              drug_id:adviceTemplate.DoctorAdviceTemplate[index].drug_id,
1663
+              way:adviceTemplate.DoctorAdviceTemplate[index].way,
1637 1664
               advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1638 1665
               selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1639 1666
               isEdit: 0,
@@ -1664,6 +1691,9 @@ export default {
1664 1691
                     children[key].prescribing_number_unit,
1665 1692
                   delivery_way: children[key].delivery_way,
1666 1693
                   execution_frequency: children[key].execution_frequency,
1694
+                   drug_name_id: children[key].drug_name_id,
1695
+                   drug_id:children[key].drug_id,
1696
+                   way:children[key].way,
1667 1697
                   isEdit: 0,
1668 1698
                   id: 0,
1669 1699
                   children: [],
@@ -1720,8 +1750,10 @@ export default {
1720 1750
           prescribing_number_unit: this.allSelectedTemplate[index]
1721 1751
             .prescribing_number_unit,
1722 1752
           delivery_way: this.allSelectedTemplate[index].delivery_way,
1723
-          execution_frequency: this.allSelectedTemplate[index]
1724
-            .execution_frequency,
1753
+          execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1754
+           drug_name_id: this.allSelectedTemplate[index].drug_name_id,
1755
+           way:this.allSelectedTemplate[index].way,
1756
+           drug_id:this.allSelectedTemplate[index].drug_id,
1725 1757
           isEdit: 0,
1726 1758
           id: 0,
1727 1759
           children: [],
@@ -1745,6 +1777,9 @@ export default {
1745 1777
                 prescribing_number_unit: children[key].prescribing_number_unit,
1746 1778
                 delivery_way: children[key].delivery_way,
1747 1779
                 execution_frequency: children[key].execution_frequency,
1780
+                drug_name_id: children[key].drug_name_id,
1781
+                drug_id:children[key].drug_id,
1782
+                way:children[key].way,
1748 1783
                 isEdit: 0,
1749 1784
                 id: 0,
1750 1785
                 children: [],
@@ -1832,6 +1867,9 @@ export default {
1832 1867
               prescribing_number_unit: groups[index].prescribing_number_unit,
1833 1868
               delivery_way: groups[index].delivery_way,
1834 1869
               execution_frequency: groups[index].execution_frequency,
1870
+              drug_name_id: groups[index].drug_name_id,
1871
+              drug_id:groups[index].drug_id,
1872
+              way:groups[index].way,
1835 1873
               isEdit: 0,
1836 1874
               index: 0,
1837 1875
               id: groups[index].id,
@@ -1854,8 +1892,10 @@ export default {
1854 1892
                   prescribing_number_unit:
1855 1893
                     childMap[item.id][key].prescribing_number_unit,
1856 1894
                   delivery_way: childMap[item.id][key].delivery_way,
1857
-                  execution_frequency:
1858
-                    childMap[item.id][key].execution_frequency,
1895
+                  execution_frequency:childMap[item.id][key].execution_frequency,
1896
+                   way:childMap[item.id][key].way,
1897
+                   drug_name_id:childMap[item.id][key].drug_name_id,
1898
+                   drug_id:childMap[item.id][key].drug_id,
1859 1899
                   isEdit: 0,
1860 1900
                   index: 0,
1861 1901
                   id: childMap[item.id][key].id,
@@ -1923,9 +1963,10 @@ export default {
1923 1963
                 delivery_way:
1924 1964
                   _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
1925 1965
                     .delivery_way,
1926
-                execution_frequency:
1927
-                  _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index]
1928
-                    .execution_frequency,
1966
+                execution_frequency:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].execution_frequency,
1967
+                 drug_name_id: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_name_id,
1968
+                  drug_id: _this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].drug_id,
1969
+                  way:_this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].way,
1929 1970
                 isEdit: 0,
1930 1971
                 id: 0,
1931 1972
                 children: [],
@@ -1956,6 +1997,9 @@ export default {
1956 1997
                       children[key].prescribing_number_unit,
1957 1998
                     delivery_way: children[key].delivery_way,
1958 1999
                     execution_frequency: children[key].execution_frequency,
2000
+                    drug_name_id: children[key].drug_name_id,
2001
+                    drug_id: children[key].drug_id,
2002
+                    way:children[key].way,
1959 2003
                     isEdit: 0,
1960 2004
                     id: 0,
1961 2005
                     children: [],
@@ -2049,6 +2093,9 @@ export default {
2049 2093
                       groups[index].prescribing_number_unit,
2050 2094
                     delivery_way: groups[index].delivery_way,
2051 2095
                     execution_frequency: groups[index].execution_frequency,
2096
+                    drug_name_id:groups[index].drug_name_id,
2097
+                    drug_id:groups[index].drug_id,
2098
+                    way:groups[index].way,
2052 2099
                     isEdit: 0,
2053 2100
                     index: 0,
2054 2101
                     id: groups[index].id,
@@ -2072,8 +2119,10 @@ export default {
2072 2119
                         prescribing_number_unit:
2073 2120
                           childMap[item.id][key].prescribing_number_unit,
2074 2121
                         delivery_way: childMap[item.id][key].delivery_way,
2075
-                        execution_frequency:
2076
-                          childMap[item.id][key].execution_frequency,
2122
+                        execution_frequency:childMap[item.id][key].execution_frequency,
2123
+                         drug_name_id:childMap[item.id][key].drug_name_id,
2124
+                         drug_id:childMap[item.id][key].drug_id,
2125
+                         way:childMap[item.id][key].way,
2077 2126
                         isEdit: 0,
2078 2127
                         index: 0,
2079 2128
                         id: childMap[item.id][key].id,
@@ -2107,6 +2156,7 @@ export default {
2107 2156
       this.templateFormVisible = true;
2108 2157
     },
2109 2158
     selectGroupAdvice(row) {
2159
+      console.log('row',row)
2110 2160
       this.groupSelectRow = row;
2111 2161
     },
2112 2162
     groupClassName({ row, rowIndex }) {
@@ -2176,6 +2226,9 @@ export default {
2176 2226
           prescribing_number_unit: groups[index].prescribing_number_unit,
2177 2227
           delivery_way: groups[index].delivery_way,
2178 2228
           execution_frequency: groups[index].execution_frequency,
2229
+          drug_name_id:groups[index].drug_name_id,
2230
+          drug_id:groups[index].drug_id,
2231
+          way:groups[index].way,
2179 2232
           isEdit: 0,
2180 2233
           index: 0,
2181 2234
           id: groups[index].id,
@@ -2200,6 +2253,9 @@ export default {
2200 2253
                 childMap[item.id][key].prescribing_number_unit,
2201 2254
               delivery_way: childMap[item.id][key].delivery_way,
2202 2255
               execution_frequency: childMap[item.id][key].execution_frequency,
2256
+               drug_name_id: childMap[item.id][key].drug_name_id,
2257
+               drug_id: childMap[item.id][key].drug_id,
2258
+               way: childMap[item.id][key].way,
2203 2259
               isEdit: 0,
2204 2260
               index: 0,
2205 2261
               id: childMap[item.id][key].id,
@@ -2340,6 +2396,8 @@ export default {
2340 2396
             this.src_type = this.drugSpec[i].type
2341 2397
             this.nameForm.drug_id = this.drugSpec[i].id
2342 2398
             this.nameForm.way = this.drugSpec[i].type
2399
+            this.drug_name_id = this.drugSpec[i].drug_name_id
2400
+            this.nameForm.drug_name_id = this.drugSpec[i].drug_name_id
2343 2401
           }
2344 2402
         }
2345 2403
     },

+ 2 - 0
src/xt_pages/stock/selfPreparedMedicine/components/addMedicine.vue View File

@@ -111,6 +111,8 @@ export default {
111 111
              patient_id:this.patient_id,
112 112
              medicineData:this.medicineData
113 113
           }
114
+         console.log("params----",params)
115
+       
114 116
          SaveSelfMedicines(params).then(response=>{
115 117
              if(response.data.state == 1){
116 118
                 var msg = response.data.data.msg

+ 63 - 6
src/xt_pages/stock/selfPreparedMedicine/index.vue View File

@@ -34,8 +34,23 @@
34 34
                     :value="item.value">
35 35
                     </el-option>
36 36
                 </el-select> -->
37
-                <el-input style="width: 180px;margin:0 10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
38
-                <el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
37
+                <!-- <el-input style="width: 180px;margin:0 10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/> -->
38
+                <!-- <el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button> -->
39
+                 <el-autocomplete
40
+                  style="margin:16px 5px"
41
+                  popper-class="my-autocomplete"
42
+                  v-model.trim="search_input"
43
+                  :fetch-suggestions="querySearchAsync"
44
+                  :trigger-on-focus="false"
45
+                  placeholder="病人名字或者透析号"
46
+                  @select="handleSelect"
47
+                >
48
+                  <i class="el-icon-search el-input__icon" slot="suffix"> </i>
49
+                  <template slot-scope="{ item }">
50
+                    <div class="name">{{ item.name }}</div>
51
+                  </template>
52
+                </el-autocomplete>
53
+
39 54
             </div>
40 55
             <el-container>
41 56
                 <div style="width:160px;">
@@ -75,10 +90,10 @@
75 90
                             </template>
76 91
                         </el-table-column>
77 92
                         <el-table-column align="center" prop="name" label="已使用" width="90">
78
-                            <template slot-scope="scope">{{getCount(scope.row.patient_id,scope.row.drug_name,scope.row.drug_spec)}}</template>
93
+                            <template slot-scope="scope">{{getCountTwo(scope.row.patient_id,scope.row.drug_name,scope.row.drug_spec)}}</template>
79 94
                         </el-table-column>
80 95
                         <el-table-column align="center" prop="name" label="剩余" width="90">
81
-                            <template slot-scope="scope">{{getTotal(scope.row.patient_id,scope.row.id)- getCount(scope.row.patient_id,scope.row.drug_name,scope.row.drug_spec)}}</template>
96
+                            <template slot-scope="scope">{{getTotal(scope.row.patient_id,scope.row.id)- getCountTwo(scope.row.patient_id,scope.row.drug_name,scope.row.drug_spec)}}</template>
82 97
                         </el-table-column>
83 98
                         <!-- <el-table-column align="center" prop="name" label="停用" width="90">
84 99
                             <template slot-scope="scope">
@@ -170,7 +185,8 @@ export default {
170 185
             search_input:"",
171 186
             patient_id:0,
172 187
             stockList:[],
173
-            outStocklist:[]
188
+            outStocklist:[],
189
+            outList:[]
174 190
         }
175 191
     },
176 192
     methods:{
@@ -241,6 +257,7 @@ export default {
241 257
                start_time:this.start_time,
242 258
                keyword:this.search_input,
243 259
             }
260
+         
244 261
           getStockList(params).then(response=>{
245 262
              if(response.data.state == 1){
246 263
                 var medicalList = response.data.data.medicalList
@@ -252,7 +269,9 @@ export default {
252 269
                 this.stockList = stocklist
253 270
                 var outstocklist = response.data.data.outStocklist
254 271
                 this.outStocklist = outstocklist
255
-                console.log("outStockList",outstocklist)
272
+                var outList =  response.data.data.outList
273
+                console.log("outList",outList)
274
+                this.outList = outList
256 275
               
257 276
               }
258 277
           })  
@@ -295,6 +314,16 @@ export default {
295 314
            return total
296 315
         },
297 316
 
317
+        getCountTwo(patientid,drugname,drugspec){
318
+           var total = 0
319
+           for(let i=0;i<this.outList.length;i++){
320
+             if(patientid == this.outList[i].patient_id && drugname == this.outList[i].drug_name && drugspec == this.outList[i].drug_spec){
321
+                  total += this.outList[i].outstore_number
322
+              }
323
+           }
324
+           return total
325
+        },
326
+
298 327
         getDrugSet(){
299 328
          getDrugSet().then(response=>{
300 329
             if(response.data.state == 1){
@@ -321,6 +350,33 @@ export default {
321 350
              }
322 351
           }
323 352
           return remarks
353
+        },
354
+
355
+        querySearchAsync(keyword, cb) {
356
+          let key = ''
357
+          if (keyword != undefined) {
358
+            key = keyword
359
+          }
360
+          let searchArray = []
361
+          getCurrentPatient(key).then(response => {
362
+            if (response.data.state == 1) {
363
+              searchArray = response.data.data.patient
364
+              cb(searchArray)
365
+            }
366
+          })
367
+          return searchArray
368
+        },
369
+        handleSelect(val){
370
+          console.log("val",val.id)
371
+          console.log("2222",this.tablePatient)
372
+          this.search_input = val.name
373
+          for(let i=0;i<this.tablePatient.length;i++){
374
+             if(this.tablePatient[i].id == val.id){
375
+               console.log("建立")
376
+               this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[i])
377
+             }
378
+          }
379
+          this.getlist()
324 380
         }
325 381
     },
326 382
     created(){
@@ -331,6 +387,7 @@ export default {
331 387
     watch: {
332 388
      tablePatient: function() {
333 389
       this.$nextTick(function() {
390
+         console.log("222222",this.tablePatient[0])
334 391
         this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[0])
335 392
       })
336 393
     }

+ 8 - 10
src/xt_pages/stock/selfPreparedMedicine/info.vue View File

@@ -497,14 +497,6 @@ export default {
497 497
               }
498 498
            }
499 499
            
500
-          console.log("------",this.form.unit)
501
-          //  var unit = ""
502
-          //  for(let i=0;i<this.untis.length;i++){
503
-          //    if(this.form.unit == this.untis[i].id){
504
-          //       unit = this.untis[i].name
505
-          //    }
506
-          //  }
507
-          
508 500
            const params = {
509 501
              drug_spec:drug_spec,
510 502
              drug_name_id:this.form.drug_name_id,
@@ -524,7 +516,10 @@ export default {
524 516
               this.ruleDialogVisible = false
525 517
               this.form.drug_name_id = ""
526 518
               this.form.unit = ""
527
-              this.form.price = ""            
519
+              this.form.price = ""   
520
+              this.form.drug_stock_limit = ""         
521
+            }else{
522
+              this.$message.error("该药品规格名称已存在!")
528 523
             }
529 524
          })  
530 525
        },
@@ -565,7 +560,10 @@ export default {
565 560
               this.$message.success("保存成功")
566 561
               this.form.drug_name_id = ""
567 562
               this.form.unit = ""
568
-              this.form.price = ""   
563
+              this.form.price = ""  
564
+              this.form.drug_stock_limit = ""     
565
+            }else{
566
+              this.$message.error("该药品规格名称已存在!")
569 567
             }
570 568
          })    
571 569
        },

+ 2 - 0
src/xt_pages/stock/selfPreparedMedicine/query.vue View File

@@ -257,6 +257,8 @@ export default {
257 257
                  stocklist[i].Count = 0
258 258
               }
259 259
               var outStockList =  response.data.data.outStockList
260
+
261
+              
260 262
               for(let i=0;i<stocklist.length;i++){
261 263
                 for(let j=0;j<outStockList.length;j++){
262 264
                    if(stocklist[i].patient_id == outStockList[j].patient_id &&stocklist[i].drug_name == outStockList[j].drug_name && stocklist[i].drug_spec == outStockList[j].drug_spec){