safecheck-client 3.0.35-gongyi → 3.0.35-gongyi-3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,757 +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 class="form-group col-sm-2" v-show="$parent.$parent.criteriaShow">
221
- <label class="font_normal_body">安检科室</label>
222
- <right-tree-safe islist :source="$parent.$parent.source" v-on:re-res="$parent.$parent.reres2" :textContent="'选择科室'" >
223
- </right-tree-safe>
224
- </div>
225
- </div>
226
- <modal :show.sync="$parent.$parent.showModal" v-ref:modal backdrop="false">
227
- <div slot="modal-header" class="modal-header">
228
- <h4 class="modal-title">
229
- 选择计划
230
- </h4>
231
- </div>
232
- <div slot="modal-body" class="modal-body">
233
- <plan-chooser :f.sync="$parent.$parent.fun" v-ref:chooser></plan-chooser>
234
- </div>
235
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
236
- <button class="button_search" @click="$parent.$parent.ok">确认</button>
237
- <button class="button_search" @click="$parent.$parent.cancel">取消</button>
238
- </div>
239
- </modal>
240
- </div>
241
- </criteria>
242
- <data-grid class="list_area table_sy" style="overflow: hidden" :model="model" partial='list' v-ref:grid>
243
- <template partial='head'>
244
- <tr>
245
- <th>
246
- <nobr>客户编号</nobr>
247
- </th>
248
- <th>
249
- <nobr>客户名称</nobr>
250
- </th>
251
- <th>
252
- <nobr>客户电话</nobr>
253
- </th>
254
- <th>
255
- <nobr>客户类型</nobr>
256
- </th>
257
- <th>
258
- <data-order field="f_address" name="客户地址"></data-order>
259
- </th>
260
- <th>
261
- <nobr>安检状态</nobr>
262
- </th>
263
- <th>
264
- <data-order field="f_offsite_time" name="安检时间"></data-order>
265
- </th>
266
- <th>
267
- <nobr>上传时间</nobr>
268
- </th>
269
- <th>
270
- <nobr>安检员</nobr>
271
- </th>
272
- <th>
273
- <nobr>操作</nobr>
274
- </th>
275
- <th v-if="$parent.$parent.$parent.audioshow">
276
- <nobr>录音</nobr>
277
- </th>
278
- </tr>
279
- </template>
280
- <template partial='body'>
281
-
282
- <td style="text-align: center">{{row.f_userinfo_code}}</td>
283
- <td style="text-align: center">{{row.f_user_name}}</td>
284
- <td style="text-align: center">{{row.f_user_phone}}</td>
285
- <td style="text-align: center">{{row.f_check_type}}</td>
286
-
287
- <td style="text-align: center">{{row.f_address}}</td>
288
- <td style="text-align: center">{{row.f_entry_status}}</td>
289
- <td style="text-align: center">{{row.f_offsite_time}}</td>
290
- <td style="text-align: center">{{row.f_upload_date}}</td>
291
- <td style="text-align: center">{{row.f_checker_name}}</td>
292
- <td style="text-align: center">
293
- <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.change(row)'>查看</button>
294
-
295
-
296
- </td>
297
- <td style="text-align: center" v-if="$parent.$parent.$parent.audioshow">
298
- <!-- <button class="button_spacing button_search-1" @click='$parent.$parent.$parent.change(row)'>查看</button>-->
299
- <audio controls="controls" v-if="row.f_recording1_path">
300
- <source type="audio/mpeg" :src="'rs/audio/file/'+row.f_recording1_path">
301
- </audio>
302
- <!--<button type="button" class="button_new-1 button_spacing" data-toggle="dropdown"
303
- @click="$parent.$parent.$parent.print(row)">
304
- 打印
305
- </button>-->
306
- </td>
307
- </template>
308
- </data-grid>
309
- </criteria-paged>
310
- <check-msg v-if="showcheckmsg" :show="showcheckmsg" :data="checkInfo"></check-msg>
311
- </div>
312
- </div>
313
- </template>
314
-
315
- <script>
316
- import {PagedList} from 'vue-client'
317
- import Vue from 'vue'
318
- import co from 'co'
319
- import AppData from '../../stores/AppData'
320
- import * as Util from '../Util'
321
- import getNowDate from "../../utils/getNowDate";
322
- import HttpResetClass from "vue-client/src/plugins/HttpResetClass";
323
- import BenzAMRRecorder from 'benz-amr-recorder'
324
-
325
- //获取json配置文件
326
- let asyncReady = async function (self) {
327
- // 获取配置信息
328
- try {
329
- let res = await Vue.resetget(`/phone/rs/vue`, {data: {}}, {resolveMsg: null, rejectMsg: null})
330
- Vue.config = res.data
331
- } catch (error) {
332
- // 忽略704,文件找不到异常R
333
- if (error.status !== 704) {
334
- throw error
335
- }
336
- }
337
- }
338
-
339
- let select = function* (self) {
340
- let http = new HttpResetClass()
341
- let getGasman = yield http.load('POST', '/rs/search', {
342
- source: 'this.getParentByType($department$).getAllChildrens().where(row.getAttributes().get($rolestr$).indexOf($安检员$) != -1))',
343
- userid: self.$login.f.id
344
- }, {resolveMsg: null, rejectMsg: null})
345
- //console.log('获取安检员', getGasman)
346
- self.checkersid.push({label: '全部', value: ''})
347
- getGasman.data.forEach((checker) => {
348
- self.checkersid.push({label: checker.name, value: checker.id})
349
- })
350
- }
351
-
352
- export default {
353
- title: '安检结果查看',
354
- data() {
355
- let model = new PagedList('rs/sql/查找安检单', 20, {
356
- f_plan_id: 'this.f_plan_id',
357
- f_approved: 'this.f_approved',
358
- f_entry_status: 'this.f_entry',
359
- f_no_checkplan: 'this.f_no_checkplan',
360
- f_filialeid: 'this.f_filialeid',
361
- orderitem: "'f_offsite_time desc'"
362
- })
363
- model.f_plan_id = ''
364
- model.f_approved = ''
365
- model.f_entry = ''
366
- model.f_no_checkplan = ''
367
- model.f_filialeid = `('${this.$login.f.orgid}')`
368
- //model.f_check_type='民用'
369
- // let searchData={
370
- // f_plan_id: this.model.f_checker_id==undefined?"":this.model.f_checker_id,
371
- // f_approved: this.model.f_approved,
372
- // f_entry_status: this.model.f_entry,
373
- // f_no_checkplan:this.model.f_no_checkplan[0],
374
- // f_filialeid: this.model.f_filialeid,
375
- // //orderitem: this.model.f_offsite_time,
376
- // //condition:this.model.condition
377
- // }
378
- // model.f_subcompany = this.$login.f.f_fengongsi
379
- return {
380
- audioshow:false,
381
- searchData: {
382
- condition: "1=1",
383
- orderitem: "f_offsite_time desc",
384
- f_plan_id: "",
385
- f_approved: '',
386
- f_entry_status: '',
387
- f_no_checkplan: '',
388
- f_filialeid: `('${this.$login.f.orgid}')`
389
- },
390
- model: model,
391
- excelHeaders: {
392
- //searchData:searchData,
393
- 'f_userinfo_code': '客户编号',
394
- 'f_user_name': '客户姓名',
395
- 'f_check_type': '客户类型',
396
- 'f_residential_area': '小区',
397
- 'f_address': '客户地址',
398
- 'f_entry_status': '安检状态',
399
- 'f_offsite_time': '安检时间',
400
- 'f_upload_date':'上传时间',
401
- 'f_checker_name': '安检员'
402
- },
403
- fun: this.$login.f,
404
- pcds:[],
405
- checkersid: [],
406
- safetype: this.$appdata.getParam('安检类型')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检类型')]:[{label: '全部', value: ''}],
407
- criteriaShow: false,
408
- showModal: false,
409
- f_approval_states: this.$appdata.getParam('安检单审核状态'),
410
- f_entry_status: this.$appdata.getParam('安检状态')?[{label: '全部', value: ''}, ...this.$appdata.getParam('安检状态')]:[{label: '全部', value: ''}],
411
- f_checkplans: this.$appdata.getParam('有无计划'),
412
- showcheckmsg: false,
413
- checkInfo: {},
414
- orderDefault: "'f_offsite_time'",
415
- orderFields: {
416
- f_offsite_time: 'no'
417
- },
418
- sliceArea: [],
419
- f_dep:'',
420
- cbc:[],
421
- housetype: [],
422
- positions: [],
423
- userTypes: [],
424
- source:
425
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
426
- 'tool.getFullTree(dep.where(row.hasSpecialRole($安检册二次分配$)))',
427
- meter_classifys:[]//气表类型
428
- }
429
- },
430
- methods: {
431
- reres2(val){
432
- if (!val.resids || val.resids.length === 0 || val.resids[0] ==='undefined' || !val.resids[0] || val.resids.length>1){
433
- console.log('未选择',val)
434
- this.f_dep = ''
435
- return
436
- }
437
- console.log('val2',val)
438
- const resids = val.orgobj.filter(res=>res.resourcetype==='department')
439
- if (resids.length>0){
440
- this.f_dep = resids[0].name
441
- }
442
- },
443
- setConList(){
444
- this.userTypes=this.$appdata.getParam('用户类型') ? [{
445
- label: '全部',
446
- value: ''
447
- }, ...this.$appdata.getParam('用户类型')] : [{label: '全部', value: ''}]
448
-
449
- this.meter_classifys=this.$appdata.getParam('气表类型') ? [{
450
- label: '全部',
451
- value: ''
452
- }, ...this.$appdata.getParam('气表类型')] : [{label: '全部', value: ''}]
453
-
454
- this.positions=this.$appdata.getParam('安装位置') ? [{
455
- label: '全部',
456
- value: ''
457
- }, ...this.$appdata.getParam('安装位置')] : [{label: '全部', value: ''}]
458
- this.housetype=this.$appdata.getParam('房屋类型') ? [{
459
- label: '全部',
460
- value: ''
461
- }, ...this.$appdata.getParam('房屋类型')] : [{label: '全部', value: ''}]
462
- },
463
- //获取省市区列表
464
- getPcd(val){
465
- this.pcds = [{label:'全部',value:''}]
466
- new HttpResetClass().load("POST", `/rs/sql/safe_singleTable_OrderBy`,
467
- {data:{items:"*",tablename:"t_pcd",orderitem:"id",condition:`f_orgid in ${val}`}},
468
- {resolveMsg: null, rejectMsg: null}).then((pcdlist)=>{
469
- pcdlist.data.forEach((result)=>{
470
- this.pcds.push({label:result.f_pcd,value:result.f_pcd})
471
- })
472
- })
473
- },
474
- showaudio(){
475
- console.log("999999999")
476
- this.audioshow=!this.audioshow
477
- console.log(this.audioshow)
478
- },
479
- getmeterbook(val){
480
- this.cbc=[]
481
- this.cbc.push({
482
- label:'全部',
483
- value:''
484
- })
485
- if (val==''){
486
-
487
- this.cbcs.forEach(res=>{
488
- this.cbc.push({
489
- label:res.f_book_name,
490
- value:res.id
491
- })
492
- })
493
- }else{
494
- this.cbcs.forEach(res=>{
495
- if (res.f_book_slice_area==val){
496
- this.cbc.push({
497
- label:res.f_book_name,
498
- value:res.id
499
- })
500
- }
501
- })
502
- }
503
- },
504
- Mreadibook(val){
505
- //console.log("999999999")
506
- //console.log(val)
507
- this.sliceArea=[]
508
- if (val){
509
- new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
510
- items: 'name',
511
- tablename: 't_zone',
512
- condition: `parentid in ${val}`,
513
- orderitem: 'id'
514
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
515
- this.sliceArea.push({
516
- label:'全部',
517
- value:''
518
- })
519
- res.data.forEach(ress=>{
520
- this.sliceArea.push({
521
- label:ress.name,
522
- value:ress.name
523
- })
524
- })
525
-
526
- })
527
- }
528
- },
529
- getAllMeterBook(val){
530
- //console.log("999999999")
531
- //console.log(val)
532
- this.cbcs=[]
533
- if (val){
534
- new HttpResetClass().load('POST',`/rs/sql/tel_singleTable_OrderBy`, {data: {
535
- items: 'f_book_name,f_book_slice_area,id',
536
- tablename: 't_meter_book',
537
- condition: `f_filiale_id in ${val}`,
538
- orderitem: 'id'
539
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
540
- res.data.forEach(ress=>{
541
- this.cbcs.push({
542
- id:ress.id,
543
- f_book_name:ress.f_book_name,
544
- f_book_slice_area:ress.f_book_slice_area
545
- })
546
- })
547
- this.cbc=[]
548
- this.cbc.push({
549
- label:'全部',
550
- value:''
551
- })
552
- this.cbcs.forEach(res=>{
553
- this.cbc.push({
554
- label:res.f_book_name,
555
- value:res.id
556
- })
557
- })
558
- })
559
- }
560
- },
561
- getRes(obj) {
562
- this.model.f_filialeid = this.$login.convertToIn(obj.resids);
563
- this.searchData.f_filialeid = this.$login.convertToIn(obj.resids);
564
- this.Mreadibook(this.model.f_filialeid)
565
- this.getAllMeterBook(this.model.f_filialeid)
566
- this.getPcd(this.model.f_filialeid)
567
- //this.$refs.paged.$refs.criteria.search()
568
- },
569
-
570
- change(row) {
571
- // Vue.$login = {jwt: row.f_checker_id}
572
- asyncReady(this).then(() => {
573
- //console.log("开始进入单子"+JSON.stringify(Vue.config))
574
- row.f_upload_state = '已传'
575
- this.$goto('new-check-paper', {f_plan_id: row.f_check_plan_id, item: row, role: 'view'}, 'self')
576
- }).catch(
577
- (respanse) => {
578
- alert('获取配置文件失败')
579
- })
580
- },
581
- readConfig() {
582
- let gen = asyncReady(this)
583
- return co(gen)
584
- },
585
- showChooser() {
586
- this.showModal = true
587
- },
588
- hidden() {
589
- this.criteriaShow = !this.criteriaShow
590
- },
591
- refresh() {
592
- this.$refs.paged.$refs.criteria.search()
593
- },
594
- ok() {
595
- this.showModal = false
596
- if (this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id) {
597
- this.model.f_plan_id = this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow.id
598
- this.model.f_check_plan=this.$refs.paged.$refs.criteria.$refs.modal.$children[0].selectedRow
599
- }
600
- },
601
- cancel() {
602
- this.showModal = false
603
- this.model.f_check_plan = {f_plan_name: '', id: ''}
604
- this.model.f_plan_id=''
605
- },
606
- print(row) {
607
- this.showcheckmsg = true
608
- this.checkInfo = row
609
- },
610
- remind() {
611
- this.$resetpost('rs/sql/getRemind', {data: {condition: ` 1 = 1 and f_filialeid = '${this.$login.f.orgid}'`}}, {
612
- resolveMsg: null,
613
- rejectMsg: null
614
- }).then((res) => {
615
-
616
- if (res.data.length > 0) {
617
- let a = 0
618
- let b = 0
619
- let c = 0
620
-
621
- for (let row of res.data) {
622
- let bb = JSON.parse(row.f_last_check_result)
623
- if (!bb.result) {
624
- bb.result = ''
625
- }
626
- row.danger = bb
627
- if (row.f_last_check_result.indexOf('A')) {
628
- a = a + 1
629
- //console.log('包含A')
630
- if (row.nocheckday > 5 && row.nocheckday <= 7) {
631
- b = b + 1
632
- row.color = 'yellow'
633
- } else if (row.nocheckday > 7) {
634
- c = c + 1
635
- row.color = 'red'
636
- }
637
- continue
638
- }
639
- if (row.f_last_check_result.indexOf('B')) {
640
- a = a + 1
641
- //console.log('包含B')
642
- if (row.nocheckday > 12 && row.nocheckday <= 14) {
643
- b = b + 1
644
- row.color = 'yellow'
645
- } else if (row.nocheckday > 14) {
646
- c = c + 1
647
- row.color = 'red'
648
- }
649
- continue
650
- }
651
- if (row.f_last_check_result.indexOf('C')) {
652
- a = a + 1
653
- //console.log('包含C')
654
- if (row.nocheckday > 28 && row.nocheckday <= 30) {
655
- b = b + 1
656
- row.color = 'yellow'
657
- } else if (row.nocheckday > 30) {
658
- c = c + 1
659
- row.color = 'red'
660
- }
661
- continue
662
- }
663
- }
664
- this.$showMessage('目前有' + res.data.length + '户存在隐患需要及时安检,其中' + b + '户需要在两天内安检,'
665
- + c + '户已超时,未在规定时间内安检,是否立刻前往计划生成页面生成计划?', ['confirm', 'cancel']).then((res1) => {
666
- if (res1 === 'confirm') {
667
- //console.log('查询到的数据', res)
668
- this.$goto('create-plan', {rowsdata: res.data}, 'self', null)
669
- }
670
- })
671
-
672
- }
673
-
674
-
675
- })
676
- },
677
- sort(field, rule) {
678
- // 将所有排序方式设为不排序,实现相互排斥
679
- for (let key in this.orderFields) {
680
- if (key === field) {
681
- this.orderFields[key] = rule
682
- } else {
683
- this.orderFields[key] = 'no'
684
- }
685
- }
686
- // 如果新规则不排序,还原为默认排序
687
- if (rule === 'no') {
688
- this.model.paramSource.orderitem = `'${this.orderDefault}'`
689
- } else {
690
- this.model.paramSource.orderitem = `'${field} ${rule}'`
691
- }
692
- this.search()
693
- },
694
- search() {
695
- this.$refs.paged.$refs.criteria.search()
696
- },
697
- selfSearch(args) {
698
- //console.log("9999999999999999")
699
- //args.condition+=" and f_check_type='民用'"
700
- if(this.f_dep){
701
- args.condition += ` and f_dep='${this.f_dep}'`
702
- }
703
- this.model.search(args.condition, args.model, args.condValue)
704
- }
705
- },
706
-
707
- ready() {
708
- //console.log('这里是PaperList', this.$login.f)
709
- this.function = this.f
710
- //console.log(this.f)
711
- //this.remind()
712
- this.setConList()
713
- let gen = select(this)
714
- //this.pianqu()
715
- this.Mreadibook(`('${this.$login.f.orgid}')`)
716
- co(gen)
717
- },
718
- watch: {
719
- 'model.f_no_checkplan'(val) {
720
- if (this.model.f_no_checkplan){
721
- this.searchData.f_no_checkplan = val
722
- }
723
- if (this.model.f_no_checkplan == '有计划安检') {
724
-
725
- this.showChooser()
726
- }
727
- },
728
- 'model.condition'(val) {
729
- if (val) {
730
- this.searchData.condition = val
731
- }
732
-
733
- },
734
- 'model.f_entry'(val) {
735
- if (val) {
736
- this.searchData.f_entry_status = val
737
- }
738
- },
739
- 'model.f_plan_id'(val) {
740
- if (val) {
741
- this.searchData.f_plan_id = val
742
- }
743
- },
744
- 'model.f_slice_area'(val) {
745
- if (val) {
746
-
747
- }
748
- },
749
- 'model.f_approved'(val) {
750
- if (val) {
751
- this.searchData.f_approved = val
752
- }
753
- },
754
- }
755
-
756
- }
757
- </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>