safecheck-client 4.0.1-94 → 4.0.1-97

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,770 +1,770 @@
1
- <template>
2
- <div>
3
- <criteria-paged :model="model" v-ref:paged>
4
- <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
- <div partial>
6
- <div class="row " >
7
- <label class="form-group font_normal_body"><b>用户信息</b></label>
8
-
9
- <div class="form-group col-sm-1" >
10
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
- style="width: 95%" placeholder="客户编号" condition="ui.f_userinfo_code='{}'">
12
- </div>
13
- <div class="form-group col-sm-1" >
14
- <input type="text" class="input_search" v-model="model.f_user_name"
15
- style="width: 95%" placeholder="用户姓名" condition="ui.f_user_name like '%{}%'">
16
- </div>
17
- <div class="form-group col-sm-1" >
18
- <input type="text" class="input_search" v-model="model.f_meternumber"
19
- style="width: 95%" placeholder="表号" condition="uf.f_meternumber like '%{}%'">
20
- </div>
21
- <div class="form-group col-sm-1" >
22
- <input type="text" class="input_search" v-model="model.f_address"
23
- style="width: 95%" placeholder="客户地址" condition="ua.f_address like '%{}%'">
24
- </div>
25
- <div class="form-group col-sm-1 upuserinfo_sel" >
26
- <v-select
27
- class="select select_list"
28
- :width="'95%'"
29
- :value.sync="model.f_area"
30
- v-model="model.f_area"
31
- :options='$parent.$parent.areaList'
32
- :timeout="500"
33
- @select-search="$parent.$parent.select_search"
34
- placeholder='小区选择'
35
- condition="ua.f_residential_area = '{}'"
36
- close-on-select
37
- value-single
38
- >
39
- </v-select>
40
- </div>
41
- <div class="form-group col-sm-1 upuserinfo_sel" >
42
- <v-select v-model="model.f_meter_book_num"
43
- :multiple="true" :options='$parent.$parent.checkBooks'
44
- :value.sync="model.f_meter_book_num"
45
- class="select select_list"
46
- @select-search="$parent.$parent.select_book"
47
- :width="'95%'"
48
- :timeout="500"
49
- placeholder='安检册选择'
50
- condition="ua.f_check_book_id in {}" >
51
- </v-select>
52
-
53
- </div>
54
- <div class="form-group col-sm-4" >
55
- <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.showUserCondition()">更多条件</button>
56
- <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.showUploadCodeCondition()">导入编号</button>
57
- <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.clearUserInfoId()">清空编号</button>
58
- <button class="button_search" style="margin-right: 10px" @click="search()">查询</button>
59
- <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.clearcon()">重置</button>
60
- </div>
61
- <div class="form-group col-sm-1" style="float: right">
62
- <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.dragtoPlanItem()">添入计划</button>
63
- </div>
64
- <modal :show.sync="$parent.$parent.showCondtion" v-ref:modal :width="'50%'" :backdrop="false">
65
- <div slot="modal-header" class="modal-header">
66
- <h4 class="modal-title">
67
- 用户查询条件
68
- </h4>
69
- </div>
70
- <div slot="modal-body" class="modal-body">
71
- <div class="row">
72
- <div class="form-group col-sm-4" >
73
- <label class="font_normal_body">用户类型:</label>
74
- <v-select
75
- class="select select_list"
76
- :value.sync="model.f_user_type"
77
- v-model="model.f_user_type"
78
- :options='$parent.$parent.userTypes'
79
- placeholder='请选择'
80
- condition="uf.f_user_type='{}'"
81
- :search="false"
82
- close-on-select
83
- value-single
84
- >
85
- </v-select>
86
- </div>
87
- <div class="form-group col-sm-4" >
88
- <label class="font_normal_body">用户状态:</label>
89
- <v-select
90
- class="select select_list"
91
- :value.sync="model.f_user_state"
92
- v-model="model.f_user_state"
93
- :options='$parent.$parent.userStates'
94
- placeholder='请选择'
95
- condition="ui.f_user_state='{}'"
96
- :search="false"
97
- close-on-select
98
- value-single
99
- >
100
- </v-select>
101
- </div>
102
- <div class="form-group col-sm-4" >
103
- <label class="font_normal_body">用气性质:</label>
104
- <v-select
105
- class="select select_list"
106
- :value.sync="model.f_gasproperties"
107
- v-model="model.f_gasproperties"
108
- :options='$parent.$parent.gasproperties'
109
- placeholder='请选择'
110
- condition="uf.f_gasproperties='{}'"
111
- :search="false"
112
- close-on-select
113
- value-single
114
- >
115
- </v-select>
116
- </div>
117
- <div class="form-group col-sm-4" >
118
- <label class="font_normal_body">气表类型:</label>
119
- <v-select
120
- class="select select_list"
121
- :value.sync="model.meter_classify"
122
- v-model="model.meter_classify"
123
- :options='$parent.$parent.meter_classifys'
124
- placeholder='请选择'
125
- condition="uf.F_METER_CLASSIFY='{}'"
126
- :search="false"
127
- close-on-select
128
- value-single
129
- >
130
- </v-select>
131
- </div>
132
- <div class="form-group col-sm-4" >
133
- <label class="font_normal_body">街&emsp;&emsp;道:</label>
134
- <v-select
135
- class="select select_list"
136
- :value.sync="model.f_street"
137
- v-model="model.f_street"
138
- :options='$parent.$parent.streets'
139
- placeholder='请选择'
140
- condition="ua.f_street_id='{}'"
141
- close-on-select
142
- value-single
143
- >
144
- </v-select>
145
- </div>
146
- <div class="form-group col-sm-4" >
147
- <label class="font_normal_body">楼&ensp;栋&ensp;号:</label>
148
- <input type="text" class="input_search" v-model="model.f_building"
149
- style="width: 60%" placeholder="请选择" condition="ua.f_building='{}'">
150
- </div>
151
- <div class="form-group col-sm-4" >
152
- <label class="font_normal_body">单&ensp;元&ensp;号:</label>
153
- <input type="text" class="input_search" v-model="model.f_unit"
154
- style="width: 60%" placeholder="请选择" condition="ua.f_unit='{}'">
155
- </div>
156
- <div class="form-group col-sm-4" >
157
- <label class="font_normal_body">楼&ensp;层&ensp;号:</label>
158
- <input type="text" class="input_search" v-model="model.f_floor"
159
- style="width: 60%" placeholder="请选择" condition="ua.f_floor='{}'">
160
- </div>
161
- <div class="form-group col-sm-4" >
162
- <label class="font_normal_body">开户起始:</label>
163
- <datepicker
164
- placeholder='请选择'
165
- style="width:60%"
166
- :disabled-days-of-week="[]"
167
- :format="'yyyy-MM-dd'"
168
- :show-rest-button="reset"
169
- :value.sync="model.f_startfile_time"
170
- v-model="model.f_startfile_time"
171
- condition="ui.f_createfile_date >= '{} 00:00:00'">
172
- </datepicker>
173
- </div>
174
- <div class="form-group col-sm-4" >
175
- <label class="font_normal_body">开户截止:</label>
176
- <datepicker
177
- placeholder='请选择'
178
- :disabled-days-of-week="[]"
179
- style="width:60%"
180
- :format="'yyyy-MM-dd'"
181
- :show-rest-button="reset"
182
- :value.sync="model.f_endfile_time"
183
- v-model="model.f_endfile_time"
184
- condition="ui.f_createfile_date <= '{} 23:59:59'">
185
- </datepicker>
186
- </div>
187
- <div class="form-group col-sm-4" >
188
- <label class="font_normal_body">表&ensp;箱&ensp;号:</label>
189
- <input type="text" class="input_search" v-model="model.f_metertitles"
190
- style="width: 60%" placeholder="请输入" condition="uf.f_metertitles='{}'">
191
- </div>
192
- <div class="form-group col-sm-4" >
193
- <label class="font_normal_body">用户电话:</label>
194
- <input type="text" class="input_search" v-model="model.f_user_phone"
195
- style="width: 60%" placeholder="请输入" condition="ui.f_user_phone='{}'">
196
- </div>
197
- <div class="form-group col-sm-4" >
198
- <label class="font_normal_body">片&ensp;&ensp;&ensp;&ensp;区:</label>
199
- <v-select
200
- class="select select_list"
201
- :value.sync="model.f_book_slice_area"
202
- v-model="model.f_book_slice_area"
203
- :options='$parent.$parent.sliceArea'
204
- @change="$parent.$parent.slice_areaChange(model.f_book_slice_area)"
205
- placeholder='请选择'
206
- condition="ua.f_slice_area ='{}'"
207
- close-on-select
208
- value-single
209
- >
210
- </v-select>
211
- </div>
212
- <div class="form-group col-sm-4" >
213
- <label class="font_normal_body">派发情况:</label>
214
- <v-select
215
- class="select select_list"
216
- :value.sync="model.yearCheck"
217
- v-model="model.yearCheck"
218
- :options='$parent.$parent.yearCheckList'
219
- placeholder='请选择'
220
- condition="{}"
221
- :search="false"
222
- close-on-select
223
- value-single
224
- >
225
- </v-select>
226
- </div>
227
- <div class="form-group col-sm-4" >
228
- <label class="font_normal_body">安检起始:</label>
229
- <datepicker
230
- placeholder='请选择'
231
- style="width:60%"
232
- :disabled-days-of-week="[]"
233
- :format="'yyyy-MM-dd'"
234
- :show-rest-button="reset"
235
- :value.sync="model.f_start_time"
236
- v-model="model.f_start_time"
237
- >
238
- </datepicker>
239
- </div>
240
- <div class="form-group col-sm-4" >
241
- <label class="font_normal_body">安检截止:</label>
242
- <datepicker
243
- placeholder='请选择'
244
- :disabled-days-of-week="[]"
245
- style="width:60%"
246
- :format="'yyyy-MM-dd'"
247
- :show-rest-button="reset"
248
- :value.sync="model.f_end_time"
249
- v-model="model.f_end_time"
250
- >
251
- </datepicker>
252
- </div>
253
- <div class="form-group col-sm-4">
254
- <label class="font_normal_body">安检状态:</label>
255
- <v-select
256
- class="select select_list"
257
- :value.sync="model.f_last_check_state"
258
- v-model="model.f_last_check_state"
259
- :options='$parent.$parent.entry_status'
260
- placeholder='请选择'
261
- :search="false"
262
- close-on-select
263
- value-single
264
- >
265
- </v-select>
266
- </div>
267
- <div class="form-group col-sm-4" >
268
- <label class="font_normal_body">通气起始:</label>
269
- <datepicker
270
- placeholder='通气开始时间'
271
- style="width:60%"
272
- :disabled-days-of-week="[]"
273
- :format="'yyyy-MM-dd'"
274
- :show-rest-button="reset"
275
- :value.sync="model.f_startgas_time"
276
- v-model="model.f_startgas_time"
277
- condition="ui.f_uservent_date >= '{} 00:00:00'">
278
- </datepicker>
279
- </div>
280
- <div class="form-group col-sm-4" >
281
- <label class="font_normal_body">通气截止:</label>
282
- <datepicker
283
- placeholder='通气结束时间'
284
- :disabled-days-of-week="[]"
285
- style="width:60%"
286
- :format="'yyyy-MM-dd'"
287
- :show-rest-button="reset"
288
- :value.sync="model.f_endgas_time"
289
- v-model="model.f_endgas_time"
290
- condition="ui.f_uservent_date <= '{} 23:59:59'">
291
- </datepicker>
292
- </div>
293
- </div>
294
- </div>
295
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
296
- <button class="button_search" style="margin-right: 15px" @click="search()">查询</button>
297
- <button class="button_search" @click="$parent.$parent.cancel">取消</button>
298
- </div>
299
- </modal>
300
- <modal :show.sync="$parent.$parent.excelUserCondtion" width="500px" v-ref:modal1 >
301
- <div slot="modal-header" class="modal-header">
302
- <h4 class="modal-title">
303
- 导入用户编号
304
- </h4>
305
- </div>
306
- <div slot="modal-body" class="modal-body">
307
- <div class="row">
308
- <file-upload class="my-file-uploader " name="UploadFile" class="btn btn-success" style="border-radius: 2px;"
309
- action="rs/file/uploadFile" tagname="档案信息导入" v-ref:file :headers="headers" multiple></file-upload>
310
- <img src="../../../assets/Excelformat.png" style="width: 100%"/>
311
- </div>
312
- </div>
313
- <footer slot="modal-footer" class="modal-footer">
314
- </footer>
315
- </modal>
316
- </div>
317
- </div>
318
- </criteria>
319
- <data-grid :model="model" partial='list' class="table_sy">
320
-
321
- <template partial='head'>
322
- <tr>
323
- <th><nobr><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.checkAll" @change="$parent.$parent.$parent.setCheckAll()"/> 全选</nobr></th>
324
- <th><nobr>用户编号</nobr></th>
325
- <th><nobr>用户名称</nobr></th>
326
- <th><nobr>用户类型</nobr></th>
327
- <th><nobr>用户电话</nobr></th>
328
- <th><nobr>表具类型</nobr></th>
329
- <th><nobr>表号</nobr></th>
330
- <th><nobr>小区名称</nobr></th>
331
- <th><nobr>片区</nobr></th>
332
- <th><nobr>安检册</nobr></th>
333
- <th title="当前所在的安检计划名称"><nobr>所属计划</nobr></th>
334
- <th title="最后一次安检日期"><nobr>安检日期</nobr></th>
335
- <th><nobr>首次通气时间</nobr></th>
336
- <th><nobr>详细地址</nobr></th>
337
- </tr>
338
- </template>
339
- <template partial='body'>
340
- <td style="text-align: center;white-space:nowrap;"><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.isChecked(row.id)" @change="$parent.$parent.$parent.setCheckes(row.id)" /></td>
341
- <td style="text-align: center"><nobr>{{row.f_userinfo_code}}</nobr></td>
342
- <td style="text-align: center"><nobr>{{row.f_user_name}}</nobr></td>
343
- <td style="text-align: center"><nobr>{{row.f_user_type}}</nobr></td>
344
- <td style="text-align: center"><nobr>{{row.f_user_phone}}</nobr></td>
345
- <td style="text-align: center"><nobr>{{row.f_meter_classify}}</nobr></td>
346
- <td style="text-align: center"><nobr>{{row.f_meternumber}}</nobr></td>
347
- <td style="text-align: center"><nobr>{{row.f_residential_area}}</nobr></td>
348
- <td style="text-align: center"><nobr>{{row.f_book_slice_area}}</nobr></td>
349
- <td style="text-align: center"><nobr>{{row.f_book_name}}</nobr></td>
350
- <td style="text-align: center"><nobr>{{row.f_plan_name}}</nobr></td>
351
- <td style="text-align: center"><nobr>{{row.f_last_check_date}}</nobr></td>
352
- <td style="text-align: center"><nobr>{{row.f_uservent_date}}</nobr></td>
353
- <td style="text-align: center"><nobr>{{row.f_address}}</nobr></td>
354
- </template>
355
- </data-grid>
356
- </criteria-paged>
357
- </div>
358
- </template>
359
-
360
- <script>
361
- import {HttpResetClass, PagedList} from "vue-client";
362
- import Vue from "vue";
363
-
364
- export default {
365
- name: "PlanManage",
366
- title: '计划管理',
367
- data() {
368
- return {
369
- model:new PagedList('/api/af-safecheck/sql/FetchUserFileByOrgNoRuHuSXQ', 100, {
370
- "orderitem": "'f_residential_area,f_building,f_unit,f_floor,f_room'",
371
- "f_usertype": "''",
372
- "month": "''",
373
- "SafeCheckSX": {"f_check_start": '', "f_check_end": ''},
374
- "SafeCheckCQ": "''",
375
- "startday":"''",
376
- "endday":"''"}),
377
- a:'1',
378
- opt:[{label:"测试",value:"测试"}],
379
- showCondtion:false,
380
- userTypes:[],//用户类型
381
- userStates:[],//用户状态
382
- gasproperties:[],//用气性质
383
- meter_classifys:[],//气表类型
384
- hasHousehold:[{label:"全部",value:""},{label:"已入户",value:"已入户"},{label:"未入户",value:"未入户"}],
385
- yearCheckList:[{label:"全部",value:""},{label:"已在计划中",value:"ua.f_plan_id is not null"},{label:"未在计划中",value:"ua.f_plan_id is null"}],
386
- entry_status: this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
387
- sliceArea:[],
388
- meterbooks:[],
389
- checkBooks:[],
390
- cbc:[],
391
- areaList:[],
392
- checkAll:false,
393
- checkes:[],
394
- excelUserCondtion:false,
395
- uploadCodeCondition:'',
396
- streets:[]
397
- }
398
- },
399
- props:["selectplan","userlogin"],
400
- ready(){
401
- this.getCheckBook()
402
- this.setConList()
403
- this.loadpage()
404
- document.addEventListener('keydown', this.handleEnter, true);
405
- },
406
- methods: {
407
- clearcon(){
408
- this.$refs.paged.$refs.criteria.model.f_userinfo_code = ''
409
- this.$refs.paged.$refs.criteria.model.f_meternumber = ''
410
- this.$refs.paged.$refs.criteria.model.f_address = ''
411
- this.$refs.paged.$refs.criteria.model.f_area = ''
412
- this.$refs.paged.$refs.criteria.model.f_meter_book_num = []
413
- this.$refs.paged.$refs.criteria.model.f_user_type = ''
414
- this.$refs.paged.$refs.criteria.model.f_user_state = ''
415
- this.$refs.paged.$refs.criteria.model.f_gasproperties = ''
416
- this.$refs.paged.$refs.criteria.model.meter_classify = ''
417
- this.$refs.paged.$refs.criteria.model.f_street = ''
418
- this.$refs.paged.$refs.criteria.model.f_building = ''
419
- this.$refs.paged.$refs.criteria.model.f_unit = ''
420
- this.$refs.paged.$refs.criteria.model.f_floor = ''
421
- this.$refs.paged.$refs.criteria.model.f_startfile_time = ''
422
- this.$refs.paged.$refs.criteria.model.f_endfile_time = ''
423
- this.$refs.paged.$refs.criteria.model.f_metertitles = ''
424
- this.$refs.paged.$refs.criteria.model.f_user_phone = ''
425
- this.$refs.paged.$refs.criteria.model.f_book_slice_area = ''
426
- this.$refs.paged.$refs.criteria.model.yearCheck = ''
427
- this.$refs.paged.$refs.criteria.model.f_start_time = ''
428
- this.$refs.paged.$refs.criteria.model.f_end_time = ''
429
- this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
430
- this.$refs.paged.$refs.criteria.model.f_startgas_time = ''
431
- this.$refs.paged.$refs.criteria.model.f_endgas_time = ''
432
- this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
433
- this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
434
- },
435
- handleEnter(e) {
436
- if (e.key === 'Enter') {
437
- this.$refs.paged.$refs.criteria.search()
438
- }
439
- },
440
- getCheckBook(){
441
- this.checkBooks=[]
442
- new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy?pageNo=1&pageSize=1000`, {
443
- data: {
444
- items: 'id,f_check_book_name,f_check_book_type',
445
- tablename: 't_check_book',
446
- condition: `f_orgid = '${this.userlogin.orgid}'`,
447
- orderitem: 'id desc'
448
- }
449
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
450
- res.data.forEach(ress => {
451
- this.checkBooks.push({
452
- label: ress.f_check_book_name,
453
- value: ress.id
454
- })
455
- })
456
- })
457
- },
458
- loadpage(){
459
- this.select_search()
460
- this.select_street()
461
- this.Mreadibook()
462
- this.getSliceArea()
463
- },
464
- cancel(){
465
- this.showCondtion=false
466
- this.excelUserCondtion=false
467
- },
468
- //清空用户编号
469
- clearUserInfoId(){
470
- this.uploadCodeCondition=''
471
- Vue.showMessage("已清空用户编号")
472
- },
473
- showUploadCodeCondition(){
474
- this.excelUserCondtion=true
475
- },
476
- selfSearch (args) {
477
- //tag)
478
- args.condition += ` and ui.f_filialeid='${this.userlogin.orgid}'`
479
-
480
- if (args.model.f_last_check_state == '未检') {
481
- let nocheckcon = 'and ( ui.f_last_check_date is null '
482
- if(args.model.f_start_time){
483
- nocheckcon += ` or ui.f_last_check_date <='${args.model.f_start_time} 00:00:00' `
484
- }
485
- if(args.model.f_end_time){
486
- nocheckcon += ` or ui.f_last_check_date >='${args.model.f_end_time} 23:59:59' `
487
- }
488
- nocheckcon += ')'
489
- args.condition += nocheckcon
490
- }else{
491
- if(args.model.f_last_check_state){
492
- args.condition += ` and ui.f_last_check_state = '${args.model.f_last_check_state}'`
493
- }
494
- if(args.model.f_start_time){
495
- args.condition += ` and ui.f_last_check_date >='${args.model.f_start_time} 00:00:00' `
496
- }
497
- if(args.model.f_end_time){
498
- args.condition += ` and ui.f_last_check_date <='${args.model.f_end_time} 23:59:59' `
499
- }
500
- }
501
-
502
- if(args.model.checkBook){
503
- let arr=args.model.checkBook.split('-')
504
- if(arr[1] == '用户'){
505
- args.condition +=` and ua.f_check_book_id='${arr[0]}'`
506
- }else{
507
- args.condition +=` and area.f_check_book_id=${arr[0]} and ua.f_check_book_id is null`
508
- }
509
- }
510
- if(this.uploadCodeCondition){
511
- args.condition +=` and ${this.uploadCodeCondition}`
512
- }
513
- this.cancel()
514
- this.checkes=[]
515
- this.checkAll=false
516
- this.model.search(args.condition, args.model, args.condValue)
517
- },
518
- showUserCondition(){
519
- this.showCondtion=true
520
- },
521
- setConList(){
522
- this.userTypes=this.$appdata.getParam('用户类型') ? [{
523
- label: '全部',
524
- value: ''
525
- }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
526
-
527
- this.userStates=this.$appdata.getParam('安检用户状态') ? [{
528
- label: '全部',
529
- value: ''
530
- },...this.$appdata.getParam('安检用户状态')] : [{label: '全部', value: ''}]
531
- this.gasproperties=this.$appdata.getParam('用气性质') ? [{
532
- label: '全部',
533
- value: ''
534
- }, ...this.$appdata.getParam('用气性质')] : [{label: '全部', value: ''}]
535
- this.meter_classifys=this.$appdata.getParam('气表类型') ? [{
536
- label: '全部',
537
- value: ''
538
- }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
539
- },
540
- select_search(text){
541
- //tag
542
- let pcdText=text?` and f_residential_area like '%${text}%'`:''
543
- new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data:{items:"*",tablename:"t_area",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}' ${pcdText} `}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
544
- //tag)
545
- if(res.data.length>0){
546
- this.areaList=[]
547
- this.areaList.push({label:"全部",value:""})
548
- res.data.forEach((result)=>{
549
- this.areaList.push({label:result.f_residential_area,value:result.f_residential_area})
550
- })
551
- }
552
- //tag)
553
- })
554
- },
555
- select_book(text){
556
- //tag
557
- let pcdText=text?` and f_check_book_name like '%${text}%'`:''
558
- new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data:{items:"*",tablename:"t_check_book",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}' ${pcdText} `}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
559
- //tag)
560
- if(res.data.length>0){
561
- this.checkBooks = []
562
- res.data.forEach((result)=>{
563
- this.checkBooks.push({label:result.f_check_book_name,value:result.id})
564
- })
565
- }
566
- //tag)
567
- })
568
- },
569
- select_street(){
570
- //tag
571
- new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data:{items:"id,f_street",tablename:"t_street",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}'`}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
572
- //tag)
573
- if(res.data.length>0){
574
- this.streets=[]
575
- this.streets.push({label:"全部",value:""})
576
- res.data.forEach((result)=>{
577
- this.streets.push({label:result.f_street,value:result.id})
578
- })
579
- }
580
- })
581
- },
582
- //获取安检册
583
- async Mreadibook(){
584
- this.cbc=[]
585
- this.sliceArea=[]
586
- let http = new HttpResetClass()
587
- let getMeterReadingBooks = await http.load('POST','api/af-safecheck/logic/getMeterBooksData',
588
- {data: {f_orgid: "('"+this.userlogin.orgid+"')"}},
589
- {resolveMsg: null, rejectMsg: '获取失败!!!'})
590
- this.cbc = [{label: '全部', value: ''}]
591
- //tag
592
- //tag)
593
- //tag
594
- this.meterbooks=[]
595
- this.meterbooks=getMeterReadingBooks.data.meterbooks
596
- this.meterbooks.forEach((res) => {
597
- this.cbc.push({label: res.f_book_name, value: res.id})
598
- /*if(res.f_book_slice_area){
599
- if(this.sliceArea.indexOf(res.f_book_slice_area)<0){
600
- this.sliceArea.push(res.f_book_slice_area)
601
- }
602
- }*/
603
- })
604
-
605
- },
606
- //片区获取
607
- async getSliceArea() {
608
- let http = new HttpResetClass()
609
- let getAllArea = await http.load('POST', '/rs/search', {
610
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
611
- userid: this.userlogin.id
612
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
613
- this.sliceArea = [{label: '全部', value: ''}]
614
- //tag
615
- //tag
616
- //tag
617
- getAllArea.data.forEach((res) => {
618
- if(res.parentid==this.userlogin.orgid){
619
- this.sliceArea.push({label:res.name,value:res.name})
620
- }
621
- })
622
- //tag
623
- },
624
- //片区改变-对应安检册下拉重新赋值
625
- slice_areaChange(value) {
626
- //tag
627
- if(!value){
628
- this.cbc=[]
629
- this.meterbooks.forEach((res) => {
630
- this.cbc.push({label: res.f_book_name, value: res.id})
631
- })
632
- }else{
633
- this.cbc=[]
634
- this.meterbooks.forEach((res) => {
635
- if(res.f_book_slice_area==value){
636
- this.cbc.push({label: res.f_book_name, value: res.id})
637
- }
638
- })
639
- }
640
- },
641
- isChecked(v) {
642
- // 如果全选,不在的按选中算,否则,在的按选中算
643
- if (this.checkAll) {
644
- return this.checkes.indexOf(v) == -1
645
- } else {
646
- return this.checkes.indexOf(v) != -1
647
- }
648
- },
649
- setCheckAll() {
650
- this.checkAll=this.checkAll?false:true;
651
- // 全选改变后,清空选中数据
652
- this.checkes = []
653
- },
654
- setCheckes(id) {
655
- let index=this.checkes.indexOf(id)
656
- if(index<0){
657
- this.checkes.push(id)
658
- }else{
659
- this.checkes.splice(index,1)
660
- }
661
- },
662
- //将客户信息拖至计划中
663
- async dragtoPlanItem() {
664
- if(this.model.rows.length==0){
665
- Vue.showMessage("未检测到列表中有用户!")
666
- return
667
- }
668
- if(!this.checkAll && this.checkes.length==0){
669
- Vue.showMessage("请先勾选你要添入到上方计划中的用户!")
670
- return
671
- }
672
- if(this.selectplan && this.selectplan.id){
673
- this.$parent.isSend=true
674
- try{
675
- let res=await new HttpResetClass().load("POST", "/api/af-safecheck/logic/AddCheckPlanItem", {
676
- data:{
677
- f_operator:this.userlogin.name,
678
- f_plan_id:this.selectplan.id,
679
- f_safecheck_type:this.selectplan.f_safecheck_type,
680
- f_filialeid:this.userlogin.orgid,
681
- f_subscribe_date:'',
682
- condition:this.model.condition,
683
- switchCheckAll:true,
684
- checkAll:this.checkAll,
685
- param:this.checkes,
686
- columnName: "ua.id"
687
- }
688
- }, {resolveMsg: null, rejectMsg: null})
689
- //tag+"---"+res.data.result.length)
690
- this.$parent.isSend=false
691
- if(res.data.code==200){
692
- //alert("添加成功!有"+res.data.result.length+"条用户地址已经存在于其他计划中: \n"+res.data.result.reduce((c,v)=>{c += v.f_user_name+":"+v.f_address+"\n"}),0)
693
- this.$showMessage("添加成功!"+(res.data.result.length>0?"有"+res.data.result.length+"条用户地址已经存在于其他计划中":""))
694
- this.$parent.refresh()
695
- }else{
696
- this.$showMessage("添加失败!")
697
- }
698
- }catch (e) {
699
- this.$showMessage("添加失败!")
700
- }
701
- }else{
702
- this.$parent.isSend=false
703
- this.$showMessage("请先打开一个计划再进行操作")
704
- }
705
- }
706
- },
707
- events: {
708
- onFileUpload: function (file, res) {
709
- //tag)
710
- //tag)
711
- let data = {
712
- filepath: res.f_downloadpath
713
- }
714
- new HttpResetClass().load('POST','/api/af-safecheck/logic/safe_GetUserInfoFromExcel', {data: data}, {
715
- resolveMsg: '导入成功!已生成条件,若要去除导入条件请点击旁边 ‘清空用户编号’ 按钮。',
716
- rejectMsg: '导入失败'
717
- }).then((res) => {
718
- this.uploadCodeCondition=res.data.condition
719
- this.excelUserCondtion = false
720
- })
721
- },
722
-
723
- }
724
- }
725
- </script>
726
-
727
- <style scoped>
728
- .safe-planfont{
729
- font-family: MicrosoftYaHei;
730
- font-size: 15px;
731
- font-weight: normal;
732
- font-stretch: normal;
733
- letter-spacing: 2px;
734
- color: #333333;
735
- line-height: 25px;
736
- }
737
- .safe-bodyfont{
738
- font-family: MicrosoftYaHei;
739
- font-size: 14px;
740
- font-weight: normal;
741
- font-stretch: normal;
742
- letter-spacing: 0px;
743
- color: #999999;
744
- line-height: 30px;
745
- }
746
- .safe-leftplan{
747
- height:auto;
748
- border-bottom:1px solid #ececec;
749
- padding: 10px 5px
750
- }
751
- .leftplan-center{
752
- border-top:1px solid #ececec;
753
- border-bottom:1px solid #ececec;
754
- }
755
- .safe_p{
756
- white-space: nowrap;
757
- overflow: hidden;
758
- text-overflow: ellipsis;
759
- }
760
- .safe-div-p{
761
- color: #4792de;
762
- text-align: end;
763
- padding: 8px 15px;
764
- }
765
- </style>
766
- <style lang="less">
767
- .upuserinfo_sel ul{
768
- width: 300% !important;
769
- }
770
- </style>
1
+ <template>
2
+ <div>
3
+ <criteria-paged :model="model" v-ref:paged>
4
+ <criteria partial='criteria' @condition-changed='$parent.selfSearch' v-ref:criteria>
5
+ <div partial>
6
+ <div class="row " >
7
+ <label class="form-group font_normal_body"><b>用户信息</b></label>
8
+
9
+ <div class="form-group col-sm-1" >
10
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
+ style="width: 95%" placeholder="客户编号" condition="ui.f_userinfo_code='{}'">
12
+ </div>
13
+ <div class="form-group col-sm-1" >
14
+ <input type="text" class="input_search" v-model="model.f_user_name"
15
+ style="width: 95%" placeholder="用户姓名" condition="ui.f_user_name like '%{}%'">
16
+ </div>
17
+ <div class="form-group col-sm-1" >
18
+ <input type="text" class="input_search" v-model="model.f_meternumber"
19
+ style="width: 95%" placeholder="表号" condition="uf.f_meternumber like '%{}%'">
20
+ </div>
21
+ <div class="form-group col-sm-1" >
22
+ <input type="text" class="input_search" v-model="model.f_address"
23
+ style="width: 95%" placeholder="客户地址" condition="ua.f_address like '%{}%'">
24
+ </div>
25
+ <div class="form-group col-sm-1 upuserinfo_sel" >
26
+ <v-select
27
+ class="select select_list"
28
+ :width="'95%'"
29
+ :value.sync="model.f_area"
30
+ v-model="model.f_area"
31
+ :options='$parent.$parent.areaList'
32
+ :timeout="500"
33
+ @select-search="$parent.$parent.select_search"
34
+ placeholder='小区选择'
35
+ condition="ua.f_residential_area = '{}'"
36
+ close-on-select
37
+ value-single
38
+ >
39
+ </v-select>
40
+ </div>
41
+ <div class="form-group col-sm-1 upuserinfo_sel" >
42
+ <v-select v-model="model.f_meter_book_num"
43
+ :multiple="true" :options='$parent.$parent.checkBooks'
44
+ :value.sync="model.f_meter_book_num"
45
+ class="select select_list"
46
+ @select-search="$parent.$parent.select_book"
47
+ :width="'95%'"
48
+ :timeout="500"
49
+ placeholder='安检册选择'
50
+ condition="ua.f_check_book_id in {}" >
51
+ </v-select>
52
+
53
+ </div>
54
+ <div class="form-group col-sm-4" >
55
+ <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.showUserCondition()">更多条件</button>
56
+ <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.showUploadCodeCondition()">导入编号</button>
57
+ <button class="button_new" style="margin-right: 10px" @click="$parent.$parent.clearUserInfoId()">清空编号</button>
58
+ <button class="button_search" style="margin-right: 10px" @click="search()">查询</button>
59
+ <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.clearcon()">重置</button>
60
+ </div>
61
+ <div class="form-group col-sm-1" style="float: right">
62
+ <button class="button_search" style="margin-right: 10px" @click="$parent.$parent.dragtoPlanItem()">添入计划</button>
63
+ </div>
64
+ <modal :show.sync="$parent.$parent.showCondtion" v-ref:modal :width="'50%'" :backdrop="false">
65
+ <div slot="modal-header" class="modal-header">
66
+ <h4 class="modal-title">
67
+ 用户查询条件
68
+ </h4>
69
+ </div>
70
+ <div slot="modal-body" class="modal-body">
71
+ <div class="row">
72
+ <div class="form-group col-sm-4" >
73
+ <label class="font_normal_body">用户类型:</label>
74
+ <v-select
75
+ class="select select_list"
76
+ :value.sync="model.f_user_type"
77
+ v-model="model.f_user_type"
78
+ :options='$parent.$parent.userTypes'
79
+ placeholder='请选择'
80
+ condition="uf.f_user_type='{}'"
81
+ :search="false"
82
+ close-on-select
83
+ value-single
84
+ >
85
+ </v-select>
86
+ </div>
87
+ <div class="form-group col-sm-4" >
88
+ <label class="font_normal_body">用户状态:</label>
89
+ <v-select
90
+ class="select select_list"
91
+ :value.sync="model.f_user_state"
92
+ v-model="model.f_user_state"
93
+ :options='$parent.$parent.userStates'
94
+ placeholder='请选择'
95
+ condition="ui.f_user_state='{}'"
96
+ :search="false"
97
+ close-on-select
98
+ value-single
99
+ >
100
+ </v-select>
101
+ </div>
102
+ <div class="form-group col-sm-4" >
103
+ <label class="font_normal_body">用气性质:</label>
104
+ <v-select
105
+ class="select select_list"
106
+ :value.sync="model.f_gasproperties"
107
+ v-model="model.f_gasproperties"
108
+ :options='$parent.$parent.gasproperties'
109
+ placeholder='请选择'
110
+ condition="uf.f_gasproperties='{}'"
111
+ :search="false"
112
+ close-on-select
113
+ value-single
114
+ >
115
+ </v-select>
116
+ </div>
117
+ <div class="form-group col-sm-4" >
118
+ <label class="font_normal_body">气表类型:</label>
119
+ <v-select
120
+ class="select select_list"
121
+ :value.sync="model.meter_classify"
122
+ v-model="model.meter_classify"
123
+ :options='$parent.$parent.meter_classifys'
124
+ placeholder='请选择'
125
+ condition="uf.F_METER_CLASSIFY='{}'"
126
+ :search="false"
127
+ close-on-select
128
+ value-single
129
+ >
130
+ </v-select>
131
+ </div>
132
+ <div class="form-group col-sm-4" >
133
+ <label class="font_normal_body">街&emsp;&emsp;道:</label>
134
+ <v-select
135
+ class="select select_list"
136
+ :value.sync="model.f_street"
137
+ v-model="model.f_street"
138
+ :options='$parent.$parent.streets'
139
+ placeholder='请选择'
140
+ condition="ua.f_street_id='{}'"
141
+ close-on-select
142
+ value-single
143
+ >
144
+ </v-select>
145
+ </div>
146
+ <div class="form-group col-sm-4" >
147
+ <label class="font_normal_body">楼&ensp;栋&ensp;号:</label>
148
+ <input type="text" class="input_search" v-model="model.f_building"
149
+ style="width: 60%" placeholder="请选择" condition="ua.f_building='{}'">
150
+ </div>
151
+ <div class="form-group col-sm-4" >
152
+ <label class="font_normal_body">单&ensp;元&ensp;号:</label>
153
+ <input type="text" class="input_search" v-model="model.f_unit"
154
+ style="width: 60%" placeholder="请选择" condition="ua.f_unit='{}'">
155
+ </div>
156
+ <div class="form-group col-sm-4" >
157
+ <label class="font_normal_body">楼&ensp;层&ensp;号:</label>
158
+ <input type="text" class="input_search" v-model="model.f_floor"
159
+ style="width: 60%" placeholder="请选择" condition="ua.f_floor='{}'">
160
+ </div>
161
+ <div class="form-group col-sm-4" >
162
+ <label class="font_normal_body">开户起始:</label>
163
+ <datepicker
164
+ placeholder='请选择'
165
+ style="width:60%"
166
+ :disabled-days-of-week="[]"
167
+ :format="'yyyy-MM-dd'"
168
+ :show-rest-button="reset"
169
+ :value.sync="model.f_startfile_time"
170
+ v-model="model.f_startfile_time"
171
+ condition="ui.f_createfile_date >= '{} 00:00:00'">
172
+ </datepicker>
173
+ </div>
174
+ <div class="form-group col-sm-4" >
175
+ <label class="font_normal_body">开户截止:</label>
176
+ <datepicker
177
+ placeholder='请选择'
178
+ :disabled-days-of-week="[]"
179
+ style="width:60%"
180
+ :format="'yyyy-MM-dd'"
181
+ :show-rest-button="reset"
182
+ :value.sync="model.f_endfile_time"
183
+ v-model="model.f_endfile_time"
184
+ condition="ui.f_createfile_date <= '{} 23:59:59'">
185
+ </datepicker>
186
+ </div>
187
+ <div class="form-group col-sm-4" >
188
+ <label class="font_normal_body">表&ensp;箱&ensp;号:</label>
189
+ <input type="text" class="input_search" v-model="model.f_metertitles"
190
+ style="width: 60%" placeholder="请输入" condition="uf.f_metertitles='{}'">
191
+ </div>
192
+ <div class="form-group col-sm-4" >
193
+ <label class="font_normal_body">用户电话:</label>
194
+ <input type="text" class="input_search" v-model="model.f_user_phone"
195
+ style="width: 60%" placeholder="请输入" condition="ui.f_user_phone='{}'">
196
+ </div>
197
+ <div class="form-group col-sm-4" >
198
+ <label class="font_normal_body">片&ensp;&ensp;&ensp;&ensp;区:</label>
199
+ <v-select
200
+ class="select select_list"
201
+ :value.sync="model.f_book_slice_area"
202
+ v-model="model.f_book_slice_area"
203
+ :options='$parent.$parent.sliceArea'
204
+ @change="$parent.$parent.slice_areaChange(model.f_book_slice_area)"
205
+ placeholder='请选择'
206
+ condition="ua.f_slice_area ='{}'"
207
+ close-on-select
208
+ value-single
209
+ >
210
+ </v-select>
211
+ </div>
212
+ <div class="form-group col-sm-4" >
213
+ <label class="font_normal_body">派发情况:</label>
214
+ <v-select
215
+ class="select select_list"
216
+ :value.sync="model.yearCheck"
217
+ v-model="model.yearCheck"
218
+ :options='$parent.$parent.yearCheckList'
219
+ placeholder='请选择'
220
+ condition="{}"
221
+ :search="false"
222
+ close-on-select
223
+ value-single
224
+ >
225
+ </v-select>
226
+ </div>
227
+ <div class="form-group col-sm-4" >
228
+ <label class="font_normal_body">安检起始:</label>
229
+ <datepicker
230
+ placeholder='请选择'
231
+ style="width:60%"
232
+ :disabled-days-of-week="[]"
233
+ :format="'yyyy-MM-dd'"
234
+ :show-rest-button="reset"
235
+ :value.sync="model.f_start_time"
236
+ v-model="model.f_start_time"
237
+ >
238
+ </datepicker>
239
+ </div>
240
+ <div class="form-group col-sm-4" >
241
+ <label class="font_normal_body">安检截止:</label>
242
+ <datepicker
243
+ placeholder='请选择'
244
+ :disabled-days-of-week="[]"
245
+ style="width:60%"
246
+ :format="'yyyy-MM-dd'"
247
+ :show-rest-button="reset"
248
+ :value.sync="model.f_end_time"
249
+ v-model="model.f_end_time"
250
+ >
251
+ </datepicker>
252
+ </div>
253
+ <div class="form-group col-sm-4">
254
+ <label class="font_normal_body">安检状态:</label>
255
+ <v-select
256
+ class="select select_list"
257
+ :value.sync="model.f_last_check_state"
258
+ v-model="model.f_last_check_state"
259
+ :options='$parent.$parent.entry_status'
260
+ placeholder='请选择'
261
+ :search="false"
262
+ close-on-select
263
+ value-single
264
+ >
265
+ </v-select>
266
+ </div>
267
+ <div class="form-group col-sm-4" >
268
+ <label class="font_normal_body">通气起始:</label>
269
+ <datepicker
270
+ placeholder='通气开始时间'
271
+ style="width:60%"
272
+ :disabled-days-of-week="[]"
273
+ :format="'yyyy-MM-dd'"
274
+ :show-rest-button="reset"
275
+ :value.sync="model.f_startgas_time"
276
+ v-model="model.f_startgas_time"
277
+ condition="ui.f_uservent_date >= '{} 00:00:00'">
278
+ </datepicker>
279
+ </div>
280
+ <div class="form-group col-sm-4" >
281
+ <label class="font_normal_body">通气截止:</label>
282
+ <datepicker
283
+ placeholder='通气结束时间'
284
+ :disabled-days-of-week="[]"
285
+ style="width:60%"
286
+ :format="'yyyy-MM-dd'"
287
+ :show-rest-button="reset"
288
+ :value.sync="model.f_endgas_time"
289
+ v-model="model.f_endgas_time"
290
+ condition="ui.f_uservent_date <= '{} 23:59:59'">
291
+ </datepicker>
292
+ </div>
293
+ </div>
294
+ </div>
295
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
296
+ <button class="button_search" style="margin-right: 15px" @click="search()">查询</button>
297
+ <button class="button_search" @click="$parent.$parent.cancel">取消</button>
298
+ </div>
299
+ </modal>
300
+ <modal :show.sync="$parent.$parent.excelUserCondtion" width="500px" v-ref:modal1 >
301
+ <div slot="modal-header" class="modal-header">
302
+ <h4 class="modal-title">
303
+ 导入用户编号
304
+ </h4>
305
+ </div>
306
+ <div slot="modal-body" class="modal-body">
307
+ <div class="row">
308
+ <file-upload class="my-file-uploader " name="UploadFile" class="btn btn-success" style="border-radius: 2px;"
309
+ action="rs/file/uploadFile" tagname="档案信息导入" v-ref:file :headers="headers" multiple></file-upload>
310
+ <img src="../../../assets/Excelformat.png" style="width: 100%"/>
311
+ </div>
312
+ </div>
313
+ <footer slot="modal-footer" class="modal-footer">
314
+ </footer>
315
+ </modal>
316
+ </div>
317
+ </div>
318
+ </criteria>
319
+ <data-grid :model="model" partial='list' class="table_sy">
320
+
321
+ <template partial='head'>
322
+ <tr>
323
+ <th><nobr><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.checkAll" @change="$parent.$parent.$parent.setCheckAll()"/> 全选</nobr></th>
324
+ <th><nobr>用户编号</nobr></th>
325
+ <th><nobr>用户名称</nobr></th>
326
+ <th><nobr>用户类型</nobr></th>
327
+ <th><nobr>用户电话</nobr></th>
328
+ <th><nobr>表具类型</nobr></th>
329
+ <th><nobr>表号</nobr></th>
330
+ <th><nobr>小区名称</nobr></th>
331
+ <th><nobr>片区</nobr></th>
332
+ <th><nobr>安检册</nobr></th>
333
+ <th title="当前所在的安检计划名称"><nobr>所属计划</nobr></th>
334
+ <th title="最后一次安检日期"><nobr>安检日期</nobr></th>
335
+ <th><nobr>首次通气时间</nobr></th>
336
+ <th><nobr>详细地址</nobr></th>
337
+ </tr>
338
+ </template>
339
+ <template partial='body'>
340
+ <td style="text-align: center;white-space:nowrap;"><input type="checkbox" onClick="event.cancelBubble = true" :checked="$parent.$parent.$parent.isChecked(row.id)" @change="$parent.$parent.$parent.setCheckes(row.id)" /></td>
341
+ <td style="text-align: center"><nobr>{{row.f_userinfo_code}}</nobr></td>
342
+ <td style="text-align: center"><nobr>{{row.f_user_name}}</nobr></td>
343
+ <td style="text-align: center"><nobr>{{row.f_user_type}}</nobr></td>
344
+ <td style="text-align: center"><nobr>{{row.f_user_phone}}</nobr></td>
345
+ <td style="text-align: center"><nobr>{{row.f_meter_classify}}</nobr></td>
346
+ <td style="text-align: center"><nobr>{{row.f_meternumber}}</nobr></td>
347
+ <td style="text-align: center"><nobr>{{row.f_residential_area}}</nobr></td>
348
+ <td style="text-align: center"><nobr>{{row.f_book_slice_area}}</nobr></td>
349
+ <td style="text-align: center"><nobr>{{row.f_book_name}}</nobr></td>
350
+ <td style="text-align: center"><nobr>{{row.f_plan_name}}</nobr></td>
351
+ <td style="text-align: center"><nobr>{{row.f_last_check_date}}</nobr></td>
352
+ <td style="text-align: center"><nobr>{{row.f_uservent_date}}</nobr></td>
353
+ <td style="text-align: center"><nobr>{{row.f_address}}</nobr></td>
354
+ </template>
355
+ </data-grid>
356
+ </criteria-paged>
357
+ </div>
358
+ </template>
359
+
360
+ <script>
361
+ import {HttpResetClass, PagedList} from "vue-client";
362
+ import Vue from "vue";
363
+
364
+ export default {
365
+ name: "PlanManage",
366
+ title: '计划管理',
367
+ data() {
368
+ return {
369
+ model:new PagedList('/api/af-safecheck/sql/FetchUserFileByOrgNoRuHuSXQ', 100, {
370
+ "orderitem": "'f_residential_area,f_building,f_unit,f_floor,f_room'",
371
+ "f_usertype": "''",
372
+ "month": "''",
373
+ "SafeCheckSX": {"f_check_start": '', "f_check_end": ''},
374
+ "SafeCheckCQ": "''",
375
+ "startday":"''",
376
+ "endday":"''"}),
377
+ a:'1',
378
+ opt:[{label:"测试",value:"测试"}],
379
+ showCondtion:false,
380
+ userTypes:[],//用户类型
381
+ userStates:[],//用户状态
382
+ gasproperties:[],//用气性质
383
+ meter_classifys:[],//气表类型
384
+ hasHousehold:[{label:"全部",value:""},{label:"已入户",value:"已入户"},{label:"未入户",value:"未入户"}],
385
+ yearCheckList:[{label:"全部",value:""},{label:"已在计划中",value:"ua.f_plan_id is not null"},{label:"未在计划中",value:"ua.f_plan_id is null"}],
386
+ entry_status: this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
387
+ sliceArea:[],
388
+ meterbooks:[],
389
+ checkBooks:[],
390
+ cbc:[],
391
+ areaList:[],
392
+ checkAll:false,
393
+ checkes:[],
394
+ excelUserCondtion:false,
395
+ uploadCodeCondition:'',
396
+ streets:[]
397
+ }
398
+ },
399
+ props:["selectplan","userlogin"],
400
+ ready(){
401
+ this.getCheckBook()
402
+ this.setConList()
403
+ this.loadpage()
404
+ document.addEventListener('keydown', this.handleEnter, true);
405
+ },
406
+ methods: {
407
+ clearcon(){
408
+ this.$refs.paged.$refs.criteria.model.f_userinfo_code = ''
409
+ this.$refs.paged.$refs.criteria.model.f_meternumber = ''
410
+ this.$refs.paged.$refs.criteria.model.f_address = ''
411
+ this.$refs.paged.$refs.criteria.model.f_area = ''
412
+ this.$refs.paged.$refs.criteria.model.f_meter_book_num = []
413
+ this.$refs.paged.$refs.criteria.model.f_user_type = ''
414
+ this.$refs.paged.$refs.criteria.model.f_user_state = ''
415
+ this.$refs.paged.$refs.criteria.model.f_gasproperties = ''
416
+ this.$refs.paged.$refs.criteria.model.meter_classify = ''
417
+ this.$refs.paged.$refs.criteria.model.f_street = ''
418
+ this.$refs.paged.$refs.criteria.model.f_building = ''
419
+ this.$refs.paged.$refs.criteria.model.f_unit = ''
420
+ this.$refs.paged.$refs.criteria.model.f_floor = ''
421
+ this.$refs.paged.$refs.criteria.model.f_startfile_time = ''
422
+ this.$refs.paged.$refs.criteria.model.f_endfile_time = ''
423
+ this.$refs.paged.$refs.criteria.model.f_metertitles = ''
424
+ this.$refs.paged.$refs.criteria.model.f_user_phone = ''
425
+ this.$refs.paged.$refs.criteria.model.f_book_slice_area = ''
426
+ this.$refs.paged.$refs.criteria.model.yearCheck = ''
427
+ this.$refs.paged.$refs.criteria.model.f_start_time = ''
428
+ this.$refs.paged.$refs.criteria.model.f_end_time = ''
429
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
430
+ this.$refs.paged.$refs.criteria.model.f_startgas_time = ''
431
+ this.$refs.paged.$refs.criteria.model.f_endgas_time = ''
432
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
433
+ this.$refs.paged.$refs.criteria.model.f_last_check_state = ''
434
+ },
435
+ handleEnter(e) {
436
+ if (e.key === 'Enter') {
437
+ this.$refs.paged.$refs.criteria.search()
438
+ }
439
+ },
440
+ getCheckBook(){
441
+ this.checkBooks=[]
442
+ new HttpResetClass().load('POST', `/api/af-safecheck/sql/safe_singleTable_OrderBy?pageNo=1&pageSize=1000`, {
443
+ data: {
444
+ items: 'id,f_check_book_name,f_check_book_type',
445
+ tablename: 't_check_book',
446
+ condition: `f_orgid = '${this.userlogin.orgid}'`,
447
+ orderitem: 'id desc'
448
+ }
449
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
450
+ res.data.forEach(ress => {
451
+ this.checkBooks.push({
452
+ label: ress.f_check_book_name,
453
+ value: ress.id
454
+ })
455
+ })
456
+ })
457
+ },
458
+ loadpage(){
459
+ this.select_search()
460
+ this.select_street()
461
+ this.Mreadibook()
462
+ this.getSliceArea()
463
+ },
464
+ cancel(){
465
+ this.showCondtion=false
466
+ this.excelUserCondtion=false
467
+ },
468
+ //清空用户编号
469
+ clearUserInfoId(){
470
+ this.uploadCodeCondition=''
471
+ Vue.showMessage("已清空用户编号")
472
+ },
473
+ showUploadCodeCondition(){
474
+ this.excelUserCondtion=true
475
+ },
476
+ selfSearch (args) {
477
+ //tag)
478
+ args.condition += ` and ui.f_filialeid='${this.userlogin.orgid}'`
479
+
480
+ if (args.model.f_last_check_state == '未检') {
481
+ let nocheckcon = 'and ( ui.f_last_check_date is null '
482
+ if(args.model.f_start_time){
483
+ nocheckcon += ` or ui.f_last_check_date <='${args.model.f_start_time} 00:00:00' `
484
+ }
485
+ if(args.model.f_end_time){
486
+ nocheckcon += ` or ui.f_last_check_date >='${args.model.f_end_time} 23:59:59' `
487
+ }
488
+ nocheckcon += ')'
489
+ args.condition += nocheckcon
490
+ }else{
491
+ if(args.model.f_last_check_state){
492
+ args.condition += ` and ui.f_last_check_state = '${args.model.f_last_check_state}'`
493
+ }
494
+ if(args.model.f_start_time){
495
+ args.condition += ` and ui.f_last_check_date >='${args.model.f_start_time} 00:00:00' `
496
+ }
497
+ if(args.model.f_end_time){
498
+ args.condition += ` and ui.f_last_check_date <='${args.model.f_end_time} 23:59:59' `
499
+ }
500
+ }
501
+
502
+ if(args.model.checkBook){
503
+ let arr=args.model.checkBook.split('-')
504
+ if(arr[1] == '用户'){
505
+ args.condition +=` and ua.f_check_book_id='${arr[0]}'`
506
+ }else{
507
+ args.condition +=` and area.f_check_book_id=${arr[0]} and ua.f_check_book_id is null`
508
+ }
509
+ }
510
+ if(this.uploadCodeCondition){
511
+ args.condition +=` and ${this.uploadCodeCondition}`
512
+ }
513
+ this.cancel()
514
+ this.checkes=[]
515
+ this.checkAll=false
516
+ this.model.search(args.condition, args.model, args.condValue)
517
+ },
518
+ showUserCondition(){
519
+ this.showCondtion=true
520
+ },
521
+ setConList(){
522
+ this.userTypes=this.$appdata.getParam('用户类型') ? [{
523
+ label: '全部',
524
+ value: ''
525
+ }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
526
+
527
+ this.userStates=this.$appdata.getParam('安检用户状态') ? [{
528
+ label: '全部',
529
+ value: ''
530
+ },...this.$appdata.getParam('安检用户状态')] : [{label: '全部', value: ''}]
531
+ this.gasproperties=this.$appdata.getParam('用气性质') ? [{
532
+ label: '全部',
533
+ value: ''
534
+ }, ...this.$appdata.getParam('用气性质')] : [{label: '全部', value: ''}]
535
+ this.meter_classifys=this.$appdata.getParam('气表类型') ? [{
536
+ label: '全部',
537
+ value: ''
538
+ }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
539
+ },
540
+ select_search(text){
541
+ //tag
542
+ let pcdText=text?` and f_residential_area like '%${text}%'`:''
543
+ new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data:{items:"*",tablename:"t_area",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}' ${pcdText} `}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
544
+ //tag)
545
+ if(res.data.length>0){
546
+ this.areaList=[]
547
+ this.areaList.push({label:"全部",value:""})
548
+ res.data.forEach((result)=>{
549
+ this.areaList.push({label:result.f_residential_area,value:result.f_residential_area})
550
+ })
551
+ }
552
+ //tag)
553
+ })
554
+ },
555
+ select_book(text){
556
+ //tag
557
+ let pcdText=text?` and f_check_book_name like '%${text}%'`:''
558
+ new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data:{items:"*",tablename:"t_check_book",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}' ${pcdText} `}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
559
+ //tag)
560
+ if(res.data.length>0){
561
+ this.checkBooks = []
562
+ res.data.forEach((result)=>{
563
+ this.checkBooks.push({label:result.f_check_book_name,value:result.id})
564
+ })
565
+ }
566
+ //tag)
567
+ })
568
+ },
569
+ select_street(){
570
+ //tag
571
+ new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/api/af-safecheck/sql/safe_singleTable_OrderBy`, {data:{items:"id,f_street",tablename:"t_street",orderitem:"id",condition:`f_orgid = '${this.userlogin.orgid}'`}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
572
+ //tag)
573
+ if(res.data.length>0){
574
+ this.streets=[]
575
+ this.streets.push({label:"全部",value:""})
576
+ res.data.forEach((result)=>{
577
+ this.streets.push({label:result.f_street,value:result.id})
578
+ })
579
+ }
580
+ })
581
+ },
582
+ //获取安检册
583
+ async Mreadibook(){
584
+ this.cbc=[]
585
+ this.sliceArea=[]
586
+ let http = new HttpResetClass()
587
+ let getMeterReadingBooks = await http.load('POST','api/af-safecheck/logic/getMeterBooksData',
588
+ {data: {f_orgid: "('"+this.userlogin.orgid+"')"}},
589
+ {resolveMsg: null, rejectMsg: '获取失败!!!'})
590
+ this.cbc = [{label: '全部', value: ''}]
591
+ //tag
592
+ //tag)
593
+ //tag
594
+ this.meterbooks=[]
595
+ this.meterbooks=getMeterReadingBooks.data.meterbooks
596
+ this.meterbooks.forEach((res) => {
597
+ this.cbc.push({label: res.f_book_name, value: res.id})
598
+ /*if(res.f_book_slice_area){
599
+ if(this.sliceArea.indexOf(res.f_book_slice_area)<0){
600
+ this.sliceArea.push(res.f_book_slice_area)
601
+ }
602
+ }*/
603
+ })
604
+
605
+ },
606
+ //片区获取
607
+ async getSliceArea() {
608
+ let http = new HttpResetClass()
609
+ let getAllArea = await http.load('POST', '/rs/search', {
610
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
611
+ userid: this.userlogin.id
612
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
613
+ this.sliceArea = [{label: '全部', value: ''}]
614
+ //tag
615
+ //tag
616
+ //tag
617
+ getAllArea.data.forEach((res) => {
618
+ if(res.parentid==this.userlogin.orgid){
619
+ this.sliceArea.push({label:res.name,value:res.name})
620
+ }
621
+ })
622
+ //tag
623
+ },
624
+ //片区改变-对应安检册下拉重新赋值
625
+ slice_areaChange(value) {
626
+ //tag
627
+ if(!value){
628
+ this.cbc=[]
629
+ this.meterbooks.forEach((res) => {
630
+ this.cbc.push({label: res.f_book_name, value: res.id})
631
+ })
632
+ }else{
633
+ this.cbc=[]
634
+ this.meterbooks.forEach((res) => {
635
+ if(res.f_book_slice_area==value){
636
+ this.cbc.push({label: res.f_book_name, value: res.id})
637
+ }
638
+ })
639
+ }
640
+ },
641
+ isChecked(v) {
642
+ // 如果全选,不在的按选中算,否则,在的按选中算
643
+ if (this.checkAll) {
644
+ return this.checkes.indexOf(v) == -1
645
+ } else {
646
+ return this.checkes.indexOf(v) != -1
647
+ }
648
+ },
649
+ setCheckAll() {
650
+ this.checkAll=this.checkAll?false:true;
651
+ // 全选改变后,清空选中数据
652
+ this.checkes = []
653
+ },
654
+ setCheckes(id) {
655
+ let index=this.checkes.indexOf(id)
656
+ if(index<0){
657
+ this.checkes.push(id)
658
+ }else{
659
+ this.checkes.splice(index,1)
660
+ }
661
+ },
662
+ //将客户信息拖至计划中
663
+ async dragtoPlanItem() {
664
+ if(this.model.rows.length==0){
665
+ Vue.showMessage("未检测到列表中有用户!")
666
+ return
667
+ }
668
+ if(!this.checkAll && this.checkes.length==0){
669
+ Vue.showMessage("请先勾选你要添入到上方计划中的用户!")
670
+ return
671
+ }
672
+ if(this.selectplan && this.selectplan.id){
673
+ this.$parent.isSend=true
674
+ try{
675
+ let res=await new HttpResetClass().load("POST", "/api/af-safecheck/logic/AddCheckPlanItem", {
676
+ data:{
677
+ f_operator:this.userlogin.name,
678
+ f_plan_id:this.selectplan.id,
679
+ f_safecheck_type:this.selectplan.f_safecheck_type,
680
+ f_filialeid:this.userlogin.orgid,
681
+ f_subscribe_date:'',
682
+ condition:this.model.condition,
683
+ switchCheckAll:true,
684
+ checkAll:this.checkAll,
685
+ param:this.checkes,
686
+ columnName: "ua.id"
687
+ }
688
+ }, {resolveMsg: null, rejectMsg: null})
689
+ //tag+"---"+res.data.result.length)
690
+ this.$parent.isSend=false
691
+ if(res.data.code==200){
692
+ //alert("添加成功!有"+res.data.result.length+"条用户地址已经存在于其他计划中: \n"+res.data.result.reduce((c,v)=>{c += v.f_user_name+":"+v.f_address+"\n"}),0)
693
+ this.$showMessage("添加成功!"+(res.data.result.length>0?"有"+res.data.result.length+"条用户地址已经存在于其他计划中":""))
694
+ this.$parent.refresh()
695
+ }else{
696
+ this.$showMessage("添加失败!")
697
+ }
698
+ }catch (e) {
699
+ this.$showMessage("添加失败!")
700
+ }
701
+ }else{
702
+ this.$parent.isSend=false
703
+ this.$showMessage("请先打开一个计划再进行操作")
704
+ }
705
+ }
706
+ },
707
+ events: {
708
+ onFileUpload: function (file, res) {
709
+ //tag)
710
+ //tag)
711
+ let data = {
712
+ filepath: res.f_downloadpath
713
+ }
714
+ new HttpResetClass().load('POST','/api/af-safecheck/logic/safe_GetUserInfoFromExcel', {data: data}, {
715
+ resolveMsg: '导入成功!已生成条件,若要去除导入条件请点击旁边 ‘清空用户编号’ 按钮。',
716
+ rejectMsg: '导入失败'
717
+ }).then((res) => {
718
+ this.uploadCodeCondition=res.data.condition
719
+ this.excelUserCondtion = false
720
+ })
721
+ },
722
+
723
+ }
724
+ }
725
+ </script>
726
+
727
+ <style scoped>
728
+ .safe-planfont{
729
+ font-family: MicrosoftYaHei;
730
+ font-size: 15px;
731
+ font-weight: normal;
732
+ font-stretch: normal;
733
+ letter-spacing: 2px;
734
+ color: #333333;
735
+ line-height: 25px;
736
+ }
737
+ .safe-bodyfont{
738
+ font-family: MicrosoftYaHei;
739
+ font-size: 14px;
740
+ font-weight: normal;
741
+ font-stretch: normal;
742
+ letter-spacing: 0px;
743
+ color: #999999;
744
+ line-height: 30px;
745
+ }
746
+ .safe-leftplan{
747
+ height:auto;
748
+ border-bottom:1px solid #ececec;
749
+ padding: 10px 5px
750
+ }
751
+ .leftplan-center{
752
+ border-top:1px solid #ececec;
753
+ border-bottom:1px solid #ececec;
754
+ }
755
+ .safe_p{
756
+ white-space: nowrap;
757
+ overflow: hidden;
758
+ text-overflow: ellipsis;
759
+ }
760
+ .safe-div-p{
761
+ color: #4792de;
762
+ text-align: end;
763
+ padding: 8px 15px;
764
+ }
765
+ </style>
766
+ <style lang="less">
767
+ .upuserinfo_sel ul{
768
+ width: 300% !important;
769
+ }
770
+ </style>