xiaoming_global 5 years ago
parent
commit
d520e613f3
1 changed files with 35 additions and 143 deletions
  1. 35 143
      src/pages/main/DialysisArea.vue

+ 35 - 143
src/pages/main/DialysisArea.vue View File

@@ -135,13 +135,8 @@ export default {
135 135
       user_id: 0,
136 136
       networkStates: true,
137 137
       timer: null,
138
-<<<<<<< .mine
139
-      selected_date: this.$store.getters.app.dialysis_area.schedule_date, // new Date(),
140
-
141
-=======
142 138
       ismypatient: false,
143
-      selected_date: this.$store.getters.app.dialysis_area.schedule_date, //new Date(),
144
->>>>>>> .theirs
139
+      selected_date: this.$store.getters.app.dialysis_area.schedule_date, // new Date(),
145 140
       schedual_types: [
146 141
         { value: 0, text: '全部班', select: true },
147 142
         { value: 1, text: '上午', select: false },
@@ -204,50 +199,19 @@ export default {
204 199
         }
205 200
         return schedules
206 201
       }
207
-
208
-<<<<<<< .mine
209
-      var zone_selected = this.zone_selected
210
-      var timetype_selected = this.schedual_type_selected
211
-
212
-
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
-=======
238
-       if (this.ismypatient) {
239
-        var schedules = [];
202
+      if (this.ismypatient) {
203
+        var schedules = []
240 204
         for (let o_i = 0; o_i < this.dialysis_scheduals.length; o_i++) {
241
-          const scheduleInfo = this.dialysis_scheduals[o_i];
242
-          var originSchedules = scheduleInfo.scheduals;
205
+          const scheduleInfo = this.dialysis_scheduals[o_i]
206
+          var originSchedules = scheduleInfo.scheduals
243 207
           if (originSchedules.length == 0) {
244
-            continue;
208
+            continue
245 209
           }
246
-          var filtedSchedules = [];
210
+          var filtedSchedules = []
247 211
           for (let s_i = 0; s_i < originSchedules.length; s_i++) {
248
-            const schedule = originSchedules[s_i];
249
-            if (schedule.dialysis_order.start_nurse == this.user_id ) {
250
-              filtedSchedules.push(schedule);
212
+            const schedule = originSchedules[s_i]
213
+            if (schedule.dialysis_order.start_nurse == this.user_id) {
214
+              filtedSchedules.push(schedule)
251 215
               // break;
252 216
             }
253 217
           }
@@ -255,16 +219,15 @@ export default {
255 219
             schedules.push({
256 220
               zone_name: scheduleInfo.zone_name,
257 221
               scheduals: filtedSchedules
258
-            });
222
+            })
259 223
           }
260 224
         }
261
-        return schedules;
225
+        return schedules
262 226
       }
263 227
 
264
-      var zone_selected = this.zone_selected;
265
-      var timetype_selected = this.schedual_type_selected;
266
->>>>>>> .theirs
267
-      if ( (zone_selected == 0 && timetype_selected == 0) || this.zones.length <= 1 ) {
228
+      var zone_selected = this.zone_selected
229
+      var timetype_selected = this.schedual_type_selected
230
+      if ((zone_selected == 0 && timetype_selected == 0) || this.zones.length <= 1) {
268 231
         return this.dialysis_scheduals
269 232
       }
270 233
 
@@ -276,29 +239,15 @@ export default {
276 239
         var filtedSchedules = []
277 240
         for (let s_i = 0; s_i < originSchedules.length; s_i++) {
278 241
           const schedule = originSchedules[s_i]
279
-<<<<<<< .mine
280
-          if (
281
-            zone_name.length == 0 ||
282
-            (zone_name.length > 0 &&
283
-              zone_name == schedule.device_number.zone.name)
284
-          ) {
285
-            if (
286
-              timetype_selected == 0 ||
287
-              schedule.schedule_type == timetype_selected
288
-            ) {
242
+          if (this.ismypatient) {
243
+            if (schedule.dialysis_order.creator == this.user_id) {
289 244
               filtedSchedules.push(schedule)
290
-=======
291
-           if(this.ismypatient){
292
-             if ( schedule.dialysis_order.creator == this.user_id){
293
-               filtedSchedules.push(schedule);
294 245
              }
295
-           }
296
-          else {
297
-            if  ( zone_name.length == 0 || (zone_name.length > 0 && zone_name == schedule.device_number.zone.name) ) {
298
-              if ( timetype_selected == 0 || schedule.schedule_type == timetype_selected ) {
299
-                filtedSchedules.push(schedule);
246
+          } else {
247
+            if (zone_name.length == 0 || (zone_name.length > 0 && zone_name == schedule.device_number.zone.name)) {
248
+              if (timetype_selected == 0 || schedule.schedule_type == timetype_selected) {
249
+                filtedSchedules.push(schedule)
300 250
               }
301
->>>>>>> .theirs
302 251
             }
303 252
           }
304 253
         }
@@ -309,112 +258,60 @@ export default {
309 258
           })
310 259
         }
311 260
       }
312
-<<<<<<< .mine
313
-      return schedules
314
-
315
-=======
316 261
       this.ismypatient = false
317
-      return schedules;
318
->>>>>>> .theirs
262
+      return schedules
319 263
     }
320 264
   },
321
-<<<<<<< .mine
322
-  methods: {
323
-    myPatients () {
324
-      alert('aaa')
325
-    }
326
-=======
327
-  created() {
328
-    this.user_id = this.$store.getters.user.user.id;
329
-    this.requestDialysisScheduals();
330 265
 
331
->>>>>>> .theirs
332
-  },
333 266
   created () {
267
+    this.user_id = this.$store.getters.user.user.id
334 268
     this.requestDialysisScheduals()
335 269
   },
336 270
   mounted () {
337 271
     this.timer = window.setInterval(() => {
338
-      setTimeout(this.requestDialysisScheduals(), 0);
339
-    }, 30000);
272
+      setTimeout(this.requestDialysisScheduals(), 0)
273
+    }, 30000)
340 274
   },
341 275
   beforeDestroy () {
342 276
     clearInterval(this.timer)
343 277
     this.timer = null
344 278
   },
345 279
   methods: {
346
-<<<<<<< .mine
280
+    mypatient () {
281
+      this.search_keyword = ''
282
+      this.zone_selected = 0
283
+      this.schedual_type_selected = 0
284
+      this.ismypatient = true
285
+    },
347 286
     reloads: function () {
348 287
       this.reload()
349
-
350
-
351
-
352
-
353
-
354
-
355
-=======
356
-    mypatient(){
357
-      this.search_keyword = '';
358
-      this.zone_selected = 0;
359
-      this.schedual_type_selected = 0;
360
-      this.ismypatient = true;
361 288
     },
362
-    reloads: function() {
363
-      this.reload();
364
->>>>>>> .theirs
365
-    },
366
-<<<<<<< .mine
367 289
     handletimeType: function (index) {
290
+      this.ismypatient = false
368 291
       this.sch_type_options_visible = false
369 292
       this.schedual_type_selected = index
370 293
       this.$emit('clear_search_keyword')
371 294
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
372
-
373
-=======
374
-    handletimeType: function(index) {
375
-      this.ismypatient = false
376
-      this.sch_type_options_visible = false;
377
-      this.schedual_type_selected = index;
378
-      this.$emit("clear_search_keyword");
379
-      this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
380
->>>>>>> .theirs
381 295
         zone: this.zone_selected,
382 296
         schedule_type: this.schedual_type_selected,
383 297
         schedule_date: this.selected_date
384 298
       })
385 299
     },
386
-<<<<<<< .mine
387 300
     handleZoneChange: function (index) {
301
+      this.ismypatient = false
388 302
       this.zone_options_visible = false
389 303
       this.zone_selected = index
390 304
       this.$emit('clear_search_keyword')
391 305
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
392
-
393
-=======
394
-    handleZoneChange: function(index) {
395
-      this.ismypatient = false
396
-      this.zone_options_visible = false;
397
-      this.zone_selected = index;
398
-      this.$emit("clear_search_keyword");
399
-      this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
400
->>>>>>> .theirs
401 306
         zone: this.zone_selected,
402 307
         schedule_type: this.schedual_type_selected,
403 308
         schedule_date: this.selected_date
404 309
       })
405 310
     },
406
-<<<<<<< .mine
407 311
     handleScheduleDateChange: function (date) {
312
+      this.ismypatient = false
408 313
       this.zone_selected = 0
409 314
       this.schedual_type_selected = 0
410
-
411
-=======
412
-    handleScheduleDateChange: function(date) {
413
-      this.ismypatient = false
414
-      this.zone_selected = 0;
415
-      this.schedual_type_selected = 0;
416
->>>>>>> .theirs
417
-
418 315
       this.$emit('clear_search_keyword')
419 316
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
420 317
         zone: this.zone_selected,
@@ -426,13 +323,8 @@ export default {
426 323
 
427 324
     requestDialysisScheduals () {
428 325
       // this.$toast.loading({forbidClick: true, duration: 0})
429
-<<<<<<< .mine
430
-      this.loading = true
431
-      var type = 0
432
-=======
433 326
       // this.loading = true;
434
-      var type = 0;
435
->>>>>>> .theirs
327
+      var type = 0
436 328
       getDialysisScheduals({ type: type, date: this.selected_date_str })
437 329
         .then(rs => {
438 330
           this.networkStates = true