See999 4 年之前
父節點
當前提交
7ec872ab6a
共有 1 個文件被更改,包括 189 次插入160 次删除
  1. 189 160
      src/xt_pages/dialysis/details/dialog/doubleCheckDialog.vue

+ 189 - 160
src/xt_pages/dialysis/details/dialog/doubleCheckDialog.vue 查看文件

121
           pipeline_connection_desc: '',
121
           pipeline_connection_desc: '',
122
           collator: '',
122
           collator: '',
123
 
123
 
124
-          creater: 0,
125
-          modifier: 0,
124
+          creater: this.$store.getters.xt_user.user.id,
125
+          modifier: '',
126
           created_time: 0,
126
           created_time: 0,
127
           updated_time: 0,
127
           updated_time: 0,
128
           check_time: 0,
128
           check_time: 0,
143
             '{y}-{m}-{d} {h}:{i}'
143
             '{y}-{m}-{d} {h}:{i}'
144
           ).split(' ')[1]
144
           ).split(' ')[1]
145
 
145
 
146
-          this.check_time = uParseTime(
147
-            this.double_check.check_time,
148
-            '{y}-{m}-{d} {h}:{i}'
149
-          ).split(' ')[1]
146
+
147
+          if(this.$store.getters.xt_user.user.id == this.double_check.creater || this.double_check.modifier > 0){
148
+            this.check_time = uParseTime(
149
+              this.doubleReview.check_time,
150
+              '{y}-{m}-{d} {h}:{i}'
151
+            ).split(' ')[1]
152
+            console.log('真性感')
153
+          }else if(this.$store.getters.xt_user.user.id != this.double_check.creater && this.double_check.modifier == 0){
154
+            this.check_time = uParseTime(
155
+              new Date(),
156
+              '{y}-{m}-{d} {h}:{i}'
157
+            ).split(' ')[1]
158
+            this.doubleReview.modifier = this.$store.getters.xt_user.user.id
159
+          }
150
           console.log( this.first_check_time )
160
           console.log( this.first_check_time )
151
           console.log( this.check_time )
161
           console.log( this.check_time )
152
 
162
 
155
           var nowDate = new Date()
165
           var nowDate = new Date()
156
           var nowHours = nowDate.getHours()
166
           var nowHours = nowDate.getHours()
157
           var nowMinutes = nowDate.getMinutes()
167
           var nowMinutes = nowDate.getMinutes()
158
-          this.check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
168
+          if(this.$store.getters.xt_user.user.id != this.double_check.creater && this.double_check.modifier == 0){
169
+            this.check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
170
+          }
159
           this.first_check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
171
           this.first_check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
160
           console.log( this.first_check_time )
172
           console.log( this.first_check_time )
161
           console.log( this.check_time )
173
           console.log( this.check_time )
242
         })
254
         })
243
 
255
 
244
       },
256
       },
245
-      getFirstCheckDesc: function() {
246
-        if (
247
-          this.doubleReview.first_check_time > 0 &&
248
-          this.doubleReview.check_time > 0
249
-        ) {
250
-          if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
251
-            let time = uParseTime(
252
-              this.doubleReview.first_check_time,
253
-              '{y}-{m}-{d}  {h}:{i}'
254
-            )
255
-            if (this.doubleReview.creater <= 0) {
256
-              return ''
257
-            }
257
+      getFirstCheckDesc: function () {
258
+        if(this.double_check.creater > 0){
259
+          if (
260
+            this.doubleReview.first_check_time > 0 &&
261
+            this.doubleReview.check_time > 0
262
+          ) {
263
+            if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
264
+              let time = uParseTime(
265
+                this.doubleReview.first_check_time,
266
+                "{y}-{m}-{d}  {h}:{i}:{s}"
267
+              );
268
+              if (this.doubleReview.creater <= 0) {
269
+                return "";
270
+              }
258
 
271
 
259
-            var desc = ''
260
-            if (
261
-              this.admin_users == null ||
262
-              typeof this.admin_users.length == 'undefined'
263
-            ) {
264
-              return ''
265
-            }
272
+              var desc = "";
273
+              if (
274
+                this.admin_users == null ||
275
+                typeof this.admin_users.length == "undefined"
276
+              ) {
277
+                return "";
278
+              }
266
 
279
 
267
-            var leng = this.admin_users.length
268
-            if (leng == 0) {
269
-              return ''
270
-            }
280
+              var leng = this.admin_users.length;
281
+              if (leng == 0) {
282
+                return "";
283
+              }
271
 
284
 
272
-            for (let index = 0; index < leng; index++) {
273
-              if (this.admin_users[index].id == this.doubleReview.creater) {
274
-                let name = this.admin_users[index].name
275
-                desc = '第一核对人员:' + name + ' 第一核对时间:' + time
285
+              for (let index = 0; index < leng; index++) {
286
+                if (this.admin_users[index].id == this.doubleReview.creater) {
287
+                  let name = this.admin_users[index].name;
288
+                  desc = "第一核对人员:" + name + " 第一核对时间:" + time;
289
+
290
+                  break;
291
+                }
292
+              }
293
+              return desc;
294
+            } else {
295
+              let time = uParseTime(
296
+                this.doubleReview.check_time,
297
+                "{y}-{m}-{d}  {h}:{i}:{s}"
298
+              );
299
+              if (this.doubleReview.modifier <= 0) {
300
+                return "";
301
+              }
302
+
303
+              var desc = "";
304
+              if (
305
+                this.admin_users == null ||
306
+                typeof this.admin_users.length == "undefined"
307
+              ) {
308
+                return "";
309
+              }
310
+
311
+              var leng = this.admin_users.length;
312
+              if (leng == 0) {
313
+                return "";
314
+              }
315
+
316
+              for (let index = 0; index < leng; index++) {
317
+                if (this.admin_users[index].id == this.doubleReview.modifier) {
318
+                  let name = this.admin_users[index].name;
319
+                  desc = "第一核对人员:" + name + " 第一核对时间:" + time;
276
 
320
 
277
-                break
321
+                  break;
322
+                }
278
               }
323
               }
324
+              return desc;
279
             }
325
             }
280
-            return desc
281
           } else {
326
           } else {
282
             let time = uParseTime(
327
             let time = uParseTime(
283
-              this.doubleReview.check_time,
284
-              '{y}-{m}-{d}  {h}:{i}'
285
-            )
286
-            if (this.doubleReview.modifier <= 0) {
287
-              return ''
328
+              this.doubleReview.first_check_time,
329
+              "{y}-{m}-{d}  {h}:{i}:{s}"
330
+            );
331
+            if (this.doubleReview.creater <= 0) {
332
+              return "";
288
             }
333
             }
289
 
334
 
290
-            var desc = ''
335
+            var desc = "";
291
             if (
336
             if (
292
               this.admin_users == null ||
337
               this.admin_users == null ||
293
-              typeof this.admin_users.length == 'undefined'
338
+              typeof this.admin_users.length == "undefined"
294
             ) {
339
             ) {
295
-              return ''
340
+              return "";
296
             }
341
             }
297
 
342
 
298
-            var leng = this.admin_users.length
343
+            var leng = this.admin_users.length;
299
             if (leng == 0) {
344
             if (leng == 0) {
300
-              return ''
345
+              return "";
301
             }
346
             }
302
 
347
 
303
             for (let index = 0; index < leng; index++) {
348
             for (let index = 0; index < leng; index++) {
304
-              if (this.admin_users[index].id == this.doubleReview.modifier) {
305
-                let name = this.admin_users[index].name
306
-                desc = '第一核对人员:' + name + ' 第一核对时间:' + time
349
+              if (this.admin_users[index].id == this.doubleReview.creater) {
350
+                let name = this.admin_users[index].name;
351
+                desc = "第一核对人员:" + name + " 第一核对时间:" + time;
307
 
352
 
308
-                break
353
+                break;
309
               }
354
               }
310
             }
355
             }
311
-            return desc
312
-          }
313
-        } else {
314
-          let time = uParseTime(
315
-            this.doubleReview.first_check_time,
316
-            '{y}-{m}-{d}  {h}:{i}'
317
-          )
318
-          if (this.doubleReview.creater <= 0) {
319
-            return ''
356
+            return desc;
320
           }
357
           }
358
+        }
359
+      },
360
+      getScondCheckDesc: function () {
361
+        if(this.double_check.modifier > 0){
321
 
362
 
322
-          var desc = ''
323
           if (
363
           if (
324
-            this.admin_users == null ||
325
-            typeof this.admin_users.length == 'undefined'
364
+            this.doubleReview.first_check_time > 0 &&
365
+            this.doubleReview.check_time > 0 
326
           ) {
366
           ) {
327
-            return ''
328
-          }
329
-
330
-          var leng = this.admin_users.length
331
-          if (leng == 0) {
332
-            return ''
333
-          }
334
-
335
-          for (let index = 0; index < leng; index++) {
336
-            if (this.admin_users[index].id == this.doubleReview.creater) {
337
-              let name = this.admin_users[index].name
338
-              desc = '第一核对人员:' + name + ' 第一核对时间:' + time
339
-
340
-              break
367
+            if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
368
+              let time = uParseTime(
369
+                this.doubleReview.check_time,
370
+                "{y}-{m}-{d} {h}:{i}:{s}"
371
+              );
372
+              if (this.doubleReview.modifier <= 0) {
373
+                return "";
374
+              }
375
+              var desc = "";
376
+              if (
377
+                this.admin_users == null ||
378
+                typeof this.admin_users.length == "undefined"
379
+              ) {
380
+                return desc;
381
+              }
382
+              var leng = this.admin_users.length;
383
+              if (leng == 0) {
384
+                return desc;
385
+              }
386
+              for (let index = 0; index < leng; index++) {
387
+                if (this.admin_users[index].id == this.doubleReview.modifier ) {
388
+                  let name = this.admin_users[index].name;
389
+                  desc = "第二核对人员:" + name + " 第二核对时间:" + time;
390
+                  break;
391
+                }
392
+              }
393
+              return desc;
394
+            } else {
395
+              let time = uParseTime(
396
+                this.doubleReview.first_check_time,
397
+                "{y}-{m}-{d} {h}:{i}:{s}"
398
+              );
399
+              if (this.doubleReview.creater <= 0) {
400
+                return "";
401
+              }
402
+              var desc = "";
403
+              if (
404
+                this.admin_users == null ||
405
+                typeof this.admin_users.length == "undefined"
406
+              ) {
407
+                return desc;
408
+              }
409
+              var leng = this.admin_users.length;
410
+              if (leng == 0) {
411
+                return desc;
412
+              }
413
+              for (let index = 0; index < leng; index++) {
414
+                if (this.admin_users[index].id == this.doubleReview.creater) {
415
+                  let name = this.admin_users[index].name;
416
+                  desc = "第二核对人员:" + name + " 第二核对时间:" + time;
417
+                  break;
418
+                }
419
+              }
420
+              return desc;
341
             }
421
             }
342
-          }
343
-          return desc
344
-        }
345
-      },
346
-      getScondCheckDesc: function() {
347
-        if (
348
-          this.doubleReview.first_check_time > 0 &&
349
-          this.doubleReview.check_time > 0
350
-        ) {
351
-          if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
422
+          } else {
352
             let time = uParseTime(
423
             let time = uParseTime(
353
               this.doubleReview.check_time,
424
               this.doubleReview.check_time,
354
-              '{y}-{m}-{d} {h}:{i}'
355
-            )
425
+              "{y}-{m}-{d} {h}:{i}:{s}"
426
+            );
356
             if (this.doubleReview.modifier <= 0) {
427
             if (this.doubleReview.modifier <= 0) {
357
-              return ''
428
+              return "";
358
             }
429
             }
359
-            var desc = ''
430
+            var desc = "";
360
             if (
431
             if (
361
               this.admin_users == null ||
432
               this.admin_users == null ||
362
-              typeof this.admin_users.length == 'undefined'
433
+              typeof this.admin_users.length == "undefined"
363
             ) {
434
             ) {
364
-              return desc
435
+              return desc;
365
             }
436
             }
366
-            var leng = this.admin_users.length
437
+            var leng = this.admin_users.length;
367
             if (leng == 0) {
438
             if (leng == 0) {
368
-              return desc
439
+              return desc;
369
             }
440
             }
370
             for (let index = 0; index < leng; index++) {
441
             for (let index = 0; index < leng; index++) {
371
               if (this.admin_users[index].id == this.doubleReview.modifier) {
442
               if (this.admin_users[index].id == this.doubleReview.modifier) {
372
-                let name = this.admin_users[index].name
373
-                desc = '第二核对人员:' + name + ' 第二核对时间:' + time
374
-                break
375
-              }
376
-            }
377
-            return desc
378
-          } else {
379
-            let time = uParseTime(
380
-              this.doubleReview.first_check_time,
381
-              '{y}-{m}-{d} {h}:{i}'
382
-            )
383
-            if (this.doubleReview.creater <= 0) {
384
-              return ''
385
-            }
386
-            var desc = ''
387
-            if (
388
-              this.admin_users == null ||
389
-              typeof this.admin_users.length == 'undefined'
390
-            ) {
391
-              return desc
392
-            }
393
-            var leng = this.admin_users.length
394
-            if (leng == 0) {
395
-              return desc
396
-            }
397
-            for (let index = 0; index < leng; index++) {
398
-              if (this.admin_users[index].id == this.doubleReview.creater) {
399
-                let name = this.admin_users[index].name
400
-                desc = '第二核对人员:' + name + ' 第二核对时间:' + time
401
-                break
443
+                let name = this.admin_users[index].name;
444
+                desc = "第二核对人员:" + name + " 第二核对时间:" + time;
445
+                break;
402
               }
446
               }
403
             }
447
             }
404
-            return desc
405
-          }
406
-        } else {
407
-          let time = uParseTime(
408
-            this.doubleReview.check_time,
409
-            '{y}-{m}-{d} {h}:{i}'
410
-          )
411
-          if (this.doubleReview.modifier <= 0) {
412
-            return ''
413
-          }
414
-          var desc = ''
415
-          if (
416
-            this.admin_users == null ||
417
-            typeof this.admin_users.length == 'undefined'
418
-          ) {
419
-            return desc
420
-          }
421
-          var leng = this.admin_users.length
422
-          if (leng == 0) {
423
-            return desc
424
-          }
425
-          for (let index = 0; index < leng; index++) {
426
-            if (this.admin_users[index].id == this.doubleReview.modifier) {
427
-              let name = this.admin_users[index].name
428
-              desc = '第二核对人员:' + name + ' 第二核对时间:' + time
429
-              break
430
-            }
448
+            return desc;
431
           }
449
           }
432
-          return desc
433
         }
450
         }
434
-      }
451
+      },
435
     },
452
     },
436
 
453
 
437
     props: {
454
     props: {
486
             '{y}-{m}-{d}  {h}:{i}'
503
             '{y}-{m}-{d}  {h}:{i}'
487
           ).split(' ')[1]
504
           ).split(' ')[1]
488
 
505
 
489
-          this.check_time = uParseTime(
490
-            this.doubleReview.check_time,
491
-            '{y}-{m}-{d}  {h}:{i}'
492
-          ).split(' ')[1]
506
+          if(this.$store.getters.xt_user.user.id == this.double_check.creater || this.double_check.modifier > 0){
507
+            this.check_time = uParseTime(
508
+              this.doubleReview.check_time,
509
+              '{y}-{m}-{d}  {h}:{i}'
510
+            ).split(' ')[1]
511
+          }else if(this.$store.getters.xt_user.user.id != this.double_check.creater && this.double_check.modifier == 0){
512
+            this.check_time = uParseTime(
513
+              new Date(),
514
+              '{y}-{m}-{d}  {h}:{i}'
515
+            ).split(' ')[1]
516
+            this.doubleReview.modifier = this.$store.getters.xt_user.user.id
517
+          }
493
 
518
 
494
         } else {
519
         } else {
495
           this.dialysis_item_check = '1'
520
           this.dialysis_item_check = '1'
508
           var nowDay = nowDate.getDate()
533
           var nowDay = nowDate.getDate()
509
           var nowHours = nowDate.getHours()
534
           var nowHours = nowDate.getHours()
510
           var nowMinutes = nowDate.getMinutes()
535
           var nowMinutes = nowDate.getMinutes()
511
-          this.check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
536
+          if(this.$store.getters.xt_user.user.id != this.double_check.creater && this.double_check.modifier == 0){
537
+            this.check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
538
+          }
512
           this.first_check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
539
           this.first_check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
513
 
540
 
514
         }
541
         }
525
       var nowDay = nowDate.getDate()
552
       var nowDay = nowDate.getDate()
526
       var nowHours = nowDate.getHours()
553
       var nowHours = nowDate.getHours()
527
       var nowMinutes = nowDate.getMinutes()
554
       var nowMinutes = nowDate.getMinutes()
528
-      this.check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
555
+      if(this.$store.getters.xt_user.user.id != this.double_check.creater && this.double_check.modifier == 0){
556
+        this.check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
557
+      }
529
       this.first_check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
558
       this.first_check_time = (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
530
 
559
 
531
     }
560
     }