safecheck-client 3.0.33-41 → 3.0.33-43

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.
@@ -1,104 +1,158 @@
1
- <template>
2
- <div class="auto select-overspread">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row">
7
- <div class="form-group col-sm-3">
8
- <label class="font_normal_body">客户编号</label>
9
- <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code"
10
- placeholder='客户编号'
11
- condition="f_userinfo_code = '{}'" @keyup.enter="search()">
12
- </div>
13
- <div class="form-group col-sm-2 button-range">
14
- <button class="button_search" style="margin-right: 10px" @click="search()" v-el:cba>查询</button>
15
-
16
- </div>
17
- </div>
18
- </div>
19
- </criteria>
20
- <data-grid :model="model" class="table_sy" partial='list' v-ref:grid>
21
- <template partial='head'>
22
- <tr>
23
- <th>
24
- <nobr>序号</nobr>
25
- </th>
26
- <th>
27
- <nobr>用户编号</nobr>
28
- </th>
29
- <th>
30
- <nobr>用户姓名</nobr>
31
- </th>
32
- <th>
33
- <nobr>用户电话</nobr>
34
- </th>
35
- <th>
36
- <nobr>用户地址</nobr>
37
- </th>
38
-
39
- </tr>
40
- </template>
41
- <template partial='body'>
42
- <tr>
43
- <td style="text-align:center;">{{ $index + 1 }}</td>
44
- <td style="text-align:center">{{ row.f_userinfo_code }}</td>
45
- <td style="text-align:center">{{ row.f_user_name }}</td>
46
- <td style="text-align:center">{{ row.f_user_phone }}</td>
47
- <td style="text-align:center">{{ row.f_address }}</td>
48
- </tr>
49
- </template>
50
- <template partial='foot'></template>
51
- </data-grid>
52
- </criteria-paged>
53
- </div>
54
- </template>
55
-
56
- <script>
57
- import {PagedList} from 'vue-client'
58
-
59
- export default {
60
- title: '安检记录列表',
61
- props: ['row'],
62
- data() {
63
- return {
64
- rowdata: this.row,
65
- model: new PagedList('rs/sql/safe_singleTable_OrderBy', 50,
66
- {
67
- items: '"tua.f_address,tui.f_userinfo_code,tui.f_user_name,tui.f_user_phone"',
68
- tablename: '"t_user_address tua left join t_userinfo tui on tua.f_userinfo_id = tui.f_userinfo_id"',
69
- orderitem: '"tua.id desc"'
70
- }
71
- )
72
- }
73
- },
74
- ready() {
75
- if (this.row) {
76
- let condition = ''
77
- condition = `tua.f_check_book_id =${this.row.id}`
78
- this.model.search(condition)
79
- //只显示用户页面
80
- this.row.f_check_book_type = '用户'
81
- }
82
- },
83
- watch: {
84
- 'row'(val) {
85
- if (val) {
86
- this.rowdata = val
87
- let condition = ''
88
- condition = `tua.f_check_book_id =${val.id} `
89
- this.model.search(condition)
90
- }
91
- }
92
- },
93
- methods: {
94
- selfSearch(args) {
95
- if (this.rowdata.id) {
96
- args.condition += `and tua.f_check_book_id =${this.rowdata.id}`
97
- this.model.search(args.condition)
98
- } else {
99
- this.$showMessage('请选择片区')
100
- }
101
- }
102
- }
103
- }
104
- </script>
1
+ <template>
2
+ <div class="auto select-overspread">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row">
7
+ <div class="form-group col-sm-3">
8
+ <label class="font_normal_body">客户编号</label>
9
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_userinfo_code"
10
+ placeholder='客户编号'
11
+ condition="f_userinfo_code = '{}'" @keyup.enter="search()">
12
+ </div>
13
+ <div class="form-group col-sm-2 button-range">
14
+ <button class="button_search" style="margin-right: 10px" @click="search()" v-el:cba>查询</button>
15
+
16
+ </div>
17
+ <div class="form-group col-sm-2 button-range">
18
+ <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.delOfCheckBook()" v-el:cba>移出</button>
19
+
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </criteria>
24
+ <data-grid :model="model" class="table_sy" partial='list' v-ref:grid>
25
+ <template partial='head'>
26
+ <tr>
27
+ <th>
28
+ <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
29
+ </th>
30
+ <th>
31
+ <nobr>序号</nobr>
32
+ </th>
33
+ <th>
34
+ <nobr>用户编号</nobr>
35
+ </th>
36
+ <th>
37
+ <nobr>用户姓名</nobr>
38
+ </th>
39
+ <th>
40
+ <nobr>用户电话</nobr>
41
+ </th>
42
+ <th>
43
+ <nobr>用户地址</nobr>
44
+ </th>
45
+
46
+ </tr>
47
+ </template>
48
+ <template partial='body'>
49
+ <tr>
50
+ <td style="text-align: center">
51
+ <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
52
+ @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
53
+ </nobr>
54
+ </td>
55
+ <td style="text-align:center;">{{ $index + 1 }}</td>
56
+ <td style="text-align:center">{{ row.f_userinfo_code }}</td>
57
+ <td style="text-align:center">{{ row.f_user_name }}</td>
58
+ <td style="text-align:center">{{ row.f_user_phone }}</td>
59
+ <td style="text-align:center">{{ row.f_address }}</td>
60
+ </tr>
61
+ </template>
62
+ <template partial='foot'></template>
63
+ </data-grid>
64
+ </criteria-paged>
65
+ </div>
66
+ </template>
67
+
68
+ <script>
69
+ import {HttpResetClass, PagedList} from 'vue-client'
70
+
71
+ export default {
72
+ title: '安检记录列表',
73
+ props: ['row'],
74
+ data() {
75
+ return {
76
+ rowdata: this.row,
77
+ bookAll: false,
78
+ bookList:[],
79
+ model: new PagedList('rs/sql/safe_singleTable_OrderBy', 50,
80
+ {
81
+ items: '"tua.f_address,tui.f_userinfo_code,tui.f_user_name,tui.f_user_phone,tui.f_userinfo_id"',
82
+ tablename: '"t_user_address tua left join t_userinfo tui on tua.f_userinfo_id = tui.f_userinfo_id"',
83
+ orderitem: '"tua.id desc"'
84
+ }
85
+ )
86
+ }
87
+ },
88
+ ready() {
89
+ if (this.row) {
90
+ let condition = ''
91
+ condition = `tua.f_check_book_id =${this.row.id}`
92
+ this.model.search(condition)
93
+ //只显示用户页面
94
+ this.row.f_check_book_type = '用户'
95
+ }
96
+ },
97
+ watch: {
98
+ 'row'(val) {
99
+ if (val) {
100
+ this.rowdata = val
101
+ let condition = ''
102
+ condition = `tua.f_check_book_id =${val.id} `
103
+ this.model.search(condition)
104
+ }
105
+ }
106
+ },
107
+ methods: {
108
+ selfSearch(args) {
109
+ if (this.rowdata.id) {
110
+ args.condition += `and tua.f_check_book_id =${this.rowdata.id}`
111
+ this.model.search(args.condition)
112
+ } else {
113
+ this.$showMessage('请选择片区')
114
+ }
115
+ },
116
+ checkModel (row) {
117
+ if (this.bookAll) {
118
+ return true
119
+ } else {
120
+ return this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1;
121
+ }
122
+ },
123
+ checkChange (row, e) {
124
+ if (e.target.checked) {
125
+ this.bookList.push(row.f_userinfo_id)
126
+ } else {
127
+ this.bookList.splice(this.bookList.findIndex(res => res === row.f_userinfo_id), 1)
128
+ }
129
+ },
130
+ delOfCheckBook(){
131
+ try {
132
+ let upAddress = `update t_user_address set f_check_book_id = null where 1 = 2 `
133
+ if (this.bookAll){
134
+ upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${this.row.id}'`
135
+ }else if (this.bookList.length > 0){
136
+ let codes = this.bookList.map( item => { return `'${item}'` } ).join()
137
+ upAddress = `update t_user_address set f_check_book_id = null where f_userinfo_id in (${codes})`
138
+ }
139
+ this.$showMessage('确认移出安检册', ['confirm', 'cancel']).then((res) => {
140
+ if (res === 'confirm') {
141
+ let http = new HttpResetClass()
142
+ http.load('POST', 'rs/logic/runSQL', {data: {sql: upAddress}},
143
+ {resolveMsg: null, rejectMsg: '移出安检册失败'}).then(resp=>{
144
+ this.$showMessage('移出成功')
145
+ this.$refs.paged.$refs.criteria.search()
146
+ }).catch(error=>{
147
+ this.$showMessage('移出失败',error)
148
+
149
+ })
150
+ }
151
+ })
152
+ }catch (e) {
153
+ this.$showMessage('移出失败',e)
154
+ }
155
+ }
156
+ }
157
+ }
158
+ </script>
@@ -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}`