safecheck-client 3.0.33-38 → 3.0.33-40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,6 +59,18 @@
59
59
  :title="row.f_create_time">{{ row.f_create_time }}
60
60
  </td>
61
61
  </tr>
62
+ <tr class="safe-bodyfont" v-if="row.f_end_time">
63
+ <td colspan="3">结束时间 :</td>
64
+ <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
65
+ :title="row.f_end_time">{{ row.f_end_time }}
66
+ </td>
67
+ </tr>
68
+ <tr class="safe-bodyfont" >
69
+ <td colspan="3">计划状态:</td>
70
+ <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
71
+ >{{ checkState(row.f_end_time,row.unchecked)}}
72
+ </td>
73
+ </tr>
62
74
  <tr class="safe-bodyfont" v-if="row.f_safecheck_type">
63
75
  <td colspan="3">安检类型 :</td>
64
76
  <td colspan="5" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
@@ -619,6 +631,29 @@ export default {
619
631
 
620
632
  },
621
633
  methods: {
634
+ //判断计划状态
635
+ checkState(time,unchecked) {
636
+ //判断当前时间与time的大小,time格式为 yyyy-MM-dd HH:mm:ss
637
+ let now = new Date()
638
+ let last = new Date(time)
639
+ if(time==undefined || time==''){
640
+ return '无'
641
+ }else{
642
+ if(last.getTime() >now.getTime() ){
643
+ return '安检中'
644
+ }else if(last.getTime() <now.getTime()){
645
+ //结束时间小于当前时间,
646
+ //判断未检数,未检大于0,则逾期
647
+ if(unchecked>0){
648
+ return '逾期'
649
+ }
650
+ if(unchecked<=0){
651
+ return '已完成'
652
+ }
653
+ }
654
+ }
655
+
656
+ },
622
657
  showPlanHistory(row){
623
658
  this.showPlanHistoryButton = true
624
659
  this.planHistory = JSON.parse(row.f_update_check_plan)
@@ -221,7 +221,7 @@
221
221
  :show-rest-button="reset"
222
222
  :value.sync="model.f_start_time"
223
223
  v-model="model.f_start_time"
224
- condition="ui.f_last_check_date >='{} 00:00:00'">
224
+
225
225
  </datepicker>
226
226
  </div>
227
227
  <div class="form-group col-sm-4" >
@@ -234,7 +234,7 @@
234
234
  :show-rest-button="reset"
235
235
  :value.sync="model.f_end_time"
236
236
  v-model="model.f_end_time"
237
- condition="ui.f_last_check_date <='{} 23:59:59'">
237
+
238
238
  </datepicker>
239
239
  </div>
240
240
  <div class="form-group col-sm-4">
@@ -246,7 +246,6 @@
246
246
  v-model="model.f_last_check_state"
247
247
  :options='$parent.$parent.entry_status'
248
248
  placeholder='请选择'
249
- condition="ui.f_last_check_state = '{}'"
250
249
  :search="false"
251
250
  close-on-select
252
251
  value-single
@@ -494,12 +493,34 @@
494
493
  args.condition +=` and area.f_check_book_id=${arr[0]} and ua.f_check_book_id is null`
495
494
  }
496
495
  }
497
- if (args.model.f_last_check_state == '未检'){
498
- args.condition = args.condition.replace("ui.f_last_check_state = '未检'"," (ui.f_last_check_state is null or ui.f_last_check_date is null) ")
499
- }
500
- if (!this.isTimeSelected){
501
- args.model.f_last_check_state = ''
502
- args.condition = args.condition.replace("(ui.f_last_check_state is null or ui.f_last_check_date is null)"," 1=1 ")
496
+ // if (args.model.f_last_check_state == '未检'){
497
+ // args.condition += ` and ui.f_last_check_date <='${args.model.f_start_time}' or ui.f_last_check_date >='${args.model.f_start_time}' and ( ui.f_last_check_date is null or ui.f_last_check_state is null or ui.f_last_check_date ='' ) `
498
+ // }else if(args.model.f_last_check_state == '') {
499
+ // args.model.f_start_time ==''?
500
+ // args.condition +=` and ui.f_last_check_date >='${args.model.f_start_time}' and ui.f_last_check_date <='${args.model.f_start_time}' `
501
+ // }else {
502
+ // args.condition +=` and ui.f_last_check_state = ${args.model.f_last_check_state?args.model.f_last_check_state:''} and ui.f_last_check_date >='${args.model.f_start_time}' and ui.f_last_check_date <='${args.model.f_start_time}' `
503
+ // }
504
+ if (!Util.isEmpty(args.model.f_last_check_state) && (!Util.isEmpty(args.model.f_start_time) || !Util.isEmpty(args.model.f_end_time) )){
505
+ if (args.model.f_last_check_state == '未检'){
506
+ var lscon = args.model.f_start_time ? ` or ui.f_last_check_date <= '${args.model.f_start_time} 00:00:00'` :''
507
+ lscon += lscon ? (args.model.f_end_time ? ` or ui.f_last_check_date >= '${args.model.f_end_time} 23:59:59'` :''): (args.model.f_end_time ? `ui.f_last_check_date >= '${args.model.f_end_time} 23:59:59'` :'')
508
+ args.condition +=`and (ui.f_last_check_state is null or ui.f_last_check_state ='' ${lscon} ) `
509
+ }else {
510
+ var lscon = args.model.f_start_time ? ` and ui.f_last_check_date >= '${args.model.f_start_time} 00:00:00'` :''
511
+ lscon += lscon ? (args.model.f_end_time ? ` and ui.f_last_check_date <= '${args.model.f_end_time} 23:59:59'` :'') : (args.model.f_end_time ? ` ui.f_last_check_date <= '${args.model.f_end_time} 23:59:59'` :'')
512
+ args.condition += `and ui.f_last_check_state = '${args.model.f_last_check_state}' ${lscon}`
513
+ }
514
+
515
+ }else if (Util.isEmpty(args.model.f_last_check_state) && (!Util.isEmpty(args.model.f_start_time) || !Util.isEmpty(args.model.f_end_time) )) {
516
+ var lscon = args.model.f_start_time ? ` and ui.f_last_check_date >= '${args.model.f_start_time} 00:00:00'` :''
517
+ lscon += lscon ? (args.model.f_end_time ? ` and ui.f_last_check_date <= '${args.model.f_end_time} 23:59:59'` :'') : (args.model.f_end_time ? ` ui.f_last_check_date <= '${args.model.f_end_time} 23:59:59'` :'')
518
+ args.condition += lscon
519
+ }else if (!Util.isEmpty(args.model.f_last_check_state) && Util.isEmpty(args.model.f_start_time) && Util.isEmpty(args.model.f_end_time)){
520
+ this.$showMessage("选择安检状态时,需要选择安检时间区间!")
521
+ return
522
+ }else{
523
+ console.log('这块无条件')
503
524
  }
504
525
  if(this.uploadCodeCondition){
505
526
  args.condition +=` and ${this.uploadCodeCondition}`