safecheck-client 3.0.33-gongyi → 3.0.35-gongyi-1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,733 +1,797 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="basic-main">
4
- <criteria-paged :model="model" v-ref:paged @sort="sort">
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="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="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="f_user_phone like '%{}%'">
22
- </div>
23
- <div class="form-group col-sm-2" >
24
- <label class="font_normal_body">小&emsp;&emsp;区</label>
25
- <input type="text" class="input_search" v-model="model.f_residential_area"
26
- style="width: 60%" placeholder="小区" condition="f_residential_area like '%{}%'">
27
- </div>
28
- <div class="form-group col-sm-2" >
29
- <label class="font_normal_body">详细地址</label>
30
- <input type="text" class="input_search" v-model="model.f_address"
31
- style="width: 60%" placeholder="详细地址" condition="f_address like '%{}%'">
32
- </div>
33
- <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right">
34
-
35
- <export-excel-safe :data="$parent.$parent.searchData"
36
- :field="$parent.$parent.excelHeaders"
37
- :choose-col="true"
38
- sqlurl="rs/logic/SafeExportExcel" sql-name="查找安检单" template-name='安检计划明细'></export-excel-safe>
39
- <!-- <export-excel :data="$parent.$parent.getCondition" -->
40
- <!-- :field="$parent.$parent.getfield"-->
41
- <!-- sqlurl="rs/logic/exportfile" sql-name="chargeQuery" template-name='收费查询导出'-->
42
- <!-- :choose-col="true"></export-excel>-->
43
- <!-- <button class="button_spacing button_search" @click="$parent.$parent.showaudio()" v-if="!$parent.$parent.audioshow">录音</button>-->
44
- <button class="button_spacing button_search" @click="$parent.$parent.showaudio()" v-if="$parent.$parent.audioshow">隐藏</button>
45
-
46
- <button class="button_spacing button_search" @click="search()">查询</button>
47
- <div style="float: right" class="button_spacing"
48
- :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
49
- @click="$parent.$parent.hidden()"></div>
50
- </div>
51
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
52
- <label class="font_normal_body">安检计划</label>
53
- <input type="text" class="input_search" v-model="$parent.$parent.model.f_check_plan.f_plan_name"
54
- @click="$parent.$parent.showChooser"
55
- style="width: 60%" placeholder="安检计划" readonly="readonly">
56
- </div>
57
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
58
- <label class="font_normal_body">开始时间</label>
59
- <datepicker
60
- class="select_list select"
61
- :value.sync="model.f_check_start"
62
- placeholder='开始时间' style="width: 60%"
63
- :disabled-days-of-week="[]"
64
- :format="'yyyy-MM-dd'"
65
- :show-rest-button="reset"
66
- v-model="model.f_check_start"
67
- condition="f_offsite_time > ='{} 00:00:00'">
68
- </datepicker>
69
- </div>
70
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
71
- <label class="font_normal_body">结束时间</label>
72
- <datepicker
73
- :value.sync="model.f_check_end"
74
- placeholder='结束时间' style="width: 60%"
75
- :disabled-days-of-week="[]"
76
- :format="'yyyy-MM-dd'"
77
- :show-rest-button="reset"
78
- v-model="model.f_check_end"
79
- condition="f_offsite_time <= '{} 23:59:59'">
80
- </datepicker>
81
- </div>
82
-
83
-
84
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
85
-
86
- <label class="font_normal_body">安检类型</label>
87
- <v-select :value.sync="model.f_safecheck_type" v-model='model.f_safecheck_type'
88
- :value-single="true" style="width: 60%"
89
- class="select_list select"
90
- :options='$parent.$parent.safetype' placeholder='安检类型'
91
- close-on-select
92
- condition="f_safecheck_type = '{}'"></v-select>
93
- </div>
94
-
95
-
96
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
97
- <label class="font_normal_body">安检状态</label>
98
- <v-select id="f_entry"
99
- class="select_list select"
100
- placeholder='安检状态' style="width: 60%"
101
- v-model='model.f_entry'
102
- :value.sync="$parent.$parent.model.f_entry"
103
- :options='$parent.$parent.f_entry_status'
104
- condition=""
105
- :value-single="true"
106
- close-on-select clear-button></v-select>
107
- </div>
108
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
109
- <label class="font_normal_body">用户类型</label>
110
- <v-select class="select_list select"
111
- placeholder='请选择' style="width: 60%"
112
- :value.sync="model.f_user_type" v-model="model.f_user_type"
113
- :options='$parent.$parent.userTypes'
114
- filer-key="name"
115
- close-on-select clear-button
116
- condition="f_user_type='{}'"
117
- :value-single="true">
118
- </v-select>
119
- </div>
120
-
121
-
122
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">-->
123
- <!-- <label class="font_normal_body">安&ensp;检&ensp;员</label>-->
124
- <!-- <v-select :value.sync="model.f_checker_id" v-model='model.f_checker_id'-->
125
- <!-- :value-single="true" style="width: 60%"-->
126
- <!-- class="select_list select"-->
127
- <!-- :options='$parent.$parent.checkersid' placeholder='安检员'-->
128
- <!-- close-on-select-->
129
- <!-- condition="f_checker_id = '{}'"></v-select>-->
130
- <!-- </div>-->
131
- <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">-->
132
- <!-- <label class="font_normal_body" style="margin-right: 2px">公&emsp;&emsp;司</label>-->
133
- <!-- <right-tree @re-res="$parent.$parent.getRes" :initresid="$parent.$parent.$login.f.orgid">-->
134
- <!-- </right-tree>-->
135
- <!-- </div>-->
136
- <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
137
- <role-selector-safe
138
- role-name="安检员"
139
- role-lable="安&nbsp;检&nbsp;员&nbsp;"
140
- @re-res="$parent.$parent.getRes"
141
- :value.sync="model.f_checker_id"
142
- v-model="model.f_checker_id"
143
- condition="f_checker_name = '{}'">
144
- </role-selector-safe>
145
- </div>
146
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
147
- <label class="font_normal_body">片&emsp;&emsp;区</label>
148
- <v-select class="select_list select"
149
- placeholder='片区/管理站' style="width: 60%"
150
- :value.sync="model.f_slice_area" v-model="model.f_slice_area"
151
- :options='$parent.$parent.sliceArea'
152
- filer-key="name"
153
- close-on-select clear-button
154
- condition="f_slice_area='{}'"
155
- @change="$parent.$parent.getmeterbook(model.f_slice_area)"
156
- :value-single="true">
157
- </v-select>
158
- </div>
159
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
160
- <label class="font_normal_body">抄&ensp;表&ensp;册</label>
161
- <v-select class="select_list select"
162
- placeholder='抄表册' style="width: 60%"
163
- :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
164
- :options='$parent.$parent.cbc'
165
- filer-key="name"
166
- close-on-select clear-button
167
- condition="f_meter_book_num={}"
168
- :value-single="true">
169
- </v-select>
170
- </div>
171
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
172
- <label class="font_normal_body">省&ensp;市&ensp;区</label>
173
- <v-select class="select_list select"
174
- placeholder='请选择' style="width: 60%"
175
- :value.sync="model.f_pcd" v-model="model.f_pcd"
176
- :options='$parent.$parent.pcds'
177
- filer-key="name"
178
- close-on-select clear-button
179
- condition="f_pcd='{}'"
180
- :value-single="true">
181
- </v-select>
182
- </div>
183
-
184
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
185
- <label class="font_normal_body">气表类型</label>
186
- <v-select class="select_list select"
187
- placeholder='请选择' style="width: 60%"
188
- :value.sync="model.meter_classify" v-model="model.meter_classify"
189
- :options='$parent.$parent.meter_classifys'
190
- filer-key="name"
191
- close-on-select clear-button
192
- condition="F_METER_CLASSIFY='{}'"
193
- :value-single="true">
194
- </v-select>
195
- </div>
196
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
197
- <label class="font_normal_body">安装位置</label>
198
- <v-select class="select_list select"
199
- placeholder='请选择' style="width: 60%"
200
- :value.sync="model.f_position" v-model="model.f_position"
201
- :options='$parent.$parent.positions'
202
- filer-key="name"
203
- close-on-select clear-button
204
- condition="f_position='{}'"
205
- :value-single="true">
206
- </v-select>
207
- </div>
208
- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
209
- <label class="font_normal_body">房屋类型</label>
210
- <v-select class="select_list select"
211
- placeholder='请选择' style="width: 60%"
212
- :value.sync="model.f_house_type" v-model="model.f_house_type"
213
- :options='$parent.$parent.housetype'
214
- filer-key="name"
215
- close-on-select clear-button
216
- condition="f_house_type='{}'"
217
- :value-single="true">
218
- </v-select>
219
- </div>
220
- </div>
221
- <modal :show.sync="$parent.$parent.showModal" v-ref:modal backdrop="false">
222
- <div slot="modal-header" class="modal-header">
223
- <h4 class="modal-title">
224
- 选择计划
225
- </h4>
226
- </div>
227
- <div slot="modal-body" class="modal-body">
228
- <plan-chooser :f.sync="$parent.$parent.fun" v-ref:chooser></plan-chooser>
229
- </div>
230
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
231
- <button class="button_search" @click="$parent.$parent.ok">确认</button>
232
- <button class="button_search" @click="$parent.$parent.cancel">取消</button>
233
- </div>
234
- </modal>
235
- </div>
236
- </criteria>
237
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
238
- <template partial='head'>
239
- <tr>
240
- <th>
241
- <nobr>客户编号</nobr>
242
- </th>
243
- <th>
244
- <nobr>客户名称</nobr>
245
- </th>
246
- <th>
247
- <nobr>客户电话</nobr>
248
- </th>
249
- <th>
250
- <nobr>客户类型</nobr>
251
- </th>
252
- <th>
253
- <data-order field="f_address" name="客户地址"></data-order>
254
- </th>
255
- <th>
256
- <nobr>安检状态</nobr>
257
- </th>
258
- <th>
259
- <data-order field="f_offsite_time" name="安检时间"></data-order>
260
- </th>
261
- <th>
262
- <nobr>上传时间</nobr>
263
- </th>
264
- <th>
265
- <nobr>安检员</nobr>
266
- </th>
267
- <th>
268
- <nobr>操作</nobr>
269
- </th>
270
- <th v-if="$parent.$parent.$parent.audioshow">
271
- <nobr>录音</nobr>
272
- </th>
273
- </tr>
274
- </template>
275
- <template partial='body'>
276
-
277
- <td style="text-align: center">{{row.f_userinfo_code}}</td>
278
- <td style="text-align: center">{{row.f_user_name}}</td>
279
- <td style="text-align: center">{{row.f_user_phone}}</td>
280
- <td style="text-align: center">{{row.f_check_type}}</td>
281
-
282
- <td style="text-align: center">{{row.f_address}}</td>
283
- <td style="text-align: center">{{row.f_entry_status}}</td>
284
- <td style="text-align: center">{{row.f_offsite_time}}</td>
285
- <td style="text-align: center">{{row.f_upload_date}}</td>
286
- <td style="text-align: center">{{row.f_checker_name}}</td>
287
- <td style="text-align: center">
288
- <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.change(row)'>查看</button>
289
-
290
-
291
- </td>
292
- <td style="text-align: center" v-if="$parent.$parent.$parent.audioshow">
293
- <!-- <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.change(row)'>查看</button>-->
294
- <audio controls="controls" v-if="row.f_recording1_path">
295
- <source type="audio/mpeg" :src="'rs/audio/file/'+row.f_recording1_path">
296
- </audio>
297
- <!--<button type="button" class="button_new-1 button_spacing" data-toggle="dropdown"
298
- @click="$parent.$parent.$parent.print(row)">
299
- 打印
300
- </button>-->
301
- </td>
302
- </template>
303
- </data-grid>
304
- </criteria-paged>
305
- <check-msg v-if="showcheckmsg" :show="showcheckmsg" :data="checkInfo"></check-msg>
306
- </div>
307
- </div>
308
- </template>
309
-
310
- <script>
311
- import {PagedList} from 'vue-client'
312
- import Vue from 'vue'
313
- import co from 'co'
314
- import AppData from '../../stores/AppData'
315
- import * as Util from '../Util'
316
- import getNowDate from "../../utils/getNowDate";
317
- import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
318
- import BenzAMRRecorder from 'benz-amr-recorder'
319
-
320
- //获取json配置文件
321
- let asyncReady = async function (self) {
322
- // 获取配置信息
323
- try {
324
- let res = await Vue.resetget(`/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
325
- Vue.config = res.data
326
- } catch (error) {
327
- // 忽略704,文件找不到异常R
328
- if (error.status !== 704) {
329
- throw error
330
- }
331
- }
332
- }
333
-
334
- let select = function* (self) {
335
- let http = new HttpResetClass()
336
- let getGasman = yield http.load('POST', '/rs/search', {
337
- source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
338
- userid: self.$login.f.id
339
- }, {resolveMsg: null, rejectMsg: null})
340
- //console.log('获取安检员', getGasman)
341
- self.checkersid.push({label: '全部', value: ''})
342
- getGasman.data.forEach((checker) => {
343
- self.checkersid.push({label: checker.name, value: checker.id})
344
- })
345
- }
346
-
347
- export default {
348
- title: '安检结果查看',
349
- data() {
350
- let model = new PagedList('rs/sql/查找安检单', 20, {
351
- f_plan_id: 'this.f_plan_id',
352
- f_approved: 'this.f_approved',
353
- f_entry_status: 'this.f_entry',
354
- f_no_checkplan: 'this.f_no_checkplan',
355
- f_filialeid: 'this.f_filialeid',
356
- orderitem: "'f_offsite_time desc'"
357
- })
358
- model.f_plan_id = ''
359
- model.f_approved = ''
360
- model.f_entry = ''
361
- model.f_no_checkplan = ''
362
- model.f_filialeid = `('${this.$login.f.orgid}')`
363
- //model.f_check_type='民用'
364
- // let searchData={
365
- // f_plan_id: this.model.f_checker_id==undefined?"":this.model.f_checker_id,
366
- // f_approved: this.model.f_approved,
367
- // f_entry_status: this.model.f_entry,
368
- // f_no_checkplan:this.model.f_no_checkplan[0],
369
- // f_filialeid: this.model.f_filialeid,
370
- // //orderitem: this.model.f_offsite_time,
371
- // //condition:this.model.condition
372
- // }
373
- // model.f_subcompany = this.$login.f.f_fengongsi
374
- return {
375
- audioshow:false,
376
- searchData: {
377
- condition: "1=1",
378
- orderitem: "f_offsite_time desc",
379
- f_plan_id: "",
380
- f_approved: '',
381
- f_entry_status: '',
382
- f_no_checkplan: '',
383
- f_filialeid: `('${this.$login.f.orgid}')`
384
- },
385
- model: model,
386
- excelHeaders: {
387
- //searchData:searchData,
388
- 'f_userinfo_code': '客户编号',
389
- 'f_user_name': '客户姓名',
390
- 'f_check_type': '客户类型',
391
- 'f_residential_area': '小区',
392
- 'f_address': '客户地址',
393
- 'f_entry_status': '安检状态',
394
- 'f_offsite_time': '安检时间',
395
- 'f_upload_date':'上传时间',
396
- 'f_checker_name': '安检员'
397
- },
398
- fun: this.$login.f,
399
- pcds:[],
400
- checkersid: [],
401
- safetype: this.$appdata.getParam('安检类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检类型')]:[{label: '全部', value: ''}],
402
- criteriaShow: false,
403
- showModal: false,
404
- f_approval_states: this.$appdata.getParam('安检单审核状态'),
405
- f_entry_status: this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
406
- f_checkplans: this.$appdata.getParam('有无计划'),
407
- showcheckmsg: false,
408
- checkInfo: {},
409
- orderDefault: "'f_offsite_time'",
410
- orderFields: {
411
- f_offsite_time: 'no'
412
- },
413
- sliceArea: [],
414
- cbc:[],
415
- housetype: [],
416
- positions: [],
417
- userTypes: [],
418
- meter_classifys:[]//气表类型
419
- }
420
- },
421
- methods: {
422
- setConList(){
423
- this.userTypes=this.$appdata.getParam('用户类型') ? [{
424
- label: '全部',
425
- value: ''
426
- }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
427
-
428
- this.meter_classifys=this.$appdata.getParam('气表类型') ? [{
429
- label: '全部',
430
- value: ''
431
- }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
432
-
433
- this.positions=this.$appdata.getParam('安装位置') ? [{
434
- label: '全部',
435
- value: ''
436
- }, ...this.$appdata.getParam('安装位置')] : [{label: '全部', value: ''}]
437
- this.housetype=this.$appdata.getParam('房屋类型') ? [{
438
- label: '全部',
439
- value: ''
440
- }, ...this.$appdata.getParam('房屋类型')] : [{label: '全部', value: ''}]
441
- },
442
- //获取省市区列表
443
- getPcd(val){
444
- this.pcds = [{label:'全部',value:''}]
445
- new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
446
- {data:{items:"*",tablename:"t_pcd",orderitem:"id",condition:`f_orgid in ${val}`}},
447
- {resolveMsg: null, rejectMsg: null}).then((pcdlist)=>{
448
- pcdlist.data.forEach((result)=>{
449
- this.pcds.push({label:result.f_pcd,value:result.f_pcd})
450
- })
451
- })
452
- },
453
- showaudio(){
454
- console.log("999999999")
455
- this.audioshow=!this.audioshow
456
- console.log(this.audioshow)
457
- },
458
- getmeterbook(val){
459
- this.cbc=[]
460
- this.cbc.push({
461
- label:'全部',
462
- value:''
463
- })
464
- if (val==''){
465
-
466
- this.cbcs.forEach(res=>{
467
- this.cbc.push({
468
- label:res.f_book_name,
469
- value:res.id
470
- })
471
- })
472
- }else{
473
- this.cbcs.forEach(res=>{
474
- if (res.f_book_slice_area==val){
475
- this.cbc.push({
476
- label:res.f_book_name,
477
- value:res.id
478
- })
479
- }
480
- })
481
- }
482
- },
483
- Mreadibook(val){
484
- //console.log("999999999")
485
- //console.log(val)
486
- this.sliceArea=[]
487
- if (val){
488
- new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
489
- items: 'name',
490
- tablename: 't_zone',
491
- condition: `parentid in ${val}`,
492
- orderitem: 'id'
493
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
494
- this.sliceArea.push({
495
- label:'全部',
496
- value:''
497
- })
498
- res.data.forEach(ress=>{
499
- this.sliceArea.push({
500
- label:ress.name,
501
- value:ress.name
502
- })
503
- })
504
-
505
- })
506
- }
507
- },
508
- getAllMeterBook(val){
509
- //console.log("999999999")
510
- //console.log(val)
511
- this.cbcs=[]
512
- if (val){
513
- new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
514
- items: 'f_book_name,f_book_slice_area,id',
515
- tablename: 't_meter_book',
516
- condition: `f_filiale_id in ${val}`,
517
- orderitem: 'id'
518
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
519
- res.data.forEach(ress=>{
520
- this.cbcs.push({
521
- id:ress.id,
522
- f_book_name:ress.f_book_name,
523
- f_book_slice_area:ress.f_book_slice_area
524
- })
525
- })
526
- this.cbc=[]
527
- this.cbc.push({
528
- label:'全部',
529
- value:''
530
- })
531
- this.cbcs.forEach(res=>{
532
- this.cbc.push({
533
- label:res.f_book_name,
534
- value:res.id
535
- })
536
- })
537
- })
538
- }
539
- },
540
- getRes(obj) {
541
- this.model.f_filialeid = this.$login.convertToIn(obj.resids);
542
- this.searchData.f_filialeid = this.$login.convertToIn(obj.resids);
543
- this.Mreadibook(this.model.f_filialeid)
544
- this.getAllMeterBook(this.model.f_filialeid)
545
- this.getPcd(this.model.f_filialeid)
546
- //this.$refs.paged.$refs.criteria.search()
547
- },
548
-
549
- change(row) {
550
- // Vue.$login = {jwt: row.f_checker_id}
551
- asyncReady(this).then(() => {
552
- //console.log("开始进入单子"+JSON.stringify(Vue.config))
553
- row.f_upload_state = '已传'
554
- this.$goto('new-check-paper', {f_plan_id: row.f_check_plan_id, item: row, role: 'view'}, 'self')
555
- }).catch(
556
- (respanse) => {
557
- alert('获取配置文件失败')
558
- })
559
- },
560
- readConfig() {
561
- let gen = asyncReady(this)
562
- return co(gen)
563
- },
564
- showChooser() {
565
- this.showModal = true
566
- },
567
- hidden() {
568
- this.criteriaShow = !this.criteriaShow
569
- },
570
- refresh() {
571
- this.$refs.paged.$refs.criteria.search()
572
- },
573
- ok() {
574
- this.showModal = false
575
- if (this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id) {
576
- this.model.f_plan_id = this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id
577
- this.model.f_check_plan=this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow
578
- }
579
- },
580
- cancel() {
581
- this.showModal = false
582
- this.model.f_check_plan = {f_plan_name: '', id: ''}
583
- this.model.f_plan_id=''
584
- },
585
- print(row) {
586
- this.showcheckmsg = true
587
- this.checkInfo = row
588
- },
589
- remind() {
590
- this.$resetpost('rs/sql/getRemind', {data: {condition: ` 1 = 1 and f_filialeid = '${this.$login.f.orgid}'`}}, {
591
- resolveMsg: null,
592
- rejectMsg: null
593
- }).then((res) => {
594
-
595
- if (res.data.length > 0) {
596
- let a = 0
597
- let b = 0
598
- let c = 0
599
-
600
- for (let row of res.data) {
601
- let bb = JSON.parse(row.f_last_check_result)
602
- if (!bb.result) {
603
- bb.result = ''
604
- }
605
- row.danger = bb
606
- if (row.f_last_check_result.indexOf('A')) {
607
- a = a + 1
608
- //console.log('包含A')
609
- if (row.nocheckday > 5 && row.nocheckday <= 7) {
610
- b = b + 1
611
- row.color = 'yellow'
612
- } else if (row.nocheckday > 7) {
613
- c = c + 1
614
- row.color = 'red'
615
- }
616
- continue
617
- }
618
- if (row.f_last_check_result.indexOf('B')) {
619
- a = a + 1
620
- //console.log('包含B')
621
- if (row.nocheckday > 12 && row.nocheckday <= 14) {
622
- b = b + 1
623
- row.color = 'yellow'
624
- } else if (row.nocheckday > 14) {
625
- c = c + 1
626
- row.color = 'red'
627
- }
628
- continue
629
- }
630
- if (row.f_last_check_result.indexOf('C')) {
631
- a = a + 1
632
- //console.log('包含C')
633
- if (row.nocheckday > 28 && row.nocheckday <= 30) {
634
- b = b + 1
635
- row.color = 'yellow'
636
- } else if (row.nocheckday > 30) {
637
- c = c + 1
638
- row.color = 'red'
639
- }
640
- continue
641
- }
642
- }
643
- this.$showMessage('目前有' + res.data.length + '户存在隐患需要及时安检,其中' + b + '户需要在两天内安检,'
644
- + c + '户已超时,未在规定时间内安检,是否立刻前往计划生成页面生成计划?', ['confirm', 'cancel']).then((res1) => {
645
- if (res1 === 'confirm') {
646
- //console.log('查询到的数据', res)
647
- this.$goto('create-plan', {rowsdata: res.data}, 'self', null)
648
- }
649
- })
650
-
651
- }
652
-
653
-
654
- })
655
- },
656
- sort(field, rule) {
657
- // 将所有排序方式设为不排序,实现相互排斥
658
- for (let key in this.orderFields) {
659
- if (key === field) {
660
- this.orderFields[key] = rule
661
- } else {
662
- this.orderFields[key] = 'no'
663
- }
664
- }
665
- // 如果新规则不排序,还原为默认排序
666
- if (rule === 'no') {
667
- this.model.paramSource.orderitem = `'${this.orderDefault}'`
668
- } else {
669
- this.model.paramSource.orderitem = `'${field} ${rule}'`
670
- }
671
- this.search()
672
- },
673
- search() {
674
- this.$refs.paged.$refs.criteria.search()
675
- },
676
- selfSearch(args) {
677
- //console.log("9999999999999999")
678
- //args.condition+=" and f_check_type='民用'"
679
- this.model.search(args.condition, args.model, args.condValue)
680
- }
681
- },
682
-
683
- ready() {
684
- //console.log('这里是PaperList', this.$login.f)
685
- this.function = this.f
686
- //console.log(this.f)
687
- //this.remind()
688
- this.setConList()
689
- let gen = select(this)
690
- //this.pianqu()
691
- this.Mreadibook(`('${this.$login.f.orgid}')`)
692
- co(gen)
693
- },
694
- watch: {
695
- 'model.f_no_checkplan'(val) {
696
- if (this.model.f_no_checkplan){
697
- this.searchData.f_no_checkplan = val
698
- }
699
- if (this.model.f_no_checkplan == '有计划安检') {
700
-
701
- this.showChooser()
702
- }
703
- },
704
- 'model.condition'(val) {
705
- if (val) {
706
- this.searchData.condition = val
707
- }
708
-
709
- },
710
- 'model.f_entry'(val) {
711
- if (val) {
712
- this.searchData.f_entry_status = val
713
- }
714
- },
715
- 'model.f_plan_id'(val) {
716
- if (val) {
717
- this.searchData.f_plan_id = val
718
- }
719
- },
720
- 'model.f_slice_area'(val) {
721
- if (val) {
722
-
723
- }
724
- },
725
- 'model.f_approved'(val) {
726
- if (val) {
727
- this.searchData.f_approved = val
728
- }
729
- },
730
- }
731
-
732
- }
733
- </script>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="basic-main">
4
+ <criteria-paged :model="model" v-ref:paged @sort="sort">
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="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="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="f_user_phone like '%{}%'">
22
+ </div>
23
+ <div class="form-group col-sm-2" >
24
+ <label class="font_normal_body">小&emsp;&emsp;区</label>
25
+ <input type="text" class="input_search" v-model="model.f_residential_area"
26
+ style="width: 60%" placeholder="小区" condition="f_residential_area like '%{}%'">
27
+ </div>
28
+ <div class="form-group col-sm-2" >
29
+ <label class="font_normal_body">详细地址</label>
30
+ <input type="text" class="input_search" v-model="model.f_address"
31
+ style="width: 60%" placeholder="详细地址" condition="f_address like '%{}%'">
32
+ </div>
33
+ <div class="form-group col-sm-2" style="width: auto;margin-top:8px;float: right">
34
+
35
+ <export-excel-safe :data="$parent.$parent.searchData"
36
+ :field="$parent.$parent.excelHeaders"
37
+ :choose-col="true"
38
+ sqlurl="rs/logic/SafeExportExcel" sql-name="查找安检单" template-name='安检计划明细'></export-excel-safe>
39
+ <!-- <export-excel :data="$parent.$parent.getCondition" -->
40
+ <!-- :field="$parent.$parent.getfield"-->
41
+ <!-- sqlurl="rs/logic/exportfile" sql-name="chargeQuery" template-name='收费查询导出'-->
42
+ <!-- :choose-col="true"></export-excel>-->
43
+ <!-- <button class="button_spacing button_search" @click="$parent.$parent.showaudio()" v-if="!$parent.$parent.audioshow">录音</button>-->
44
+ <button class="button_spacing button_search" @click="$parent.$parent.showaudio()" v-if="$parent.$parent.audioshow">隐藏</button>
45
+
46
+ <button class="button_spacing button_search" @click="search()">查询</button>
47
+ <div style="float: right" class="button_spacing"
48
+ :class="{'button_shrink_top':$parent.$parent.criteriaShow,'button_shrink_bottom':!$parent.$parent.criteriaShow}"
49
+ @click="$parent.$parent.hidden()"></div>
50
+ </div>
51
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
52
+ <label class="font_normal_body">安检计划</label>
53
+ <input type="text" class="input_search" v-model="$parent.$parent.model.f_check_plan.f_plan_name"
54
+ @click="$parent.$parent.showChooser"
55
+ style="width: 60%" placeholder="安检计划" readonly="readonly">
56
+ </div>
57
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
58
+ <label class="font_normal_body">开始时间</label>
59
+ <datepicker
60
+ class="select_list select"
61
+ :value.sync="model.f_check_start"
62
+ placeholder='开始时间' style="width: 60%"
63
+ :disabled-days-of-week="[]"
64
+ :format="'yyyy-MM-dd'"
65
+ :show-rest-button="reset"
66
+ v-model="model.f_check_start"
67
+ condition="f_offsite_time > ='{} 00:00:00'">
68
+ </datepicker>
69
+ </div>
70
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
71
+ <label class="font_normal_body">结束时间</label>
72
+ <datepicker
73
+ :value.sync="model.f_check_end"
74
+ placeholder='结束时间' style="width: 60%"
75
+ :disabled-days-of-week="[]"
76
+ :format="'yyyy-MM-dd'"
77
+ :show-rest-button="reset"
78
+ v-model="model.f_check_end"
79
+ condition="f_offsite_time <= '{} 23:59:59'">
80
+ </datepicker>
81
+ </div>
82
+
83
+
84
+
85
+
86
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
87
+ <label class="font_normal_body">安检时间</label>
88
+ <datepicker
89
+ :value.sync="model.f_check_onsite"
90
+ placeholder='安检时间' style="width: 60%"
91
+ :disabled-days-of-week="[]"
92
+ :format="'yyyy-MM-dd'"
93
+ :show-rest-button="reset"
94
+ v-model="model.f_check_onsite"
95
+ condition="f_onsite_time <= '{} 00:00:00'">
96
+ </datepicker>
97
+ </div>
98
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
99
+ <label class="font_normal_body">上传时间</label>
100
+ <datepicker
101
+ :value.sync="model.f_check_upload"
102
+ placeholder='上传时间' style="width: 60%"
103
+ :disabled-days-of-week="[]"
104
+ :format="'yyyy-MM-dd'"
105
+ :show-rest-button="reset"
106
+ v-model="model.f_check_upload"
107
+ condition="f_upload_date<= '{} 23:59:59'">
108
+ </datepicker>
109
+ </div>
110
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
111
+ <label class="font_normal_body">下发时间</label>
112
+ <datepicker
113
+ :value.sync="model.f_check_issue"
114
+ placeholder='下发时间' style="width: 60%"
115
+ :disabled-days-of-week="[]"
116
+ :format="'yyyy-MM-dd'"
117
+ :show-rest-button="reset"
118
+ v-model="model.f_check_issue"
119
+ condition="f_issue_time <= '{} 23:59:59'">
120
+ </datepicker>
121
+ </div>
122
+
123
+
124
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow" >
125
+
126
+ <label class="font_normal_body">安检类型</label>
127
+ <v-select :value.sync="model.f_safecheck_type" v-model='model.f_safecheck_type'
128
+ :value-single="true" style="width: 60%"
129
+ class="select_list select"
130
+ :options='$parent.$parent.safetype' placeholder='安检类型'
131
+ close-on-select
132
+ condition="f_safecheck_type = '{}'"></v-select>
133
+ </div>
134
+
135
+
136
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
137
+ <label class="font_normal_body">安检状态</label>
138
+ <v-select id="f_entry"
139
+ class="select_list select"
140
+ placeholder='安检状态' style="width: 60%"
141
+ v-model='model.f_entry'
142
+ :value.sync="$parent.$parent.model.f_entry"
143
+ :options='$parent.$parent.f_entry_status'
144
+ condition=""
145
+ :value-single="true"
146
+ close-on-select clear-button></v-select>
147
+ </div>
148
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
149
+ <label class="font_normal_body">用户类型</label>
150
+ <v-select class="select_list select"
151
+ placeholder='请选择' style="width: 60%"
152
+ :value.sync="model.f_user_type" v-model="model.f_user_type"
153
+ :options='$parent.$parent.userTypes'
154
+ filer-key="name"
155
+ close-on-select clear-button
156
+ condition="f_user_type='{}'"
157
+ :value-single="true">
158
+ </v-select>
159
+ </div>
160
+
161
+
162
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">-->
163
+ <!-- <label class="font_normal_body">安&ensp;检&ensp;员</label>-->
164
+ <!-- <v-select :value.sync="model.f_checker_id" v-model='model.f_checker_id'-->
165
+ <!-- :value-single="true" style="width: 60%"-->
166
+ <!-- class="select_list select"-->
167
+ <!-- :options='$parent.$parent.checkersid' placeholder='安检员'-->
168
+ <!-- close-on-select-->
169
+ <!-- condition="f_checker_id = '{}'"></v-select>-->
170
+ <!-- </div>-->
171
+ <!-- <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">-->
172
+ <!-- <label class="font_normal_body" style="margin-right: 2px">公&emsp;&emsp;司</label>-->
173
+ <!-- <right-tree @re-res="$parent.$parent.getRes" :initresid="$parent.$parent.$login.f.orgid">-->
174
+ <!-- </right-tree>-->
175
+ <!-- </div>-->
176
+ <div class="col-sm-4 form-group" v-show="$parent.$parent.criteriaShow" style="margin: 0">
177
+ <role-selector-safe
178
+ role-name="安检员"
179
+ role-lable="安&nbsp;检&nbsp;员&nbsp;"
180
+ @re-res="$parent.$parent.getRes"
181
+ :value.sync="model.f_checker_id"
182
+ v-model="model.f_checker_id"
183
+ condition="f_checker_name = '{}'">
184
+ </role-selector-safe>
185
+ </div>
186
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
187
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
188
+ <v-select class="select_list select"
189
+ placeholder='片区/管理站' style="width: 60%"
190
+ :value.sync="model.f_slice_area" v-model="model.f_slice_area"
191
+ :options='$parent.$parent.sliceArea'
192
+ filer-key="name"
193
+ close-on-select clear-button
194
+ condition="f_slice_area='{}'"
195
+ @change="$parent.$parent.getmeterbook(model.f_slice_area)"
196
+ :value-single="true">
197
+ </v-select>
198
+ </div>
199
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
200
+ <label class="font_normal_body">抄&ensp;表&ensp;册</label>
201
+ <v-select class="select_list select"
202
+ placeholder='抄表册' style="width: 60%"
203
+ :value.sync="model.f_meter_book_num" v-model="model.f_meter_book_num"
204
+ :options='$parent.$parent.cbc'
205
+ filer-key="name"
206
+ close-on-select clear-button
207
+ condition="f_meter_book_num={}"
208
+ :value-single="true">
209
+ </v-select>
210
+ </div>
211
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
212
+ <label class="font_normal_body">省&ensp;市&ensp;区</label>
213
+ <v-select class="select_list select"
214
+ placeholder='请选择' style="width: 60%"
215
+ :value.sync="model.f_pcd" v-model="model.f_pcd"
216
+ :options='$parent.$parent.pcds'
217
+ filer-key="name"
218
+ close-on-select clear-button
219
+ condition="f_pcd='{}'"
220
+ :value-single="true">
221
+ </v-select>
222
+ </div>
223
+
224
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
225
+ <label class="font_normal_body">气表类型</label>
226
+ <v-select class="select_list select"
227
+ placeholder='请选择' style="width: 60%"
228
+ :value.sync="model.meter_classify" v-model="model.meter_classify"
229
+ :options='$parent.$parent.meter_classifys'
230
+ filer-key="name"
231
+ close-on-select clear-button
232
+ condition="F_METER_CLASSIFY='{}'"
233
+ :value-single="true">
234
+ </v-select>
235
+ </div>
236
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
237
+ <label class="font_normal_body">安装位置</label>
238
+ <v-select class="select_list select"
239
+ placeholder='请选择' style="width: 60%"
240
+ :value.sync="model.f_position" v-model="model.f_position"
241
+ :options='$parent.$parent.positions'
242
+ filer-key="name"
243
+ close-on-select clear-button
244
+ condition="f_position='{}'"
245
+ :value-single="true">
246
+ </v-select>
247
+ </div>
248
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
249
+ <label class="font_normal_body">房屋类型</label>
250
+ <v-select class="select_list select"
251
+ placeholder='请选择' style="width: 60%"
252
+ :value.sync="model.f_house_type" v-model="model.f_house_type"
253
+ :options='$parent.$parent.housetype'
254
+ filer-key="name"
255
+ close-on-select clear-button
256
+ condition="f_house_type='{}'"
257
+ :value-single="true">
258
+ </v-select>
259
+ </div>
260
+ <div class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
261
+ <label class="font_normal_body">安检科室</label>
262
+ <right-tree-safe islist :source="$parent.$parent.source" v-on:re-res="$parent.$parent.reres2" :textContent="'选择科室'" >
263
+ </right-tree-safe>
264
+ </div>
265
+ </div>
266
+ <modal :show.sync="$parent.$parent.showModal" v-ref:modal backdrop="false">
267
+ <div slot="modal-header" class="modal-header">
268
+ <h4 class="modal-title">
269
+ 选择计划
270
+ </h4>
271
+ </div>
272
+ <div slot="modal-body" class="modal-body">
273
+ <plan-chooser :f.sync="$parent.$parent.fun" v-ref:chooser></plan-chooser>
274
+ </div>
275
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
276
+ <button class="button_search" @click="$parent.$parent.ok">确认</button>
277
+ <button class="button_search" @click="$parent.$parent.cancel">取消</button>
278
+ </div>
279
+ </modal>
280
+ </div>
281
+ </criteria>
282
+ <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
283
+ <template partial='head'>
284
+ <tr>
285
+ <th>
286
+ <nobr>客户编号</nobr>
287
+ </th>
288
+ <th>
289
+ <nobr>客户名称</nobr>
290
+ </th>
291
+ <th>
292
+ <nobr>客户电话</nobr>
293
+ </th>
294
+ <th>
295
+ <nobr>客户类型</nobr>
296
+ </th>
297
+ <th>
298
+ <data-order field="f_address" name="客户地址"></data-order>
299
+ </th>
300
+ <th>
301
+ <nobr>安检状态</nobr>
302
+ </th>
303
+ <th>
304
+ <data-order field="f_offsite_time" name="安检时间"></data-order>
305
+ </th>
306
+ <th>
307
+ <nobr>上传时间</nobr>
308
+ </th>
309
+ <th>
310
+ <nobr>安检员</nobr>
311
+ </th>
312
+ <th>
313
+ <nobr>操作</nobr>
314
+ </th>
315
+ <th v-if="$parent.$parent.$parent.audioshow">
316
+ <nobr>录音</nobr>
317
+ </th>
318
+ </tr>
319
+ </template>
320
+ <template partial='body'>
321
+
322
+ <td style="text-align: center">{{row.f_userinfo_code}}</td>
323
+ <td style="text-align: center">{{row.f_user_name}}</td>
324
+ <td style="text-align: center">{{row.f_user_phone}}</td>
325
+ <td style="text-align: center">{{row.f_check_type}}</td>
326
+
327
+ <td style="text-align: center">{{row.f_address}}</td>
328
+ <td style="text-align: center">{{row.f_entry_status}}</td>
329
+ <td style="text-align: center">{{row.f_offsite_time}}</td>
330
+ <td style="text-align: center">{{row.f_upload_date}}</td>
331
+ <td style="text-align: center">{{row.f_checker_name}}</td>
332
+ <td style="text-align: center">
333
+ <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.change(row)'>查看</button>
334
+
335
+
336
+ </td>
337
+ <td style="text-align: center" v-if="$parent.$parent.$parent.audioshow">
338
+ <!-- <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.change(row)'>查看</button>-->
339
+ <audio controls="controls" v-if="row.f_recording1_path">
340
+ <source type="audio/mpeg" :src="'rs/audio/file/'+row.f_recording1_path">
341
+ </audio>
342
+ <!--<button type="button" class="button_new-1 button_spacing" data-toggle="dropdown"
343
+ @click="$parent.$parent.$parent.print(row)">
344
+ 打印
345
+ </button>-->
346
+ </td>
347
+ </template>
348
+ </data-grid>
349
+ </criteria-paged>
350
+ <check-msg v-if="showcheckmsg" :show="showcheckmsg" :data="checkInfo"></check-msg>
351
+ </div>
352
+ </div>
353
+ </template>
354
+
355
+ <script>
356
+ import {PagedList} from 'vue-client'
357
+ import Vue from 'vue'
358
+ import co from 'co'
359
+ import AppData from '../../stores/AppData'
360
+ import * as Util from '../Util'
361
+ import getNowDate from "../../utils/getNowDate";
362
+ import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
363
+ import BenzAMRRecorder from 'benz-amr-recorder'
364
+
365
+ //获取json配置文件
366
+ let asyncReady = async function (self) {
367
+ // 获取配置信息
368
+ try {
369
+ let res = await Vue.resetget(`/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
370
+ Vue.config = res.data
371
+ } catch (error) {
372
+ // 忽略704,文件找不到异常R
373
+ if (error.status !== 704) {
374
+ throw error
375
+ }
376
+ }
377
+ }
378
+
379
+ let select = function* (self) {
380
+ let http = new HttpResetClass()
381
+ let getGasman = yield http.load('POST', '/rs/search', {
382
+ source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
383
+ userid: self.$login.f.id
384
+ }, {resolveMsg: null, rejectMsg: null})
385
+ //console.log('获取安检员', getGasman)
386
+ self.checkersid.push({label: '全部', value: ''})
387
+ getGasman.data.forEach((checker) => {
388
+ self.checkersid.push({label: checker.name, value: checker.id})
389
+ })
390
+ }
391
+
392
+ export default {
393
+ title: '安检结果查看',
394
+ data() {
395
+ let model = new PagedList('rs/sql/查找安检单', 20, {
396
+ f_plan_id: 'this.f_plan_id',
397
+ f_approved: 'this.f_approved',
398
+ f_entry_status: 'this.f_entry',
399
+ f_no_checkplan: 'this.f_no_checkplan',
400
+ f_filialeid: 'this.f_filialeid',
401
+ orderitem: "'f_offsite_time desc'"
402
+ })
403
+ model.f_plan_id = ''
404
+ model.f_approved = ''
405
+ model.f_entry = ''
406
+ model.f_no_checkplan = ''
407
+ model.f_filialeid = `('${this.$login.f.orgid}')`
408
+ //model.f_check_type='民用'
409
+ // let searchData={
410
+ // f_plan_id: this.model.f_checker_id==undefined?"":this.model.f_checker_id,
411
+ // f_approved: this.model.f_approved,
412
+ // f_entry_status: this.model.f_entry,
413
+ // f_no_checkplan:this.model.f_no_checkplan[0],
414
+ // f_filialeid: this.model.f_filialeid,
415
+ // //orderitem: this.model.f_offsite_time,
416
+ // //condition:this.model.condition
417
+ // }
418
+ // model.f_subcompany = this.$login.f.f_fengongsi
419
+ return {
420
+ audioshow:false,
421
+ searchData: {
422
+ condition: "1=1",
423
+ orderitem: "f_offsite_time desc",
424
+ f_plan_id: "",
425
+ f_approved: '',
426
+ f_entry_status: '',
427
+ f_no_checkplan: '',
428
+ f_filialeid: `('${this.$login.f.orgid}')`
429
+ },
430
+ model: model,
431
+ excelHeaders: {
432
+ //searchData:searchData,
433
+ 'f_userinfo_code': '客户编号',
434
+ 'f_user_name': '客户姓名',
435
+ 'f_check_type': '客户类型',
436
+ 'f_residential_area': '小区',
437
+ 'f_address': '客户地址',
438
+ 'f_entry_status': '安检状态',
439
+ 'f_offsite_time': '安检时间',
440
+ 'f_upload_date':'上传时间',
441
+ 'f_checker_name': '安检员'
442
+ },
443
+ fun: this.$login.f,
444
+ pcds:[],
445
+ checkersid: [],
446
+ safetype: this.$appdata.getParam('安检类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检类型')]:[{label: '全部', value: ''}],
447
+ criteriaShow: false,
448
+ showModal: false,
449
+ f_approval_states: this.$appdata.getParam('安检单审核状态'),
450
+ f_entry_status: this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
451
+ f_checkplans: this.$appdata.getParam('有无计划'),
452
+ showcheckmsg: false,
453
+ checkInfo: {},
454
+ orderDefault: "'f_offsite_time'",
455
+ orderFields: {
456
+ f_offsite_time: 'no'
457
+ },
458
+ sliceArea: [],
459
+ f_dep:'',
460
+ cbc:[],
461
+ housetype: [],
462
+ positions: [],
463
+ userTypes: [],
464
+ source:
465
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
466
+ 'tool.getFullTree(dep.where(row.hasSpecialRole($安检册二次分配$)))',
467
+ meter_classifys:[]//气表类型
468
+ }
469
+ },
470
+ methods: {
471
+ reres2(val){
472
+ if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || !val.resids[0] || val.resids.length>1){
473
+ console.log('未选择',val)
474
+ this.f_dep = ''
475
+ return
476
+ }
477
+ console.log('val2',val)
478
+ const resids = val.orgobj.filter(res=>res.resourcetype==='department')
479
+ if (resids.length>0){
480
+ this.f_dep = resids[0].name
481
+ }
482
+ },
483
+ setConList(){
484
+ this.userTypes=this.$appdata.getParam('用户类型') ? [{
485
+ label: '全部',
486
+ value: ''
487
+ }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
488
+
489
+ this.meter_classifys=this.$appdata.getParam('气表类型') ? [{
490
+ label: '全部',
491
+ value: ''
492
+ }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
493
+
494
+ this.positions=this.$appdata.getParam('安装位置') ? [{
495
+ label: '全部',
496
+ value: ''
497
+ }, ...this.$appdata.getParam('安装位置')] : [{label: '全部', value: ''}]
498
+ this.housetype=this.$appdata.getParam('房屋类型') ? [{
499
+ label: '全部',
500
+ value: ''
501
+ }, ...this.$appdata.getParam('房屋类型')] : [{label: '全部', value: ''}]
502
+ },
503
+ //获取省市区列表
504
+ getPcd(val){
505
+ this.pcds = [{label:'全部',value:''}]
506
+ new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
507
+ {data:{items:"*",tablename:"t_pcd",orderitem:"id",condition:`f_orgid in ${val}`}},
508
+ {resolveMsg: null, rejectMsg: null}).then((pcdlist)=>{
509
+ pcdlist.data.forEach((result)=>{
510
+ this.pcds.push({label:result.f_pcd,value:result.f_pcd})
511
+ })
512
+ })
513
+ },
514
+ showaudio(){
515
+ console.log("999999999")
516
+ this.audioshow=!this.audioshow
517
+ console.log(this.audioshow)
518
+ },
519
+ getmeterbook(val){
520
+ this.cbc=[]
521
+ this.cbc.push({
522
+ label:'全部',
523
+ value:''
524
+ })
525
+ if (val==''){
526
+
527
+ this.cbcs.forEach(res=>{
528
+ this.cbc.push({
529
+ label:res.f_book_name,
530
+ value:res.id
531
+ })
532
+ })
533
+ }else{
534
+ this.cbcs.forEach(res=>{
535
+ if (res.f_book_slice_area==val){
536
+ this.cbc.push({
537
+ label:res.f_book_name,
538
+ value:res.id
539
+ })
540
+ }
541
+ })
542
+ }
543
+ },
544
+ Mreadibook(val){
545
+ //console.log("999999999")
546
+ //console.log(val)
547
+ this.sliceArea=[]
548
+ if (val){
549
+ new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
550
+ items: 'name',
551
+ tablename: 't_zone',
552
+ condition: `parentid in ${val}`,
553
+ orderitem: 'id'
554
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
555
+ this.sliceArea.push({
556
+ label:'全部',
557
+ value:''
558
+ })
559
+ res.data.forEach(ress=>{
560
+ this.sliceArea.push({
561
+ label:ress.name,
562
+ value:ress.name
563
+ })
564
+ })
565
+
566
+ })
567
+ }
568
+ },
569
+ getAllMeterBook(val){
570
+ //console.log("999999999")
571
+ //console.log(val)
572
+ this.cbcs=[]
573
+ if (val){
574
+ new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
575
+ items: 'f_book_name,f_book_slice_area,id',
576
+ tablename: 't_meter_book',
577
+ condition: `f_filiale_id in ${val}`,
578
+ orderitem: 'id'
579
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
580
+ res.data.forEach(ress=>{
581
+ this.cbcs.push({
582
+ id:ress.id,
583
+ f_book_name:ress.f_book_name,
584
+ f_book_slice_area:ress.f_book_slice_area
585
+ })
586
+ })
587
+ this.cbc=[]
588
+ this.cbc.push({
589
+ label:'全部',
590
+ value:''
591
+ })
592
+ this.cbcs.forEach(res=>{
593
+ this.cbc.push({
594
+ label:res.f_book_name,
595
+ value:res.id
596
+ })
597
+ })
598
+ })
599
+ }
600
+ },
601
+ getRes(obj) {
602
+ this.model.f_filialeid = this.$login.convertToIn(obj.resids);
603
+ this.searchData.f_filialeid = this.$login.convertToIn(obj.resids);
604
+ this.Mreadibook(this.model.f_filialeid)
605
+ this.getAllMeterBook(this.model.f_filialeid)
606
+ this.getPcd(this.model.f_filialeid)
607
+ //this.$refs.paged.$refs.criteria.search()
608
+ },
609
+
610
+ change(row) {
611
+ // Vue.$login = {jwt: row.f_checker_id}
612
+ asyncReady(this).then(() => {
613
+ //console.log("开始进入单子"+JSON.stringify(Vue.config))
614
+ row.f_upload_state = '已传'
615
+ this.$goto('new-check-paper', {f_plan_id: row.f_check_plan_id, item: row, role: 'view'}, 'self')
616
+ }).catch(
617
+ (respanse) => {
618
+ alert('获取配置文件失败')
619
+ })
620
+ },
621
+ readConfig() {
622
+ let gen = asyncReady(this)
623
+ return co(gen)
624
+ },
625
+ showChooser() {
626
+ this.showModal = true
627
+ },
628
+ hidden() {
629
+ this.criteriaShow = !this.criteriaShow
630
+ },
631
+ refresh() {
632
+ this.$refs.paged.$refs.criteria.search()
633
+ },
634
+ ok() {
635
+ this.showModal = false
636
+ if (this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id) {
637
+ this.model.f_plan_id = this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id
638
+ this.model.f_check_plan=this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow
639
+ }
640
+ },
641
+ cancel() {
642
+ this.showModal = false
643
+ this.model.f_check_plan = {f_plan_name: '', id: ''}
644
+ this.model.f_plan_id=''
645
+ },
646
+ print(row) {
647
+ this.showcheckmsg = true
648
+ this.checkInfo = row
649
+ },
650
+ remind() {
651
+ this.$resetpost('rs/sql/getRemind', {data: {condition: ` 1 = 1 and f_filialeid = '${this.$login.f.orgid}'`}}, {
652
+ resolveMsg: null,
653
+ rejectMsg: null
654
+ }).then((res) => {
655
+
656
+ if (res.data.length > 0) {
657
+ let a = 0
658
+ let b = 0
659
+ let c = 0
660
+
661
+ for (let row of res.data) {
662
+ let bb = JSON.parse(row.f_last_check_result)
663
+ if (!bb.result) {
664
+ bb.result = ''
665
+ }
666
+ row.danger = bb
667
+ if (row.f_last_check_result.indexOf('A')) {
668
+ a = a + 1
669
+ //console.log('包含A')
670
+ if (row.nocheckday > 5 && row.nocheckday <= 7) {
671
+ b = b + 1
672
+ row.color = 'yellow'
673
+ } else if (row.nocheckday > 7) {
674
+ c = c + 1
675
+ row.color = 'red'
676
+ }
677
+ continue
678
+ }
679
+ if (row.f_last_check_result.indexOf('B')) {
680
+ a = a + 1
681
+ //console.log('包含B')
682
+ if (row.nocheckday > 12 && row.nocheckday <= 14) {
683
+ b = b + 1
684
+ row.color = 'yellow'
685
+ } else if (row.nocheckday > 14) {
686
+ c = c + 1
687
+ row.color = 'red'
688
+ }
689
+ continue
690
+ }
691
+ if (row.f_last_check_result.indexOf('C')) {
692
+ a = a + 1
693
+ //console.log('包含C')
694
+ if (row.nocheckday > 28 && row.nocheckday <= 30) {
695
+ b = b + 1
696
+ row.color = 'yellow'
697
+ } else if (row.nocheckday > 30) {
698
+ c = c + 1
699
+ row.color = 'red'
700
+ }
701
+ continue
702
+ }
703
+ }
704
+ this.$showMessage('目前有' + res.data.length + '户存在隐患需要及时安检,其中' + b + '户需要在两天内安检,'
705
+ + c + '户已超时,未在规定时间内安检,是否立刻前往计划生成页面生成计划?', ['confirm', 'cancel']).then((res1) => {
706
+ if (res1 === 'confirm') {
707
+ //console.log('查询到的数据', res)
708
+ this.$goto('create-plan', {rowsdata: res.data}, 'self', null)
709
+ }
710
+ })
711
+
712
+ }
713
+
714
+
715
+ })
716
+ },
717
+ sort(field, rule) {
718
+ // 将所有排序方式设为不排序,实现相互排斥
719
+ for (let key in this.orderFields) {
720
+ if (key === field) {
721
+ this.orderFields[key] = rule
722
+ } else {
723
+ this.orderFields[key] = 'no'
724
+ }
725
+ }
726
+ // 如果新规则不排序,还原为默认排序
727
+ if (rule === 'no') {
728
+ this.model.paramSource.orderitem = `'${this.orderDefault}'`
729
+ } else {
730
+ this.model.paramSource.orderitem = `'${field} ${rule}'`
731
+ }
732
+ this.search()
733
+ },
734
+ search() {
735
+ this.$refs.paged.$refs.criteria.search()
736
+ },
737
+ selfSearch(args) {
738
+ //console.log("9999999999999999")
739
+ //args.condition+=" and f_check_type='民用'"
740
+ if(this.f_dep){
741
+ args.condition += ` and f_dep='${this.f_dep}'`
742
+ }
743
+ this.model.search(args.condition, args.model, args.condValue)
744
+ }
745
+ },
746
+
747
+ ready() {
748
+ //console.log('这里是PaperList', this.$login.f)
749
+ this.function = this.f
750
+ //console.log(this.f)
751
+ //this.remind()
752
+ this.setConList()
753
+ let gen = select(this)
754
+ //this.pianqu()
755
+ this.Mreadibook(`('${this.$login.f.orgid}')`)
756
+ co(gen)
757
+ },
758
+ watch: {
759
+ 'model.f_no_checkplan'(val) {
760
+ if (this.model.f_no_checkplan){
761
+ this.searchData.f_no_checkplan = val
762
+ }
763
+ if (this.model.f_no_checkplan == '有计划安检') {
764
+
765
+ this.showChooser()
766
+ }
767
+ },
768
+ 'model.condition'(val) {
769
+ if (val) {
770
+ this.searchData.condition = val
771
+ }
772
+
773
+ },
774
+ 'model.f_entry'(val) {
775
+ if (val) {
776
+ this.searchData.f_entry_status = val
777
+ }
778
+ },
779
+ 'model.f_plan_id'(val) {
780
+ if (val) {
781
+ this.searchData.f_plan_id = val
782
+ }
783
+ },
784
+ 'model.f_slice_area'(val) {
785
+ if (val) {
786
+
787
+ }
788
+ },
789
+ 'model.f_approved'(val) {
790
+ if (val) {
791
+ this.searchData.f_approved = val
792
+ }
793
+ },
794
+ }
795
+
796
+ }
797
+ </script>