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
       user_id: 0,
135
       user_id: 0,
136
       networkStates: true,
136
       networkStates: true,
137
       timer: null,
137
       timer: null,
138
-<<<<<<< .mine
139
-      selected_date: this.$store.getters.app.dialysis_area.schedule_date, // new Date(),
140
-
141
-=======
142
       ismypatient: false,
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
       schedual_types: [
140
       schedual_types: [
146
         { value: 0, text: '全部班', select: true },
141
         { value: 0, text: '全部班', select: true },
147
         { value: 1, text: '上午', select: false },
142
         { value: 1, text: '上午', select: false },
204
         }
199
         }
205
         return schedules
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
         for (let o_i = 0; o_i < this.dialysis_scheduals.length; o_i++) {
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
           if (originSchedules.length == 0) {
207
           if (originSchedules.length == 0) {
244
-            continue;
208
+            continue
245
           }
209
           }
246
-          var filtedSchedules = [];
210
+          var filtedSchedules = []
247
           for (let s_i = 0; s_i < originSchedules.length; s_i++) {
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
               // break;
215
               // break;
252
             }
216
             }
253
           }
217
           }
255
             schedules.push({
219
             schedules.push({
256
               zone_name: scheduleInfo.zone_name,
220
               zone_name: scheduleInfo.zone_name,
257
               scheduals: filtedSchedules
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
         return this.dialysis_scheduals
231
         return this.dialysis_scheduals
269
       }
232
       }
270
 
233
 
276
         var filtedSchedules = []
239
         var filtedSchedules = []
277
         for (let s_i = 0; s_i < originSchedules.length; s_i++) {
240
         for (let s_i = 0; s_i < originSchedules.length; s_i++) {
278
           const schedule = originSchedules[s_i]
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
               filtedSchedules.push(schedule)
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
           })
258
           })
310
         }
259
         }
311
       }
260
       }
312
-<<<<<<< .mine
313
-      return schedules
314
-
315
-=======
316
       this.ismypatient = false
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
   created () {
266
   created () {
267
+    this.user_id = this.$store.getters.user.user.id
334
     this.requestDialysisScheduals()
268
     this.requestDialysisScheduals()
335
   },
269
   },
336
   mounted () {
270
   mounted () {
337
     this.timer = window.setInterval(() => {
271
     this.timer = window.setInterval(() => {
338
-      setTimeout(this.requestDialysisScheduals(), 0);
339
-    }, 30000);
272
+      setTimeout(this.requestDialysisScheduals(), 0)
273
+    }, 30000)
340
   },
274
   },
341
   beforeDestroy () {
275
   beforeDestroy () {
342
     clearInterval(this.timer)
276
     clearInterval(this.timer)
343
     this.timer = null
277
     this.timer = null
344
   },
278
   },
345
   methods: {
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
     reloads: function () {
286
     reloads: function () {
348
       this.reload()
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
     handletimeType: function (index) {
289
     handletimeType: function (index) {
290
+      this.ismypatient = false
368
       this.sch_type_options_visible = false
291
       this.sch_type_options_visible = false
369
       this.schedual_type_selected = index
292
       this.schedual_type_selected = index
370
       this.$emit('clear_search_keyword')
293
       this.$emit('clear_search_keyword')
371
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
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
         zone: this.zone_selected,
295
         zone: this.zone_selected,
382
         schedule_type: this.schedual_type_selected,
296
         schedule_type: this.schedual_type_selected,
383
         schedule_date: this.selected_date
297
         schedule_date: this.selected_date
384
       })
298
       })
385
     },
299
     },
386
-<<<<<<< .mine
387
     handleZoneChange: function (index) {
300
     handleZoneChange: function (index) {
301
+      this.ismypatient = false
388
       this.zone_options_visible = false
302
       this.zone_options_visible = false
389
       this.zone_selected = index
303
       this.zone_selected = index
390
       this.$emit('clear_search_keyword')
304
       this.$emit('clear_search_keyword')
391
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
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
         zone: this.zone_selected,
306
         zone: this.zone_selected,
402
         schedule_type: this.schedual_type_selected,
307
         schedule_type: this.schedual_type_selected,
403
         schedule_date: this.selected_date
308
         schedule_date: this.selected_date
404
       })
309
       })
405
     },
310
     },
406
-<<<<<<< .mine
407
     handleScheduleDateChange: function (date) {
311
     handleScheduleDateChange: function (date) {
312
+      this.ismypatient = false
408
       this.zone_selected = 0
313
       this.zone_selected = 0
409
       this.schedual_type_selected = 0
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
       this.$emit('clear_search_keyword')
315
       this.$emit('clear_search_keyword')
419
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
316
       this.$store.dispatch('SaveDialysisAreaSelectIndexs', {
420
         zone: this.zone_selected,
317
         zone: this.zone_selected,
426
 
323
 
427
     requestDialysisScheduals () {
324
     requestDialysisScheduals () {
428
       // this.$toast.loading({forbidClick: true, duration: 0})
325
       // this.$toast.loading({forbidClick: true, duration: 0})
429
-<<<<<<< .mine
430
-      this.loading = true
431
-      var type = 0
432
-=======
433
       // this.loading = true;
326
       // this.loading = true;
434
-      var type = 0;
435
->>>>>>> .theirs
327
+      var type = 0
436
       getDialysisScheduals({ type: type, date: this.selected_date_str })
328
       getDialysisScheduals({ type: type, date: this.selected_date_str })
437
         .then(rs => {
329
         .then(rs => {
438
           this.networkStates = true
330
           this.networkStates = true