Browse Source

长期医嘱提醒

csx 5 years ago
parent
commit
c3e5dfa75b

+ 163 - 72
src/pages/main/dialog/PrescriptionDialog.vue View File

@@ -5,7 +5,9 @@
5 5
       <div class="DialogTit">
6 6
         <span @click="close()" class="iconfont">&#xe6e9;</span>
7 7
         <h1 class="name">透析处方</h1>
8
-        <span @click="commitInfo" class="success">完成</span>
8
+        <span @click="commitInfo" class="success" v-if="isPermission()">完成</span>
9
+        <span @click="commitInfo" class="success" v-if="!isPermission()"></span>
10
+
9 11
       </div>
10 12
 
11 13
       <div class="DialogContent" id="dialogTop">
@@ -287,8 +289,8 @@
287 289
         <!--</div>-->
288 290
         <div class="PrescSubmit">
289 291
           <button style="display: none" class="tj" @click="sign()">医生签名</button>
290
-          <button class="tjcq" @click="commitSolutionInfo">保存并设为长期处方</button>
291
-          <button class="tj" @click="commitInfo">保存</button>
292
+          <button class="tjcq" @click="commitSolutionInfo" v-if="isPermission()">保存并设为长期处方</button>
293
+          <button class="tj" @click="commitInfo" v-if="isPermission()">保存</button>
292 294
         </div>
293 295
       </div>
294 296
     </div>
@@ -508,6 +510,13 @@
508 510
     },
509 511
 
510 512
     methods: {
513
+      isPermission(){
514
+        if(this.$store.getters.user.user.user_type == 3 && (this.$store.getters.user.template_info.template_id == 2 || this.$store.getters.user.template_info.template_id == 6)){
515
+          return false
516
+        }else{
517
+          return true
518
+        }
519
+      },
511 520
       isShow (name) {
512 521
         var filedList = this.$store.getters.user.fileds
513 522
 
@@ -883,12 +892,30 @@
883 892
         return anticoagulan_name
884 893
       },
885 894
       commitInfo: function () {
886
-        this.is_pre = 1
887 895
 
888 896
 
897
+        this.is_pre = 1
889 898
         if (this.prescription_prop.id == '') {
890 899
           console.log(this.is_open)
891
-          if (this.is_open == 1) {
900
+          if (this.is_open == 0){
901
+            Toast.loading({forbidClick: true, duration: 0})
902
+            let ParamsQuery = this.dialysisPrescription
903
+            ParamsQuery['patient'] = this.$route.query.patient_id
904
+            ParamsQuery['record_date'] = this.record_date
905
+            commitDialysisPrescription(ParamsQuery).then(response => {
906
+              if (response.data.state == 0) {
907
+                Toast.fail(response.data.msg)
908
+                return false
909
+              } else {
910
+                Toast.success('提交成功')
911
+
912
+                this.$emit('prescription', response.data.data.prescription)
913
+                this.finish()
914
+
915
+              }
916
+            })
917
+
918
+          }else if (this.is_open == 1) {
892 919
             //弹框推送提醒
893 920
             this.advicePropForm.list = this.targetAdvices
894 921
             this.advicePropForm.operators = this.admin_users_prop
@@ -902,24 +929,27 @@
902 929
             }
903 930
 
904 931
           } else if (this.is_open == 2) {
905
-            this.advice_visibility = false
906
-            let params = {
907
-              advices: this.waitUploadAdvices,
908
-              advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
909
-              advice_doctor: this.waitUploadAdvices[0].advice_doctor,
910
-              advice_type: this.waitUploadAdvices[0].advice_type,
911
-              parent_id: this.patient_id,
912
-              start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
913
-              remark: '',
914
-            }
915
-            CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
916
-              var resp = rs.data
917
-              if (resp.state == 1) {
918
-
919
-              } else {
920 932
 
933
+            if(this.waitUploadAdvices.length > 0) {
934
+              this.advice_visibility = false
935
+              let params = {
936
+                advices: this.waitUploadAdvices,
937
+                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
938
+                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
939
+                advice_type: this.waitUploadAdvices[0].advice_type,
940
+                parent_id: this.patient_id,
941
+                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
942
+                remark: '',
921 943
               }
922
-            })
944
+              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
945
+                var resp = rs.data
946
+                if (resp.state == 1) {
947
+
948
+                } else {
949
+
950
+                }
951
+              })
952
+            }
923 953
 
924 954
             Toast.loading({forbidClick: true, duration: 0})
925 955
             let ParamsQuery = this.dialysisPrescription
@@ -941,7 +971,25 @@
941 971
 
942 972
         } else {
943 973
           if (this.dialysisPrescription.creater == 0) {
944
-            if (this.is_open == 1) {
974
+            if (this.is_open == 0){
975
+              Toast.loading({forbidClick: true, duration: 0})
976
+              let ParamsQuery = this.dialysisPrescription
977
+              ParamsQuery['patient'] = this.$route.query.patient_id
978
+              ParamsQuery['record_date'] = this.record_date
979
+              commitDialysisPrescription(ParamsQuery).then(response => {
980
+                if (response.data.state == 0) {
981
+                  Toast.fail(response.data.msg)
982
+                  return false
983
+                } else {
984
+                  Toast.success('提交成功')
985
+
986
+                  this.$emit('prescription', response.data.data.prescription)
987
+                  this.finish()
988
+
989
+                }
990
+              })
991
+
992
+            }else  if (this.is_open == 1) {
945 993
               //弹框推送提醒
946 994
               this.advicePropForm.list = this.targetAdvices
947 995
               this.advicePropForm.operators = this.admin_users_prop
@@ -955,24 +1003,27 @@
955 1003
               }
956 1004
 
957 1005
             } else if (this.is_open == 2) {
958
-              this.advice_visibility = false
959
-              let params = {
960
-                advices: this.waitUploadAdvices,
961
-                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
962
-                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
963
-                advice_type: this.waitUploadAdvices[0].advice_type,
964
-                parent_id: this.patient_id,
965
-                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
966
-                remark: '',
967
-              }
968
-              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
969
-                var resp = rs.data
970
-                if (resp.state == 1) {
1006
+              if(this.waitUploadAdvices.length > 0) {
1007
+
1008
+                this.advice_visibility = false
1009
+                let params = {
1010
+                  advices: this.waitUploadAdvices,
1011
+                  advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1012
+                  advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1013
+                  advice_type: this.waitUploadAdvices[0].advice_type,
1014
+                  parent_id: this.patient_id,
1015
+                  start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1016
+                  remark: '',
1017
+                }
1018
+                CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1019
+                  var resp = rs.data
1020
+                  if (resp.state == 1) {
971 1021
 
972
-                } else {
1022
+                  } else {
973 1023
 
974
-                }
975
-              })
1024
+                  }
1025
+                })
1026
+              }
976 1027
 
977 1028
             }
978 1029
           }
@@ -998,7 +1049,25 @@
998 1049
         this.is_pre = 2
999 1050
 
1000 1051
         if (this.prescription_prop.id == '') {
1001
-          if (this.is_open == 1) {
1052
+          if (this.is_open == 0){
1053
+            Toast.loading({forbidClick: true, duration: 0})
1054
+            let ParamsQuery = this.dialysisPrescription
1055
+            ParamsQuery['patient'] = this.$route.query.patient_id
1056
+            ParamsQuery['record_date'] = this.record_date
1057
+            commitDialysisPrescription(ParamsQuery).then(response => {
1058
+              if (response.data.state == 0) {
1059
+                Toast.fail(response.data.msg)
1060
+                return false
1061
+              } else {
1062
+                Toast.success('提交成功')
1063
+
1064
+                this.$emit('prescription', response.data.data.prescription)
1065
+                this.finish()
1066
+
1067
+              }
1068
+            })
1069
+
1070
+          } else if (this.is_open == 1) {
1002 1071
             //弹框推送提醒
1003 1072
             this.advicePropForm.list = this.targetAdvices
1004 1073
             this.advicePropForm.operators = this.admin_users_prop
@@ -1012,24 +1081,26 @@
1012 1081
             }
1013 1082
 
1014 1083
           } else if (this.is_open == 2) {
1015
-            this.advice_visibility = false
1016
-            let params = {
1017
-              advices: this.waitUploadAdvices,
1018
-              advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1019
-              advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1020
-              advice_type: this.waitUploadAdvices[0].advice_type,
1021
-              parent_id: this.patient_id,
1022
-              start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1023
-              remark: '',
1024
-            }
1025
-            CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1026
-              var resp = rs.data
1027
-              if (resp.state == 1) {
1084
+            if(this.waitUploadAdvices.length > 0) {
1085
+              this.advice_visibility = false
1086
+              let params = {
1087
+                advices: this.waitUploadAdvices,
1088
+                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1089
+                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1090
+                advice_type: this.waitUploadAdvices[0].advice_type,
1091
+                parent_id: this.patient_id,
1092
+                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1093
+                remark: '',
1094
+              }
1095
+              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1096
+                var resp = rs.data
1097
+                if (resp.state == 1) {
1028 1098
 
1029
-              } else {
1099
+                } else {
1030 1100
 
1031
-              }
1032
-            })
1101
+                }
1102
+              })
1103
+            }
1033 1104
 
1034 1105
             Toast.loading({forbidClick: true, duration: 0})
1035 1106
             let ParamsQuery = this.dialysisPrescription
@@ -1054,7 +1125,25 @@
1054 1125
 
1055 1126
         } else {
1056 1127
           if (this.dialysisPrescription.creater == 0) {
1057
-            if (this.is_open == 1) {
1128
+            if (this.is_open == 0){
1129
+              Toast.loading({forbidClick: true, duration: 0})
1130
+              let ParamsQuery = this.dialysisPrescription
1131
+              ParamsQuery['patient'] = this.$route.query.patient_id
1132
+              ParamsQuery['record_date'] = this.record_date
1133
+              commitDialysisPrescription(ParamsQuery).then(response => {
1134
+                if (response.data.state == 0) {
1135
+                  Toast.fail(response.data.msg)
1136
+                  return false
1137
+                } else {
1138
+                  Toast.success('提交成功')
1139
+
1140
+                  this.$emit('prescription', response.data.data.prescription)
1141
+                  this.finish()
1142
+
1143
+                }
1144
+              })
1145
+
1146
+            }else  if (this.is_open == 1) {
1058 1147
               //弹框推送提醒
1059 1148
               this.advicePropForm.list = this.targetAdvices
1060 1149
               this.advicePropForm.operators = this.admin_users_prop
@@ -1068,24 +1157,26 @@
1068 1157
               }
1069 1158
 
1070 1159
             } else if (this.is_open == 2) {
1071
-              this.advice_visibility = false
1072
-              let params = {
1073
-                advices: this.waitUploadAdvices,
1074
-                advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1075
-                advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1076
-                advice_type: this.waitUploadAdvices[0].advice_type,
1077
-                parent_id: this.patient_id,
1078
-                start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1079
-                remark: '',
1080
-              }
1081
-              CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1082
-                var resp = rs.data
1083
-                if (resp.state == 1) {
1160
+              if(this.waitUploadAdvices.length > 0) {
1161
+                this.advice_visibility = false
1162
+                let params = {
1163
+                  advices: this.waitUploadAdvices,
1164
+                  advice_date: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1165
+                  advice_doctor: this.waitUploadAdvices[0].advice_doctor,
1166
+                  advice_type: this.waitUploadAdvices[0].advice_type,
1167
+                  parent_id: this.patient_id,
1168
+                  start_time: parseTime(this.$route.query.date, '{y}-{m}-{d}'),
1169
+                  remark: '',
1170
+                }
1171
+                CreateGroupAdvice(this.$route.query.patient_id, 0, params).then(rs => {
1172
+                  var resp = rs.data
1173
+                  if (resp.state == 1) {
1084 1174
 
1085
-                } else {
1175
+                  } else {
1086 1176
 
1087
-                }
1088
-              })
1177
+                  }
1178
+                })
1179
+              }
1089 1180
 
1090 1181
             }
1091 1182
           }

+ 5 - 5
src/pages/main/dialog/subMenu/LongAdviceSubMenu.vue View File

@@ -68,7 +68,7 @@
68 68
       }, getContent (val) {
69 69
         let prescribing_number = ''
70 70
         let single_dose = ''
71
-        let advice_name = ''
71
+        let advice_desc = ''
72 72
 
73 73
         if (val.prescribing_number > 0) {
74 74
           prescribing_number = val.prescribing_number + val.prescribing_number_unit
@@ -77,8 +77,8 @@
77 77
           single_dose = ' 单次用量 ' + val.single_dose + val.single_dose_unit
78 78
         }
79 79
 
80
-        if (val.advice_name > 0) {
81
-          advice_name = val.advice_name + val.drug_spec_unit
80
+        if (val.advice_desc > 0) {
81
+          advice_desc = val.advice_desc + val.drug_spec_unit
82 82
         }
83 83
 
84 84
         let name = ""
@@ -101,13 +101,13 @@
101 101
               + val.child[i].presc
102 102
               + val.child[i].single
103 103
           }
104
-          return  val.advice_name +"  "+ val.drug_spec+" "
104
+          return  val.advice_name +"  "+advice_desc+" "
105 105
             + val.drug_spec_unit
106 106
             + prescribing_number
107 107
             + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark +name
108 108
 
109 109
         } else {
110
-          return advice_name +"  "
110
+          return val.advice_name +"  "+advice_desc
111 111
             + prescribing_number
112 112
             + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark
113 113
         }