Browse Source

修改样式问题

csx 5 years ago
parent
commit
63774e5b18

+ 2 - 3
config/prod.env.js View File

@@ -1,10 +1,9 @@
1 1
 'use strict'
2 2
 module.exports = {
3 3
   NODE_ENV: '"production"',
4
-  // BASE_API: '"http://api.xt.test.sgjyun.com"'
5
-
6
-  BASE_API: '"https://api.xt.kuyicloud.com"'
4
+  BASE_API: '"http://api.xt.test.sgjyun.com"'
7 5
 
6
+  // BASE_API: '"https://api.xt.kuyicloud.com"'
8 7
   // http://api.xt.test.sgjyun.com
9 8
   // '"http://api.xt.kuyicloud.com"', //'"http://api.xt.kuyicloud.com"','"http://api.xt.test.sgjyun.com"'
10 9
 }

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

@@ -128,4 +128,11 @@ export function ModifyExecDoctorAdvice(params){
128 128
   })
129 129
 }
130 130
 
131
+export function GetRemindLongAdvice(params){
132
+  return request({
133
+    url:'/m/api/dialysis/advice_remind',
134
+    method:'Get',
135
+    params:params,
136
+  })
137
+}
131 138
 

+ 12 - 0
src/api/dialysis.js View File

@@ -213,3 +213,15 @@ export function PostModifyEndDialysis (params) {
213 213
 }
214 214
 
215 215
 
216
+
217
+
218
+export function CreateGroupAdvice(id, groupno, advices){
219
+  return request({
220
+    url:'/m/api/advice_remind/create?id='+id + '&groupno=' + groupno,
221
+    method:'post',
222
+    data:advices,
223
+  })
224
+
225
+}
226
+
227
+

File diff suppressed because it is too large
+ 681 - 452
src/pages/main/dialog/PrescriptionDialog.vue


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

@@ -0,0 +1,213 @@
1
+<template>
2
+  <div v-if="visibility" class="Dialog">
3
+    <div class="DialogTit">
4
+      <div class="back" @click="cancle()">
5
+        <span class="iconfont">&#xe720; </span>返回
6
+      </div>
7
+      <h1 class="name">长期医嘱推送</h1>
8
+      <span @click="comfirm" class="success"
9
+      >确定</span
10
+      >
11
+    </div>
12
+
13
+    <div class="CheckBox">
14
+      <ul>
15
+        <li>
16
+          <van-checkbox-group v-model="propsForm.result">
17
+            <van-checkbox
18
+              style="border-bottom: 1px #e5e5e5 solid;padding: 0 0.38rem"
19
+              v-for="(advice, index) in propsForm.list"
20
+              :key="index"
21
+              :name="advice.id"
22
+            >
23
+             <div style="padding-top: 15px;padding-left: 10px">开嘱医生&nbsp;{{ getDoctorName(advice.advice_doctor) }}</div><br/>
24
+              <div style="padding-left: 10px">开嘱时间&nbsp;{{ getTime(advice.created_time) }}</div><br/>
25
+              <div style="padding-bottom: 15px;padding-left: 10px"> 医嘱内容&nbsp;{{getContent(advice)}}</div>
26
+
27
+            </van-checkbox>
28
+          </van-checkbox-group>
29
+        </li>
30
+      </ul>
31
+    </div>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+  import {parseTime} from '@/utils'
37
+
38
+  export default {
39
+    name: 'LongAdviceSubMenu',
40
+    created () {
41
+    },
42
+    data () {
43
+      return {
44
+        result: [],
45
+        id: 0,
46
+        selectName: ''
47
+      }
48
+    },
49
+    props: {
50
+      propsForm: {
51
+        type: Object
52
+      },
53
+      visibility: {
54
+        type: Boolean,
55
+        default: false
56
+      },
57
+    },
58
+    methods: {
59
+      getDoctorName (doctor_id) {
60
+        for (let i = 0; i < this.propsForm.operators.length; i++) {
61
+          if (this.propsForm.operators[i].id == doctor_id) {
62
+            return this.propsForm.operators[i].name
63
+          }
64
+        }
65
+      }, getTime (val) {
66
+        return parseTime(val, '{y}-{m}-{d} {h}:{i}')
67
+
68
+      }, getContent (val) {
69
+        let prescribing_number = ''
70
+        let single_dose = ''
71
+        if (val.prescribing_number > 0) {
72
+          prescribing_number = val.prescribing_number + val.prescribing_number_unit
73
+        }
74
+        if (val.single_dose > 0) {
75
+          single_dose = ' 单次用量 ' + val.single_dose + val.single_dose_unit
76
+        }
77
+        let name = ""
78
+        if (val.child.length > 0){
79
+          for (let i = 0 ; i < val.child.length; i++){
80
+            if(val.child[i].prescribing_number > 0){
81
+              val.child[i]['presc'] = val.child[i].prescribing_number + val.child[i].prescribing_number_unit
82
+            }else{
83
+              val.child[i]['presc'] = ''
84
+            }
85
+
86
+            if(val.child[i].single_dose > 0){
87
+              val.child[i]['single'] = " "+' 单次用量 '+" "+val.child[i].single_dose + val.child[i].single_dose_unit
88
+            }else{
89
+              val.child[i]['single'] = ''
90
+            }
91
+            name = name+"▲"+val.child[i].advice_name+""
92
+              + val.child[i].advice_desc
93
+              + val.child[i].drug_spec_unit
94
+              + val.child[i].presc
95
+              + val.child[i].single
96
+
97
+
98
+          }
99
+          return  val.advice_name +"  "+ val.advice_desc+" "
100
+            + val.drug_spec_unit
101
+            + prescribing_number
102
+            + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark +name
103
+
104
+        }else{
105
+          return val.advice_name +"  "+ val.advice_desc+" "
106
+            + val.drug_spec_unit
107
+            + prescribing_number
108
+            + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark
109
+
110
+        }
111
+
112
+
113
+      },
114
+
115
+      cancle: function () {
116
+        this.$emit('menu-cancle-three')
117
+      },
118
+      comfirm: function () {
119
+        this.$emit('menu-comfirm-three', this.getValue())
120
+      },
121
+      getValue: function () {
122
+        let form = {}
123
+
124
+        let results = []
125
+
126
+        for (let i = 0; i < this.propsForm.list.length; i++){
127
+          for (let a = 0; a < this.propsForm.result.length; a++){
128
+            if( this.propsForm.list[i].id == this.propsForm.result[a]){
129
+              results.push(this.propsForm.list[i])
130
+            }
131
+          }
132
+        }
133
+
134
+        var obj5={}
135
+        results = results.reduce((cur, next) => {
136
+          obj5[next.id] ? '' : obj5[next.id] = true && cur.push(next)
137
+          return cur
138
+        }, [])
139
+
140
+
141
+
142
+        return results
143
+      },
144
+      itemClick: function (id) {
145
+        if (id == -2) {
146
+          this.$emit('menu-empty', this.getValue())
147
+        }
148
+        this.propsForm.selectId = id
149
+        this.$emit('menu-comfirm', this.getValue())
150
+      }
151
+    },
152
+    watch: {
153
+      visibility (val) {
154
+        //初始化数据操作
155
+      }
156
+    }
157
+  }
158
+</script>
159
+
160
+<style style="stylesheet/scss" lang="scss" scoped>
161
+  .optionsBox {
162
+  background: #fff;
163
+  max-height: 10rem;
164
+  min-height: 5rem;
165
+  @media only screen and (max-width: 812px) {
166
+  min-height: 8rem !important;
167
+  }
168
+  ul {
169
+  overflow-y: scroll;
170
+  max-height: 9rem;
171
+  li {
172
+  height: 1.1rem;
173
+  line-height: 1.1rem;
174
+  border-bottom: 1px #e5e5e5 solid;
175
+  padding: 0 0.38rem;
176
+  font-size: 0.36rem;
177
+  color: $title-color;
178
+  }
179
+  .tick {
180
+  position: relative;
181
+  &::before {
182
+  content: "";
183
+  display: inline-block;
184
+  border: 2px solid $main-color;
185
+  border-top-width: 0;
186
+  border-right-width: 0;
187
+  width: 0.3rem;
188
+  height: 0.15rem;
189
+  -webkit-transform: rotate(-50deg);
190
+  position: absolute;
191
+  top: 0.38rem;
192
+  right: 0.44rem;
193
+  }
194
+  }
195
+  }
196
+  }
197
+  .CheckBox {
198
+  background: #fff;
199
+  max-height: 6.8rem;
200
+  min-height: 5rem;
201
+  overflow-y: scroll;
202
+  @media only screen and (max-width: 812px) {
203
+  max-height: 8rem !important;
204
+  min-height: 8rem !important;
205
+  }
206
+
207
+  ul {
208
+  li {
209
+  line-height: 1rem;
210
+  }
211
+  }
212
+  }
213
+</style>

+ 206 - 26
src/pages/main/today/TodayTab.vue View File

@@ -109,8 +109,8 @@
109 109
     <van-popup title="透析处方" v-model="menuList[1].showPopup" :overlay="true" :close-on-click-overlay="false">
110 110
       <prescription-dialog :patient_prop="patient" :solution_prop="solution" :machines_prop="devices" :config="config"
111 111
                            :prescription_prop="prescription" @finish="closePrescriptionDialog" :operators="operators"
112
-                           :types="goodTypes" :info="goodInfos"
113
-                           @close="closePrescriptionDialog" @prescription="prescriptionFunc"
112
+                           :types="goodTypes" :info="goodInfos" :status="status" :targetAdvices="targetAdvices"
113
+                           @close="closePrescriptionDialog" @prescription="prescriptionFunc"  :admin_users_prop="admin_users" @advice="adviceFunc"
114 114
                            @longSolution="longSolutionFunc" ref="prescription_dialog"></prescription-dialog>
115 115
     </van-popup>
116 116
 
@@ -217,7 +217,9 @@
217 217
   import MonitDialog from '../dialog/MonitDialog'
218 218
   import ComputerDialog from '../dialog/ComputerDialog'
219 219
 
220
-  import {dialysisGlobalConfig, getDialysisRecord} from '@/api/dialysis'
220
+  import {dialysisGlobalConfig, getDialysisRecord,CreateGroupAdvice} from '@/api/dialysis'
221
+  import {GetRemindLongAdvice} from '@/api/advice'
222
+
221 223
   import {parseTime} from '@/utils'
222 224
 
223 225
   export default {
@@ -300,6 +302,10 @@
300 302
         goTopShow: false,
301 303
         goodTypes: [],
302 304
         goodInfos: [],
305
+
306
+        longAdvices: [],
307
+        targetAdvices:[],
308
+        status:'',
303 309
       }
304 310
     },
305 311
     computed: {
@@ -373,6 +379,8 @@
373 379
       this.patient_id = patient_id
374 380
       this.date = date
375 381
       this.requestDialysisRecord()
382
+      this.requestLongAdvice()
383
+
376 384
     },
377 385
     mounted () {
378 386
       window.addEventListener('scroll', this.handleScroll)
@@ -469,7 +477,7 @@
469 477
           monitor.conductivity
470 478
         this.monitor_records[monitor_index].displacement_flow_quantity =
471 479
           monitor.displacement_flow_quantity
472
-        this.monitor_records.sort((a, b) =>a.operate_time - b.operate_time )
480
+        this.monitor_records.sort((a, b) => a.operate_time - b.operate_time)
473 481
 
474 482
         // if (monitor_index >= 0) {
475 483
         //   var record = this.monitor_records[monitor_index]
@@ -918,6 +926,146 @@
918 926
           }
919 927
         })
920 928
       },
929
+      requestLongAdvice () {
930
+        var dateStr = parseTime(this.date, '{y}-{m}-{d}')
931
+
932
+        var params = {
933
+          id: this.patient_id,
934
+        }
935
+        GetRemindLongAdvice(params).then(rs => {
936
+          var resp = rs.data
937
+          if (resp.state == 1) {
938
+
939
+            var status = parseInt(resp.data.status)
940
+            this.status = status
941
+
942
+            switch (status) {
943
+              case 2:
944
+                this.longAdvices = resp.data.advices
945
+
946
+                var longAdvicesTwo = resp.data.advices_two
947
+
948
+                for (let i = 0; i < this.longAdvices.length; i++) {
949
+                  this.longAdvices[i]['isCheck'] = 0
950
+                  switch (this.longAdvices[i].frequency_type) {
951
+                    case 1: //每日推送
952
+                      this.longAdvices[i]['isCheck'] = 1
953
+                      break
954
+                    case 2: //用今天的日期与推送类型为2的医嘱进行比较如果相差天数等于设定的天数,则设置为选中状态
955
+                      for (let i = 0;i < this.longAdvices.length;i++){
956
+                        for (let a = 0; a < longAdvicesTwo.length;a++){
957
+                          if(this.longAdvices[i].advice_name == longAdvicesTwo[a].advice_name && this.longAdvices[i].advice_desc == longAdvicesTwo[a].advice_desc){
958
+                            this.longAdvices[i]['isCheck'] = 1
959
+                          }
960
+                        }
961
+                      }
962
+                      break
963
+                    case 3://用今天的属于周几与推送类型为3的医嘱进行比较如果包含某个字符串,则设置为选中状态
964
+                      let day = new Date().getDay()
965
+                      let name =""
966
+                      switch (day) {
967
+                        case 1:
968
+                          name="周一"
969
+                          break
970
+                        case 2:
971
+                          name="周二"
972
+
973
+                          break
974
+                        case 3:
975
+                          name="周三"
976
+
977
+                          break
978
+                        case 4:
979
+                          name="周四"
980
+                          break
981
+                        case 5:
982
+                          name="周五"
983
+                          break
984
+                        case 6:
985
+                          name="周六"
986
+                          break
987
+                        case 7:
988
+                          name="周日"
989
+                          break
990
+                      }
991
+                      if (this.longAdvices[i].week_day.indexOf(name) != -1){
992
+                        this.longAdvices[i]['isCheck'] = 1
993
+                      }
994
+                      break
995
+                  }
996
+                }
997
+
998
+                this.targetAdvices = this.longAdvices
999
+
1000
+                break
1001
+              case 3:
1002
+                this.longAdvices = resp.data.advices
1003
+                var advices_two = resp.data.advices_two
1004
+                let dayAdvices = []
1005
+                for (let i = 0; i < this.longAdvices.length; i++) {
1006
+                  switch (this.longAdvices[i].frequency_type) {
1007
+                    case 1: //每日推送,则加入到待上传数组里面
1008
+                      dayAdvices.push(this.longAdvices[i])
1009
+                      break
1010
+                    case 3://用今天的属于周几与推送类型为3的医嘱进行比较如果包含某个字符串,则加入到待上传数组里面
1011
+                      let day = new Date().getDay()
1012
+                      let name =""
1013
+                      switch (day) {
1014
+                        case 1:
1015
+                          name="周一"
1016
+                          break
1017
+                        case 2:
1018
+                          name="周二"
1019
+                          break
1020
+                        case 3:
1021
+                          name="周三"
1022
+                          break
1023
+                        case 4:
1024
+                          name="周四"
1025
+                          break
1026
+                        case 5:
1027
+                          name="周五"
1028
+                          break
1029
+                        case 6:
1030
+                          name="周六"
1031
+                          break
1032
+                        case 7:
1033
+                          name="周日"
1034
+                          break
1035
+                      }
1036
+                      if (this.longAdvices[i].week_day.indexOf(name) != -1){
1037
+                        dayAdvices.push(this.longAdvices[i])
1038
+                      }
1039
+                      break
1040
+                  }
1041
+                }
1042
+                this.targetAdvices = dayAdvices.concat(advices_two)
1043
+                console.log(dayAdvices)
1044
+                console.log(advices_two)
1045
+                console.log( this.targetAdvices)
1046
+
1047
+
1048
+                break
1049
+            }
1050
+          } else {
1051
+
1052
+          }
1053
+        })
1054
+      }, getNowFormatDate () {
1055
+        var date = new Date()
1056
+        var seperator1 = '-'
1057
+        var year = date.getFullYear()
1058
+        var month = date.getMonth() + 1
1059
+        var strDate = date.getDate()
1060
+        if (month >= 1 && month <= 9) {
1061
+          month = '0' + month
1062
+        }
1063
+        if (strDate >= 0 && strDate <= 9) {
1064
+          strDate = '0' + strDate
1065
+        }
1066
+        var currentdate = year + seperator1 + month + seperator1 + strDate
1067
+        return currentdate
1068
+      },
921 1069
       newAdviceGroupObject: function () {
922 1070
         return Object.assign(
923 1071
           {},
@@ -931,69 +1079,88 @@
931 1079
             // checker: 0,
932 1080
           }
933 1081
         )
1082
+      }
1083
+      ,adviceFunc:function(){
1084
+        console.log("111111")
1085
+        this.requestDialysisRecord()
1086
+
934 1087
       },
935 1088
       prescriptionFunc: function (val) {
936 1089
         this.prescription = val
937 1090
 
938
-      },
1091
+      }
1092
+      ,
939 1093
       longSolutionFunc: function (val) {
940 1094
         this.solution = val
941 1095
 
942
-      },
1096
+      }
1097
+      ,
943 1098
       closePrescriptionDialog: function () {
944 1099
         this.closeDialog(1)
945 1100
         this.scrollToView('prescription')
946
-      },
1101
+      }
1102
+      ,
947 1103
       closeAcceptsAssessment: function () {
948 1104
         this.closeDialog(2)
949 1105
         this.scrollToView('accepts_assessment')
950
-      },
1106
+      }
1107
+      ,
951 1108
       closeAssessmentBefore: function () {
952 1109
         this.closeDialog(3)
953 1110
         this.scrollToView('assessment_before')
954
-      },
1111
+      }
1112
+      ,
955 1113
       update_evaluation: function (evaluation) {
956 1114
         this.predialysis_evaluation = evaluation
957 1115
         this.closeAssessmentBefore()
958
-      },
1116
+      }
1117
+      ,
959 1118
       closeStatOrder: function () {
960 1119
         this.closeDialog(4)
961 1120
         this.doctor_advices.push([])
962 1121
         this.scrollToView('stat_order')
963
-      },
1122
+      }
1123
+      ,
964 1124
       closeDialysisComputer: function (dialysis_order) {
965 1125
         this.closeDialog(0)
966 1126
         this.scrollToView('dialysis_computer')
967
-      },
1127
+      }
1128
+      ,
968 1129
       closeDoubleCheck: function () {
969 1130
         this.closeDialog(5)
970 1131
         this.scrollToView('double_check')
971
-      },
1132
+      }
1133
+      ,
972 1134
       closeMonitoring: function () {
973 1135
         this.closeDialog(6)
974 1136
         this.scrollToView('monitoring')
975
-      },
1137
+      }
1138
+      ,
976 1139
       closeDialysisOff: function () {
977 1140
         this.closeDialog(7)
978 1141
         this.scrollToView('dialysis_off')
979
-      },
1142
+      }
1143
+      ,
980 1144
       closeAssessmentAfter: function (assessment_after_dislysis) {
981 1145
         this.closeDialog(8)
982 1146
         this.scrollToView('assessment_after')
983 1147
         if (assessment_after_dislysis != undefined) {
984 1148
           this.assessment_after_dislysis = assessment_after_dislysis
985 1149
         }
986
-      },
1150
+      }
1151
+      ,
987 1152
       closeTreatmentOf: function () {
988 1153
         this.closeDialog(9)
989 1154
         this.scrollToView('treatment_of')
990
-      },
1155
+      }
1156
+      ,
991 1157
       scrollToView: function (id) {
992 1158
         document.body.scrollTop =
993 1159
           document.querySelector('#' + id).offsetTop - 100
994 1160
         document.documentElement.scrollTop =
995 1161
           document.querySelector('#' + id).offsetTop - 100
996
-      },
1162
+      }
1163
+      ,
997 1164
       handleScroll () {
998 1165
         this.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
999 1166
         if (this.scrollTop > 50) {
@@ -1001,7 +1168,8 @@
1001 1168
         } else {
1002 1169
           this.goTopShow = false
1003 1170
         }
1004
-      },
1171
+      }
1172
+      ,
1005 1173
       goTop () {
1006 1174
         let timer = null,
1007 1175
           _that = this
@@ -1017,10 +1185,13 @@
1017 1185
             _that.goTopShow = false
1018 1186
           }
1019 1187
         })
1020
-      },
1188
+      }
1189
+      ,
1021 1190
       destroyed () {
1022 1191
         window.removeEventListener('scroll', this.handleScroll)
1023
-      }, getUnReadNum () {
1192
+      }
1193
+      ,
1194
+      getUnReadNum () {
1024 1195
         let doctorAdvice = []
1025 1196
         for (let y = 0; y < this.doctor_advices.length; y++) {
1026 1197
           if (this.doctor_advices[y].execution_state == 2) {
@@ -1033,7 +1204,9 @@
1033 1204
 
1034 1205
         return sorted.length
1035 1206
 
1036
-      }, groupBy (array, f) {
1207
+      }
1208
+      ,
1209
+      groupBy (array, f) {
1037 1210
         const groups = {}
1038 1211
         array.forEach(function (o) {
1039 1212
           const group = JSON.stringify(f(o))
@@ -1043,19 +1216,26 @@
1043 1216
         return Object.keys(groups).map(function (group) {
1044 1217
           return groups[group]
1045 1218
         })
1046
-      }, getDeviceNumber () {
1219
+      }
1220
+      ,
1221
+      getDeviceNumber () {
1047 1222
         if (this.dialysis_order.id && this.dialysis_order.DeviceNumber && this.dialysis_order.DeviceNumber.number.length > 0) {
1048 1223
           return this.dialysis_order.DeviceNumber.number
1049
-
1050 1224
         } else {
1051 1225
           if (this.schedual.device_number == null) {
1052 1226
             return ''
1053 1227
           } else {
1054 1228
             return this.schedual.device_number.number
1055 1229
           }
1056
-
1057 1230
         }
1058
-
1231
+      }
1232
+      ,
1233
+      dateDiff (firstDate, secondDate) {
1234
+        var firstDate = new Date(firstDate)
1235
+        var secondDate = new Date(secondDate)
1236
+        var diff = Math.abs(firstDate.getTime() - secondDate.getTime())
1237
+        var result = parseInt(diff / (1000 * 60 * 60 * 24))
1238
+        return result
1059 1239
       }
1060 1240
     }
1061 1241
   }