safecheck-client 3.0.34-47 → 3.0.34-49

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