safecheck-client 3.0.33-57 → 3.0.33-59

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,1046 +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 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>
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>