safecheck-client 4.0.2-22 → 4.0.2-23

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,397 +1,403 @@
1
- <template>
2
- <div class="flex">
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
- <div class="row" v-show="!$parent.$parent.$parent.showItemAll">
7
- <div :class="$parent.$parent.style2" style="margin: 0px">
8
- <role-selector-safe-dep
9
- v-ref:selector
10
- role-name="安检员"
11
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
12
- @re-res="$parent.$parent.getRes"
13
- @alluser="$parent.$parent.getchecker"
14
- :value.sync="model.f_checker_id"
15
- v-model="model.f_checker_id"
16
- :value-multiple="true"
17
- condition=" f_checker_name in {}">
18
- >
19
- </role-selector-safe-dep>
20
- </div>
21
- <div :class="$parent.$parent.style">
22
- <label class="font_normal_body">安检册名称</label>
23
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
24
- :multiple="true" style="width: 60%"
25
- class="select_list select"
26
- :options='$parent.$parent.checkBooks' placeholder='安检册名称'
27
- condition="tcb.id in {}"></v-select>
28
- </div>
29
- <!-- <div :class="$parent.$parent.style">-->
30
- <!-- <label class="font_normal_body">表册类型</label>-->
31
- <!-- <v-select :value.sync="model.f_check_book_type" v-model='model.f_check_book_type'-->
32
- <!-- :value-single="true" style="width: 60%"-->
33
- <!-- class="select_list select"-->
34
- <!-- :options='$parent.$parent.bookTypes' placeholder='表册类型'-->
35
- <!-- close-on-select-->
36
- <!-- condition="tcb.f_check_book_type ='{}'"></v-select>-->
37
- <!-- </div>-->
38
- <!-- <div :class="$parent.$parent.style">-->
39
- <!-- <label class="font_normal_body">用户类型</label>-->
40
- <!-- <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'-->
41
- <!-- :value-single="true" style="width: 60%"-->
42
- <!-- class="select_list select"-->
43
- <!-- :options='$parent.$parent.userTypes' placeholder='用户类型'-->
44
- <!-- close-on-select-->
45
- <!-- condition="tcb.f_user_type ='{}'"></v-select>-->
46
- <!-- </div>-->
47
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
48
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
49
- <button type="button" class="button_search button_spacing" @click="$parent.$parent.clean()">重置</button>
50
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增安检册</button>
51
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">安检册用户管理</button>
52
- <div style="float: right" class="button_spacing"
53
- v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
54
- :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
55
- @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
56
- </div>
57
-
58
-
59
- </div>
60
-
61
-
62
- <div class="row" v-show="$parent.$parent.$parent.showItemAll">
63
- <div :class="$parent.$parent.style2" style="margin: 0px">
64
- <role-selector-safe-dep
65
- role-name="安检员"
66
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
67
- @re-res="$parent.$parent.getRes"
68
- @alluser="$parent.$parent.getchecker"
69
- :value.sync="model.f_checker_id"
70
- v-model="model.f_checker_id"
71
- :value-multiple="true"
72
- condition=" f_checker_name in {}">
73
- </role-selector-safe-dep>
74
- </div>
75
-
76
- <div :class="$parent.$parent.style">
77
- <label class="font_normal_body">安检册名称</label>
78
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
79
- :multiple="true" style="width: 60%"
80
- class="select_list select"
81
- :options='$parent.$parent.checkBooks' placeholder='安检册名称'
82
- condition="tcb.id in {}"></v-select>
83
- </div>
84
- <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
85
- <button type="button" class="button_search button_spacing" @click="search()">查询</button>
86
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增安检册</button>
87
- <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">安检册用户管理</button>
88
- <div style="float: right" class="button_spacing"
89
- v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
90
- :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
91
- @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
92
- <!-- <div style="float: right" class="button_spacing"-->
93
- <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
94
- <!-- @click="$parent.$parent.hidden()">-->
95
- <!-- </div>-->
96
- </div>
97
-
98
- </div>
99
-
100
- </div>
101
- </criteria>
102
- <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
103
- <template partial='head'>
104
- <tr>
105
- <th>
106
- <nobr>所属安检员</nobr>
107
- </th>
108
- <th>
109
- <nobr>安检册名称</nobr>
110
- </th>
111
- <!-- <th>-->
112
- <!-- <nobr>安检册类型</nobr>-->
113
- <!-- </th>-->
114
- <th>
115
- <nobr>用户类型</nobr>
116
- </th>
117
- <th>
118
- <nobr>创建日期</nobr>
119
- </th>
120
- <th>
121
- <nobr>创建人</nobr>
122
- </th>
123
- <th>
124
- <nobr>用户数量</nobr>
125
- </th>
126
- <th>
127
- <nobr>已下发</nobr>
128
- </th>
129
- <th>
130
- <nobr>未下发</nobr>
131
- </th>
132
- <th>
133
- <nobr>最后下发时间</nobr>
134
- </th>
135
- <!-- <th>
136
- <nobr>已检</nobr>
137
- </th>
138
- <th>
139
- <nobr>未检</nobr>
140
- </th>-->
141
- <!-- <th v-show="$parent.$parent.$parent.showCaoZuo">-->
142
- <!-- <nobr>操作</nobr>-->
143
- <!-- </th>-->
144
- </tr>
145
- </template>
146
- <template partial='body'>
147
- <td style="text-align: center;">{{ row.f_checker_name }}</td>
148
- <td style="text-align: center;">{{ row.f_check_book_name }}</td>
149
- <!-- <td style="text-align: center;">{{ row.f_check_book_type }}</td>-->
150
- <td style="text-align: center;">{{ row.f_user_type }}</td>
151
- <td style="text-align: center;">{{ row.f_create_date }}</td>
152
- <td style="text-align: center;">{{ row.f_create_person }}</td>
153
- <td style="text-align: center;"><button @click.stop="$parent.$parent.$parent.details(row)" class="btn btn-link"><b>{{row.num}}</b></button></td>
154
- <td style="text-align: center;">{{ row.xiafa }}</td>
155
- <td style="text-align: center;">{{ row.f_user_type =='民用'?row.num-row.xiafa:row.num4-row.xiafa }}</td>
156
- <td style="text-align: center;">{{ row.last_check_time }}</td>
157
- <!-- <td style="text-align: center;">{{ row.yijian }}</td>
158
- <td style="text-align: center;">{{ row.weijian }}</td>-->
159
- <!-- <td v-show="row.f_check_book_type!='小区'" style="text-align: center;"><button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.send(row)'>下发</button></td>-->
160
- </template>
161
- </data-grid>
162
- </criteria-paged>
163
- <modal :show.sync="showModal" :backdrop="false" id="checkbookEntryShow">
164
- <article slot="modal-body" class="modal-body">
165
- <check-book-entry v-if="showModal" @select-changed="selectedEntry" :showtype="showtype"></check-book-entry>
166
- </article>
167
- <footer slot="modal-footer">
168
- </footer>
169
-
170
- </modal>
171
- <modal :show.sync="showSendModal" :backdrop="false" width="90%" height="90%">
172
- <article slot="modal-body" class="modal-body" style="height: 80vh">
173
- <check-book-search-user-list v-if="showSendModal" :row="checkBookRow" :bookrow="checkBookRow" :needprops="needprops":userlogin="userlogin"></check-book-search-user-list>
174
- </article>
175
- <footer slot="modal-footer">
176
- </footer>
177
-
178
- </modal>
179
- </div>
180
- </template>
181
-
182
- <script>
183
- import {PagedList} from 'vue-client'
184
- import {HttpResetClass} from 'vue-client'
185
- import bus from '../../../bus'
186
- export default {
187
- title: '用户安检情况',
188
- data () {
189
- return {
190
- checker_name:'',
191
- showSendModal:false,
192
- searchData: {
193
- condition: '1=1'
194
- },
195
- showCaoZuo:false,
196
- userlogin:{
197
- id:this.$login.f.id,
198
- name:this.$login.f.name,
199
- orgid:this.$login.f.orgid,
200
- orgstr:this.$login.f.orgs,
201
- },
202
- checkBooks:[],
203
- bookTypes: [{label: '全部', value: ''}, {label: '用户', value: '用户'}, {label: '小区', value: '小区'}],
204
- userTypes: [{label: '全部', value: ''}, {label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
205
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '日'}],
206
- showModal:false,
207
- excelHeaders: {
208
-
209
- 'f_userinfo_code': '用户编号',
210
- 'f_user_name': '用户名称',
211
- 'f_user_phone': '用户电话',
212
- 'f_meternumber': '用户表号',
213
- 'f_user_type': '用户类型',
214
- 'f_last_checker': '安检员',
215
- 'f_residential_area': '小区名称',
216
- 'f_address': '地址',
217
- 'f_last_check_date': '安检日期',
218
- 'f_last_check_state': '安检状态',
219
- 'f_last_check_result': '安检结果'
220
- },
221
- model: new PagedList('api/af-safecheck/sql/QueryCheckBook', 20),
222
- checkBookRow:{},
223
- checkBook :{
224
- f_check_book_name: '',
225
- f_run_date: '',
226
- f_around_time: '',
227
- f_around_unit: '',
228
- f_create_date: '',
229
- f_create_person: '',
230
- f_orgid: '',
231
- f_checker_name: ''
232
- }
233
- }
234
- },
235
- props: {
236
- style: {
237
- type: String,
238
- default: 'col-sm-2 form-group'
239
- },
240
- style2: {
241
- type: String,
242
- default: 'col-sm-4 form-group'
243
- },
244
- needprops:{
245
- type: Object,
246
- default:{}
247
- },
248
- showtype:{
249
- type: String
250
- }
251
- },
252
- ready () {
253
- bus.$on('fresh-main',()=>{
254
- console.log("进入方法")
255
- this.$refs.paged.$refs.criteria.search()
256
- })
257
- this.freshCheckBook()
258
- },
259
- beforeDestroy() {
260
- //tag
261
- bus.$off('fresh-main')
262
- },
263
- methods: {
264
- clean(){
265
- this.$refs.paged.$refs.criteria.model.f_checker_id = ''
266
- this.$refs.paged.$refs.criteria.model.f_check_book_id = []
267
- this.$refs.paged.$refs.criteria.$refs.selector.clear()
268
- },
269
- getchecker(val){
270
- this.$refs.paged.$refs.criteria.model.f_checker_id = ''
271
- if(val && val.length > 0){
272
- this.checker_name = ''
273
- val.forEach(user => {
274
- this.checker_name += `'${user.name}',`
275
- })
276
- this.checker_name = this.checker_name.slice(0,this.checker_name.length-1)
277
- }else{
278
- this.checker_name = ''
279
- }
280
- },
281
-
282
- send(row){
283
- console.log(" ",row)
284
- this.checkBookRow = row
285
- this.showSendModal = true
286
- },
287
- freshCheckBook () {
288
- this.checkBooks = []
289
- new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy?pageNo=1&pageSize=9999999`, {
290
- data: {
291
- items: 'id,f_check_book_name',
292
- tablename: 't_check_book',
293
- condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid} and f_user_type ='${this.showtype}' `:`f_user_type ='${this.showtype}'`,
294
- orderitem: 'id desc'
295
- }
296
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
297
- this.checkBooks.push({label: '全部', value: ''})
298
- res.data.forEach(ress => {
299
- this.checkBooks.push({
300
- label: ress.f_check_book_name,
301
- value: ress.id
302
- })
303
- })
304
- })
305
- },
306
- selectedEntry(){
307
- console.log("666666666666666666")
308
- },
309
- details(row){
310
- this.$emit('showdetails' ,row)
311
- },
312
- add(){
313
- this.$emit('addbook')
314
- },
315
- ok (){
316
- //tag
317
- let http = new HttpResetClass()
318
- http.load('POST', 'api/af-safecheck/logic/safeEntity', {data:{tableName:'t_check_book',entityData:this.checkBook}},
319
- {resolveMsg: '更新安检册信息成功', rejectMsg: '保存安检册信息成功'}).then(res=>{
320
- if (res.data.code===200){
321
- this.$showMessage('修改成功')
322
- this.showModal = false
323
- this.checkBook= {}
324
- }
325
- })
326
- },
327
- cancel () {
328
- this.showModal = false
329
- this.checkBook= {}
330
- },
331
- updateCheckBook(val){
332
- this.checkBook=val
333
- this.showModal = true
334
- },
335
- search (args) {
336
- // //tag
337
- // //tag
338
- if(this.checker_name){
339
- args.condition += ` and f_checker_name in (${this.checker_name}) `
340
- }
341
- this.$parent.showItem = false
342
- this.$parent.showItemUser = false
343
- args.condition += ` and f_orgid in ('${this.$login.f.orgid}')`
344
- args.condition += ` and tcb.f_user_type ='${this.showtype}' `
345
- return this.model.search(args.condition, args.model)
346
- },
347
- getRes (obj) {
348
- // this.model.f_filialeids = this.$login.convertToIn(obj.resids)
349
- },
350
- async deleteCheckBook (val) {
351
- try {
352
- //tag
353
- let http = new HttpResetClass()
354
- let upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${val.id}'`
355
- let delCheckBook= `delete from t_check_book where id ='${val.id}'`
356
- await http.load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: upAddress}},
357
- {resolveMsg: null, rejectMsg: '删除安检册失败'})
358
- await http.load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: delCheckBook}},
359
- {resolveMsg: null, rejectMsg: '删除安检册失败'})
360
- this.$showMessage('删除成功')
361
- this.$refs.paged.$refs.criteria.search()
362
- }catch (e) {
363
- this.$showMessage('删除失败',e)
364
- }
365
- }
366
- },
367
-
368
- watch: {
369
- 'model.rows'(val){
370
- console.log("997997",val)
371
- this.showCaoZuo = val.filter(item=>item.f_check_book_type!='小区').length>0
372
- }
373
- },
374
- computed: {
375
- selected () {
376
- return this.$refs.paged.$refs.grid.selected
377
- }
378
- }
379
- }
380
- </script>
381
- <style scoped>
382
- .newcolor {
383
- color: red;
384
- }
385
-
386
- .table th {
387
- background-color: #f2f6fa;
388
- color: black;
389
- }
390
- </style>
391
- <style lang="less">
392
- #checkbookEntryShow {
393
- .modal-dialog {
394
- width: 80%;
395
- }
396
- }
397
- </style>
1
+ <template>
2
+ <div class="flex">
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.search' v-ref:criteria>
5
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
+ <div class="row" v-show="!$parent.$parent.$parent.showItemAll">
7
+ <div :class="$parent.$parent.style2" style="margin: 0px">
8
+ <role-selector-safe-dep
9
+ v-ref:selector
10
+ role-name="安检员"
11
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
12
+ @re-res="$parent.$parent.getRes"
13
+ @alluser="$parent.$parent.getchecker"
14
+ :value.sync="model.f_checker_id"
15
+ v-model="model.f_checker_id"
16
+ :value-multiple="true"
17
+ condition=" f_checker_name in {}">
18
+ >
19
+ </role-selector-safe-dep>
20
+ </div>
21
+ <div :class="$parent.$parent.style">
22
+ <label class="font_normal_body">安检册名称</label>
23
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
24
+ :multiple="true" style="width: 60%"
25
+ class="select_list select"
26
+ :options='$parent.$parent.checkBooks' placeholder='安检册名称'
27
+ condition="tcb.id in {}"></v-select>
28
+ </div>
29
+ <div :class="$parent.$parent.style">
30
+ <label class="font_normal_body">开始时间</label>
31
+ <datepicker
32
+ :value.sync="model.f_check_start"
33
+ placeholder='最后一次下发开始时间'
34
+ style="width: 60%"
35
+ :format="'yyyy-MM-dd 00:00:00'"
36
+ :show-rest-button="reset"
37
+ v-model="model.f_check_start"
38
+ condition="lasttime.last_check_time > '{}'">
39
+ </datepicker>
40
+ </div>
41
+ <div :class="$parent.$parent.style" >
42
+ <label class="font_normal_body">结束时间</label>
43
+ <datepicker
44
+ :value.sync="model.f_check_end"
45
+ placeholder='最后一次下发截止时间'
46
+ style="width: 60%"
47
+ :format="'yyyy-MM-dd 23:59:59'"
48
+ :show-rest-button="reset"
49
+ v-model="model.f_check_end"
50
+ condition="lasttime.last_check_time < '{}'">
51
+ </datepicker>
52
+ </div>
53
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
54
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
55
+ <button type="button" class="button_search button_spacing" @click="$parent.$parent.clean()">重置</button>
56
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增安检册</button>
57
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">安检册用户管理</button>
58
+ <div style="float: right" class="button_spacing"
59
+ v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
60
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
61
+ @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
62
+ </div>
63
+
64
+
65
+ </div>
66
+
67
+
68
+ <div class="row" v-show="$parent.$parent.$parent.showItemAll">
69
+ <div :class="$parent.$parent.style2" style="margin: 0px">
70
+ <role-selector-safe-dep
71
+ role-name="安检员"
72
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
73
+ @re-res="$parent.$parent.getRes"
74
+ @alluser="$parent.$parent.getchecker"
75
+ :value.sync="model.f_checker_id"
76
+ v-model="model.f_checker_id"
77
+ :value-multiple="true"
78
+ condition=" f_checker_name in {}">
79
+ </role-selector-safe-dep>
80
+ </div>
81
+
82
+ <div :class="$parent.$parent.style">
83
+ <label class="font_normal_body">安检册名称</label>
84
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
85
+ :multiple="true" style="width: 60%"
86
+ class="select_list select"
87
+ :options='$parent.$parent.checkBooks' placeholder='安检册名称'
88
+ condition="tcb.id in {}"></v-select>
89
+ </div>
90
+ <div :class="$parent.$parent.style" style="width: auto;margin-top:8px;float: right">
91
+ <button type="button" class="button_search button_spacing" @click="search()">查询</button>
92
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.add()">新增安检册</button>
93
+ <button type="button" class="button_new button_spacing" @click="$parent.$parent.showModal = true">安检册用户管理</button>
94
+ <div style="float: right" class="button_spacing"
95
+ v-show="$parent.$parent.$parent.showItem ||$parent.$parent.$parent.showItemUser"
96
+ :class="{'button_shrink_left':$parent.$parent.$parent.showItemAll,'button_shrink_right':!$parent.$parent.$parent.showItemAll}"
97
+ @click="($parent.$parent.$parent.showItem =false) || ($parent.$parent.$parent.showItemUser =false)"></div>
98
+ <!-- <div style="float: right" class="button_spacing"-->
99
+ <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
100
+ <!-- @click="$parent.$parent.hidden()">-->
101
+ <!-- </div>-->
102
+ </div>
103
+
104
+ </div>
105
+
106
+ </div>
107
+ </criteria>
108
+ <data-grid :model="model" partial="list" class="list_area table_sy" v-ref:grid>
109
+ <template partial='head'>
110
+ <tr>
111
+ <th>
112
+ <nobr>所属安检员</nobr>
113
+ </th>
114
+ <th>
115
+ <nobr>安检册名称</nobr>
116
+ </th>
117
+ <!-- <th>-->
118
+ <!-- <nobr>安检册类型</nobr>-->
119
+ <!-- </th>-->
120
+ <th>
121
+ <nobr>用户类型</nobr>
122
+ </th>
123
+ <th>
124
+ <nobr>创建日期</nobr>
125
+ </th>
126
+ <th>
127
+ <nobr>创建人</nobr>
128
+ </th>
129
+ <th>
130
+ <nobr>用户数量</nobr>
131
+ </th>
132
+ <th>
133
+ <nobr>已下发</nobr>
134
+ </th>
135
+ <th>
136
+ <nobr>未下发</nobr>
137
+ </th>
138
+ <th>
139
+ <nobr>最后下发时间</nobr>
140
+ </th>
141
+ <!-- <th>
142
+ <nobr>已检</nobr>
143
+ </th>
144
+ <th>
145
+ <nobr>未检</nobr>
146
+ </th>-->
147
+ <!-- <th v-show="$parent.$parent.$parent.showCaoZuo">-->
148
+ <!-- <nobr>操作</nobr>-->
149
+ <!-- </th>-->
150
+ </tr>
151
+ </template>
152
+ <template partial='body'>
153
+ <td style="text-align: center;">{{ row.f_checker_name }}</td>
154
+ <td style="text-align: center;">{{ row.f_check_book_name }}</td>
155
+ <!-- <td style="text-align: center;">{{ row.f_check_book_type }}</td>-->
156
+ <td style="text-align: center;">{{ row.f_user_type }}</td>
157
+ <td style="text-align: center;">{{ row.f_create_date }}</td>
158
+ <td style="text-align: center;">{{ row.f_create_person }}</td>
159
+ <td style="text-align: center;"><button @click.stop="$parent.$parent.$parent.details(row)" class="btn btn-link"><b>{{row.num}}</b></button></td>
160
+ <td style="text-align: center;">{{ row.xiafa }}</td>
161
+ <td style="text-align: center;">{{ row.f_user_type =='民用'?row.num-row.xiafa:row.num4-row.xiafa }}</td>
162
+ <td style="text-align: center;">{{ row.last_check_time }}</td>
163
+ <!-- <td style="text-align: center;">{{ row.yijian }}</td>
164
+ <td style="text-align: center;">{{ row.weijian }}</td>-->
165
+ <!-- <td v-show="row.f_check_book_type!='小区'" style="text-align: center;"><button class="button_spacing button_search-1" @click.stop='$parent.$parent.$parent.send(row)'>下发</button></td>-->
166
+ </template>
167
+ </data-grid>
168
+ </criteria-paged>
169
+ <modal :show.sync="showModal" :backdrop="false" id="checkbookEntryShow">
170
+ <article slot="modal-body" class="modal-body">
171
+ <check-book-entry v-if="showModal" @select-changed="selectedEntry" :showtype="showtype"></check-book-entry>
172
+ </article>
173
+ <footer slot="modal-footer">
174
+ </footer>
175
+
176
+ </modal>
177
+ <modal :show.sync="showSendModal" :backdrop="false" width="90%" height="90%">
178
+ <article slot="modal-body" class="modal-body" style="height: 80vh">
179
+ <check-book-search-user-list v-if="showSendModal" :row="checkBookRow" :bookrow="checkBookRow" :needprops="needprops":userlogin="userlogin"></check-book-search-user-list>
180
+ </article>
181
+ <footer slot="modal-footer">
182
+ </footer>
183
+
184
+ </modal>
185
+ </div>
186
+ </template>
187
+
188
+ <script>
189
+ import {PagedList} from 'vue-client'
190
+ import {HttpResetClass} from 'vue-client'
191
+ import bus from '../../../bus'
192
+ export default {
193
+ title: '用户安检情况',
194
+ data () {
195
+ return {
196
+ checker_name:'',
197
+ showSendModal:false,
198
+ searchData: {
199
+ condition: '1=1'
200
+ },
201
+ showCaoZuo:false,
202
+ userlogin:{
203
+ id:this.$login.f.id,
204
+ name:this.$login.f.name,
205
+ orgid:this.$login.f.orgid,
206
+ orgstr:this.$login.f.orgs,
207
+ },
208
+ checkBooks:[],
209
+ bookTypes: [{label: '全部', value: ''}, {label: '用户', value: '用户'}, {label: '小区', value: '小区'}],
210
+ userTypes: [{label: '全部', value: ''}, {label: '民用', value: '民用'}, {label: '非民用', value: '非民用'}],
211
+ aroundUnit: [{label: '', value: ''}, {label: '月', value: '月'}, {label: '日', value: '日'}],
212
+ showModal:false,
213
+ excelHeaders: {
214
+
215
+ 'f_userinfo_code': '用户编号',
216
+ 'f_user_name': '用户名称',
217
+ 'f_user_phone': '用户电话',
218
+ 'f_meternumber': '用户表号',
219
+ 'f_user_type': '用户类型',
220
+ 'f_last_checker': '安检员',
221
+ 'f_residential_area': '小区名称',
222
+ 'f_address': '地址',
223
+ 'f_last_check_date': '安检日期',
224
+ 'f_last_check_state': '安检状态',
225
+ 'f_last_check_result': '安检结果'
226
+ },
227
+ model: new PagedList('api/af-safecheck/sql/QueryCheckBook', 20),
228
+ checkBookRow:{},
229
+ checkBook :{
230
+ f_check_book_name: '',
231
+ f_run_date: '',
232
+ f_around_time: '',
233
+ f_around_unit: '',
234
+ f_create_date: '',
235
+ f_create_person: '',
236
+ f_orgid: '',
237
+ f_checker_name: ''
238
+ }
239
+ }
240
+ },
241
+ props: {
242
+ style: {
243
+ type: String,
244
+ default: 'col-sm-2 form-group'
245
+ },
246
+ style2: {
247
+ type: String,
248
+ default: 'col-sm-4 form-group'
249
+ },
250
+ needprops:{
251
+ type: Object,
252
+ default:{}
253
+ },
254
+ showtype:{
255
+ type: String
256
+ }
257
+ },
258
+ ready () {
259
+ bus.$on('fresh-main',()=>{
260
+ console.log("进入方法")
261
+ this.$refs.paged.$refs.criteria.search()
262
+ })
263
+ this.freshCheckBook()
264
+ },
265
+ beforeDestroy() {
266
+ //tag
267
+ bus.$off('fresh-main')
268
+ },
269
+ methods: {
270
+ clean(){
271
+ this.$refs.paged.$refs.criteria.model.f_checker_id = ''
272
+ this.$refs.paged.$refs.criteria.model.f_check_book_id = []
273
+ this.$refs.paged.$refs.criteria.$refs.selector.clear()
274
+ },
275
+ getchecker(val){
276
+ this.$refs.paged.$refs.criteria.model.f_checker_id = ''
277
+ if(val && val.length > 0){
278
+ this.checker_name = ''
279
+ val.forEach(user => {
280
+ this.checker_name += `'${user.name}',`
281
+ })
282
+ this.checker_name = this.checker_name.slice(0,this.checker_name.length-1)
283
+ }else{
284
+ this.checker_name = ''
285
+ }
286
+ },
287
+
288
+ send(row){
289
+ console.log(" ",row)
290
+ this.checkBookRow = row
291
+ this.showSendModal = true
292
+ },
293
+ freshCheckBook () {
294
+ this.checkBooks = []
295
+ new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy?pageNo=1&pageSize=9999999`, {
296
+ data: {
297
+ items: 'id,f_check_book_name',
298
+ tablename: 't_check_book',
299
+ condition: this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid} and f_user_type ='${this.showtype}' `:`f_user_type ='${this.showtype}'`,
300
+ orderitem: 'id desc'
301
+ }
302
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
303
+ this.checkBooks.push({label: '全部', value: ''})
304
+ res.data.forEach(ress => {
305
+ this.checkBooks.push({
306
+ label: ress.f_check_book_name,
307
+ value: ress.id
308
+ })
309
+ })
310
+ })
311
+ },
312
+ selectedEntry(){
313
+ console.log("666666666666666666")
314
+ },
315
+ details(row){
316
+ this.$emit('showdetails' ,row)
317
+ },
318
+ add(){
319
+ this.$emit('addbook')
320
+ },
321
+ ok (){
322
+ //tag
323
+ let http = new HttpResetClass()
324
+ http.load('POST', 'api/af-safecheck/logic/safeEntity', {data:{tableName:'t_check_book',entityData:this.checkBook}},
325
+ {resolveMsg: '更新安检册信息成功', rejectMsg: '保存安检册信息成功'}).then(res=>{
326
+ if (res.data.code===200){
327
+ this.$showMessage('修改成功')
328
+ this.showModal = false
329
+ this.checkBook= {}
330
+ }
331
+ })
332
+ },
333
+ cancel () {
334
+ this.showModal = false
335
+ this.checkBook= {}
336
+ },
337
+ updateCheckBook(val){
338
+ this.checkBook=val
339
+ this.showModal = true
340
+ },
341
+ search (args) {
342
+ // //tag
343
+ // //tag
344
+ if(this.checker_name){
345
+ args.condition += ` and f_checker_name in (${this.checker_name}) `
346
+ }
347
+ this.$parent.showItem = false
348
+ this.$parent.showItemUser = false
349
+ args.condition += ` and f_orgid in ('${this.$login.f.orgid}')`
350
+ args.condition += ` and tcb.f_user_type ='${this.showtype}' `
351
+ return this.model.search(args.condition, args.model)
352
+ },
353
+ getRes (obj) {
354
+ // this.model.f_filialeids = this.$login.convertToIn(obj.resids)
355
+ },
356
+ async deleteCheckBook (val) {
357
+ try {
358
+ //tag
359
+ let http = new HttpResetClass()
360
+ let upAddress = `update t_user_address set f_check_book_id = null where f_check_book_id = '${val.id}'`
361
+ let delCheckBook= `delete from t_check_book where id ='${val.id}'`
362
+ await http.load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: upAddress}},
363
+ {resolveMsg: null, rejectMsg: '删除安检册失败'})
364
+ await http.load('POST', 'api/af-safecheck/logic/runSQL', {data: {sql: delCheckBook}},
365
+ {resolveMsg: null, rejectMsg: '删除安检册失败'})
366
+ this.$showMessage('删除成功')
367
+ this.$refs.paged.$refs.criteria.search()
368
+ }catch (e) {
369
+ this.$showMessage('删除失败',e)
370
+ }
371
+ }
372
+ },
373
+
374
+ watch: {
375
+ 'model.rows'(val){
376
+ console.log("997997",val)
377
+ this.showCaoZuo = val.filter(item=>item.f_check_book_type!='小区').length>0
378
+ }
379
+ },
380
+ computed: {
381
+ selected () {
382
+ return this.$refs.paged.$refs.grid.selected
383
+ }
384
+ }
385
+ }
386
+ </script>
387
+ <style scoped>
388
+ .newcolor {
389
+ color: red;
390
+ }
391
+
392
+ .table th {
393
+ background-color: #f2f6fa;
394
+ color: black;
395
+ }
396
+ </style>
397
+ <style lang="less">
398
+ #checkbookEntryShow {
399
+ .modal-dialog {
400
+ width: 80%;
401
+ }
402
+ }
403
+ </style>