safecheck-client 3.0.33-gongyi → 3.0.34-gongyi

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,903 +1,910 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged>
5
- <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
- <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
- <div class="row">
8
- <div class="form-group col-sm-2">
9
- <label class="font_normal_body">客户编号</label>
10
- <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
- style="width: 60%" placeholder="客户编号" condition="tui.f_userinfo_code='{}'">
12
- </div>
13
- <div class="form-group col-sm-2">
14
- <label class="font_normal_body">客户名称</label>
15
- <input type="text" class="input_search" v-model="model.f_user_name"
16
- style="width: 60%" placeholder="客户名称" condition="tui.f_user_name like '{}%'">
17
- </div>
18
- <div class="form-group col-sm-2">
19
- <label class="font_normal_body">客户电话</label>
20
- <input type="text" class="input_search" v-model="model.f_user_phone"
21
- style="width: 60%" placeholder="客户电话" condition="tui.f_user_phone like '{}%'">
22
- </div>
23
- <div class="form-group col-sm-2">
24
- <label class="font_normal_body">客户地址</label>
25
- <input type="text" class="input_search" v-model="model.f_address"
26
- style="width: 60%" placeholder="客户地址" condition="tua.f_address like '%{}%'">
27
- </div>
28
-
29
- <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right">
30
-
31
- <export-excel-safe :data="$parent.$parent.searchData"
32
- :field="$parent.$parent.excelHeaders"
33
- progress="safeGetExportProgress"
34
- sqlurl="rs/logic/SafeExportExcel" sql-name="defectDetails"
35
- template-name='安检隐患明细'></export-excel-safe>
36
-
37
-
38
- <button class="button_spacing button_search" @click="search()">查询</button>
39
- <!-- <div style="float: right" class="button_spacing"-->
40
- <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
41
- <!-- @click="$parent.$parent.hidden()"></div>-->
42
- </div>
43
- <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right" v-if="$parent.$parent.permission === 'c1'">
44
-
45
-
46
- <button class="button_spacing button_search" @click="$parent.$parent.beforeCreateBook">创建安检册</button>
47
-
48
- </div>
49
- </div>
50
- <div class="row">
51
- <div class="col-sm-2 form-group" style="margin-top: 0px">
52
- <label class="font_normal_body">公&emsp;&emsp;司</label>
53
- <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="tua.f_orgid in {}"></right-tree-safe>
54
- </div>
55
- <div class="form-group col-sm-2" style="margin-top: 0px">
56
- <label class="font_normal_body">小&emsp;&emsp;区</label>
57
- <input type="text" class="input_search" v-model="model.f_residential_area"
58
- style="width: 60%" placeholder="小区" condition="tua.f_residential_area like '%{}%'">
59
- </div>
60
- <div class="col-sm-2 form-group" style="margin-top: 0px">
61
-
62
- <label class="font_normal_body" title="用户类型">用户类型</label>
63
- <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'
64
- :value-single="true" style="width: 60%"
65
- class="select_list select"
66
- :options='$parent.$parent.usertypes' placeholder='用户类型'
67
- close-on-select
68
- condition="tuf.f_user_type ='{}'"></v-select>
69
-
70
- </div>
71
- <!-- <div class="col-sm-2 form-group" style="margin: 0">
72
-
73
- <label class="font_normal_body" title="安检用户状态">用户状态</label>
74
- <v-select :value.sync="model.f_user_state" v-model='model.f_user_state'
75
- :value-single="true" style="width: 60%"
76
- class="select_list select"
77
- :options='$parent.$parent.userstates' placeholder='用户状态'
78
- close-on-select
79
- condition="tui.f_user_state ='{}'"></v-select>
80
-
81
- </div> -->
82
- <div class="col-sm-2 form-group" style="margin-top: 0px">
83
-
84
- <label class="font_normal_body" title="用气性质">用气性质</label>
85
- <v-select :value.sync="model.f_gasproperties" v-model='model.f_gasproperties'
86
- :value-single="true" style="width: 60%"
87
- class="select_list select"
88
- :options='$parent.$parent.gasproperties' placeholder='用气性质'
89
- close-on-select
90
- condition="tuf.f_gasproperties ='{}'"></v-select>
91
-
92
- </div>
93
- <div class="col-sm-2 form-group" style="margin-top: 0px">
94
-
95
- <label class="font_normal_body" title="气表类型">气表类型</label>
96
- <v-select
97
- class="select select_list"
98
- :value.sync="model.f_meter_classify"
99
- v-model="model.f_meter_classify"
100
- :options='$parent.$parent.meter_classifys'
101
- placeholder='请选择'
102
- condition="tuf.f_meter_classify='{}'"
103
- :search="false"
104
- style="width: 60%"
105
- close-on-select
106
- value-single
107
- ></v-select>
108
- </div>
109
- <div class="col-sm-2 form-group" style="margin-top: 0px">
110
-
111
- <label class="font_normal_body">气表品牌</label>
112
- <v-select :value.sync="model.gasbrand" v-model='model.gasbrand'
113
- :value-single="true" style="width: 60%"
114
- class="select_list select"
115
- :options='$parent.$parent.getgasbrand' placeholder='气表品牌'
116
- close-on-select
117
- ></v-select>
118
- </div>
119
- <div class="col-sm-2 form-group" style="margin-top: 0px">
120
-
121
- <label class="font_normal_body">气表型号</label>
122
- <v-select :value.sync="model.gasmodel" v-model='model.gasmodel'
123
- :value-single="true" style="width: 60%"
124
- class="select_list select"
125
- :options='$parent.$parent.getgasmodel' placeholder='气表型号'
126
- close-on-select
127
- condition="tuf.f_gasmodel_id = {}"></v-select>
128
-
129
- </div>
130
- <div class="col-sm-2 form-group" style="margin-top: 0px">
131
-
132
- <label class="font_normal_body" title="房屋类型">房屋类型</label>
133
- <v-select :value.sync="model.f_house_type" v-model='model.f_house_type'
134
- :value-single="true" style="width: 60%"
135
- class="select_list select"
136
- :options='$parent.$parent.housetypes' placeholder='房屋类型'
137
- close-on-select
138
- condition="tui.f_house_type = {}"></v-select>
139
-
140
- </div>
141
- <div class="col-sm-2 form-group" style="margin-top: 0px">
142
-
143
- <label class="font_normal_body" title="安装位置">安装位置</label>
144
- <v-select :value.sync="model.f_position" v-model='model.f_position'
145
- :value-single="true" style="width: 60%"
146
- class="select_list select"
147
- :options='$parent.$parent.positions' placeholder='安装位置'
148
- close-on-select
149
- condition="tuf.f_position = {}"></v-select>
150
-
151
- </div>
152
- <div class="col-sm-2 form-group" style="margin-top: 0px">
153
-
154
- <label class="font_normal_body" title="使用类型">使用类型</label>
155
- <v-select :value.sync="model.f_usetype" v-model='model.f_usetype'
156
- :value-single="true" style="width: 60%"
157
- class="select_list select"
158
- :options='$parent.$parent.usetypes' placeholder='使用类型'
159
- close-on-select
160
- condition="tuf.f_usetype = {}"></v-select>
161
-
162
- </div>
163
- <div class="form-group col-sm-2" style="margin-top: 0px">
164
- <label class="font_normal_body">开户起始</label>
165
- <datepicker
166
- placeholder='开户起始'
167
- style="width:60%"
168
- :disabled-days-of-week="[]"
169
- :format="'yyyy-MM-dd'"
170
- :show-rest-button="reset"
171
- :value.sync="model.f_startfile_time"
172
- v-model="model.f_startfile_time"
173
- condition="tui.f_createfile_date >= '{} 00:00:00'">
174
- </datepicker>
175
- </div>
176
- <div class="form-group col-sm-2"style="margin-top: 0px" >
177
- <label class="font_normal_body">开户截止</label>
178
- <datepicker
179
- placeholder='开户截止'
180
- :disabled-days-of-week="[]"
181
- style="width:60%"
182
- :format="'yyyy-MM-dd'"
183
- :show-rest-button="reset"
184
- :value.sync="model.f_endfile_time"
185
- v-model="model.f_endfile_time"
186
- condition="tui.f_createfile_date <= '{} 00:00:00'">
187
- </datepicker>
188
- </div>
189
- <div class="form-group col-sm-2" style="margin-top: 0px">
190
- <label class="font_normal_body">片&ensp;&ensp;&ensp;&ensp;区</label>
191
- <v-select
192
- class="select select_list"
193
- style="width:60%"
194
- :value.sync="model.f_book_slice_area"
195
- v-model="model.f_book_slice_area"
196
- :options='$parent.$parent.sliceArea'
197
- placeholder='片区'
198
- condition="tua.f_slice_area ='{}'"
199
- close-on-select
200
- value-single
201
- >
202
- </v-select>
203
- </div>
204
- <div class="form-group col-sm-2" style="margin-top: 0px">
205
- <label class="font_normal_body" title="安检状态">安检状态</label>
206
- <v-select
207
- class="select select_list"
208
- style="width:60%"
209
- :value.sync="model.f_last_check_state"
210
- v-model="model.f_last_check_state"
211
- :options='$parent.$parent.check_states'
212
- placeholder='安检状态'
213
- condition="tua.f_last_check_state ='{}'"
214
- close-on-select
215
- value-single
216
- >
217
- </v-select>
218
- </div>
219
- <div class="col-sm-2 form-group" style="margin-top: 0px">
220
-
221
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
222
- <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
223
- :value-single="true" style="width: 60%"
224
- class="select_list select"
225
- :options='$parent.$parent.checkBooks' placeholder='安&ensp;检&ensp;册'
226
- close-on-select
227
- condition="f_check_book_id ='{}'"></v-select>
228
-
229
- </div>
230
- <div class="col-sm-2 form-group" style="margin-top: 0px">
231
-
232
- <label class="font_normal_body">是否划分</label>
233
- <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
234
- :value-single="true" style="width: 60%"
235
- class="select_list select"
236
- @change="$parent.$parent.changeState"
237
- :options='$parent.$parent.isCheckBook' placeholder='有无所属安检册'
238
- close-on-select
239
- condition="{}"></v-select>
240
-
241
- </div>
242
- <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right" v-if="$parent.$parent.permission === 'c1'">
243
-
244
-
245
- <button class="button_spacing button_search" @click="$parent.$parent.addUser">添加用户</button>
246
-
247
- </div>
248
- <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right">
249
-
250
-
251
- <button class="button_spacing button_search" @click="$parent.$parent.upUser">调整用户</button>
252
-
253
- </div>
254
- <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right" v-if="$parent.$parent.permission === 'c1'">
255
-
256
-
257
- <button class="button_spacing button_search" @click="$parent.$parent.delUser">移除用户</button>
258
-
259
- </div>
260
- </div>
261
- </div>
262
- </criteria>
263
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
264
- <template partial='head'>
265
- <tr @dblclick.stop="">
266
- <th>
267
- <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
268
- </th>
269
- <th>
270
- <nobr>客户姓名</nobr>
271
- </th>
272
- <th>
273
- <nobr>客户编号</nobr>
274
- </th>
275
- <th>
276
- <nobr>客户类型</nobr>
277
- </th>
278
- <th>
279
- <nobr>客户电话</nobr>
280
- </th>
281
- <th>
282
- <nobr>客户地址</nobr>
283
- </th>
284
- <th>
285
- <nobr>所属安检册</nobr>
286
- </th>
287
- </tr>
288
- </template>
289
- <template partial='body'>
290
- <td style="text-align: center">
291
- <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
292
- @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
293
- </nobr>
294
- </td>
295
- <td style="text-align: center">{{ row.f_user_name }}</td>
296
- <td style="text-align: center">{{ row.f_userinfo_code }}</td>
297
- <td style="text-align: center">{{ row.f_user_type }}</td>
298
- <td style="text-align: center">{{ row.f_user_phone }}</td>
299
- <td style="text-align: center">{{ row.f_address }}</td>
300
- <td style="text-align: center">{{ row.f_check_book_name }}</td>
301
- </template>
302
- </data-grid>
303
- </criteria-paged>
304
- </div>
305
- <modal :show.sync="showModal" :backdrop="false">
306
- <div slot="modal-header" class="modal-header">
307
- <h4 class="modal-title">
308
- 创建安检册
309
- </h4>
310
- </div>
311
- <div slot="modal-body" class="modal-body">
312
- <div v-if="true">
313
- <div class="row" style="margin-top: 10px">
314
- <!-- <label class="control-label font text-left" style="float:left;margin-left:10%;margin-top:5px">安检册名称</label>-->
315
- <!-- <div class="col-xs-8 col-md-8">-->
316
- <!-- <input type="text" class="input_search" style="width: 70%;" v-model="checkBook.f_check_book_name"/>-->
317
- <!-- </div>-->
318
- <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c1' && showModal ">
319
- <label class="font_normal_body">安检科室</label>
320
- <right-tree islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择科室" :selectData="" v-ref:f_reciever>
321
- </right-tree>
322
- </div>
323
- <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c2' ">
324
- <label class="font_normal_body">安&ensp;检&ensp;员</label>
325
- <v-select :value.sync="checkBook.f_checker_name" v-model='checkBook.f_checker_name'
326
- :value-single="true" style="width: 60%"
327
- class="select_list select"
328
- :options='checkers' placeholder='安检员'
329
- close-on-select></v-select>
330
- </div>
331
- <div class="form-group col-sm-6" style="margin-top: 20px">
332
- <label class="font_normal_body">安检册名</label>
333
- <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
334
- style="width: 60%" >
335
- </div>
336
- <div class="form-group col-sm-6" style="margin-top: 20px">
337
- <label class="font_normal_body">执行日期</label>
338
- <datepicker
339
- :value.sync="checkBook.f_run_date"
340
- style="width: 60%"
341
- :format="'yyyy-MM-dd'"
342
- v-model="checkBook.f_run_date"
343
- >
344
- </datepicker>
345
- </div>
346
- <div class="form-group col-sm-6" style="margin-top: 20px">
347
- <label class="font_normal_body">执行周期</label>
348
- <input type="number" class="input_search" v-model="checkBook.f_around_time"
349
- style="width: 60%" >
350
- </div>
351
- <div class="form-group col-sm-6" style="margin-top: 20px">
352
- <label class="font_normal_body">周期单位</label>
353
- <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
354
- :value-single="true" style="width: 60%"
355
- class="select_list select"
356
- :options='aroundUnit' placeholder=''
357
- close-on-select></v-select>
358
- </div>
359
- </div>
360
- </div>
361
- </div>
362
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
363
- <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
364
- <button class="button_search" @click="cancel">取消</button>
365
- </div>
366
- </modal>
367
- <modal :show.sync="showModal2" :backdrop="false">
368
- <div slot="modal-header" class="modal-header">
369
- <h4 class="modal-title">
370
- 添加用户
371
- </h4>
372
- </div>
373
- <div slot="modal-body" class="modal-body">
374
- <div v-if="true">
375
- <div class="row" style="margin-top: 10px">
376
- <div class="form-group col-sm-12" style="margin-top: 20px">
377
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
378
- <v-select :value.sync="selectBook" v-model='selectBook'
379
- :value-single="true" style="width: 80%"
380
- class="select_list select"
381
- :options='checkBooks' placeholder=''
382
- close-on-select></v-select>
383
- </div>
384
- </div>
385
- </div>
386
- </div>
387
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
388
- <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
389
- <button class="button_search" @click="cancel2">取消</button>
390
- </div>
391
- </modal>
392
- <modal :show.sync="showModal3" :backdrop="false">
393
- <div slot="modal-header" class="modal-header">
394
- <h4 class="modal-title">
395
- 调整用户
396
- </h4>
397
- </div>
398
- <div slot="modal-body" class="modal-body">
399
- <div v-if="true">
400
- <div class="row" style="margin-top: 10px;text-align: center">
401
- <div class="form-group col-sm-12" style="margin-top: 20px">
402
- <label class="font_normal_body">安&ensp;检&ensp;册</label>
403
- <v-select :value.sync="selectBook" v-model='selectBook'
404
- :value-single="true" style="width: 80%"
405
- class="select_list select"
406
- :options='checkBooks' placeholder=''
407
- close-on-select></v-select>
408
- </div>
409
- </div>
410
- </div>
411
- </div>
412
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
413
- <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
414
- <button class="button_search" @click="cancel3">取消</button>
415
- </div>
416
- </modal>
417
-
418
- </div>
419
- </template>
420
-
421
- <script>
422
- import {PagedList, HttpResetClass} from 'vue-client'
423
- import * as Util from '../../components/Util'
424
-
425
- export default {
426
- title: '安检册管理',
427
- data () {
428
- let model = new PagedList('rs/sql/getUserByCheckBook', 20)
429
- return {
430
- model: model,
431
- criteriaShow: false,
432
- excelHeaders: {},
433
- checkBooks: [],
434
- f_orgid: '',
435
- bookAll: false,
436
- bookList: [],
437
- selectBook:'',
438
- // init:false,
439
- aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
440
- isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_name is not null'}, {label: '否', value: 'f_check_book_name is null'}],
441
- isSearch: false,
442
- checkers:[],
443
- source:
444
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
445
- 'tool.getFullTree(dep.where(row.hasSpecialRole($安检册二次分配$)))',
446
- userid: this.$login.f.id,
447
- checkBook: {
448
- f_check_book_name: '',
449
- f_run_date: '',
450
- f_around_time: '',
451
- f_around_unit: '',
452
- f_create_date: Util.toStandardDateString(),
453
- f_create_person: this.$login.f.name,
454
- f_orgid: this.$login.f.orgid,
455
- f_depid:'',
456
- f_checker_name: '',
457
- f_checker_id:''
458
- },
459
- showModal: false,
460
- showModal2: false,
461
- showModal3: false,
462
- userstates:this.$appdata.getParam('安检用户状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检用户状态')]:[{label: '全部', value: ''}],
463
- usertypes:this.$appdata.getParam('用户类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]:[{label: '全部', value: ''}],
464
- gasproperties:this.$appdata.getParam('用气性质')?[{label: '全部', value: ''}, ...this.$appdata.getParam('用气性质')]:[{label: '全部', value: ''}],
465
- meter_classifys:this.$appdata.getParam('气表类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('气表类型')]:[{label: '全部', value: ''}],
466
- housetypes:this.$appdata.getParam('房屋类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('房屋类型')]:[{label: '全部', value: ''}],
467
- positions:this.$appdata.getParam('安装位置')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安装位置')]:[{label: '全部', value: ''}],
468
- usetypes:this.$appdata.getParam('使用类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]:[{label: '全部', value: ''}],
469
- check_states:this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
470
- meterbrands:[],
471
- sliceArea:[]
472
-
473
- }
474
- },
475
- props:['permission'],
476
- computed: {
477
- getgasbrand(){
478
- let ops=[{label:'全部',value:''}]
479
- this.meterbrands.forEach(b =>{
480
- ops.push({label:b.f_meter_brand,value:b})
481
- })
482
- return ops
483
- },
484
- getgasmodel(){
485
- let ops=[{label:'全部',value:''}]
486
- this.$refs.paged.$refs.criteria.model.gasmodel=''
487
- if(this.$refs.paged.$refs.criteria.model && this.$refs.paged.$refs.criteria.model.gasbrand){
488
- this.$refs.paged.$refs.criteria.model.gasbrand.gasmodel.forEach(b =>{
489
- ops.push({label:b.f_meter_style,value:b.id})
490
- })
491
- }
492
- return ops
493
- },
494
- searchData () {
495
- return {condition: this.model.condition}
496
- },
497
- bookCondition () {
498
- return this.model.condition
499
- },
500
- isCreateBook () {
501
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
502
- },
503
- isChangeBook () {
504
- return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
505
- }
506
- },
507
- methods: {
508
- //片区获取
509
- async getSliceArea() {
510
- let http = new HttpResetClass()
511
- let getAllArea = await http.load('POST', '/rs/search', {
512
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
513
- userid: this.userlogin.id
514
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
515
- this.sliceArea = [{label: '全部', value: ''}]
516
- getAllArea.data.forEach((res) => {
517
- if(res.parentid==this.userlogin.orgid){
518
- this.sliceArea.push({label:res.name,value:res.name})
519
- }
520
- })
521
- console.log('片区' + this.sliceArea)
522
- },
523
- //片区改变-对应抄表册下拉重新赋值
524
- slice_areaChange(value) {
525
- console.log("下拉改变--"+value)
526
- if(!value){
527
- this.cbc=[]
528
- this.meterbooks.forEach((res) => {
529
- this.cbc.push({label: res.f_book_name, value: res.id})
530
- })
531
- }else{
532
- this.cbc=[]
533
- this.meterbooks.forEach((res) => {
534
- if(res.f_book_slice_area==value){
535
- this.cbc.push({label: res.f_book_name, value: res.id})
536
- }
537
- })
538
- }
539
- },
540
- // 获取气表品牌
541
- setConList(){
542
- new HttpResetClass().load("POST", `/rs/logic/getSaleInitData`, {data:{f_orgid:`${this.$login.f.orgid}`}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
543
- this.meterbrands=res.data.gasbrands
544
- })
545
- },
546
- reres(val){
547
- if (!val.resids){
548
- return
549
- }
550
- console.log('val',val)
551
- this.checkBook.f_depid = val.resids[0]
552
- },
553
- clearBook(){
554
- this.checkBook ={
555
- f_check_book_name: '',
556
- f_run_date: '',
557
- f_around_time: '',
558
- f_around_unit: '',
559
- f_create_date: Util.toStandardDateString(),
560
- f_create_person: this.$login.f.name,
561
- f_orgid: this.$login.f.orgid,
562
- f_depid:'',
563
- f_checker_name: '',
564
- f_checker_id:''
565
- }
566
- },
567
- async ok2() {
568
- if (!this.selectBook) {
569
- this.$showMessage('请选择安检册')
570
- return
571
- }
572
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
573
- let userCondition = ''
574
- if (this.bookList.length < 1) {
575
- console.log('bookCondition', this.bookCondition)
576
- userCondition = this.bookCondition
577
- } else {
578
- console.log('this.bookList', JSON.stringify(this.bookList))
579
-
580
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
581
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
582
- console.log('condition', userCondition)
583
- }
584
- let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
585
- FROM
586
- t_userinfo tui
587
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
588
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
589
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
590
- WHERE
591
- tui.f_user_state = '正常'
592
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
593
- AND ${userCondition}`
594
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: addUser}},
595
- {resolveMsg: null, rejectMsg: '添加用户失败'})
596
- this.$showMessage('添加用户成功')
597
- this.selectBook = ''
598
- this.clearBook()
599
- this.bookAll = false
600
- this.bookList = []
601
- this.showModal2 = false
602
- this.$refs.paged.$refs.criteria.search()
603
- }
604
- },
605
- async ok3() {
606
- if (!this.selectBook) {
607
- this.$showMessage('请选择安检册')
608
- return
609
- }
610
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
611
- let userCondition = ''
612
- if (this.bookList.length < 1) {
613
- console.log('bookCondition', this.bookCondition)
614
- userCondition = this.bookCondition
615
- } else {
616
- console.log('this.bookList', JSON.stringify(this.bookList))
617
-
618
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
619
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
620
- console.log('condition', userCondition)
621
- }
622
- let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
623
- FROM
624
- t_userinfo tui
625
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
626
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
627
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
628
- WHERE
629
- tui.f_user_state = '正常'
630
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
631
- AND ${userCondition}`
632
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: upUser}},
633
- {resolveMsg: null, rejectMsg: '调整用户失败'})
634
- this.$showMessage('调整用户成功')
635
- this.selectBook = ''
636
- this.clearBook()
637
- this.bookAll = false
638
- this.bookList = []
639
- this.showModal3 = false
640
- this.$refs.paged.$refs.criteria.search()
641
- }
642
- },
643
- cancel2(){
644
- this.selectBook = ''
645
- this.clearBook()
646
- this.bookAll = false
647
- this.bookList = []
648
- this.showModal2 = false
649
- this.$refs.paged.$refs.criteria.search()
650
- },
651
- cancel3(){
652
- this.selectBook = ''
653
- this.clearBook()
654
- this.bookAll = false
655
- this.bookList = []
656
- this.showModal3 = false
657
- this.$refs.paged.$refs.criteria.search()
658
- },
659
- addUser () {
660
- if (!this.isCreateBook) {
661
- this.$showMessage('请选择查询未划分安检册的用户')
662
- return
663
- }
664
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
665
- this.showModal2 = true
666
- this.freshCheckBook()
667
- return
668
- }
669
- this.$showMessage('请选择用户')
670
- },
671
- upUser () {
672
- if (!this.isChangeBook) {
673
- this.$showMessage('请选择查询已划分安检册的用户')
674
- return
675
- }
676
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
677
- this.showModal3 = true
678
- this.freshCheckBook()
679
- return
680
- }
681
- this.$showMessage('请选择用户')
682
- },
683
- async delUser () {
684
- if (!this.isChangeBook) {
685
- this.$showMessage('请选择查询已划分安检册的用户')
686
- return
687
- }
688
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
689
- let userCondition= ''
690
- if (this.bookList.length < 1) {
691
- console.log('bookCondition', this.bookCondition)
692
- userCondition = this.bookCondition
693
- } else {
694
- console.log('this.bookList', JSON.stringify(this.bookList))
695
-
696
- userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
697
- userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
698
- console.log('condition', userCondition)
699
- }
700
- let delUser= `update t_user_address set f_check_book_id =null
701
- FROM
702
- t_userinfo tui
703
- LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
704
- LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
705
- LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
706
- WHERE
707
- tui.f_user_state = '正常'
708
- AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
709
- AND ${userCondition}`
710
- await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: delUser}},
711
- {resolveMsg: null, rejectMsg: '删除安检册失败'})
712
- this.$showMessage('从安检册删除所选用户成功')
713
- this.selectBook = ''
714
- this.bookAll = false
715
- this.clearBook()
716
- this.bookList = []
717
- this.showModal3 = false
718
- this.$refs.paged.$refs.criteria.search()
719
- return
720
- }
721
- this.$showMessage('请选择用户')
722
- },
723
- beforeCreateBook () {
724
- if (!this.isCreateBook) {
725
- this.$showMessage('请选择查询未划分安检册的用户')
726
- return
727
- }
728
- if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
729
- this.showModal = true
730
- return
731
- }
732
- this.$showMessage('请选择用户')
733
- },
734
- ok () {
735
- console.log('checkbook', JSON.stringify(this.checkBook))
736
- let condition = ''
737
- if (!this.checkBook.f_check_book_name) {
738
- this.$showMessage('请填写册名')
739
- return
740
- }
741
- if (!this.checkBook.f_checker_name && this.permission === 'c2') {
742
- this.$showMessage('请选择安检员')
743
- return
744
- }
745
- if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
746
- this.$showMessage('请选填写周期信息')
747
- return
748
- }
749
- if (!this.checkBook.f_run_date) {
750
- this.$showMessage('执行日期')
751
- return
752
- }
753
- if(this.checkBook.f_run_date < Util.toStandardDateString()){
754
- this.$showMessage('执行日期应大于当前日期')
755
- return
756
- }
757
- if (this.bookList.length < 1) {
758
- console.log('bookCondition', this.bookCondition)
759
- condition = this.bookCondition
760
- } else {
761
- console.log('this.bookList', JSON.stringify(this.bookList))
762
-
763
- condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
764
- condition = 'tui.f_userinfo_id in (' + condition + ')'
765
- console.log('condition', condition)
766
- }
767
- let data = {
768
- checkBook: this.checkBook,
769
- sqlStr: condition
770
- }
771
- new HttpResetClass().load('post', 'rs/logic/AddCheckBook', {data}).then(res => {
772
- console.log('res=>', JSON.stringify(res))
773
- if (res.data.id) {
774
- this.$showMessage('创建成功')
775
- this.showModal = false
776
- this.isSearch = false
777
- this.clearBook()
778
- this.bookList = []
779
- this.bookAll = false
780
- this.freshCheckBook()
781
- this.$refs.paged.$refs.criteria.search()
782
- }
783
- })
784
- },
785
- changeState (val) {
786
- console.log('66666666666', val)
787
- console.log(this.model.rows)
788
- this.bookAll = false
789
- this.bookList = []
790
- if (this.$refs.paged.$refs.criteria.model.f_orgid){
791
- this.$refs.paged.$refs.criteria.search()
792
- }
793
- },
794
- cancel () {
795
- this.bookAll = false
796
- this.bookList = []
797
- this.clearBook()
798
- this.showModal = false
799
- this.$refs.paged.$refs.criteria.search()
800
- },
801
- checkModel (row) {
802
- if (this.bookAll) {
803
- console.log('row', this.bookAll, JSON.stringify(row))
804
- return true
805
- } else {
806
- if (this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1) {
807
- console.log('row1111', JSON.stringify(row))
808
- return true
809
- } else {
810
- return false
811
- }
812
- }
813
- },
814
- checkChange (row, e) {
815
- console.log('e', e.target.checked)
816
- if (e.target.checked) {
817
- this.bookList.push(row.f_userinfo_id)
818
- } else {
819
- this.bookList.splice(this.bookList.findIndex(res => res === row.f_userinfo_id), 1)
820
- }
821
- // console.log('aaaaa', JSON.stringify(this.bookList))
822
- },
823
- getRes (obj) {
824
- this.checkBook.f_orgid = obj.resids[0]
825
- },
826
- getResm (obj) {
827
- this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
828
- },
829
- hidden () {
830
- this.criteriaShow = !this.criteriaShow
831
- },
832
- selfSearch (args) {
833
- this.isSearch = true
834
- this.bookAll = false
835
- this.bookList = []
836
- // if (this.$refs.paged.$refs.criteria.model.f_orgid){
837
- // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
838
- // }
839
- if (this.permission === 'c2'){
840
- args.condition +=` and tcb.f_depid = '${this.$login.f.depids}'`
841
- }
842
- if(args.model.gasbrand){
843
- args.condition +=` and tuf.f_gasbrand_id=${args.model.gasbrand.id}`
844
- }
845
- this.model.search(args.condition, args.model)
846
- },
847
- getChecker(){
848
- let http = new HttpResetClass()
849
- http.load('POST', '/rs/search', {data: {source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))', userid: this.$login.f.id}}, {resolveMsg: null, rejectMsg: null})
850
- .then(res => {
851
- console.log('res666-->' + JSON.stringify(res))
852
- this.checkers = res.data.map(res=>{
853
- return {label:res.name,value:res.name}
854
- })
855
- })
856
- },
857
- freshCheckBook () {
858
- this.checkBooks = []
859
- new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
860
- data: {
861
- items: 'id,f_check_book_name',
862
- tablename: 't_check_book',
863
- condition: (this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1')+(this.permission === 'c2' ? ` and f_depid='${this.$login.f.depids}'`:'') ,
864
- orderitem: 'id desc'
865
- }
866
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
867
- this.checkBooks.push({label: '全部', value: ''})
868
- res.data.forEach(ress => {
869
- this.checkBooks.push({
870
- label: ress.f_check_book_name,
871
- value: ress.id
872
- })
873
- })
874
- })
875
- }
876
- },
877
-
878
- ready () {
879
- // 获取片区
880
- this.getSliceArea()
881
- // 获取营收气表参数
882
- this.setConList()
883
- if (this.permission === 'c1'){
884
- this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is null'
885
- }else if(this.permission === 'c2'){
886
- this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is not null'
887
- }
888
-
889
- console.log('checkbook', this.$login.f)
890
- this.checkBook.f_orgid = this.$login.f.orgid
891
- console.log('permission2',this.permission)
892
- // this.init=true
893
- this.freshCheckBook()
894
- this.getChecker()
895
- }
896
- }
897
- </script>
898
- <style scoped>
899
- /*.btn-group > .btn:first-child {*/
900
- /* margin-left: 0;*/
901
- /* width: 100%;*/
902
- /*}*/
903
- </style>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="basic-main">
4
+ <criteria-paged :model="model" v-ref:paged>
5
+ <criteria partial='criteria' class="search_area" @condition-changed='$parent.selfSearch' v-ref:criteria>
6
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
7
+ <div class="row">
8
+ <div class="form-group col-sm-2">
9
+ <label class="font_normal_body">客户编号</label>
10
+ <input type="text" class="input_search" v-model="model.f_userinfo_code"
11
+ style="width: 60%" placeholder="客户编号" condition="tui.f_userinfo_code='{}'">
12
+ </div>
13
+ <div class="form-group col-sm-2">
14
+ <label class="font_normal_body">客户名称</label>
15
+ <input type="text" class="input_search" v-model="model.f_user_name"
16
+ style="width: 60%" placeholder="客户名称" condition="tui.f_user_name like '{}%'">
17
+ </div>
18
+ <div class="form-group col-sm-2">
19
+ <label class="font_normal_body">客户电话</label>
20
+ <input type="text" class="input_search" v-model="model.f_user_phone"
21
+ style="width: 60%" placeholder="客户电话" condition="tui.f_user_phone like '{}%'">
22
+ </div>
23
+ <div class="form-group col-sm-2">
24
+ <label class="font_normal_body">客户地址</label>
25
+ <input type="text" class="input_search" v-model="model.f_address"
26
+ style="width: 60%" placeholder="客户地址" condition="tua.f_address like '%{}%'">
27
+ </div>
28
+
29
+ <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right">
30
+
31
+ <export-excel-safe :data="$parent.$parent.searchData"
32
+ :field="$parent.$parent.excelHeaders"
33
+ progress="safeGetExportProgress"
34
+ sqlurl="rs/logic/SafeExportExcel" sql-name="defectDetails"
35
+ template-name='安检隐患明细'></export-excel-safe>
36
+
37
+
38
+ <button class="button_spacing button_search" @click="search()">查询</button>
39
+ <!-- <div style="float: right" class="button_spacing"-->
40
+ <!-- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"-->
41
+ <!-- @click="$parent.$parent.hidden()"></div>-->
42
+ </div>
43
+ <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right" v-if="$parent.$parent.permission === 'c1'">
44
+
45
+
46
+ <button class="button_spacing button_search" @click="$parent.$parent.beforeCreateBook">创建安检册</button>
47
+
48
+ </div>
49
+ </div>
50
+ <div class="row">
51
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
52
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
53
+ <right-tree-safe @re-res="$parent.$parent.getResm" v-model="model.f_orgid" condition="tua.f_orgid in {}"></right-tree-safe>
54
+ </div>
55
+ <div class="form-group col-sm-2" style="margin-top: 0px">
56
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
57
+ <input type="text" class="input_search" v-model="model.f_residential_area"
58
+ style="width: 60%" placeholder="小区" condition="tua.f_residential_area like '%{}%'">
59
+ </div>
60
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
61
+
62
+ <label class="font_normal_body" title="用户类型">用户类型</label>
63
+ <v-select :value.sync="model.f_user_type" v-model='model.f_user_type'
64
+ :value-single="true" style="width: 60%"
65
+ class="select_list select"
66
+ :options='$parent.$parent.usertypes' placeholder='用户类型'
67
+ close-on-select
68
+ condition="tuf.f_user_type ='{}'"></v-select>
69
+
70
+ </div>
71
+ <!-- <div class="col-sm-2 form-group" style="margin: 0">
72
+
73
+ <label class="font_normal_body" title="安检用户状态">用户状态</label>
74
+ <v-select :value.sync="model.f_user_state" v-model='model.f_user_state'
75
+ :value-single="true" style="width: 60%"
76
+ class="select_list select"
77
+ :options='$parent.$parent.userstates' placeholder='用户状态'
78
+ close-on-select
79
+ condition="tui.f_user_state ='{}'"></v-select>
80
+
81
+ </div> -->
82
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
83
+
84
+ <label class="font_normal_body" title="用气性质">用气性质</label>
85
+ <v-select :value.sync="model.f_gasproperties" v-model='model.f_gasproperties'
86
+ :value-single="true" style="width: 60%"
87
+ class="select_list select"
88
+ :options='$parent.$parent.gasproperties' placeholder='用气性质'
89
+ close-on-select
90
+ condition="tuf.f_gasproperties ='{}'"></v-select>
91
+
92
+ </div>
93
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
94
+
95
+ <label class="font_normal_body" title="气表类型">气表类型</label>
96
+ <v-select
97
+ class="select select_list"
98
+ :value.sync="model.f_meter_classify"
99
+ v-model="model.f_meter_classify"
100
+ :options='$parent.$parent.meter_classifys'
101
+ placeholder='请选择'
102
+ condition="tuf.f_meter_classify='{}'"
103
+ :search="false"
104
+ style="width: 60%"
105
+ close-on-select
106
+ value-single
107
+ ></v-select>
108
+ </div>
109
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
110
+
111
+ <label class="font_normal_body">气表品牌</label>
112
+ <v-select :value.sync="model.gasbrand" v-model='model.gasbrand'
113
+ :value-single="true" style="width: 60%"
114
+ class="select_list select"
115
+ :options='$parent.$parent.getgasbrand' placeholder='气表品牌'
116
+ close-on-select
117
+ ></v-select>
118
+ </div>
119
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
120
+
121
+ <label class="font_normal_body">气表型号</label>
122
+ <v-select :value.sync="model.gasmodel" v-model='model.gasmodel'
123
+ :value-single="true" style="width: 60%"
124
+ class="select_list select"
125
+ :options='$parent.$parent.getgasmodel' placeholder='气表型号'
126
+ close-on-select
127
+ condition="tuf.f_gasmodel_id = {}"></v-select>
128
+
129
+ </div>
130
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
131
+
132
+ <label class="font_normal_body" title="房屋类型">房屋类型</label>
133
+ <v-select :value.sync="model.f_house_type" v-model='model.f_house_type'
134
+ :value-single="true" style="width: 60%"
135
+ class="select_list select"
136
+ :options='$parent.$parent.housetypes' placeholder='房屋类型'
137
+ close-on-select
138
+ condition="tui.f_house_type = {}"></v-select>
139
+
140
+ </div>
141
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
142
+
143
+ <label class="font_normal_body" title="安装位置">安装位置</label>
144
+ <v-select :value.sync="model.f_position" v-model='model.f_position'
145
+ :value-single="true" style="width: 60%"
146
+ class="select_list select"
147
+ :options='$parent.$parent.positions' placeholder='安装位置'
148
+ close-on-select
149
+ condition="tuf.f_position = {}"></v-select>
150
+
151
+ </div>
152
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
153
+
154
+ <label class="font_normal_body" title="使用类型">使用类型</label>
155
+ <v-select :value.sync="model.f_usetype" v-model='model.f_usetype'
156
+ :value-single="true" style="width: 60%"
157
+ class="select_list select"
158
+ :options='$parent.$parent.usetypes' placeholder='使用类型'
159
+ close-on-select
160
+ condition="tuf.f_usetype = {}"></v-select>
161
+
162
+ </div>
163
+ <div class="form-group col-sm-2" style="margin-top: 0px">
164
+ <label class="font_normal_body">开户起始</label>
165
+ <datepicker
166
+ placeholder='开户起始'
167
+ style="width:60%"
168
+ :disabled-days-of-week="[]"
169
+ :format="'yyyy-MM-dd'"
170
+ :show-rest-button="reset"
171
+ :value.sync="model.f_startfile_time"
172
+ v-model="model.f_startfile_time"
173
+ condition="tui.f_createfile_date >= '{} 00:00:00'">
174
+ </datepicker>
175
+ </div>
176
+ <div class="form-group col-sm-2"style="margin-top: 0px" >
177
+ <label class="font_normal_body">开户截止</label>
178
+ <datepicker
179
+ placeholder='开户截止'
180
+ :disabled-days-of-week="[]"
181
+ style="width:60%"
182
+ :format="'yyyy-MM-dd'"
183
+ :show-rest-button="reset"
184
+ :value.sync="model.f_endfile_time"
185
+ v-model="model.f_endfile_time"
186
+ condition="tui.f_createfile_date <= '{} 00:00:00'">
187
+ </datepicker>
188
+ </div>
189
+ <div class="form-group col-sm-2" style="margin-top: 0px">
190
+ <label class="font_normal_body">片&ensp;&ensp;&ensp;&ensp;区</label>
191
+ <v-select
192
+ class="select select_list"
193
+ style="width:60%"
194
+ :value.sync="model.f_book_slice_area"
195
+ v-model="model.f_book_slice_area"
196
+ :options='$parent.$parent.sliceArea'
197
+ placeholder='片区'
198
+ condition="tua.f_slice_area ='{}'"
199
+ close-on-select
200
+ value-single
201
+ >
202
+ </v-select>
203
+ </div>
204
+ <div class="form-group col-sm-2" style="margin-top: 0px">
205
+ <label class="font_normal_body" title="安检状态">安检状态</label>
206
+ <v-select
207
+ class="select select_list"
208
+ style="width:60%"
209
+ :value.sync="model.f_last_check_state"
210
+ v-model="model.f_last_check_state"
211
+ :options='$parent.$parent.check_states'
212
+ placeholder='安检状态'
213
+ condition="tua.f_last_check_state ='{}'"
214
+ close-on-select
215
+ value-single
216
+ >
217
+ </v-select>
218
+ </div>
219
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
220
+
221
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
222
+ <v-select :value.sync="model.f_check_book_id" v-model='model.f_check_book_id'
223
+ :value-single="true" style="width: 60%"
224
+ class="select_list select"
225
+ :options='$parent.$parent.checkBooks' placeholder='安&ensp;检&ensp;册'
226
+ close-on-select
227
+ condition="f_check_book_id ='{}'"></v-select>
228
+
229
+ </div>
230
+ <div class="col-sm-2 form-group" style="margin-top: 0px">
231
+
232
+ <label class="font_normal_body">是否划分</label>
233
+ <v-select :value.sync="model.f_is_checkbook" v-model='model.f_is_checkbook'
234
+ :value-single="true" style="width: 60%"
235
+ class="select_list select"
236
+ @change="$parent.$parent.changeState"
237
+ :options='$parent.$parent.isCheckBook' placeholder='有无所属安检册'
238
+ close-on-select
239
+ condition="{}"></v-select>
240
+
241
+ </div>
242
+ <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right" v-if="$parent.$parent.permission === 'c1'">
243
+
244
+
245
+ <button class="button_spacing button_search" @click="$parent.$parent.addUser">添加用户</button>
246
+
247
+ </div>
248
+ <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right">
249
+
250
+
251
+ <button class="button_spacing button_search" @click="$parent.$parent.upUser">调整用户</button>
252
+
253
+ </div>
254
+ <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right" v-if="$parent.$parent.permission === 'c1'">
255
+
256
+
257
+ <button class="button_spacing button_search" @click="$parent.$parent.delUser">移除用户</button>
258
+
259
+ </div>
260
+ </div>
261
+ </div>
262
+ </criteria>
263
+ <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
264
+ <template partial='head'>
265
+ <tr @dblclick.stop="">
266
+ <th>
267
+ <nobr><input type="checkbox" v-model="$parent.$parent.$parent.bookAll"></input>全选</nobr>
268
+ </th>
269
+ <th>
270
+ <nobr>客户姓名</nobr>
271
+ </th>
272
+ <th>
273
+ <nobr>客户编号</nobr>
274
+ </th>
275
+ <th>
276
+ <nobr>客户类型</nobr>
277
+ </th>
278
+ <th>
279
+ <nobr>客户电话</nobr>
280
+ </th>
281
+ <th>
282
+ <nobr>客户地址</nobr>
283
+ </th>
284
+ <th>
285
+ <nobr>所属安检册</nobr>
286
+ </th>
287
+ </tr>
288
+ </template>
289
+ <template partial='body'>
290
+ <td style="text-align: center">
291
+ <nobr><input type="checkbox" :checked="$parent.$parent.$parent.checkModel(row)"
292
+ @change="$parent.$parent.$parent.checkChange(row, $event)"></input>
293
+ </nobr>
294
+ </td>
295
+ <td style="text-align: center">{{ row.f_user_name }}</td>
296
+ <td style="text-align: center">{{ row.f_userinfo_code }}</td>
297
+ <td style="text-align: center">{{ row.f_user_type }}</td>
298
+ <td style="text-align: center">{{ row.f_user_phone }}</td>
299
+ <td style="text-align: center">{{ row.f_address }}</td>
300
+ <td style="text-align: center">{{ row.f_check_book_name }}</td>
301
+ </template>
302
+ </data-grid>
303
+ </criteria-paged>
304
+ </div>
305
+ <modal :show.sync="showModal" :backdrop="false">
306
+ <div slot="modal-header" class="modal-header">
307
+ <h4 class="modal-title">
308
+ 创建安检册
309
+ </h4>
310
+ </div>
311
+ <div slot="modal-body" class="modal-body">
312
+ <div v-if="true">
313
+ <div class="row" style="margin-top: 10px">
314
+ <!-- <label class="control-label font text-left" style="float:left;margin-left:10%;margin-top:5px">安检册名称</label>-->
315
+ <!-- <div class="col-xs-8 col-md-8">-->
316
+ <!-- <input type="text" class="input_search" style="width: 70%;" v-model="checkBook.f_check_book_name"/>-->
317
+ <!-- </div>-->
318
+ <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c1' && showModal ">
319
+ <label class="font_normal_body">安检科室</label>
320
+ <right-tree islist :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择科室" :selectData="" v-ref:f_reciever>
321
+ </right-tree>
322
+ </div>
323
+ <div class="col-sm-6 form-group" style="margin-top: 20px" v-if="permission === 'c2' ">
324
+ <label class="font_normal_body">安&ensp;检&ensp;员</label>
325
+ <v-select :value.sync="checkBook.f_checker_name" v-model='checkBook.f_checker_name'
326
+ :value-single="true" style="width: 60%"
327
+ class="select_list select"
328
+ :options='checkers' placeholder='安检员'
329
+ close-on-select></v-select>
330
+ </div>
331
+ <div class="form-group col-sm-6" style="margin-top: 20px">
332
+ <label class="font_normal_body">安检册名</label>
333
+ <input type="text" class="input_search" v-model="checkBook.f_check_book_name"
334
+ style="width: 60%" >
335
+ </div>
336
+ <div class="form-group col-sm-6" style="margin-top: 20px">
337
+ <label class="font_normal_body">执行日期</label>
338
+ <datepicker
339
+ :value.sync="checkBook.f_run_date"
340
+ style="width: 60%"
341
+ :format="'yyyy-MM-dd'"
342
+ v-model="checkBook.f_run_date"
343
+ >
344
+ </datepicker>
345
+ </div>
346
+ <div class="form-group col-sm-6" style="margin-top: 20px">
347
+ <label class="font_normal_body">执行周期</label>
348
+ <input type="number" class="input_search" v-model="checkBook.f_around_time"
349
+ style="width: 60%" >
350
+ </div>
351
+ <div class="form-group col-sm-6" style="margin-top: 20px">
352
+ <label class="font_normal_body">周期单位</label>
353
+ <v-select :value.sync="checkBook.f_around_unit" v-model='checkBook.f_around_unit'
354
+ :value-single="true" style="width: 60%"
355
+ class="select_list select"
356
+ :options='aroundUnit' placeholder=''
357
+ close-on-select></v-select>
358
+ </div>
359
+ </div>
360
+ </div>
361
+ </div>
362
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
363
+ <button class="button_search" style="margin-right: 20px" @click="ok">确认</button>
364
+ <button class="button_search" @click="cancel">取消</button>
365
+ </div>
366
+ </modal>
367
+ <modal :show.sync="showModal2" :backdrop="false">
368
+ <div slot="modal-header" class="modal-header">
369
+ <h4 class="modal-title">
370
+ 添加用户
371
+ </h4>
372
+ </div>
373
+ <div slot="modal-body" class="modal-body">
374
+ <div v-if="true">
375
+ <div class="row" style="margin-top: 10px">
376
+ <div class="form-group col-sm-12" style="margin-top: 20px">
377
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
378
+ <v-select :value.sync="selectBook" v-model='selectBook'
379
+ :value-single="true" style="width: 80%"
380
+ class="select_list select"
381
+ :options='checkBooks' placeholder=''
382
+ close-on-select></v-select>
383
+ </div>
384
+ </div>
385
+ </div>
386
+ </div>
387
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
388
+ <button class="button_search" style="margin-right: 20px" @click="ok2">确认</button>
389
+ <button class="button_search" @click="cancel2">取消</button>
390
+ </div>
391
+ </modal>
392
+ <modal :show.sync="showModal3" :backdrop="false">
393
+ <div slot="modal-header" class="modal-header">
394
+ <h4 class="modal-title">
395
+ 调整用户
396
+ </h4>
397
+ </div>
398
+ <div slot="modal-body" class="modal-body">
399
+ <div v-if="true">
400
+ <div class="row" style="margin-top: 10px;text-align: center">
401
+ <div class="form-group col-sm-12" style="margin-top: 20px">
402
+ <label class="font_normal_body">安&ensp;检&ensp;册</label>
403
+ <v-select :value.sync="selectBook" v-model='selectBook'
404
+ :value-single="true" style="width: 80%"
405
+ class="select_list select"
406
+ :options='checkBooks' placeholder=''
407
+ close-on-select></v-select>
408
+ </div>
409
+ </div>
410
+ </div>
411
+ </div>
412
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
413
+ <button class="button_search" style="margin-right: 20px" @click="ok3">确认</button>
414
+ <button class="button_search" @click="cancel3">取消</button>
415
+ </div>
416
+ </modal>
417
+
418
+ </div>
419
+ </template>
420
+
421
+ <script>
422
+ import {PagedList, HttpResetClass} from 'vue-client'
423
+ import * as Util from '../../components/Util'
424
+
425
+ export default {
426
+ title: '安检册管理',
427
+ data () {
428
+ let model = new PagedList('rs/sql/getUserByCheckBook', 20)
429
+ return {
430
+ model: model,
431
+ criteriaShow: false,
432
+ excelHeaders: {},
433
+ checkBooks: [],
434
+ f_orgid: '',
435
+ bookAll: false,
436
+ bookList: [],
437
+ selectBook:'',
438
+ // init:false,
439
+ aroundUnit: [{label: '年', value: '年'}, {label: '月', value: '月'}, {label: '日', value: '月'}],
440
+ isCheckBook: [{label: '全部', value: ''}, {label: '是', value: 'f_check_book_name is not null'}, {label: '否', value: 'f_check_book_name is null'}],
441
+ isSearch: false,
442
+ checkers:[],
443
+ source:
444
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
445
+ 'tool.getFullTree(dep.where(row.hasSpecialRole($安检册二次分配$)))',
446
+ userid: this.$login.f.id,
447
+ checkBook: {
448
+ f_check_book_name: '',
449
+ f_run_date: '',
450
+ f_around_time: '',
451
+ f_around_unit: '',
452
+ f_create_date: Util.toStandardDateString(),
453
+ f_create_person: this.$login.f.name,
454
+ f_orgid: this.$login.f.orgid,
455
+ f_depid:'',
456
+ f_dep:'',
457
+ f_checker_name: '',
458
+ f_checker_id:''
459
+ },
460
+ showModal: false,
461
+ showModal2: false,
462
+ showModal3: false,
463
+ userstates:this.$appdata.getParam('安检用户状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检用户状态')]:[{label: '全部', value: ''}],
464
+ usertypes:this.$appdata.getParam('用户类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')]:[{label: '全部', value: ''}],
465
+ gasproperties:this.$appdata.getParam('用气性质')?[{label: '全部', value: ''}, ...this.$appdata.getParam('用气性质')]:[{label: '全部', value: ''}],
466
+ meter_classifys:this.$appdata.getParam('气表类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('气表类型')]:[{label: '全部', value: ''}],
467
+ housetypes:this.$appdata.getParam('房屋类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('房屋类型')]:[{label: '全部', value: ''}],
468
+ positions:this.$appdata.getParam('安装位置')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安装位置')]:[{label: '全部', value: ''}],
469
+ usetypes:this.$appdata.getParam('使用类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('使用类型')]:[{label: '全部', value: ''}],
470
+ check_states:this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
471
+ meterbrands:[],
472
+ sliceArea:[]
473
+
474
+ }
475
+ },
476
+ props:['permission'],
477
+ computed: {
478
+ getgasbrand(){
479
+ let ops=[{label:'全部',value:''}]
480
+ this.meterbrands.forEach(b =>{
481
+ ops.push({label:b.f_meter_brand,value:b})
482
+ })
483
+ return ops
484
+ },
485
+ getgasmodel(){
486
+ let ops=[{label:'全部',value:''}]
487
+ this.$refs.paged.$refs.criteria.model.gasmodel=''
488
+ if(this.$refs.paged.$refs.criteria.model && this.$refs.paged.$refs.criteria.model.gasbrand){
489
+ this.$refs.paged.$refs.criteria.model.gasbrand.gasmodel.forEach(b =>{
490
+ ops.push({label:b.f_meter_style,value:b.id})
491
+ })
492
+ }
493
+ return ops
494
+ },
495
+ searchData () {
496
+ return {condition: this.model.condition}
497
+ },
498
+ bookCondition () {
499
+ return this.model.condition
500
+ },
501
+ isCreateBook () {
502
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is null'
503
+ },
504
+ isChangeBook () {
505
+ return this.$refs.paged.$refs.criteria.model.f_is_checkbook === 'f_check_book_name is not null'
506
+ }
507
+ },
508
+ methods: {
509
+ //片区获取
510
+ async getSliceArea() {
511
+ let http = new HttpResetClass()
512
+ let getAllArea = await http.load('POST', '/rs/search', {
513
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
514
+ userid: this.userlogin.id
515
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
516
+ this.sliceArea = [{label: '全部', value: ''}]
517
+ getAllArea.data.forEach((res) => {
518
+ if(res.parentid==this.userlogin.orgid){
519
+ this.sliceArea.push({label:res.name,value:res.name})
520
+ }
521
+ })
522
+ console.log('片区' + this.sliceArea)
523
+ },
524
+ //片区改变-对应抄表册下拉重新赋值
525
+ slice_areaChange(value) {
526
+ console.log("下拉改变--"+value)
527
+ if(!value){
528
+ this.cbc=[]
529
+ this.meterbooks.forEach((res) => {
530
+ this.cbc.push({label: res.f_book_name, value: res.id})
531
+ })
532
+ }else{
533
+ this.cbc=[]
534
+ this.meterbooks.forEach((res) => {
535
+ if(res.f_book_slice_area==value){
536
+ this.cbc.push({label: res.f_book_name, value: res.id})
537
+ }
538
+ })
539
+ }
540
+ },
541
+ // 获取气表品牌
542
+ setConList(){
543
+ new HttpResetClass().load("POST", `/rs/logic/getSaleInitData`, {data:{f_orgid:`${this.$login.f.orgid}`}}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
544
+ this.meterbrands=res.data.gasbrands
545
+ })
546
+ },
547
+ reres(val){
548
+ if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || val.resids.length>1){
549
+ return
550
+ }
551
+ console.log('val2',val)
552
+ const resids = val.orgobj.filter(res=>res.resourcetype==='department')
553
+ console.log('val2',resids)
554
+ if (resids.length>0){
555
+ this.checkBook.f_depid = resids[0].id
556
+ this.checkBook.f_dep = resids[0].name
557
+ }
558
+ },
559
+ clearBook(){
560
+ this.checkBook ={
561
+ f_check_book_name: '',
562
+ f_run_date: '',
563
+ f_around_time: '',
564
+ f_around_unit: '',
565
+ f_create_date: Util.toStandardDateString(),
566
+ f_create_person: this.$login.f.name,
567
+ f_orgid: this.$login.f.orgid,
568
+ f_depid:'',
569
+ f_dep:'',
570
+ f_checker_name: '',
571
+ f_checker_id:''
572
+ }
573
+ },
574
+ async ok2() {
575
+ if (!this.selectBook) {
576
+ this.$showMessage('请选择安检册')
577
+ return
578
+ }
579
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
580
+ let userCondition = ''
581
+ if (this.bookList.length < 1) {
582
+ console.log('bookCondition', this.bookCondition)
583
+ userCondition = this.bookCondition
584
+ } else {
585
+ console.log('this.bookList', JSON.stringify(this.bookList))
586
+
587
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
588
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
589
+ console.log('condition', userCondition)
590
+ }
591
+ let addUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
592
+ FROM
593
+ t_userinfo tui
594
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
595
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
596
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
597
+ WHERE
598
+ tui.f_user_state = '正常'
599
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
600
+ AND ${userCondition}`
601
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: addUser}},
602
+ {resolveMsg: null, rejectMsg: '添加用户失败'})
603
+ this.$showMessage('添加用户成功')
604
+ this.selectBook = ''
605
+ this.clearBook()
606
+ this.bookAll = false
607
+ this.bookList = []
608
+ this.showModal2 = false
609
+ this.$refs.paged.$refs.criteria.search()
610
+ }
611
+ },
612
+ async ok3() {
613
+ if (!this.selectBook) {
614
+ this.$showMessage('请选择安检册')
615
+ return
616
+ }
617
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
618
+ let userCondition = ''
619
+ if (this.bookList.length < 1) {
620
+ console.log('bookCondition', this.bookCondition)
621
+ userCondition = this.bookCondition
622
+ } else {
623
+ console.log('this.bookList', JSON.stringify(this.bookList))
624
+
625
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
626
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
627
+ console.log('condition', userCondition)
628
+ }
629
+ let upUser = `update t_user_address set f_check_book_id ='${this.selectBook}'
630
+ FROM
631
+ t_userinfo tui
632
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
633
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
634
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
635
+ WHERE
636
+ tui.f_user_state = '正常'
637
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
638
+ AND ${userCondition}`
639
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: upUser}},
640
+ {resolveMsg: null, rejectMsg: '调整用户失败'})
641
+ this.$showMessage('调整用户成功')
642
+ this.selectBook = ''
643
+ this.clearBook()
644
+ this.bookAll = false
645
+ this.bookList = []
646
+ this.showModal3 = false
647
+ this.$refs.paged.$refs.criteria.search()
648
+ }
649
+ },
650
+ cancel2(){
651
+ this.selectBook = ''
652
+ this.clearBook()
653
+ this.bookAll = false
654
+ this.bookList = []
655
+ this.showModal2 = false
656
+ this.$refs.paged.$refs.criteria.search()
657
+ },
658
+ cancel3(){
659
+ this.selectBook = ''
660
+ this.clearBook()
661
+ this.bookAll = false
662
+ this.bookList = []
663
+ this.showModal3 = false
664
+ this.$refs.paged.$refs.criteria.search()
665
+ },
666
+ addUser () {
667
+ if (!this.isCreateBook) {
668
+ this.$showMessage('请选择查询未划分安检册的用户')
669
+ return
670
+ }
671
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
672
+ this.showModal2 = true
673
+ this.freshCheckBook()
674
+ return
675
+ }
676
+ this.$showMessage('请选择用户')
677
+ },
678
+ upUser () {
679
+ if (!this.isChangeBook) {
680
+ this.$showMessage('请选择查询已划分安检册的用户')
681
+ return
682
+ }
683
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
684
+ this.showModal3 = true
685
+ this.freshCheckBook()
686
+ return
687
+ }
688
+ this.$showMessage('请选择用户')
689
+ },
690
+ async delUser () {
691
+ if (!this.isChangeBook) {
692
+ this.$showMessage('请选择查询已划分安检册的用户')
693
+ return
694
+ }
695
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
696
+ let userCondition= ''
697
+ if (this.bookList.length < 1) {
698
+ console.log('bookCondition', this.bookCondition)
699
+ userCondition = this.bookCondition
700
+ } else {
701
+ console.log('this.bookList', JSON.stringify(this.bookList))
702
+
703
+ userCondition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
704
+ userCondition = 'tui.f_userinfo_id in (' + userCondition + ')'
705
+ console.log('condition', userCondition)
706
+ }
707
+ let delUser= `update t_user_address set f_check_book_id =null
708
+ FROM
709
+ t_userinfo tui
710
+ LEFT JOIN t_userfiles tuf ON tui.f_userinfo_id= tuf.f_userinfo_id
711
+ LEFT JOIN t_user_address tua ON tuf.f_userinfo_id = tua.f_userinfo_id
712
+ LEFT JOIN t_check_book tcb ON tua.f_check_book_id= tcb.id
713
+ WHERE
714
+ tui.f_user_state = '正常'
715
+ AND ( tuf.f_table_state= '正常' OR tuf.f_table_state= '停用' )
716
+ AND ${userCondition}`
717
+ await new HttpResetClass().load('POST', 'rs/logic/runSQL', {data: {sql: delUser}},
718
+ {resolveMsg: null, rejectMsg: '删除安检册失败'})
719
+ this.$showMessage('从安检册删除所选用户成功')
720
+ this.selectBook = ''
721
+ this.bookAll = false
722
+ this.clearBook()
723
+ this.bookList = []
724
+ this.showModal3 = false
725
+ this.$refs.paged.$refs.criteria.search()
726
+ return
727
+ }
728
+ this.$showMessage('请选择用户')
729
+ },
730
+ beforeCreateBook () {
731
+ if (!this.isCreateBook) {
732
+ this.$showMessage('请选择查询未划分安检册的用户')
733
+ return
734
+ }
735
+ if (this.isSearch && (this.bookAll || this.bookList.length > 0) && this.model.rows.length > 0) {
736
+ this.showModal = true
737
+ return
738
+ }
739
+ this.$showMessage('请选择用户')
740
+ },
741
+ ok () {
742
+ console.log('checkbook', JSON.stringify(this.checkBook))
743
+ let condition = ''
744
+ if (!this.checkBook.f_check_book_name) {
745
+ this.$showMessage('请填写册名')
746
+ return
747
+ }
748
+ if (!this.checkBook.f_checker_name && this.permission === 'c2') {
749
+ this.$showMessage('请选择安检员')
750
+ return
751
+ }
752
+ if (!this.checkBook.f_around_time || !this.checkBook.f_around_unit) {
753
+ this.$showMessage('请选填写周期信息')
754
+ return
755
+ }
756
+ if (!this.checkBook.f_run_date) {
757
+ this.$showMessage('执行日期')
758
+ return
759
+ }
760
+ if(this.checkBook.f_run_date < Util.toStandardDateString()){
761
+ this.$showMessage('执行日期应大于当前日期')
762
+ return
763
+ }
764
+ if (this.bookList.length < 1) {
765
+ console.log('bookCondition', this.bookCondition)
766
+ condition = this.bookCondition
767
+ } else {
768
+ console.log('this.bookList', JSON.stringify(this.bookList))
769
+
770
+ condition = JSON.stringify(this.bookList).substring(JSON.stringify(this.bookList).indexOf('[') + 1, JSON.stringify(this.bookList).indexOf(']'))
771
+ condition = 'tui.f_userinfo_id in (' + condition + ')'
772
+ console.log('condition', condition)
773
+ }
774
+ let data = {
775
+ checkBook: this.checkBook,
776
+ sqlStr: condition
777
+ }
778
+ new HttpResetClass().load('post', 'rs/logic/AddCheckBook', {data}).then(res => {
779
+ console.log('res=>', JSON.stringify(res))
780
+ if (res.data.id) {
781
+ this.$showMessage('创建成功')
782
+ this.showModal = false
783
+ this.isSearch = false
784
+ this.clearBook()
785
+ this.bookList = []
786
+ this.bookAll = false
787
+ this.freshCheckBook()
788
+ this.$refs.paged.$refs.criteria.search()
789
+ }
790
+ })
791
+ },
792
+ changeState (val) {
793
+ console.log('66666666666', val)
794
+ console.log(this.model.rows)
795
+ this.bookAll = false
796
+ this.bookList = []
797
+ if (this.$refs.paged.$refs.criteria.model.f_orgid){
798
+ this.$refs.paged.$refs.criteria.search()
799
+ }
800
+ },
801
+ cancel () {
802
+ this.bookAll = false
803
+ this.bookList = []
804
+ this.clearBook()
805
+ this.showModal = false
806
+ this.$refs.paged.$refs.criteria.search()
807
+ },
808
+ checkModel (row) {
809
+ if (this.bookAll) {
810
+ console.log('row', this.bookAll, JSON.stringify(row))
811
+ return true
812
+ } else {
813
+ if (this.bookList.findIndex(res => res === row.f_userinfo_id) !== -1) {
814
+ console.log('row1111', JSON.stringify(row))
815
+ return true
816
+ } else {
817
+ return false
818
+ }
819
+ }
820
+ },
821
+ checkChange (row, e) {
822
+ console.log('e', e.target.checked)
823
+ if (e.target.checked) {
824
+ this.bookList.push(row.f_userinfo_id)
825
+ } else {
826
+ this.bookList.splice(this.bookList.findIndex(res => res === row.f_userinfo_id), 1)
827
+ }
828
+ // console.log('aaaaa', JSON.stringify(this.bookList))
829
+ },
830
+ getRes (obj) {
831
+ this.checkBook.f_orgid = obj.resids[0]
832
+ },
833
+ getResm (obj) {
834
+ this.$refs.paged.$refs.criteria.model.f_orgid = this.$login.convertToIn(obj.resids)
835
+ },
836
+ hidden () {
837
+ this.criteriaShow = !this.criteriaShow
838
+ },
839
+ selfSearch (args) {
840
+ this.isSearch = true
841
+ this.bookAll = false
842
+ this.bookList = []
843
+ // if (this.$refs.paged.$refs.criteria.model.f_orgid){
844
+ // args.condition += `f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`
845
+ // }
846
+ if (this.permission === 'c2'){
847
+ args.condition +=` and tcb.f_depid = '${this.$login.f.depids}'`
848
+ }
849
+ if(args.model.gasbrand){
850
+ args.condition +=` and tuf.f_gasbrand_id=${args.model.gasbrand.id}`
851
+ }
852
+ this.model.search(args.condition, args.model)
853
+ },
854
+ getChecker(){
855
+ let http = new HttpResetClass()
856
+ http.load('POST', '/rs/search', {data: {source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))', userid: this.$login.f.id}}, {resolveMsg: null, rejectMsg: null})
857
+ .then(res => {
858
+ console.log('res666-->' + JSON.stringify(res))
859
+ this.checkers = res.data.map(res=>{
860
+ return {label:res.name,value:res.name}
861
+ })
862
+ })
863
+ },
864
+ freshCheckBook () {
865
+ this.checkBooks = []
866
+ new HttpResetClass().load('POST', `/rs/sql/safe_singleTable_OrderBy`, {
867
+ data: {
868
+ items: 'id,f_check_book_name',
869
+ tablename: 't_check_book',
870
+ condition: (this.$refs.paged.$refs.criteria.model.f_orgid?`f_orgid in ${this.$refs.paged.$refs.criteria.model.f_orgid}`:'1=1')+(this.permission === 'c2' ? ` and f_depid='${this.$login.f.depids}'`:'') ,
871
+ orderitem: 'id desc'
872
+ }
873
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
874
+ this.checkBooks.push({label: '全部', value: ''})
875
+ res.data.forEach(ress => {
876
+ this.checkBooks.push({
877
+ label: ress.f_check_book_name,
878
+ value: ress.id
879
+ })
880
+ })
881
+ })
882
+ }
883
+ },
884
+
885
+ ready () {
886
+ // 获取片区
887
+ this.getSliceArea()
888
+ // 获取营收气表参数
889
+ this.setConList()
890
+ if (this.permission === 'c1'){
891
+ this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is null'
892
+ }else if(this.permission === 'c2'){
893
+ this.$refs.paged.$refs.criteria.model.f_is_checkbook = 'f_check_book_name is not null'
894
+ }
895
+
896
+ console.log('checkbook', this.$login.f)
897
+ this.checkBook.f_orgid = this.$login.f.orgid
898
+ console.log('permission2',this.permission)
899
+ // this.init=true
900
+ this.freshCheckBook()
901
+ this.getChecker()
902
+ }
903
+ }
904
+ </script>
905
+ <style scoped>
906
+ /*.btn-group > .btn:first-child {*/
907
+ /* margin-left: 0;*/
908
+ /* width: 100%;*/
909
+ /*}*/
910
+ </style>