safecheck-client 3.0.33-54 → 3.0.33-57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1019 +1,1046 @@
1
- <template>
2
- <div class="auto">
3
- <div style="width: 100%;height: 36px;background-color: #f1f8ff">
4
- <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
5
- <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">拍照选项:</p></div>
6
- </div>
7
- <form novalidate class="form-horizontal" style="width: 100%;margin: auto">
8
- <div class="form-group col-sm-12 col-xs-12 col-md-12 info" style="width:100%;">
9
- <div class="text-center">
10
- <label class="font">检查说明:</label>
11
- </div>
12
- <div class="col-md-12 col-sm-12 col-xs-12" style="width: 90%;margin-left: 5px">
13
- <ol class="showInput" style="width: 90%;margin-left: 40px">
14
- <li>已对客户燃气设施进行了安全检查</li>
15
- <li>已对客户进行了安全知识宣传,并发放宣传资料</li>
16
- <li>已对客户的资料进行了登记</li>
17
- <li>已对违章及隐患之客户下发隐患整改告知书</li>
18
- </ol>
19
- </div>
20
- </div>
21
-
22
- <div class="form-group col-sm-12" style="margin-top: 10px">
23
- <div class="auto" style="width: 100%;float: left;" >
24
- <label class="text-left font">总体送气照片</label>
25
- <div class="auto">
26
- <div class="panel">
27
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
28
- <div class="row" style="height: 240px;overflow: scroll;top: 1px">
29
- <div class="row">
30
- <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 10px;margin-right: 75px" v-for="(index,img) in paper.f_overall_imgs">
31
- <img-self :src="img.f_overall_path" alt="总体送气照片" :width="150" :height="200"></img-self>
32
- <!--<img src="../../assets/remove.png" @click="delfile('f_overall_path', img.f_overall_path,index)" class="imgs" style="width: 30px;" alt="">-->
33
- </div>
34
- </div>
35
- </div>
36
- <div class="row text-right div-photo">
37
- <!--<button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_overall_path', '总体安检照片1')">拍照</button>-->
38
- </div>
39
- </div>
40
- </div>
41
- </div>
42
- </div>
43
- <!--<div class="auto" style="width: 49%;float: left;margin-left: 20px">-->
44
- <!--<label class="text-left font">总体安检照片2</label>-->
45
- <!--<div class="auto">-->
46
- <!--<div class="panel">-->
47
- <!--<div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">-->
48
- <!--<div class="row" style="height: 240px;overflow: scroll;top: 1px">-->
49
- <!--<div class="col-sm-4">-->
50
- <!--<img-self :src="paper.f_overall2_path" alt="总体安检照片2" width="150" height="200"></img-self>-->
51
- <!--</div>-->
52
- <!--</div>-->
53
- <!--<div class="row text-right div-photo">-->
54
- <!--<button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_overall2_path', '总体安检照片2')">拍照</button>-->
55
- <!--</div>-->
56
- <!--</div>-->
57
- <!--</div>-->
58
- <!--</div>-->
59
- <!--</div>-->
60
- </div>
61
- <div class="form-group col-sm-12" style="margin-top: 20px">
62
- <label class="text-left font">用户签名</label>
63
- <div class="auto">
64
- <div class="panel">
65
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
66
- <div class="row" style="height: 240px;overflow: scroll;top: 1px">
67
- <div class="col-sm-4">
68
- <img :class="style__" :src="paper.f_sign_path" :width="200" :height="150" />
69
- </div>
70
- </div>
71
- <!--<div class="row text-right div-photo">-->
72
- <!--&lt;!&ndash;<button type="button" name="button" class="btn btn-primary btn-photo" @click="sign">签名</button>&ndash;&gt;-->
73
- <!--</div>-->
74
- </div>
75
- </div>
76
- </div>
77
- </div>
78
- <div class="form-group col-sm-12" v-if="paper.f_exceed_reason">
79
- <label>送气超期原因:</label><br/>
80
- <textarea style="width: 100%;" v-model="paper.f_exceed_reason"></textarea>
81
- </div>
82
- <!--<div class="form-group col-sm-12" style="margin-top: 20px">
83
- <input type="checkbox" :readonly="true" :checked="paper.f_blacklist=='是'"/><label class="text-left font" >限制该用户购气</label>
84
- <textarea if="paper.f_blacklist=='是'" id="el_ca_tx" v-model.trim="paper.f_blocking_cause" style="border-radius:4px;width: 100%;" >
85
- </textarea>
86
- </div>-->
87
- <div class="form-group col-md-12 col-sm-12 col-xs-12">
88
- <!--<div class="form-group col-md-12 col-sm-12 col-xs-12">
89
- <input type="checkbox" v-model="paper.f_defect_notified" class="showInput"/>安检通知书/隐患整改通知书
90
- </div>
91
- <div class="form-group col-md-12 col-sm-12 col-xs-12" v-if="paper.f_defect_notified">
92
- <div class="form-group col-md-12 col-sm-12 col-xs-12">
93
- <button type="button" @click="print()">打印隐患整改单</button>
94
- </div>
95
- <div class="form-group col-md-12 col-sm-12 col-xs-12">
96
- <label class="text-left font">安检通知书/隐患整改通知书照片(要求能清晰反应安检通知单和用户签字内容):</label>
97
- <div class="auto" >
98
- <div class="panel" style="padding: 10px 10px 5px 10px;">
99
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
100
- <div class="row" style="height: 240px;overflow: scroll;top: 1px">
101
- <div class="col-sm-4">
102
- <img-self :src="paper.f_notified_path" alt="安检通知书/隐患整改通知书照片" width="150" height="200"></img-self>
103
- </div>
104
- </div>
105
- <div class="row text-right div-photo">
106
- <button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_notified_path', '安检通知书/隐患整改通知书照片')">拍照</button>
107
- &nbsp;&nbsp;&nbsp;&nbsp;<img src="../../assets/remove.png" :class="style__" @click="delfile('f_notified_path', this.paper.f_notified_path)" style="width: 25%;"></img>
108
- </div>
109
- </div>
110
- </div>
111
- </div>
112
- </div>
113
- </div>
114
- -->
115
- <div class="form-group col-md-12 col-sm-12 col-xs-12">
116
- <div class="row">
117
- <label class="text-left">请对我们的服务做出评价:</label>
118
- </div>
119
- <div class="col-xs-4 col-sm-4" v-for="item in radios">
120
- <input v-model="paper.f_client_evaluation" :value="item.label" :checked='item.isChecked' @click="check(item.value)" type="radio">{{item.label}}
121
- </div>
122
- </div>
123
- <!-- <div class="form-group col-md-12 col-sm-12 col-xs-12">-->
124
- <!-- <label class="text-left font">反馈录音:</label>-->
125
- <!-- <div class="col-md-12 col-sm-12 col-xs-12" v-if="!paper.f_recording1_path">-->
126
- <!-- <audio :src="paper.f_recording1_path" v-el:audio controls @click="palyAudio(row)"></audio>-->
127
- <!-- </div>-->
128
- <!-- </div>-->
129
- <div class="text-center form-group col-md-12 col-sm-12 col-xs-12">
130
- <button type="button" v-show="$parent.actionEnabled" class="btn save-btn" @click="$parent.savePaper(true)">保存</button>
131
- <button id="upload" type="button" v-show="$parent.actionEnabled && !$parent.isBusy" class="btn upload-btn" @click="$parent.uploadPaper" >上传</button>
132
- <button v-if="safeCheckToRepair && $parent.actionEnabled" class="btn repair-btn btn-warning" type="button" @click="showToRepair">转维修</button>
133
- </div>
134
- </div>
135
- </form>
136
-
137
- <modal :show.sync="showCheckToRepair" v-ref:modal :backdrop="isback">
138
- <div slot="modal-header" class="modal-header">
139
- <h4 class="modal-title">
140
- 安检转维修
141
- </h4>
142
- </div>
143
- <div slot="modal-body" class="modal-body">
144
- <div v-if="showrepair">
145
- <div class="row">
146
- <label class="col-xs-4 col-md-4 control-label text-left">派单方式</label>
147
- <div class="col-xs-8 col-md-8">
148
- <label v-for="handling1 in handling" >
149
- <input type="radio"
150
- v-model="meading"
151
- value="{{handling1.label}}">
152
- {{handling1.label}}
153
- </label>
154
- </div>
155
- </div>
156
- <div class="row" v-if="meading == '转站点'">
157
- <label class="col-xs-4 col-md-4 control-label font text-left" for="f_reciever">站点</label>
158
- <div class="col-xs-8 col-md-8">
159
- <right-tree @ready="onReady" islist :Url="Url" :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择站点管理员" :selectData="" v-ref:f_reciever>
160
- </right-tree>
161
- </div>
162
- </div>
163
-
164
- <div class="row" style="margin-top: 6px" v-if="meading == '转维修员'">
165
- <label class="col-xs-4 col-md-4 control-label font text-left">维修人</label>
166
- <div class="col-xs-8">
167
- <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
168
- :options='f_repair_person' placeholder='请选择维修员'
169
- close-on-select v-on:change="repiarmancg"></v-select>
170
- </div>
171
-
172
- </div>
173
- <div class="row" style="margin-top: 6px">
174
- <label for="f_repair" class="col-xs-4 col-md-4 control-label font text-left">报修类型</label>
175
- <div class="col-xs-8 col-md-8">
176
- <v-select :value.sync="model.f_repairtype" :value-single="true"
177
- :options='repairstypes' placeholder='报修类型'
178
- close-on-select>
179
- </v-select>
180
- </div>
181
- </div>
182
-
183
- <div class="row" style="margin-top: 6px">
184
- <label class="control-label font text-left col-md-4 col-xs-4">备注</label>
185
- <div class="col-xs-8 col-md-8">
186
- <input type="text" v-model="model.f_remarks"/>
187
- </div>
188
-
189
- </div>
190
-
191
- </div>
192
- <div v-if="!showrepair">
193
- 暂无隐患设备信息
194
- </div>
195
- </div>
196
- <div slot="modal-footer" class="modal-footer">
197
- <button type="button" class="btn btn-default" @click="uploadPaper()">确定</button>
198
- <button type="button" class="btn btn-default" @click="undo()">取消</button>
199
- </div>
200
- </modal>
201
- </div>
202
- </template>
203
-
204
- <script>
205
- import Vue from 'vue'
206
- import * as Util from '../Util'
207
- import { HttpResetClass } from 'vue-client'
208
- import RadioGroup from 'vue-client/src/vue-strap/src/radioGroup'
209
- import Radio from 'vue-client/src/vue-strap/src/radioBtn'
210
- import co from 'co'
211
-
212
- let getRepairParam = function * (self){
213
- let data = {
214
- model: self.model, loginUser: {
215
- name: self.role == 'view'?self.$login.f.name:Vue.user.name,
216
- ename: self.role == 'view'?self.$login.f.ename:Vue.user.ename
217
- }, user: self.user, callObj: self.callObj
218
- }
219
- if(self.meading == '转维修员'){
220
- data.toRepair = '一级派单'
221
- }
222
- data.model.f_attendant = data.loginUser.name
223
- //tag
224
- //tag
225
- let res
226
- let errString = self.$parent.errorVerify()
227
- if(errString){
228
- //tag
229
- if (Vue.android)
230
- self.undo()
231
- this.$showMessage(errString)
232
- return
233
- } else {
234
- if(self.role == 'inspect'){
235
- if(self.meading == '转维修员' && (self.model.serviceacitivity[0].f_reciever == '' || self.model.serviceacitivity[0].f_reciever == undefined)){
236
- this.$showMessage("请选择维修员!")
237
- return
238
- }
239
- if(self.meading == '转站点' && (self.model.serviceacitivity[0].f_reciever == '' || self.model.serviceacitivity[0].f_reciever == undefined)){
240
- this.$showMessage("请选择站点!")
241
- return
242
- }
243
- if(self.model.f_repairtype == ''){
244
- this.$showMessage("请选择报修类型!")
245
- return
246
- }
247
- //tag)
248
- let checkResult = '正常'
249
- let options = [{"data": "已处理"},{"data": "未处理"}]
250
- let value = ''
251
- let codata = JSON.parse(JSON.stringify(self.paper))
252
- for(let device in codata){
253
- //tag)
254
- let f_device_type
255
- if(device.startsWith("device")){
256
- for(let item in codata[device]) {
257
- if(codata[device].length > 1 ){
258
- let j = Number.parseInt(item)+1
259
- f_device_type = `${codata[device][item].f_device_type}${j}`
260
- }else{
261
- f_device_type = codata[device][item].f_device_type
262
- }
263
- // //tag
264
- let details = []
265
- for(let i in codata[device][item].f_items){
266
- let items = codata[device][item].f_items[i]
267
- //tag
268
- if(items.f_is_defect == true || items.f_is_defect == 'true'){
269
- checkResult = '有隐患'
270
- //tag
271
- let res = yield self.$resetpost(`${self.Url}/rs/sql/getDeviceItem`,{data:{f_device_id:codata[device][item].f_device_id,f_item_name:items.f_item_name}})
272
- //tag)
273
- self.$set('detail.f_defect_id', res.data[0].id)
274
- self.$set('detail.f_project',`${items.f_item_name}:${items.f_item_value}`)
275
- self.$set('detail.type',items.type)
276
- self.$set('detail.options',options)
277
- details.push(JSON.parse(JSON.stringify(self.detail)))
278
- }
279
- if(items.type == 'selector'){
280
- items.selected = ''
281
- }
282
- self.detail = {}
283
- }
284
- //tag
285
- self.$set('defectDevice.f_type',f_device_type)
286
- self.$set('defectDevice.details',details)
287
- if(self.defectDevice.details.length >0 ){
288
- self.repairitems.push(JSON.parse(JSON.stringify(self.defectDevice)))
289
- }
290
- self.defectDevice = {}
291
- //tag
292
- }
293
- }
294
- }
295
- self.$set('model.f_repairitems.data',self.repairitems)
296
-
297
-
298
- //tag)
299
- res = self.$androidUtil.bzLogic('safecheckToRepair',data)
300
- //tag
301
- //tag
302
- //tag
303
- if(res.code == 200){
304
- self.$parent.isSafeCheckToRepair = true
305
- self.undo()
306
- self.$set('paper.f_SafeToRepair_id',res.data.f_service_id)
307
- //tag
308
- self.$resetpost(`${self.Url}/rs/logic/updatePaperRepair`,{data:{f_paper_id:self.paper.f_paper_id,f_SafeToRepair_id:res.data.f_service_id}}).then((ret)=>{
309
- //tag
310
- if(ret.data.code ==200){
311
- //tag
312
- self.$parent.$back()
313
- }else{
314
- self.$showMessage('安检转维修失败!')
315
- }
316
- }).catch(v=>{
317
- //tag)
318
- self.$showMessage('安检转维修失败!')
319
- })
320
- }else{
321
- self.$showMessage('安检转维修失败!')
322
- }
323
- }
324
- }
325
- }
326
-
327
-
328
-
329
- let getRepairs = async function(self,url) {
330
- // 获取配置信息
331
- try {
332
- let val = {source: 'this.getParentByType($department$).getChildByName($维修员$).getUsers()', userid: `${Vue.$login.jwt}`}
333
- let repairs =[]
334
- let res = await Vue.resetpost(`${url}/rs/search`,{data: val},{resolveMsg: null, rejectMsg: null})
335
- res.data.forEach((item) => {
336
- repairs.push({label: item.name, value: item})
337
- })
338
- self.f_repair_person = repairs
339
- if(self.$parent.role == 'inspect'){
340
- let res = self.$androidUtil.bzLogic('getUserInfo',{id:self.paper.f_userinfoid})
341
- if(res.code == 200){
342
- self.user = res.data[0]
343
- self.model.f_area = self.user.f_area
344
- }
345
- }else{
346
- //tag
347
- self.$resetpost(`${self.Url}/rs/sql/safeCheckgetUserInfo`,{data:{id:self.paper.f_userinfoid}},{resolveMsg: null, rejectMsg: null}).then((res)=>{
348
- //tag
349
- if(res.data.length != 0){
350
- self.user = res.data[0]
351
- self.model.f_area = self.user.f_area
352
- }
353
- })
354
- // path({alias:'getUserInfo',data:{id:this.paper.f_userinfoid}})
355
- }
356
- } catch (error) {
357
- //tag
358
- }
359
- }
360
-
361
- export default {
362
- title: '用户反馈',
363
- data() {
364
- return {
365
- paper:this.$parent.data,
366
- printContent:[],
367
- radios:[
368
- {
369
- label: '满意',
370
- value: 0,
371
- isChecked: false,
372
- },
373
- {
374
- label: '基本满意',
375
- value:1,
376
- isChecked: false,
377
- },
378
- {
379
- label: '不满意',
380
- value:2,
381
- isChecked: false,
382
- },
383
- ],
384
- model: {
385
- // 一次派单
386
- serviceacitivity: [{
387
- f_service_acitivity_type: '派单'
388
- }],
389
- f_source:'安检',
390
- f_service_id: '',
391
- f_contact_phone: '',
392
- f_meetunit: '',
393
- f_phone: '',
394
- f_user_name: '',
395
- f_address: '',
396
- f_repair_date: Util.toStandardTimeString(),
397
- f_card_id: '',
398
- // f_department: '', 站点选择
399
- f_reciever:'',
400
- f_remarks: '',
401
- f_user_type: '',
402
- f_area: '',
403
- f_unit_name:'',
404
- f_street: '',
405
- f_residential_area: '',
406
- f_building: '',
407
- f_unit: '',
408
- f_floor: '',
409
- f_room: '',
410
- aState: null,
411
- f_repairtype: '',
412
- f_repairitems:{},
413
- },
414
- repairitems:[],
415
- repairstypes:this.$appdata.getParam('报修类型'),
416
- //f_repair_person: this.readRepair(),
417
- showrepair: false,
418
- safeCheckToRepair:'',
419
- showCheckToRepair:false,
420
- userid: '',
421
- source:
422
- 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
423
- 'tool.getFullTree(dep.where(row.getChildByName($派单员$) != null))',
424
- isback:false,
425
- defectDevice:{},
426
- detail:{},
427
- callObj:null,
428
- user:{},
429
- role:this.$parent.role,
430
- handling:[{label:'转站点',value:'转站点'},{label:'转维修员',value:'转维修员'}],
431
- meading:'转站点',
432
- Url:this.$androidUtil.getProxyUrl()
433
- }
434
- },
435
- props: ['idx'],
436
- components: {
437
- RadioGroup,
438
- Radio
439
- },
440
- methods: {
441
- check(index) {
442
- //tag
443
- // 先取消所有选中项
444
- for (let item of this.radios){
445
- item.isChecked = false;
446
- }
447
- //再设置当前点击项选中
448
- this.paper.f_client_evaluation = this.radios[index].label;
449
- // 设置值,以供传递
450
- this.radios[index].isChecked = true;
451
- //tag;
452
- },
453
- getSignValue(fileName) {
454
- this.f_signname = fileName
455
- },
456
- cameraCallBack(prop, fileName) {
457
- HostApp.__this__.paper[prop] = fileName + '?' + Math.random()
458
- HostApp.__callback__ = null
459
- HostApp.__this__ = null
460
- },
461
- takePic(prop, title) {
462
- HostApp.__callback__ = this.cameraCallBack
463
- HostApp.__this__ = this
464
- //tag
465
- //tag
466
- let fileName
467
- if (!this.paper[prop] || this.paper[prop].includes("nopic.png")) {
468
- fileName = Util.guid() + '-' + prop + '.jpg'
469
- } else {
470
- fileName = Util.getFileName(this.paper[prop])
471
- }
472
- HostApp._open_a_page({
473
- type: 'boomerang',
474
- page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
475
- param: {
476
- file: fileName,
477
- requestCode: 111,
478
- callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");',
479
- watermark: title + '\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name
480
- }
481
- })
482
- },
483
- amrCallBack(fileName) {
484
- HostApp.__this__.$set('paper.f_recording1_path', fileName)
485
- HostApp.__callback__ = null
486
- HostApp.__this__ = null
487
- },
488
- record() {
489
- if (this.$parent.role != 'inspect') {
490
- if (this.paper.f_recording1_path != '') {
491
- window.location = this.paper.f_recording1_path
492
- }
493
- } else {
494
- HostApp.__callback__ = this.amrCallBack
495
- HostApp.__this__ = this
496
- let fileName
497
- if (!this.paper.f_recording1_path) {
498
- fileName = Util.guid() + '.amr'
499
- } else {
500
- fileName = Util.getFileName(this.paper.f_recording1_path)
501
- }
502
- HostApp._open_a_page({
503
- type: 'boomerang',
504
- page: 'com.aofeng.hybrid.android.peripheral.AudioClipActivity',
505
- param: {file: fileName, requestCode: 111, callback: 'javascript:HostApp.__callback__("%s");'}
506
- })
507
- }
508
- },
509
- // 签名回调
510
- signCallback(prop, fileName) {
511
- // HostApp.alert('绑定属性:' + prop + ' 文件全路径如file:///storage/sdcard0/safecheck/abc.jpg:' + fullFileName)
512
- HostApp.__this__.$set('paper.f_sign_path', fileName)
513
- HostApp.__callback__ = null
514
- HostApp.__this__ = null
515
- },
516
- // 用户签名
517
- sign() {
518
- this.delAudioFile('f_sign_path', this.paper.f_sign_path)
519
- let prop = 'f_sign_path'
520
- let idx = 'aofeng'
521
- let fileName
522
- if (!this.paper.f_sign_path) {
523
- fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
524
- } else {
525
- fileName = Util.getFileName(this.paper.f_sign_path)
526
- }
527
- HostApp.__callback__ = this.signCallback
528
- HostApp.__this__ = this
529
- HostApp.getSignature({
530
- file: fileName,
531
- requestCode: 111,
532
- callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");'
533
- })
534
- },
535
- delfile(prop, fileName) {
536
- if (fileName == Vue.nopic)
537
- return
538
- else {
539
- HostApp.delfile(fileName)
540
- this.paper[prop] = Vue.nopic
541
- }
542
- },
543
- delAudioFile(prop, fileName) {
544
- if (!fileName)
545
- return
546
- else {
547
- HostApp.delfile(fileName)
548
- this.paper[prop] = null
549
- }
550
- },
551
- //获取打印用户信息
552
- getUser() {
553
- if (this.paper.f_user_name == undefined)
554
- this.paper.f_user_name = ''
555
- this.printContent.push({type: 3, text: '用户名称:' + this.paper.f_user_name, fontsize: 2, isbold: false, align: 'left'})
556
- if (this.paper.f_userinfo_code == undefined)
557
- this.paper.f_userinfo_code = ''
558
- this.printContent.push({type: 3, text: '用户编号:' + this.paper.f_userinfo_code, fontsize: 2, isbold: false, align: 'left'})
559
- if (this.paper.f_address == undefined)
560
- this.paper.f_address = ''
561
- this.printContent.push({type: 3, text: '地址:' + this.paper.f_address, fontsize: 2, isbold: false, align: 'left'})
562
- if (this.paper.f_user_phone == undefined)
563
- this.paper.f_user_phone = ''
564
- this.printContent.push({type: 3, text: '电话:' + this.paper.f_user_phone, fontsize: 2, isbold: false, align: 'left'})
565
- },
566
- verify(){
567
- let hasError = this.$parent.verifyUser()
568
- if(hasError)
569
- return hasError
570
- hasError = this.$parent.verifyDevices()
571
- if(hasError)
572
- return hasError
573
- },
574
- print() {
575
- let errString = this.verify()
576
- if (errString) {
577
- //tag
578
- if (Vue.android)
579
- this.$showMessage(errString)
580
- return
581
- }
582
- // 文本
583
- let templatename = '安检结果单'
584
- if(Vue.config.safecheck != undefined) {
585
- if (Vue.config.safecheck.ApproveConfig != undefined) {
586
- if (Vue.config.safecheck.ApproveConfig.templatename != undefined) {
587
- templatename = Vue.config.safecheck.ApproveConfig.templatename
588
- }
589
- }
590
- }
591
- let textHead = {type: 3, text: templatename, fontsize: 3, isbold: true, align: 'center'}
592
- let feedPageHead = {type: 4, value: 2, unit: 'line'}
593
- let feedPageEnd = {type: 4, value: 4, unit: 'line'}
594
- this.printContent.push(textHead)
595
- this.printContent.push(feedPageHead)
596
- this.getUser()
597
- this.getDefect()
598
- this.getCheck()
599
- this.printContent.push(feedPageEnd)
600
- let arrstr = JSON.stringify(this.printContent)
601
- //tag
602
- this.$androidUtil.print(arrstr)
603
- this.$set('printContent', [])
604
- },
605
- //打印安检信息
606
- getCheck() {
607
- let telephone = '96777'
608
- if(Vue.config.safecheck != undefined) {
609
- if (Vue.config.safecheck.ApproveConfig != undefined) {
610
- if (Vue.config.safecheck.ApproveConfig.checkphone != undefined) {
611
- telephone = Vue.config.safecheck.ApproveConfig.checkphone
612
- }
613
- }
614
- }
615
- this.printContent.push({type: 3, text: '*******************************', fontsize: 3, isbold: false, align: 'center'})
616
- this.printContent.push({type: 3, text: '咨询电话;'+telephone, fontsize: 2, isbold: false, align: 'left'})
617
- this.printContent.push({type: 3, text: '安检人:'+Vue.user.name, fontsize: 2, isbold: false, align: 'left'})
618
- this.printContent.push({type: 3, text: '安检时间:' + this.getNowFormatDate(), fontsize: 2, isbold: false, align: 'left'})
619
- this.printContent.push({type: 3, text: '用户签字:', fontsize: 2, isbold: false, align: 'left'})
620
- this.printContent.push({type: 4, value: 4, unit: 'line'})
621
- },
622
-
623
- getDefect() {
624
- let showmore = false
625
- if(Vue.config.safecheck != undefined) {
626
- if (Vue.config.safecheck.ApproveConfig != undefined) {
627
- if (Vue.config.safecheck.ApproveConfig.showmore != undefined) {
628
- showmore = Vue.config.safecheck.ApproveConfig.showmore
629
- }
630
- }
631
- }
632
-
633
- let backData = this.$parent.getAllDefect()
634
- // 对隐患信息进行遍历
635
- let res = JSON.parse(backData.f_defect_content)
636
- this.printContent.push({
637
- type: 3,
638
- text: '安检结果:' + res.result,
639
- fontsize: 2,
640
- isbold: false,
641
- align: 'left'
642
- })
643
- this.printContent.push({type: 3, text: '*******************************', fontsize: 3, isbold: false, align: 'center'})
644
-
645
-
646
- if(showmore) {
647
- //全部打印
648
- for (let dev in this.$parent.config) {
649
- for (let device in backData) {
650
- if (device.startsWith("device")) {
651
- for (let item in backData[device]) {
652
- //遍历结果
653
- if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
654
- let error = true
655
- for (let i in backData[device][item].f_items) {
656
- if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
657
- error = false
658
- }
659
- }
660
- if (error) {
661
- this.printContent.push({
662
- type: 3,
663
- text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':正常',
664
- fontsize: 2,
665
- isbold: false,
666
- align: 'left'
667
- })
668
- } else {
669
- this.printContent.push({
670
- type: 3,
671
- text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':有隐患',
672
- fontsize: 2,
673
- isbold: true,
674
- align: 'left'
675
- })
676
- }
677
-
678
- for (let i in backData[device][item].f_items) {
679
- if (backData[device][item].f_items[i].f_item_value != '' && backData[device][item].f_items[i].f_item_value != null) {
680
- this.printContent.push({
681
- type: 3,
682
- text: backData[device][item].f_items[i].f_item_name + backData[device][item].f_items[i].f_item_value,
683
- fontsize: 2,
684
- isbold: false,
685
- align: 'left'
686
- })
687
- }
688
- }
689
- this.printContent.push({type: 4, value: 2, unit: 'line'})
690
- }
691
- }
692
- }
693
- }
694
- }
695
-
696
- for (let dev in this.$parent.config) {
697
- for (let device in backData) {
698
- if (device.startsWith("device")) {
699
- for (let item in backData[device]) {
700
- //遍历结果
701
- if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
702
- let error = true
703
- for (let i in backData[device][item].f_items) {
704
- if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
705
- error = false
706
- }
707
- }
708
- if (!error) {
709
- this.printContent.push({
710
- type: 3,
711
- text: '隐患:',
712
- fontsize: 2,
713
- isbold: true,
714
- align: 'left'
715
- })
716
- }
717
- }
718
- }
719
- }
720
- }
721
- for (let device in backData) {
722
- if (device.startsWith("device")) {
723
- for (let item in backData[device]) {
724
- if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
725
- for (let i in backData[device][item].f_items) {
726
- if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
727
- this.printContent.push({
728
- type: 3,
729
- text: backData[device][item].f_items[i].f_item_name + ' ' + backData[device][item].f_items[i].f_item_value,
730
- fontsize: 2,
731
- isbold: true,
732
- align: 'left'
733
- })
734
- }
735
- }
736
- }
737
- }
738
- }
739
- }
740
-
741
- }
742
- }else {
743
- for (let dev in this.$parent.config) {
744
- for (let device in backData) {
745
- if (device.startsWith("device")) {
746
- for (let item in backData[device]) {
747
- //遍历结果
748
- if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
749
- let error = true
750
- for (let i in backData[device][item].f_items) {
751
- if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
752
- error = false
753
- }
754
- }
755
- if (error) {
756
- this.printContent.push({
757
- type: 3,
758
- text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':正常',
759
- fontsize: 2,
760
- isbold: false,
761
- align: 'left'
762
- })
763
- } else {
764
- this.printContent.push({
765
- type: 3,
766
- text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':有隐患',
767
- fontsize: 2,
768
- isbold: false,
769
- align: 'left'
770
- })
771
- }
772
-
773
- for (let i in backData[device][item].f_items) {
774
- if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
775
- this.printContent.push({
776
- type: 3,
777
- text: '隐患:' + backData[device][item].f_items[i].f_item_name + backData[device][item].f_items[i].f_item_value,
778
- fontsize: 2,
779
- isbold: false,
780
- align: 'left'
781
- })
782
- }
783
- }
784
- this.printContent.push({type: 4, value: 2, unit: 'line'})
785
- }
786
- }
787
- }
788
- }
789
- }
790
- }
791
- },
792
- //获取当前时间
793
- getNowFormatDate(){
794
- var date = new Date();
795
- var seperator1 = "-";
796
- var seperator2 = ":";
797
- var month = date.getMonth() + 1;
798
- var strDate = date.getDate();
799
- if (month >= 1 && month <= 9) {
800
- month = "0" + month;
801
- }
802
- if (strDate >= 0 && strDate <= 9) {
803
- strDate = "0" + strDate;
804
- }
805
- var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
806
- + " " + date.getHours() + seperator2 + date.getMinutes()
807
- + seperator2 + date.getSeconds();
808
- return currentdate;
809
- },
810
- readRepair () {
811
- let url = this.$androidUtil.getProxyUrl()
812
- let gen = getRepairs(this,url)
813
- return co(gen)
814
- },
815
- showToRepair(){
816
- let res = this.hasDefect()
817
- //tag
818
- //tag
819
- if(res == '正常'){
820
- this.showrepair = false
821
- }else{
822
- this.showrepair = true
823
- this.assignObj()
824
- }
825
- this.showCheckToRepair = !this.showCheckToRepair
826
- },
827
- // 选中部门
828
- reres(val){
829
- if(val.res == undefined){
830
- return
831
- }
832
- this.model.serviceacitivity[0].f_meetunit = val.res
833
- this.model.f_meetunit = val.res
834
- this.model.f_orgstr = val.resids
835
- var arr = val.res.split('.')
836
- this.model.f_outlets = arr[arr.length - 1]
837
- this.model.serviceacitivity[0].f_reciever = val.resids
838
- },
839
- assignObj(){
840
- this.model.f_contact_phone = this.paper.f_user_phone
841
- this.model.f_user_name = this.paper.f_user_name
842
- this.model.f_address = this.paper.f_address
843
- this.model.f_user_type = this.paper.f_check_type
844
- this.model.f_street = this.paper.f_street
845
- this.model.f_residential_area = this.paper.f_residential_area
846
- this.model.f_building = this.paper.f_building
847
- this.model.f_unit = this.paper.f_unit
848
- this.model.f_floor = this.paper.f_floor
849
- this.model.f_room = this.paper.f_room
850
- this.model.f_floor = this.paper.f_floor
851
- this.model.f_userinfo_id = this.paper.f_userinfoid
852
- this.model.f_userinfo_code = this.paper.f_userinfo_code
853
- },
854
- hasDefect(){
855
- let checkResult = '正常'
856
- let codata = JSON.parse(JSON.stringify(this.paper))
857
- for(let device in this.paper){
858
- if(device.startsWith("device")){
859
- for(let item in this.paper[device]) {
860
- for(let i in this.paper[device][item].f_items){
861
- let items = this.paper[device][item].f_items[i]
862
- //tag
863
- if(items.f_is_defect == true || items.f_is_defect == 'true'){
864
- checkResult = '有隐患'
865
- }
866
- }
867
- }
868
- }
869
- }
870
- return checkResult
871
- },
872
- uploadPaper() {
873
- if(this.showrepair){
874
- this.$parent.isToRepair = true
875
- this.$parent.savePaper(false).then((res) => {
876
- //tag
877
- if(res != true){
878
- //tag
879
- return
880
- }else{
881
- //TODO 上传成功 转维修失败
882
- this.todo()
883
- }
884
- })
885
- }else{
886
- this.undo()
887
- }
888
-
889
- },
890
- //确认安检转维修
891
- todo(){
892
- let gen = getRepairParam(this)
893
- co(gen)
894
- },
895
- undo(){
896
- this.showCheckToRepair = !this.showCheckToRepair
897
- this.model.serviceacitivity[0].f_reciever = ''
898
- this.model.serviceacitivity[0].f_meetunit = ''
899
- this.model.f_repairtype = ''
900
- this.meading = '转站点'
901
- },
902
- repiarmancg(val){
903
- if(val){
904
- //tag
905
- this.model.serviceacitivity[0].f_reciever = val.name
906
- let http1 = new HttpResetClass()
907
- http1.load('POST',`${this.Url}/rs/sql/tel_singleTable_OrderBy`, {data: {
908
- items: 'f_user_telephone',
909
- tablename: 't_user',
910
- condition: `name = '${val}'`,
911
- orderitem: 'id'
912
- }}, {resolveMsg: null, rejectMsg: null}).then((ress) => {
913
- this.model.f_repairman_phone = ress.data[0].f_user_telephone
914
- })
915
- }
916
- },
917
- },
918
- ready() {
919
- for (let item of this.radios){
920
- if(this.paper.f_client_evaluation == item.label){
921
- item.isChecked = true;
922
- }
923
- }
924
- //tag
925
- //tag
926
- //tag
927
- //tag
928
- if (!this.paper.f_notified_path)
929
- this.$set('paper.f_notified_path', Vue.nopic)
930
- if (!this.paper.f_sign_path)
931
- this.$set('paper.f_sign_path', Vue.nopic)
932
- if (!this.paper.f_overall_imgs){
933
- let imgs = []
934
- // imgs.push({f_overall_path:Vue.nopic})
935
- this.$set('paper.f_overall_imgs', imgs)
936
- //tag
937
- }
938
- if (!this.paper.f_overall2_path)
939
- this.$set('paper.f_overall2_path', Vue.nopic)
940
-
941
- this.userid = this.role == 'view'? this.$login.f.id:Vue.user.id
942
- if(Vue.config.safecheck != undefined){
943
- if(Vue.config.safecheck.ApproveConfig != undefined){
944
- if(Vue.config.safecheck.ApproveConfig.safeCheckToRepair != undefined) {
945
- this.safeCheckToRepair = Vue.config.safecheck.ApproveConfig.safeCheckToRepair
946
- }
947
- }
948
- }
949
- //tag
950
- //tag
951
- },
952
- watch:{
953
- '$parent.isUpload'(val){
954
- //tag
955
- }
956
- }
957
- }
958
- </script>
959
- <style>
960
- .text-left{
961
- text-align:left;
962
- }
963
- .font{
964
- font: 15px PingFang-SC-Medium;
965
- color: #333333;
966
- }
967
- .showInput{
968
- font: 14px PingFang-SC-Medium;
969
- color: #666666;
970
- }
971
- .info{
972
- margin-top: 15px;
973
- border-radius: 5px;
974
- background-color: #f3faff;
975
- }
976
- .btn-photo{
977
- border: 0;
978
- border-radius: 7px;
979
- background-color: #7dc1f4;
980
- font: 15px PingFang-SC-Bold;
981
- height: 20%;
982
- }
983
- .div-photo{
984
- width: auto;
985
- height: auto;
986
- /* margin-top: 10px; */
987
- position: absolute;
988
- bottom: 10px;
989
- right: 10px;
990
- }
991
- .btn-voice{
992
- border-radius: 7px;
993
- border: 1px solid #dedede;
994
- background-color: #f5fbff;
995
- font: 15px PingFang-SC-Bold;
996
- color: #499edf;
997
- }
998
- .save-btn{
999
- width: 25%;
1000
- background-color:#499edf;
1001
- border-radius: 6px;
1002
- color: #FFFFFF;
1003
- font: 15px PingFang-SC-Bold;
1004
- }
1005
- .upload-btn{
1006
- width: 25%;
1007
- background-color:#ffffff;
1008
- border: 1px solid #499edf;
1009
- border-radius: 6px;
1010
- color: #499edf;
1011
- font: 15px PingFang-SC-Bold;
1012
- }
1013
- .repair-btn{
1014
- width: 25%;
1015
- border: 1px solid #499edf;
1016
- border-radius: 6px;
1017
- font: 15px PingFang-SC-Bold;
1018
- }
1019
- </style>
1
+ <template>
2
+ <div class="auto">
3
+ <div style="width: 100%;height: 36px;background-color: #f1f8ff">
4
+ <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
5
+ <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">拍照选项:</p></div>
6
+ </div>
7
+ <form novalidate class="form-horizontal" style="width: 100%;margin: auto">
8
+ <div class="form-group col-sm-12 col-xs-12 col-md-12 info" style="width:100%;">
9
+ <div class="text-center">
10
+ <label class="font">检查说明:</label>
11
+ </div>
12
+ <div class="col-md-12 col-sm-12 col-xs-12" style="width: 90%;margin-left: 5px">
13
+ <ol class="showInput" style="width: 90%;margin-left: 40px">
14
+ <li>已对客户燃气设施进行了安全检查</li>
15
+ <li>已对客户进行了安全知识宣传,并发放宣传资料</li>
16
+ <li>已对客户的资料进行了登记</li>
17
+ <li>已对违章及隐患之客户下发隐患整改告知书</li>
18
+ </ol>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="form-group col-sm-12" style="margin-top: 10px">
23
+ <div class="auto" style="width: 100%;float: left;" >
24
+ <label class="text-left font">总体送气照片</label>
25
+ <div class="auto">
26
+ <div class="panel">
27
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
28
+ <div class="row" style="height: 240px;overflow: scroll;top: 1px">
29
+ <div class="row">
30
+ <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 10px;margin-right: 75px" v-for="(index,img) in paper.f_overall_imgs">
31
+ <img-self :src="img.f_overall_path" alt="总体送气照片" :width="150" :height="200"></img-self>
32
+ <!--<img src="../../assets/remove.png" @click="delfile('f_overall_path', img.f_overall_path,index)" class="imgs" style="width: 30px;" alt="">-->
33
+ </div>
34
+ <div class="img" v-for="row in fileInfoData">
35
+ <img :src="row.f_downloadURL">
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <div class="row text-right div-photo">
40
+ <!--<button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_overall_path', '总体安检照片1')">拍照</button>-->
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ <!--<div class="auto" style="width: 49%;float: left;margin-left: 20px">-->
47
+ <!--<label class="text-left font">总体安检照片2</label>-->
48
+ <!--<div class="auto">-->
49
+ <!--<div class="panel">-->
50
+ <!--<div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">-->
51
+ <!--<div class="row" style="height: 240px;overflow: scroll;top: 1px">-->
52
+ <!--<div class="col-sm-4">-->
53
+ <!--<img-self :src="paper.f_overall2_path" alt="总体安检照片2" width="150" height="200"></img-self>-->
54
+ <!--</div>-->
55
+ <!--</div>-->
56
+ <!--<div class="row text-right div-photo">-->
57
+ <!--<button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_overall2_path', '总体安检照片2')">拍照</button>-->
58
+ <!--</div>-->
59
+ <!--</div>-->
60
+ <!--</div>-->
61
+ <!--</div>-->
62
+ <!--</div>-->
63
+ </div>
64
+ <div class="form-group col-sm-12" style="margin-top: 20px">
65
+ <label class="text-left font">用户签名</label>
66
+ <div class="auto">
67
+ <div class="panel">
68
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
69
+ <div class="row" style="height: 240px;overflow: scroll;top: 1px">
70
+ <div class="col-sm-4">
71
+ <img :class="style__" :src="paper.f_sign_path" :width="200" :height="150" />
72
+ </div>
73
+ </div>
74
+ <!--<div class="row text-right div-photo">-->
75
+ <!--&lt;!&ndash;<button type="button" name="button" class="btn btn-primary btn-photo" @click="sign">签名</button>&ndash;&gt;-->
76
+ <!--</div>-->
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ <div class="form-group col-sm-12" v-if="paper.f_exceed_reason">
82
+ <label>送气超期原因:</label><br/>
83
+ <textarea style="width: 100%;" v-model="paper.f_exceed_reason"></textarea>
84
+ </div>
85
+ <!--<div class="form-group col-sm-12" style="margin-top: 20px">
86
+ <input type="checkbox" :readonly="true" :checked="paper.f_blacklist=='是'"/><label class="text-left font" >限制该用户购气</label>
87
+ <textarea if="paper.f_blacklist=='是'" id="el_ca_tx" v-model.trim="paper.f_blocking_cause" style="border-radius:4px;width: 100%;" >
88
+ </textarea>
89
+ </div>-->
90
+ <div class="form-group col-md-12 col-sm-12 col-xs-12">
91
+ <!--<div class="form-group col-md-12 col-sm-12 col-xs-12">
92
+ <input type="checkbox" v-model="paper.f_defect_notified" class="showInput"/>安检通知书/隐患整改通知书
93
+ </div>
94
+ <div class="form-group col-md-12 col-sm-12 col-xs-12" v-if="paper.f_defect_notified">
95
+ <div class="form-group col-md-12 col-sm-12 col-xs-12">
96
+ <button type="button" @click="print()">打印隐患整改单</button>
97
+ </div>
98
+ <div class="form-group col-md-12 col-sm-12 col-xs-12">
99
+ <label class="text-left font">安检通知书/隐患整改通知书照片(要求能清晰反应安检通知单和用户签字内容):</label>
100
+ <div class="auto" >
101
+ <div class="panel" style="padding: 10px 10px 5px 10px;">
102
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
103
+ <div class="row" style="height: 240px;overflow: scroll;top: 1px">
104
+ <div class="col-sm-4">
105
+ <img-self :src="paper.f_notified_path" alt="安检通知书/隐患整改通知书照片" width="150" height="200"></img-self>
106
+ </div>
107
+ </div>
108
+ <div class="row text-right div-photo">
109
+ <button type="button" name="button" class="btn btn-primary btn-photo" @click="takePic('f_notified_path', '安检通知书/隐患整改通知书照片')">拍照</button>
110
+ &nbsp;&nbsp;&nbsp;&nbsp;<img src="../../assets/remove.png" :class="style__" @click="delfile('f_notified_path', this.paper.f_notified_path)" style="width: 25%;"></img>
111
+ </div>
112
+ </div>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ -->
118
+ <div class="form-group col-md-12 col-sm-12 col-xs-12">
119
+ <div class="row">
120
+ <label class="text-left">请对我们的服务做出评价:</label>
121
+ </div>
122
+ <div class="col-xs-4 col-sm-4" v-for="item in radios">
123
+ <input v-model="paper.f_client_evaluation" :value="item.label" :checked='item.isChecked' @click="check(item.value)" type="radio">{{item.label}}
124
+ </div>
125
+ </div>
126
+ <!-- <div class="form-group col-md-12 col-sm-12 col-xs-12">-->
127
+ <!-- <label class="text-left font">反馈录音:</label>-->
128
+ <!-- <div class="col-md-12 col-sm-12 col-xs-12" v-if="!paper.f_recording1_path">-->
129
+ <!-- <audio :src="paper.f_recording1_path" v-el:audio controls @click="palyAudio(row)"></audio>-->
130
+ <!-- </div>-->
131
+ <!-- </div>-->
132
+ <div class="text-center form-group col-md-12 col-sm-12 col-xs-12">
133
+ <button type="button" v-show="$parent.actionEnabled" class="btn save-btn" @click="$parent.savePaper(true)">保存</button>
134
+ <button id="upload" type="button" v-show="$parent.actionEnabled && !$parent.isBusy" class="btn upload-btn" @click="$parent.uploadPaper" >上传</button>
135
+ <button v-if="safeCheckToRepair && $parent.actionEnabled" class="btn repair-btn btn-warning" type="button" @click="showToRepair">转维修</button>
136
+ </div>
137
+ </div>
138
+ </form>
139
+
140
+ <modal :show.sync="showCheckToRepair" v-ref:modal :backdrop="isback">
141
+ <div slot="modal-header" class="modal-header">
142
+ <h4 class="modal-title">
143
+ 安检转维修
144
+ </h4>
145
+ </div>
146
+ <div slot="modal-body" class="modal-body">
147
+ <div v-if="showrepair">
148
+ <div class="row">
149
+ <label class="col-xs-4 col-md-4 control-label text-left">派单方式</label>
150
+ <div class="col-xs-8 col-md-8">
151
+ <label v-for="handling1 in handling" >
152
+ <input type="radio"
153
+ v-model="meading"
154
+ value="{{handling1.label}}">
155
+ {{handling1.label}}
156
+ </label>
157
+ </div>
158
+ </div>
159
+ <div class="row" v-if="meading == '转站点'">
160
+ <label class="col-xs-4 col-md-4 control-label font text-left" for="f_reciever">站点</label>
161
+ <div class="col-xs-8 col-md-8">
162
+ <right-tree @ready="onReady" islist :Url="Url" :userid="userid" :source="source" v-on:re-res="reres" :textContent="选择站点管理员" :selectData="" v-ref:f_reciever>
163
+ </right-tree>
164
+ </div>
165
+ </div>
166
+
167
+ <div class="row" style="margin-top: 6px" v-if="meading == '转维修员'">
168
+ <label class="col-xs-4 col-md-4 control-label font text-left">维修人</label>
169
+ <div class="col-xs-8">
170
+ <v-select :value="model.serviceacitivity[0].f_reciever" :value-single="true"
171
+ :options='f_repair_person' placeholder='请选择维修员'
172
+ close-on-select v-on:change="repiarmancg"></v-select>
173
+ </div>
174
+
175
+ </div>
176
+ <div class="row" style="margin-top: 6px">
177
+ <label for="f_repair" class="col-xs-4 col-md-4 control-label font text-left">报修类型</label>
178
+ <div class="col-xs-8 col-md-8">
179
+ <v-select :value.sync="model.f_repairtype" :value-single="true"
180
+ :options='repairstypes' placeholder='报修类型'
181
+ close-on-select>
182
+ </v-select>
183
+ </div>
184
+ </div>
185
+
186
+ <div class="row" style="margin-top: 6px">
187
+ <label class="control-label font text-left col-md-4 col-xs-4">备注</label>
188
+ <div class="col-xs-8 col-md-8">
189
+ <input type="text" v-model="model.f_remarks"/>
190
+ </div>
191
+
192
+ </div>
193
+
194
+ </div>
195
+ <div v-if="!showrepair">
196
+ 暂无隐患设备信息
197
+ </div>
198
+ </div>
199
+ <div slot="modal-footer" class="modal-footer">
200
+ <button type="button" class="btn btn-default" @click="uploadPaper()">确定</button>
201
+ <button type="button" class="btn btn-default" @click="undo()">取消</button>
202
+ </div>
203
+ </modal>
204
+ </div>
205
+ </template>
206
+
207
+ <script>
208
+ import Vue from 'vue'
209
+ import * as Util from '../Util'
210
+ import { HttpResetClass } from 'vue-client'
211
+ import RadioGroup from 'vue-client/src/vue-strap/src/radioGroup'
212
+ import Radio from 'vue-client/src/vue-strap/src/radioBtn'
213
+ import co from 'co'
214
+
215
+ let getRepairParam = function * (self){
216
+ let data = {
217
+ model: self.model, loginUser: {
218
+ name: self.role == 'view'?self.$login.f.name:Vue.user.name,
219
+ ename: self.role == 'view'?self.$login.f.ename:Vue.user.ename
220
+ }, user: self.user, callObj: self.callObj
221
+ }
222
+ if(self.meading == '转维修员'){
223
+ data.toRepair = '一级派单'
224
+ }
225
+ data.model.f_attendant = data.loginUser.name
226
+ //tag
227
+ //tag
228
+ let res
229
+ let errString = self.$parent.errorVerify()
230
+ if(errString){
231
+ //tag
232
+ if (Vue.android)
233
+ self.undo()
234
+ this.$showMessage(errString)
235
+ return
236
+ } else {
237
+ if(self.role == 'inspect'){
238
+ if(self.meading == '转维修员' && (self.model.serviceacitivity[0].f_reciever == '' || self.model.serviceacitivity[0].f_reciever == undefined)){
239
+ this.$showMessage("请选择维修员!")
240
+ return
241
+ }
242
+ if(self.meading == '转站点' && (self.model.serviceacitivity[0].f_reciever == '' || self.model.serviceacitivity[0].f_reciever == undefined)){
243
+ this.$showMessage("请选择站点!")
244
+ return
245
+ }
246
+ if(self.model.f_repairtype == ''){
247
+ this.$showMessage("请选择报修类型!")
248
+ return
249
+ }
250
+ //tag)
251
+ let checkResult = '正常'
252
+ let options = [{"data": "已处理"},{"data": "未处理"}]
253
+ let value = ''
254
+ let codata = JSON.parse(JSON.stringify(self.paper))
255
+ for(let device in codata){
256
+ //tag)
257
+ let f_device_type
258
+ if(device.startsWith("device")){
259
+ for(let item in codata[device]) {
260
+ if(codata[device].length > 1 ){
261
+ let j = Number.parseInt(item)+1
262
+ f_device_type = `${codata[device][item].f_device_type}${j}`
263
+ }else{
264
+ f_device_type = codata[device][item].f_device_type
265
+ }
266
+ // //tag
267
+ let details = []
268
+ for(let i in codata[device][item].f_items){
269
+ let items = codata[device][item].f_items[i]
270
+ //tag
271
+ if(items.f_is_defect == true || items.f_is_defect == 'true'){
272
+ checkResult = '有隐患'
273
+ //tag
274
+ let res = yield self.$resetpost(`${self.Url}/rs/sql/getDeviceItem`,{data:{f_device_id:codata[device][item].f_device_id,f_item_name:items.f_item_name}})
275
+ //tag)
276
+ self.$set('detail.f_defect_id', res.data[0].id)
277
+ self.$set('detail.f_project',`${items.f_item_name}:${items.f_item_value}`)
278
+ self.$set('detail.type',items.type)
279
+ self.$set('detail.options',options)
280
+ details.push(JSON.parse(JSON.stringify(self.detail)))
281
+ }
282
+ if(items.type == 'selector'){
283
+ items.selected = ''
284
+ }
285
+ self.detail = {}
286
+ }
287
+ //tag
288
+ self.$set('defectDevice.f_type',f_device_type)
289
+ self.$set('defectDevice.details',details)
290
+ if(self.defectDevice.details.length >0 ){
291
+ self.repairitems.push(JSON.parse(JSON.stringify(self.defectDevice)))
292
+ }
293
+ self.defectDevice = {}
294
+ //tag
295
+ }
296
+ }
297
+ }
298
+ self.$set('model.f_repairitems.data',self.repairitems)
299
+
300
+
301
+ //tag)
302
+ res = self.$androidUtil.bzLogic('safecheckToRepair',data)
303
+ //tag
304
+ //tag
305
+ //tag
306
+ if(res.code == 200){
307
+ self.$parent.isSafeCheckToRepair = true
308
+ self.undo()
309
+ self.$set('paper.f_SafeToRepair_id',res.data.f_service_id)
310
+ //tag
311
+ self.$resetpost(`${self.Url}/rs/logic/updatePaperRepair`,{data:{f_paper_id:self.paper.f_paper_id,f_SafeToRepair_id:res.data.f_service_id}}).then((ret)=>{
312
+ //tag
313
+ if(ret.data.code ==200){
314
+ //tag
315
+ self.$parent.$back()
316
+ }else{
317
+ self.$showMessage('安检转维修失败!')
318
+ }
319
+ }).catch(v=>{
320
+ //tag)
321
+ self.$showMessage('安检转维修失败!')
322
+ })
323
+ }else{
324
+ self.$showMessage('安检转维修失败!')
325
+ }
326
+ }
327
+ }
328
+ }
329
+
330
+
331
+
332
+ let getRepairs = async function(self,url) {
333
+ // 获取配置信息
334
+ try {
335
+ let val = {source: 'this.getParentByType($department$).getChildByName($维修员$).getUsers()', userid: `${Vue.$login.jwt}`}
336
+ let repairs =[]
337
+ let res = await Vue.resetpost(`${url}/rs/search`,{data: val},{resolveMsg: null, rejectMsg: null})
338
+ res.data.forEach((item) => {
339
+ repairs.push({label: item.name, value: item})
340
+ })
341
+ self.f_repair_person = repairs
342
+ if(self.$parent.role == 'inspect'){
343
+ let res = self.$androidUtil.bzLogic('getUserInfo',{id:self.paper.f_userinfoid})
344
+ if(res.code == 200){
345
+ self.user = res.data[0]
346
+ self.model.f_area = self.user.f_area
347
+ }
348
+ }else{
349
+ //tag
350
+ self.$resetpost(`${self.Url}/rs/sql/safeCheckgetUserInfo`,{data:{id:self.paper.f_userinfoid}},{resolveMsg: null, rejectMsg: null}).then((res)=>{
351
+ //tag
352
+ if(res.data.length != 0){
353
+ self.user = res.data[0]
354
+ self.model.f_area = self.user.f_area
355
+ }
356
+ })
357
+ // path({alias:'getUserInfo',data:{id:this.paper.f_userinfoid}})
358
+ }
359
+ } catch (error) {
360
+ //tag
361
+ }
362
+ }
363
+
364
+ export default {
365
+ title: '用户反馈',
366
+ data() {
367
+ return {
368
+ fileInfoData:[],
369
+ paper:this.$parent.data,
370
+ printContent:[],
371
+ radios:[
372
+ {
373
+ label: '满意',
374
+ value: 0,
375
+ isChecked: false,
376
+ },
377
+ {
378
+ label: '基本满意',
379
+ value:1,
380
+ isChecked: false,
381
+ },
382
+ {
383
+ label: '不满意',
384
+ value:2,
385
+ isChecked: false,
386
+ },
387
+ ],
388
+ model: {
389
+ // 一次派单
390
+ serviceacitivity: [{
391
+ f_service_acitivity_type: '派单'
392
+ }],
393
+ f_source:'安检',
394
+ f_service_id: '',
395
+ f_contact_phone: '',
396
+ f_meetunit: '',
397
+ f_phone: '',
398
+ f_user_name: '',
399
+ f_address: '',
400
+ f_repair_date: Util.toStandardTimeString(),
401
+ f_card_id: '',
402
+ // f_department: '', 站点选择
403
+ f_reciever:'',
404
+ f_remarks: '',
405
+ f_user_type: '',
406
+ f_area: '',
407
+ f_unit_name:'',
408
+ f_street: '',
409
+ f_residential_area: '',
410
+ f_building: '',
411
+ f_unit: '',
412
+ f_floor: '',
413
+ f_room: '',
414
+ aState: null,
415
+ f_repairtype: '',
416
+ f_repairitems:{},
417
+ },
418
+ repairitems:[],
419
+ repairstypes:this.$appdata.getParam('报修类型'),
420
+ //f_repair_person: this.readRepair(),
421
+ showrepair: false,
422
+ safeCheckToRepair:'',
423
+ showCheckToRepair:false,
424
+ userid: '',
425
+ source:
426
+ 'dep=this.getParentByType($organization$).getSpecialResByType($department$),' +
427
+ 'tool.getFullTree(dep.where(row.getChildByName($派单员$) != null))',
428
+ isback:false,
429
+ defectDevice:{},
430
+ detail:{},
431
+ callObj:null,
432
+ user:{},
433
+ role:this.$parent.role,
434
+ handling:[{label:'转站点',value:'转站点'},{label:'转维修员',value:'转维修员'}],
435
+ meading:'转站点',
436
+ Url:this.$androidUtil.getProxyUrl()
437
+ }
438
+ },
439
+ props: ['idx','item'],
440
+ components: {
441
+ RadioGroup,
442
+ Radio
443
+ },
444
+ methods: {
445
+ //获取pc上传的送气全景照片
446
+ getGaspic() {
447
+ let data = {
448
+ tablename: 't_files',
449
+ condition: `f_blobid = '${this.item.id}' order by f_uploaddate desc `
450
+ }
451
+ let http = new HttpResetClass()
452
+ http.load('post', 'rs/sql/singleTable', {data: data}, {
453
+ resolveMsg: null,
454
+ rejectMsg: null
455
+ }).then(getFile=> {
456
+ for (var i = 0; i < getFile.data.length; i++) {
457
+ let temp = getFile.data[i].f_downloadpath
458
+ if (temp) {
459
+ let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
460
+ getFile.data[i].f_downloadURL = "http://" + location.host + "/" + URL
461
+ }
462
+ }
463
+ this.fileInfoData = []
464
+ this.fileInfoData = getFile.data
465
+ })
466
+ },
467
+ check(index) {
468
+ //tag
469
+ // 先取消所有选中项
470
+ for (let item of this.radios){
471
+ item.isChecked = false;
472
+ }
473
+ //再设置当前点击项选中
474
+ this.paper.f_client_evaluation = this.radios[index].label;
475
+ // 设置值,以供传递
476
+ this.radios[index].isChecked = true;
477
+ //tag;
478
+ },
479
+ getSignValue(fileName) {
480
+ this.f_signname = fileName
481
+ },
482
+ cameraCallBack(prop, fileName) {
483
+ HostApp.__this__.paper[prop] = fileName + '?' + Math.random()
484
+ HostApp.__callback__ = null
485
+ HostApp.__this__ = null
486
+ },
487
+ takePic(prop, title) {
488
+ HostApp.__callback__ = this.cameraCallBack
489
+ HostApp.__this__ = this
490
+ //tag
491
+ //tag
492
+ let fileName
493
+ if (!this.paper[prop] || this.paper[prop].includes("nopic.png")) {
494
+ fileName = Util.guid() + '-' + prop + '.jpg'
495
+ } else {
496
+ fileName = Util.getFileName(this.paper[prop])
497
+ }
498
+ HostApp._open_a_page({
499
+ type: 'boomerang',
500
+ page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
501
+ param: {
502
+ file: fileName,
503
+ requestCode: 111,
504
+ callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");',
505
+ watermark: title + '\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name
506
+ }
507
+ })
508
+ },
509
+ amrCallBack(fileName) {
510
+ HostApp.__this__.$set('paper.f_recording1_path', fileName)
511
+ HostApp.__callback__ = null
512
+ HostApp.__this__ = null
513
+ },
514
+ record() {
515
+ if (this.$parent.role != 'inspect') {
516
+ if (this.paper.f_recording1_path != '') {
517
+ window.location = this.paper.f_recording1_path
518
+ }
519
+ } else {
520
+ HostApp.__callback__ = this.amrCallBack
521
+ HostApp.__this__ = this
522
+ let fileName
523
+ if (!this.paper.f_recording1_path) {
524
+ fileName = Util.guid() + '.amr'
525
+ } else {
526
+ fileName = Util.getFileName(this.paper.f_recording1_path)
527
+ }
528
+ HostApp._open_a_page({
529
+ type: 'boomerang',
530
+ page: 'com.aofeng.hybrid.android.peripheral.AudioClipActivity',
531
+ param: {file: fileName, requestCode: 111, callback: 'javascript:HostApp.__callback__("%s");'}
532
+ })
533
+ }
534
+ },
535
+ // 签名回调
536
+ signCallback(prop, fileName) {
537
+ // HostApp.alert('绑定属性:' + prop + ' 文件全路径如file:///storage/sdcard0/safecheck/abc.jpg:' + fullFileName)
538
+ HostApp.__this__.$set('paper.f_sign_path', fileName)
539
+ HostApp.__callback__ = null
540
+ HostApp.__this__ = null
541
+ },
542
+ // 用户签名
543
+ sign() {
544
+ this.delAudioFile('f_sign_path', this.paper.f_sign_path)
545
+ let prop = 'f_sign_path'
546
+ let idx = 'aofeng'
547
+ let fileName
548
+ if (!this.paper.f_sign_path) {
549
+ fileName = Util.guid() + '-valve-' + idx + '-' + prop + '.jpg'
550
+ } else {
551
+ fileName = Util.getFileName(this.paper.f_sign_path)
552
+ }
553
+ HostApp.__callback__ = this.signCallback
554
+ HostApp.__this__ = this
555
+ HostApp.getSignature({
556
+ file: fileName,
557
+ requestCode: 111,
558
+ callback: 'javascript:HostApp.__callback__("' + prop + '", "%s");'
559
+ })
560
+ },
561
+ delfile(prop, fileName) {
562
+ if (fileName == Vue.nopic)
563
+ return
564
+ else {
565
+ HostApp.delfile(fileName)
566
+ this.paper[prop] = Vue.nopic
567
+ }
568
+ },
569
+ delAudioFile(prop, fileName) {
570
+ if (!fileName)
571
+ return
572
+ else {
573
+ HostApp.delfile(fileName)
574
+ this.paper[prop] = null
575
+ }
576
+ },
577
+ //获取打印用户信息
578
+ getUser() {
579
+ if (this.paper.f_user_name == undefined)
580
+ this.paper.f_user_name = ''
581
+ this.printContent.push({type: 3, text: '用户名称:' + this.paper.f_user_name, fontsize: 2, isbold: false, align: 'left'})
582
+ if (this.paper.f_userinfo_code == undefined)
583
+ this.paper.f_userinfo_code = ''
584
+ this.printContent.push({type: 3, text: '用户编号:' + this.paper.f_userinfo_code, fontsize: 2, isbold: false, align: 'left'})
585
+ if (this.paper.f_address == undefined)
586
+ this.paper.f_address = ''
587
+ this.printContent.push({type: 3, text: '地址:' + this.paper.f_address, fontsize: 2, isbold: false, align: 'left'})
588
+ if (this.paper.f_user_phone == undefined)
589
+ this.paper.f_user_phone = ''
590
+ this.printContent.push({type: 3, text: '电话:' + this.paper.f_user_phone, fontsize: 2, isbold: false, align: 'left'})
591
+ },
592
+ verify(){
593
+ let hasError = this.$parent.verifyUser()
594
+ if(hasError)
595
+ return hasError
596
+ hasError = this.$parent.verifyDevices()
597
+ if(hasError)
598
+ return hasError
599
+ },
600
+ print() {
601
+ let errString = this.verify()
602
+ if (errString) {
603
+ //tag
604
+ if (Vue.android)
605
+ this.$showMessage(errString)
606
+ return
607
+ }
608
+ // 文本
609
+ let templatename = '安检结果单'
610
+ if(Vue.config.safecheck != undefined) {
611
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
612
+ if (Vue.config.safecheck.ApproveConfig.templatename != undefined) {
613
+ templatename = Vue.config.safecheck.ApproveConfig.templatename
614
+ }
615
+ }
616
+ }
617
+ let textHead = {type: 3, text: templatename, fontsize: 3, isbold: true, align: 'center'}
618
+ let feedPageHead = {type: 4, value: 2, unit: 'line'}
619
+ let feedPageEnd = {type: 4, value: 4, unit: 'line'}
620
+ this.printContent.push(textHead)
621
+ this.printContent.push(feedPageHead)
622
+ this.getUser()
623
+ this.getDefect()
624
+ this.getCheck()
625
+ this.printContent.push(feedPageEnd)
626
+ let arrstr = JSON.stringify(this.printContent)
627
+ //tag
628
+ this.$androidUtil.print(arrstr)
629
+ this.$set('printContent', [])
630
+ },
631
+ //打印安检信息
632
+ getCheck() {
633
+ let telephone = '96777'
634
+ if(Vue.config.safecheck != undefined) {
635
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
636
+ if (Vue.config.safecheck.ApproveConfig.checkphone != undefined) {
637
+ telephone = Vue.config.safecheck.ApproveConfig.checkphone
638
+ }
639
+ }
640
+ }
641
+ this.printContent.push({type: 3, text: '*******************************', fontsize: 3, isbold: false, align: 'center'})
642
+ this.printContent.push({type: 3, text: '咨询电话;'+telephone, fontsize: 2, isbold: false, align: 'left'})
643
+ this.printContent.push({type: 3, text: '安检人:'+Vue.user.name, fontsize: 2, isbold: false, align: 'left'})
644
+ this.printContent.push({type: 3, text: '安检时间:' + this.getNowFormatDate(), fontsize: 2, isbold: false, align: 'left'})
645
+ this.printContent.push({type: 3, text: '用户签字:', fontsize: 2, isbold: false, align: 'left'})
646
+ this.printContent.push({type: 4, value: 4, unit: 'line'})
647
+ },
648
+
649
+ getDefect() {
650
+ let showmore = false
651
+ if(Vue.config.safecheck != undefined) {
652
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
653
+ if (Vue.config.safecheck.ApproveConfig.showmore != undefined) {
654
+ showmore = Vue.config.safecheck.ApproveConfig.showmore
655
+ }
656
+ }
657
+ }
658
+
659
+ let backData = this.$parent.getAllDefect()
660
+ // 对隐患信息进行遍历
661
+ let res = JSON.parse(backData.f_defect_content)
662
+ this.printContent.push({
663
+ type: 3,
664
+ text: '安检结果:' + res.result,
665
+ fontsize: 2,
666
+ isbold: false,
667
+ align: 'left'
668
+ })
669
+ this.printContent.push({type: 3, text: '*******************************', fontsize: 3, isbold: false, align: 'center'})
670
+
671
+
672
+ if(showmore) {
673
+ //全部打印
674
+ for (let dev in this.$parent.config) {
675
+ for (let device in backData) {
676
+ if (device.startsWith("device")) {
677
+ for (let item in backData[device]) {
678
+ //遍历结果
679
+ if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
680
+ let error = true
681
+ for (let i in backData[device][item].f_items) {
682
+ if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
683
+ error = false
684
+ }
685
+ }
686
+ if (error) {
687
+ this.printContent.push({
688
+ type: 3,
689
+ text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':正常',
690
+ fontsize: 2,
691
+ isbold: false,
692
+ align: 'left'
693
+ })
694
+ } else {
695
+ this.printContent.push({
696
+ type: 3,
697
+ text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':有隐患',
698
+ fontsize: 2,
699
+ isbold: true,
700
+ align: 'left'
701
+ })
702
+ }
703
+
704
+ for (let i in backData[device][item].f_items) {
705
+ if (backData[device][item].f_items[i].f_item_value != '' && backData[device][item].f_items[i].f_item_value != null) {
706
+ this.printContent.push({
707
+ type: 3,
708
+ text: backData[device][item].f_items[i].f_item_name + backData[device][item].f_items[i].f_item_value,
709
+ fontsize: 2,
710
+ isbold: false,
711
+ align: 'left'
712
+ })
713
+ }
714
+ }
715
+ this.printContent.push({type: 4, value: 2, unit: 'line'})
716
+ }
717
+ }
718
+ }
719
+ }
720
+ }
721
+
722
+ for (let dev in this.$parent.config) {
723
+ for (let device in backData) {
724
+ if (device.startsWith("device")) {
725
+ for (let item in backData[device]) {
726
+ //遍历结果
727
+ if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
728
+ let error = true
729
+ for (let i in backData[device][item].f_items) {
730
+ if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
731
+ error = false
732
+ }
733
+ }
734
+ if (!error) {
735
+ this.printContent.push({
736
+ type: 3,
737
+ text: '隐患:',
738
+ fontsize: 2,
739
+ isbold: true,
740
+ align: 'left'
741
+ })
742
+ }
743
+ }
744
+ }
745
+ }
746
+ }
747
+ for (let device in backData) {
748
+ if (device.startsWith("device")) {
749
+ for (let item in backData[device]) {
750
+ if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
751
+ for (let i in backData[device][item].f_items) {
752
+ if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
753
+ this.printContent.push({
754
+ type: 3,
755
+ text: backData[device][item].f_items[i].f_item_name + ' ' + backData[device][item].f_items[i].f_item_value,
756
+ fontsize: 2,
757
+ isbold: true,
758
+ align: 'left'
759
+ })
760
+ }
761
+ }
762
+ }
763
+ }
764
+ }
765
+ }
766
+
767
+ }
768
+ }else {
769
+ for (let dev in this.$parent.config) {
770
+ for (let device in backData) {
771
+ if (device.startsWith("device")) {
772
+ for (let item in backData[device]) {
773
+ //遍历结果
774
+ if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
775
+ let error = true
776
+ for (let i in backData[device][item].f_items) {
777
+ if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
778
+ error = false
779
+ }
780
+ }
781
+ if (error) {
782
+ this.printContent.push({
783
+ type: 3,
784
+ text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':正常',
785
+ fontsize: 2,
786
+ isbold: false,
787
+ align: 'left'
788
+ })
789
+ } else {
790
+ this.printContent.push({
791
+ type: 3,
792
+ text: dev + (backData[device].indexOf(backData[device][item]) + 1) + ':有隐患',
793
+ fontsize: 2,
794
+ isbold: false,
795
+ align: 'left'
796
+ })
797
+ }
798
+
799
+ for (let i in backData[device][item].f_items) {
800
+ if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
801
+ this.printContent.push({
802
+ type: 3,
803
+ text: '隐患:' + backData[device][item].f_items[i].f_item_name + backData[device][item].f_items[i].f_item_value,
804
+ fontsize: 2,
805
+ isbold: false,
806
+ align: 'left'
807
+ })
808
+ }
809
+ }
810
+ this.printContent.push({type: 4, value: 2, unit: 'line'})
811
+ }
812
+ }
813
+ }
814
+ }
815
+ }
816
+ }
817
+ },
818
+ //获取当前时间
819
+ getNowFormatDate(){
820
+ var date = new Date();
821
+ var seperator1 = "-";
822
+ var seperator2 = ":";
823
+ var month = date.getMonth() + 1;
824
+ var strDate = date.getDate();
825
+ if (month >= 1 && month <= 9) {
826
+ month = "0" + month;
827
+ }
828
+ if (strDate >= 0 && strDate <= 9) {
829
+ strDate = "0" + strDate;
830
+ }
831
+ var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
832
+ + " " + date.getHours() + seperator2 + date.getMinutes()
833
+ + seperator2 + date.getSeconds();
834
+ return currentdate;
835
+ },
836
+ readRepair () {
837
+ let url = this.$androidUtil.getProxyUrl()
838
+ let gen = getRepairs(this,url)
839
+ return co(gen)
840
+ },
841
+ showToRepair(){
842
+ let res = this.hasDefect()
843
+ //tag
844
+ //tag
845
+ if(res == '正常'){
846
+ this.showrepair = false
847
+ }else{
848
+ this.showrepair = true
849
+ this.assignObj()
850
+ }
851
+ this.showCheckToRepair = !this.showCheckToRepair
852
+ },
853
+ // 选中部门
854
+ reres(val){
855
+ if(val.res == undefined){
856
+ return
857
+ }
858
+ this.model.serviceacitivity[0].f_meetunit = val.res
859
+ this.model.f_meetunit = val.res
860
+ this.model.f_orgstr = val.resids
861
+ var arr = val.res.split('.')
862
+ this.model.f_outlets = arr[arr.length - 1]
863
+ this.model.serviceacitivity[0].f_reciever = val.resids
864
+ },
865
+ assignObj(){
866
+ this.model.f_contact_phone = this.paper.f_user_phone
867
+ this.model.f_user_name = this.paper.f_user_name
868
+ this.model.f_address = this.paper.f_address
869
+ this.model.f_user_type = this.paper.f_check_type
870
+ this.model.f_street = this.paper.f_street
871
+ this.model.f_residential_area = this.paper.f_residential_area
872
+ this.model.f_building = this.paper.f_building
873
+ this.model.f_unit = this.paper.f_unit
874
+ this.model.f_floor = this.paper.f_floor
875
+ this.model.f_room = this.paper.f_room
876
+ this.model.f_floor = this.paper.f_floor
877
+ this.model.f_userinfo_id = this.paper.f_userinfoid
878
+ this.model.f_userinfo_code = this.paper.f_userinfo_code
879
+ },
880
+ hasDefect(){
881
+ let checkResult = '正常'
882
+ let codata = JSON.parse(JSON.stringify(this.paper))
883
+ for(let device in this.paper){
884
+ if(device.startsWith("device")){
885
+ for(let item in this.paper[device]) {
886
+ for(let i in this.paper[device][item].f_items){
887
+ let items = this.paper[device][item].f_items[i]
888
+ //tag
889
+ if(items.f_is_defect == true || items.f_is_defect == 'true'){
890
+ checkResult = '有隐患'
891
+ }
892
+ }
893
+ }
894
+ }
895
+ }
896
+ return checkResult
897
+ },
898
+ uploadPaper() {
899
+ if(this.showrepair){
900
+ this.$parent.isToRepair = true
901
+ this.$parent.savePaper(false).then((res) => {
902
+ //tag
903
+ if(res != true){
904
+ //tag
905
+ return
906
+ }else{
907
+ //TODO 上传成功 转维修失败
908
+ this.todo()
909
+ }
910
+ })
911
+ }else{
912
+ this.undo()
913
+ }
914
+
915
+ },
916
+ //确认安检转维修
917
+ todo(){
918
+ let gen = getRepairParam(this)
919
+ co(gen)
920
+ },
921
+ undo(){
922
+ this.showCheckToRepair = !this.showCheckToRepair
923
+ this.model.serviceacitivity[0].f_reciever = ''
924
+ this.model.serviceacitivity[0].f_meetunit = ''
925
+ this.model.f_repairtype = ''
926
+ this.meading = '转站点'
927
+ },
928
+ repiarmancg(val){
929
+ if(val){
930
+ //tag
931
+ this.model.serviceacitivity[0].f_reciever = val.name
932
+ let http1 = new HttpResetClass()
933
+ http1.load('POST',`${this.Url}/rs/sql/tel_singleTable_OrderBy`, {data: {
934
+ items: 'f_user_telephone',
935
+ tablename: 't_user',
936
+ condition: `name = '${val}'`,
937
+ orderitem: 'id'
938
+ }}, {resolveMsg: null, rejectMsg: null}).then((ress) => {
939
+ this.model.f_repairman_phone = ress.data[0].f_user_telephone
940
+ })
941
+ }
942
+ },
943
+ },
944
+ ready() {
945
+ for (let item of this.radios){
946
+ if(this.paper.f_client_evaluation == item.label){
947
+ item.isChecked = true;
948
+ }
949
+ }
950
+ //tag
951
+ //tag
952
+ //tag
953
+ //tag
954
+ if (!this.paper.f_notified_path)
955
+ this.$set('paper.f_notified_path', Vue.nopic)
956
+ if (!this.paper.f_sign_path)
957
+ this.$set('paper.f_sign_path', Vue.nopic)
958
+ if (!this.paper.f_overall_imgs){
959
+ let imgs = []
960
+ // imgs.push({f_overall_path:Vue.nopic})
961
+ this.$set('paper.f_overall_imgs', imgs)
962
+ //tag
963
+ }
964
+ if (!this.paper.f_overall2_path)
965
+ this.$set('paper.f_overall2_path', Vue.nopic)
966
+
967
+ this.userid = this.role == 'view'? this.$login.f.id:Vue.user.id
968
+ if(Vue.config.safecheck != undefined){
969
+ if(Vue.config.safecheck.ApproveConfig != undefined){
970
+ if(Vue.config.safecheck.ApproveConfig.safeCheckToRepair != undefined) {
971
+ this.safeCheckToRepair = Vue.config.safecheck.ApproveConfig.safeCheckToRepair
972
+ }
973
+ }
974
+ }
975
+ //tag
976
+ //tag
977
+ this.getGaspic()
978
+ },
979
+ watch:{
980
+ '$parent.isUpload'(val){
981
+ //tag
982
+ }
983
+ }
984
+ }
985
+ </script>
986
+ <style>
987
+ .text-left{
988
+ text-align:left;
989
+ }
990
+ .font{
991
+ font: 15px PingFang-SC-Medium;
992
+ color: #333333;
993
+ }
994
+ .showInput{
995
+ font: 14px PingFang-SC-Medium;
996
+ color: #666666;
997
+ }
998
+ .info{
999
+ margin-top: 15px;
1000
+ border-radius: 5px;
1001
+ background-color: #f3faff;
1002
+ }
1003
+ .btn-photo{
1004
+ border: 0;
1005
+ border-radius: 7px;
1006
+ background-color: #7dc1f4;
1007
+ font: 15px PingFang-SC-Bold;
1008
+ height: 20%;
1009
+ }
1010
+ .div-photo{
1011
+ width: auto;
1012
+ height: auto;
1013
+ /* margin-top: 10px; */
1014
+ position: absolute;
1015
+ bottom: 10px;
1016
+ right: 10px;
1017
+ }
1018
+ .btn-voice{
1019
+ border-radius: 7px;
1020
+ border: 1px solid #dedede;
1021
+ background-color: #f5fbff;
1022
+ font: 15px PingFang-SC-Bold;
1023
+ color: #499edf;
1024
+ }
1025
+ .save-btn{
1026
+ width: 25%;
1027
+ background-color:#499edf;
1028
+ border-radius: 6px;
1029
+ color: #FFFFFF;
1030
+ font: 15px PingFang-SC-Bold;
1031
+ }
1032
+ .upload-btn{
1033
+ width: 25%;
1034
+ background-color:#ffffff;
1035
+ border: 1px solid #499edf;
1036
+ border-radius: 6px;
1037
+ color: #499edf;
1038
+ font: 15px PingFang-SC-Bold;
1039
+ }
1040
+ .repair-btn{
1041
+ width: 25%;
1042
+ border: 1px solid #499edf;
1043
+ border-radius: 6px;
1044
+ font: 15px PingFang-SC-Bold;
1045
+ }
1046
+ </style>