safecheck-client 3.0.30-33 → 3.0.30-34

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,2418 +1,2426 @@
1
- <template>
2
-
3
- <div class="no-close row android-repair-order" style="background-color: #f9f9f9">
4
- <div class="col-sm-12 col-xs-12" >
5
- <ul class="nav nav-tabs" style="background:#ffffff;overflow-y: hidden">
6
- <li v-for="row in tabs" @click="tabSelect(row,$index)" :class="{active1: row.complete === componentName}"
7
- v-if="$index < number+1 && $index < faultshow.number" >
8
- <a href="#" style="background-color: #ffffff;color: #666666;font-size: 16px;font-family:SimSun" :class="row.class">
9
- <span class="spanboder">{{row.header}}</span>
10
- <img class="butt2" :src="imgback(row.complete === componentName,row.header === header)"></a>
11
- <p></p>
12
- </li>
13
- <div class="col-sm-12 col-xs-12 repair-bg" v-show="routeShow">
14
- <route name='repair' :reuse="false"></route>
15
- </div>
16
- <li v-for="row in tabs" @click="tabSelect(row,$index)" :class="{active1: row.complete === componentName}"
17
- v-if="$index > number && $index < faultshow.number ">
18
- <a href="#" style="background-color: #ffffff;color: #666666;font-size: 16px;font-family:SimSun" :class="row.class">
19
- <span class="spanboder">{{row.header}}</span>
20
- <img class="butt2" :src="imgback(row.complete === componentName,row.header === header)"></a>
21
- <p></p>
22
- </li>
23
- <div class="col-sm-12 col-xs-12 repair-bg" v-if="actionEnabled ">
24
- <div class="auto select-overspread form-horizontal repair-bg " style="padding-bottom:5px;">
25
- <div class="bq-parent">
26
- <blockquote class="blockquote">
27
- <p>安检上传</p>
28
- </blockquote>
29
- </div>
30
- <div class="panel panel-default auto repair-info-content">
31
- <div class="panel-body ">
32
- <div class="row auto">
33
- <!--<div class="col-xs-12 col-sm-12 col-md-12" :style="timeSet(this.isneedDate)?'':'display:none'">-->
34
- <!--<label>请输入超期原因:</label><br/>-->
35
- <!--<textarea style="width: 100%;" v-model=""></textarea>-->
36
- <!--</div>-->
37
- <div id="savebut" class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;">
38
- <div class="col-xs-3 col-sm-3 col-md-3">
39
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="save('temp')">
40
- 临时保存
41
- </button>
42
- </div>
43
- <div class="col-xs-3 col-sm-3 col-md-3">
44
- <button class="col-sm-3 btn btn-primary" @click="save('finish')">
45
- 本地缓存
46
- </button>
47
- </div>
48
- <div class="col-xs-3 col-sm-3 col-md-3">
49
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="uploadCheckPaper">
50
- 上传
51
- </button>
52
- </div>
53
- <div class="col-xs-3 col-sm-3 col-md-3">
54
- <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="openremark">
55
- 转维修
56
- </button>
57
- </div>
58
-
59
- </div>
60
- </div>
61
- </div>
62
- </div>
63
- </div>
64
- </div>
65
- </ul>
66
- </div>
67
- <modal :show.sync="showModal">
68
- <div slot="modal-header" class="modal-header">
69
- <h4 class="modal-title">
70
- 请填写备注
71
- </h4>
72
- </div>
73
- <div slot="modal-body" class="modal-body">
74
- <textarea type="text" v-model="repairremark" rows="3"></textarea>
75
- </div>
76
- <div slot="modal-footer" class="modal-footer">
77
- <button type="button" class="btn btn-default" @click="changetorepair">确认</button>
78
- <button type="button" class="btn btn-default" @click="canalremark">取消</button>
79
-
80
- </div>
81
- </modal>
82
- </div>
83
- </template>
84
-
85
- <script>
86
- // 户内维修
87
- import Vue from 'vue'
88
- import * as Util from '../../Util'
89
- // import DoorService from './DoorService'
90
- // import Pipeline from './Pipeline'
91
- // import DeviceService from './DeviceService'
92
- // import TroubleRemoval from './TroubleRemoval'
93
- // import FirstGasCheck from './FirstGasCheck'
94
- // import RepairMatterInfo from './RepairMatterInfo'
95
- // import TelChangeMatter from './TelChangeMatter'
96
- import { HttpResetClass } from 'vue-client'
97
- import co from 'co'
98
- import $ from "jquery";
99
- let loadParamGem = async function (self) {
100
- await self.$LoadParams.loadParam()
101
- }
102
-
103
- export default {
104
- title: '安检单',
105
- props: ['f_plan_id', 'item', 'role'],
106
- // props: ['f_plan_id', 'role'],
107
- data() {
108
- return {
109
- //测试数据
110
- // f_plan_id:'',
111
- // role:'inspect',
112
- // item:{"f_approved_time":null,"f_user_family_remarks":null,"f_street":"测试街道","f_repair_approved_time":null,
113
- // "f_user_type":null,"f_approved_by":null,"f_card_id":null,"f_remark":null,"f_building":"1","f_batch_number":null,
114
- // "f_idnumber":null,"f_state":"未检","id":"0EFE0EE2-B155-46F9-8DE0-38C022664A4D","f_complete":null,"f_check_state":null,"f_last_check_state":"拒检",
115
- // "f_user_inhome_time":null,"f_residential_area":"测试小区1","version":1,"f_processid":null,"f_last_check_result":"{\"result\":\"正常\",\"data\":[]}",
116
- // "f_area":null,"f_usegas":null,"f_user_phone":"16566546548","f_slice_area":"营业大区","f_approved":"未审核","f_upload_state":"未传","f_user_check_time":null,
117
- // "f_unit":"1","f_user_spare_phone":null,"f_last_check_date":null,"f_userproperties":null,"f_userfile_id":null,"f_prearranged_date":null,"f_filialeid":"453",
118
- // "f_branch":null,"f_orgstr":null,"f_plan_year":2020,"f_orgid":null,"f_approval_notified":null,"f_plan_month":4,"f_approved_note":null,"f_filialeids":null,
119
- // "f_floor":"1","f_flag":null,"f_repair_approved_note":null,"f_userinfo_code":"00000002","f_create_time":"2020-05-10 18:56:03","f_meter_no":"","f_station":null,
120
- // "f_repair_approved":"未审核","f_no_checkplan":"有计划安检","f_plan_name":"关于","f_repair_approved_by":null,"f_room":"1","f_office":null,"f_comments":null,
121
- // "f_address":"兰山街道泰盛小区1栋1单元1层1室","id_back":null,"f_userinfoid":"2","f_subcompany":null,"f_addressid":null,"f_user_phone2":null,
122
- // "f_user_equipment_remarks":null,"f_plan_id":"0819ea6707ad4d9dad217c06a87f4227","f_user_name":"用户二",
123
- // "f_plan_meters":[{"f_weizhi":null,"f_flow_direction":"右表","f_metertitles":"","f_prior_reading":0,"f_meter_no":"2119035714","f_collection_type":"按金额","f_aliasname":"先锋系统结算物联网表","f_meter_type":"物联网表","version":3,"f_maker":null,"f_metergasnums":0,"f_total_fee":100,"f_diaphgram_size":"G2.5","f_total_gas":0,"id":18663},{"f_weizhi":null,"f_flow_direction":"右表","f_metertitles":"","f_prior_reading":0,"f_meter_no":"2118999901","f_collection_type":"按金额","f_aliasname":"先锋系统结算物联网表","f_meter_type":"物联网表","version":1,"f_maker":null,"f_metergasnums":0,"f_total_fee":0,"f_diaphgram_size":"G2.5","f_total_gas":0,"id":18663}]
124
- // },
125
-
126
- data: {
127
- f_devices: [],
128
- f_defect_content:''
129
- },
130
- updateuserphone:false, //安检时是否更新用户电话
131
- beforephone:'',
132
- isUpload:false,
133
- onlySave:true, //判断保存还是保存并上传
134
- livedispose:'',
135
- startClick:false, //开始安检按钮是否可点击
136
- isStrat: false, //是否开始安检
137
- checkResult:{},//查询结果
138
- newcheckResult:{},
139
- timer: null,
140
- showModal: false,
141
- pic_to_be_viewed: '',
142
- repairremark:'',
143
- showBack:true,
144
- devices: [],
145
- f_devices : [],
146
- isToRepair:false,
147
- clickBack:true, //是否点击返回按钮
148
- isSafeCheckToRepair:false,//是否转维修
149
- Url:this.$androidUtil.getProxyUrl(),
150
- detail:{},
151
- defectDevice:{},
152
- user:{},
153
- model: { //转维修数据
154
- // 一次派单
155
- serviceacitivity: [{
156
- f_service_acitivity_type: '派单'
157
- }],
158
- f_source:'安检',
159
- f_service_id: '',
160
- f_contact_phone: '',
161
- f_meetunit: '',
162
- f_phone: '',
163
- f_user_name: '',
164
- f_address: '',
165
- f_repair_date: Util.toStandardTimeString(),
166
- f_card_id: '',
167
- // f_department: '', 站点选择
168
- f_reciever:'',
169
- f_remarks: '',
170
- f_user_type: '',
171
- f_area: '',
172
- f_unit_name:'',
173
- f_street: '',
174
- f_residential_area: '',
175
- f_building: '',
176
- f_unit: '',
177
- f_floor: '',
178
- f_room: '',
179
- aState: null,
180
- f_repairtype: '',
181
- f_repairitems:{},
182
- },
183
- repairitems:[],
184
- meading:'转站点',
185
- config: {
186
- "燃气表":{
187
- "checkmust":true,
188
- "index":1,
189
- "items":{
190
- //"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
191
- "基表编号":{"index":1,"type":"string","readonly":true},
192
- "气表型号":{"index":2,"type":"string","readonly":true},
193
- "气表品牌":{"index":3,"type":"string","readonly":true},
194
- "进气方向":{"index":4,"type":"string","readonly":true},
195
- "初始表底":{"index":5,"type":"number","isshow":false,"readonly":true},
196
- "上期表读数":{"index":6,"type":"number","readonly":true,isshow:false},
197
- "已用气量":{"index":7,"type":"number","checkmust": false},//基表数
198
- "已用金额":{"index":7,"type":"number","checkmust": false},
199
- "剩余气量":{"index":8,"type":"number","checkmust": false},//累购-已用
200
- //显示屏数 --实际剩余气量
201
- "剩余金额":{"index":8,"type":"number","checkmust": false},
202
- "表箱号":{"index":9,"type":"string","readonly": true}
203
- }
204
- // 注意,配置项的index必须与上面的固定配置保持'顺序'
205
- },
206
- // "燃气表2":{
207
- // "checkmust":true,
208
- // "index":2,src
209
- // "items":{
210
- // "燃气表照片":{"index":1,"type":"picture"},
211
- // "表品牌":{"index":2,"type":"string","readonly":true},
212
- // "表号":{"index":3,"type":"string","readonly":true},
213
- // "表封号":{"index":4,"type":"number","readonly":true},
214
- // "表型号":{"index":5,"type":"string","readonly":true},
215
- // "位置":{"index":6,"type":"string","readonly":true},
216
- // "表底数":{"index":7,"type":"number","readonly":true},
217
- // "累购气量":{"index":8,"type":"number","readonly":true},
218
- // "累购金额":{"index":8,"type":"number","readonly":true}
219
- // }
220
- // }
221
- },
222
- // 维修项
223
- isneedDate:'',
224
- routeShow:true,
225
- number:0,
226
- shupingshow:false,
227
- pipeline: {},
228
- details: [],
229
- ids: '',
230
- savevalid: {
231
- uservalid: false,
232
- doorvalid: true,
233
- changetable: false
234
- },
235
- doordetails: {},
236
- devicedetails: {},
237
- cookdetails: {},
238
- componentName: 'safecheck-userinfo',
239
- header:'客户信息',
240
- tabs: [
241
-
242
- // 参数全部设置成空,在ready时,等model处理好了,再添加
243
- {
244
- header: '客户信息',complete:'safecheck-userinfo',class: 'repair-info-class', props: null
245
- },
246
- {
247
- header: '拍照签名',complete:'paper-feedback', class: 'outlay-class', props: null
248
- }
249
- ],
250
- faultshow:{
251
- number : 8
252
- } // 控制 故障汇总 在 菜单里显示与否,
253
- }
254
- },
255
- computed: {
256
- actionEnabled: {
257
- get() {
258
- return this.role == 'inspect'
259
- }
260
- }
261
- },
262
- methods: {
263
- openremark(){
264
- this.repairremark=''
265
- this.showModal=true
266
- },
267
- canalremark(){
268
- this.repairremark=''
269
- this.showModal=false
270
- },
271
- changetorepair(){
272
- let mdata={"model":{
273
- "serviceacitivity":[
274
- {
275
- "f_service_acitivity_type":"派单",
276
- "f_reciever":Vue.user.depids,
277
- "f_meetunit":Vue.user.deps
278
- }
279
- ],
280
- "f_source":"安检转单",
281
- "f_service_id":"",
282
- "f_contact_phone":this.data.f_user_phone,
283
- "f_meetunit":Vue.user.deps,
284
- "f_phone":"",
285
- "f_user_name":this.data.f_user_name,
286
- "f_address":this.data.f_address,
287
- "f_repair_date":Util.toStandardTimeString(),
288
- "f_reciever":"",
289
- "f_remarks":this.repairremark,
290
- "f_user_type":this.data.f_user_type,
291
- "f_area":this.data.f_area,
292
- "f_unit_name":this.data.f_unit_name,
293
- "f_street":this.data.f_street,
294
- "f_residential_area":this.data.f_residential_area,
295
- "f_building":this.data.f_building,
296
- "f_unit":this.data.f_unit,
297
- "f_floor":this.data.f_floor,
298
- "f_room":this.data.f_room,
299
- "aState":null,
300
- "f_handlingtype":"转站点",
301
- "f_repairtype":"安检转维修",
302
- "f_orgid":Vue.user.orgid,
303
- "f_orgname":this.data.f_subcompany,
304
- "f_depid":Vue.user.depids,
305
- "f_operator":Vue.user.name,
306
- "f_operatorid":Vue.user.id,
307
- "f_filiale":this.data.f_subcompany,
308
- "f_filiale_id":Vue.user.orgid,
309
- "f_userinfo_id":this.data.f_userinfoid,
310
- "f_userinfo_code":this.data.f_userinfo_code,
311
- "f_orgstr":"",
312
- "f_outlets":Vue.user.deps,
313
- "f_repairman_phone":"",
314
- "failure":"[{\"f_failure_type\":\"安检转维修\"}]",
315
- "f_attendant":Vue.user.name
316
- },
317
- "loginUser":{
318
- "name":Vue.user.name,
319
- "ename":Vue.user.ename
320
- },
321
- "user":{
322
- "f_street":this.data.f_street,
323
- "f_unit":this.data.f_unit,
324
- "f_floor_suffix":"层",
325
- "f_rent_phone":this.data.f_user_phone,
326
- "f_user_type":this.data.f_user_type,
327
- "f_unit_suffix":"单元",
328
- "f_orgid":Vue.user.orgid,
329
- "f_building":this.data.f_building,
330
- "f_userinfo_id":this.data.f_userinfoid,
331
- "f_orgname":Vue.user.orgname,
332
- "f_floor":this.data.f_floor,
333
- "f_userinfo_code":this.data.f_userinfo_code,
334
- "f_room":this.data.f_room,
335
- "f_residential_area":this.data.f_residential_area,
336
- "f_user_state":this.data.f_user_state,
337
- "f_address":this.data.f_address,
338
- "f_room_suffix":"室",
339
- "f_user_phone":this.data.f_user_phone,
340
- "f_slice_area":this.data.f_slice_area,
341
- "f_depname":Vue.user.deps,
342
- "f_user_name":this.data.f_user_name,
343
- "f_building_suffix":"栋"
344
- },
345
- "callObj":null
346
- }
347
- //tag
348
- //tag)
349
- this.$showMessage('是否确认转维修!', ['confirm', 'cancel']).then((ress) => {
350
- if (ress === 'confirm') {
351
- new HttpResetClass().load('post',`${this.$androidUtil.getProxyUrl()}/rs/logic/callerSend`,mdata).then(res=> {
352
- //tag)
353
- if(res.data.f_service_id){
354
- this.showModal=false
355
- this.$showMessage('转维修成功,工单编号'+res.data.f_service_id)
356
- }else{
357
- this.$showMessage('网络异常,转维修失败,请稍后重试')
358
- }
359
- })
360
- }
361
- })
362
-
363
- },
364
- saveNoclick() {
365
- // 禁用点击事件
366
- $("#savebut").addClass("noclickbut");
367
- //tag
368
-
369
- // 5秒后启用点击事件
370
- setTimeout(function(){
371
- $("#savebut").removeClass("noclickbut");
372
- },5000);
373
- },
374
- timeSet(val){
375
- if (!val){
376
- return
377
- }
378
- let time =new Date(val).getTime()
379
- let time2=new Date().getTime()
380
- if (time2>time) {
381
- return true
382
- }
383
- },
384
- imgback(val,isheader){
385
- if(val && this.routeShow && isheader){
386
- return require('../../../assets/xiangxia1.png')
387
- }else{
388
- return require('../../../assets/xiangyou1.png')
389
- }
390
- },
391
- changediv(val){
392
- //tag
393
- return val
394
- },
395
- // 选择tab
396
- tabSelect (item,number) {
397
- this.header = item.header
398
- //tag
399
- //tag
400
- //tag
401
- //tag
402
- // 处理关闭/显示 内容
403
- if(this.number == number && !this.routeShow ){
404
- this.routeShow = true
405
- }else if(this.number == number && this.routeShow){
406
- this.routeShow = false
407
- }else if(this.number != item.complete){
408
- this.routeShow = true
409
- }
410
- this.number = number
411
- this.componentName = item.complete
412
- //tag
413
- if(item.complete == 'safecheck-devices'){
414
- //tag
415
- if(item.header != '燃气表' && this.data['device'+item.number].length == 0){
416
- this.data['device' + item.number].push({})
417
- }
418
- //tag
419
- //tag)
420
- let idx=this.data['device' + item.number].length - 1
421
- let itemprops = {
422
- config:this.config,
423
- device:this.devices[item.number-1],
424
- idx:idx,
425
- role:'inspect'
426
- }
427
- //tag
428
- //tag)
429
- //tag)
430
- //tag
431
- if(this.routeShow){
432
- this.$goto(item.complete, itemprops, 'repair')
433
- //tag
434
- }
435
- }else{
436
- //tag
437
- if(this.routeShow){
438
- this.$goto(item.complete, {userinfo:this.data}, 'repair')
439
- }
440
- }
441
- this.shupingshow = true
442
- },
443
- // 给组件添加参数
444
- getImgPath() {
445
- for (var i = 0; i < this.model.serviceacitivity[0].imgs.length; i++) {
446
- this.ids += this.model.serviceacitivity[0].imgs[i].imgid + ','
447
- }
448
- this.ids = this.ids.substring(0, this.ids.length - 1)
449
- if(this.ids){
450
- this.getImgGen();
451
- }
452
- },
453
- getImgGen(){
454
- let http = new HttpResetClass()
455
- http.load('POST','rs/sql/tel_singleTable_OrderBy', {data: {
456
- items: '*',
457
- tablename: 't_files',
458
- condition: `id in (${this.ids})`,
459
- orderitem: 'id'
460
- }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
461
- for (let i = 0; i < res.data.length; i++) {
462
- for (let j = 0; j < this.model.serviceacitivity[0].imgs.length; j++) {
463
- //tag)
464
- //tag
465
- if (res.data[i].id.toString() === this.model.serviceacitivity[0].imgs[j].imgid) {
466
- this.model.serviceacitivity[0].imgs[j] = Object.assign({}, res.data[i], this.model.serviceacitivity[0].imgs[j])
467
- }
468
- }
469
-
470
- }
471
- })
472
- },
473
-
474
- sortDetails(){
475
- for (let i = 0; i < this.details.length; i++) {
476
- if (this.details[i].details.length) {
477
- for (let j = 0; j < this.details[i].details.length; j++) {
478
- if (this.details[i].details[j].f_type === 'a') {
479
- this.doordetails = {details: this.details[i].details}
480
- break
481
- }
482
- if (this.details[i].details[j].f_type === 'b') {
483
- this.devicedetails = {details: this.details[i].details}
484
- break
485
- }
486
- if (this.details[i].details[j].f_type === 'c') {
487
- this.cookdetails = {details: this.details[i].details}
488
- break
489
- }
490
- }
491
- }
492
- }
493
- },
494
- // 复制数据
495
- back () {
496
- let _this = this
497
- if(this.issee){
498
- _this.$back()
499
- return
500
- }
501
- this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
502
- if (res === 'confirm') {
503
- _this.$back()
504
- }
505
- })
506
- },
507
- confirm(){
508
- this.$dispatch('confirm')
509
- },
510
- tick() {
511
- this.timer = null
512
- this.data.f_offsite_time = Util.toStandardTimeString()
513
- this.timer = window.setTimeout(this.tick, 1000)
514
- },
515
- getRepairState() {
516
- let repaired = true
517
- this.data.f_defects.forEach((defect) => {
518
- repaired = repaired & (defect.f_ratification == '已处理')
519
- })
520
- return repaired
521
- },
522
- verifyRepairDefects() {
523
- this.data.f_repair_date = Util.toStandardTimeString()
524
- this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
525
- },
526
- errorVerify() {
527
- let hasError = this.verifyState()
528
- if(hasError)
529
- return hasError
530
-
531
- if(this.data.f_entry_status != '入户')
532
- return null
533
- hasError = this.verifyUser()
534
- if(hasError)
535
- return hasError
536
- hasError = this.verifyDevices()
537
- if(hasError)
538
- return hasError
539
- hasError = this.verifyFeedback()
540
- if(hasError)
541
- return hasError
542
- },
543
- verifyState() {
544
- if(Vue.android && this.data.f_entry_status == '未使用天然气' && this.data.f_nongasuser_path == Vue.nopic)
545
- return '未使用天然气则必须拍照'
546
- if(Vue.android && this.data.f_entry_status == '到访不遇' && this.data.f_noanswer_path == Vue.nopic)
547
- return '到访不遇必须拍照'
548
- },
549
- verifyUser() {
550
- //tag
551
- //tag
552
- //tag)
553
- let prefix = '用户基本信息:'
554
- if(Util.required(this.data.f_user_name))
555
- return prefix + '用户名必须输入'
556
- if(!(/^\d{11}$/.test(this.data.f_user_phone))) {
557
-
558
- return '请输入正确的电话号码'
559
- }
560
- // if(Util.required(this.data.f_residential_area))
561
- // return prefix + '小区名称必须输入'
562
- if(Util.required(this.data.f_address))
563
- return prefix + '地址必须输入'
564
- },
565
- verifyDevices() {
566
- for (let dev in this.config) {
567
- if (this.config[dev].checkmust == true) {
568
- let error = true
569
- for(let device in this.data) {
570
- if (device.startsWith("device")) {
571
- for (let item in this.data[device]) {
572
- if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
573
- error = false
574
- }
575
- }
576
- }
577
- }
578
- if (error) {
579
- return "请检查" + dev
580
- }
581
- }
582
- }
583
-
584
- for (let dev in this.config) {
585
- for(let device in this.data) {
586
- if (device.startsWith("device")) {
587
- for (let item in this.data[device]) {
588
- //检查每一条安检结果
589
- if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
590
- for (let i in this.data[device][item].f_items) {
591
- for (let it in this.config[dev].items) {
592
- if (it == this.data[device][item].f_items[i].f_item_name) {
593
- let check=false
594
- if (!this.data[device][item].f_items[i].f_item_value){
595
- check=true
596
- }else if (Array.isArray(this.data[device][item].f_items[i].f_item_value)){
597
- if (this.data[device][item].f_items[i].f_item_value.length==0){
598
- check=true
599
- }
600
- }
601
-
602
- if(this.config[dev].items[it].type=='picture' && this.config[dev].items[it].checkmust == true && !this.data[device][item].f_items[i].f_path){
603
- return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
604
- }
605
- if (this.config[dev].items[it].type !='picture' && this.config[dev].items[it].checkmust == true && check) {
606
- return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
607
- }
608
- }
609
- }
610
- //检查安检下拉结果
611
- if (this.data[device][item].f_items[i].type == 'selector' || this.data[device][item].f_items[i].type == 'radio') {
612
- if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
613
- return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + this.data[device][item].f_items[i].f_item_value + "选中必须拍照"
614
- }
615
- }
616
- }
617
- }
618
- }
619
- }
620
- }
621
- }
622
- },
623
-
624
-
625
- verifyFeedback() {
626
- let prefix = '拍照签名:'
627
- //tag)
628
- if(Vue.android && (!this.data.f_overall_imgs || this.data.f_overall_imgs.length == 0) && this.data.f_entry_status == '入户')
629
- return prefix + '必须有安检总体照片'
630
- if(Vue.android && (!this.data.f_sign_path || this.data.f_sign_path.length == 0) && this.data.f_entry_status == '入户')
631
- return prefix + '必须有用户签名'
632
- if(Vue.android && this.data.f_defect_notified && this.data.f_notified_path == Vue.nopic)
633
- return prefix + '下发安检通知书则必须给通知书拍照'
634
- if(Vue.android && this.data.f_blacklist && this.data.f_blocking_cause=='')
635
- return prefix + '请填写拉黑原因'
636
- if(!this.data.f_client_evaluation && this.data.f_entry_status == '入户')
637
- return prefix + '请选择服务评价'
638
- },
639
-
640
- getAllDefect() {
641
- let checkResults = {
642
- result: '正常',
643
- data: []
644
- }
645
- let value = ''
646
- let codata = JSON.parse(JSON.stringify(this.data))
647
- //tag)
648
- //tag)
649
- codata.f_devices = []
650
- this.f_devices = []
651
- for (let device in codata) {
652
- let f_device_type
653
- if (device.startsWith("device")) {
654
- //tag)
655
- let hasOther = ''
656
- let otherValue = null
657
- for (let item in codata[device]) {
658
- codata[device][item].f_create_time = Util.toStandardTimeString()
659
- // if (codata[device].length > 1) {
660
- // let j = Number.parseInt(item) + 1
661
- // f_device_type = `${codata[device][item].f_device_type}${j}`
662
- // } else {
663
- // f_device_type = codata[device][item].f_device_type
664
- // }
665
- //tag
666
- //tag
667
- //tag)
668
- //tag)
669
- for (let i = 0; i < codata[device][item].f_items.length ; i++) {
670
- //tag
671
- if(i == 'sum'){
672
- continue
673
- }
674
- //tag)
675
- var items = codata[device][item].f_items[i]
676
- items.f_create_time = Util.toStandardTimeString()
677
- //tag)
678
- items.f_item_lists = []
679
- //tag)
680
- // //tag)
681
- // //tag} name => ${JSON.stringify(items.f_item_name)} value => ${JSON.stringify(items.f_item_value)}`)
682
- // console.log(`f_is_defect => ${this.config[codata[device][item]
683
- // .f_device_type]
684
- // .items[items.f_item_name]
685
- // .options
686
- // .find((option)=>option.data === items.f_item_value)
687
- // .map((option)=>option.f_is_defect)}`)
688
- // if (items.f_is_defect && (items.f_is_defect == true || items.f_is_defect == 'true')) {
689
- // //tag
690
- // checkResults.result = '有隐患'
691
- // //tag)
692
- // //tag)
693
- // // this.$set('checkResult.' + items.f_item_name, items.f_item_value)
694
- // this.checkResult[items.f_item_name] = items.f_item_value
695
- // //tag)
696
- // // this.$set('checkResultsss.' + items.f_item_name, `${f_device_type}${items.f_item_value}`)
697
- // // //tag)
698
- // }
699
- if (items.type == 'selector') {
700
- items.selected = []
701
- } else if (items.type == 'inputSelector') {
702
- items.selected = ''
703
- }
704
- //遍历配置项 将所选隐患项的配置信息放入保存的数据中
705
- let f_is_defect //是否是隐患
706
- let f_defect_level //是否是隐患
707
- let f_item_name = items.f_item_name
708
- let f_item_value
709
- let f_is_eliminate //隐患是否消除
710
- let f_meternumber = ''
711
- let f_user_defects = [] // 用户所有隐患
712
- //tag
713
- //tag
714
- if (items.type == 'selector' || items.type == 'checkbox' || items.type == 'radio') {
715
- for (let i in items.f_item_value) {
716
- let configItems = this.config[codata[device][item].f_device_type].items[f_item_name]
717
- //tag)
718
- for (let k in configItems.options) {
719
- //tag)
720
- if (items.f_item_value[i] === configItems.options[k].data) {
721
-
722
- f_is_defect = configItems.options[k].isdefect
723
- f_item_value = items.f_item_value[i]
724
- f_defect_level = configItems.options[k].level
725
-
726
- //tag
727
- //tag
728
- //tag
729
-
730
- if (f_is_defect) {
731
- if (checkResults.result !== '有隐患') {
732
- checkResults.result = '有隐患'
733
- }
734
- if (!this.checkResult.hasOwnProperty(f_item_name)) {
735
- //tag
736
- this.checkResult[f_item_name] = []
737
- }
738
-
739
- //tag
740
- this.checkResult[f_item_name].push(f_item_value)
741
-
742
- }
743
-
744
- let items_list = {
745
- f_is_defect: f_is_defect,
746
- f_item_value: f_item_value,
747
- f_defect_level: f_defect_level,
748
- f_is_eliminate: null,
749
- f_create_time: Util.toStandardTimeString()
750
- }
751
- if (!items.f_item_lists) {
752
- //tag
753
- items.f_item_lists = []
754
- //tag)
755
- if (JSON.stringify(items_list) !== '{}') {
756
- //tag
757
- items.f_item_lists.push(items_list)
758
- }
759
- } else {
760
- //tag)
761
- if (JSON.stringify(items_list) !== '{}') {
762
- //tag
763
- items.f_item_lists.push(items_list)
764
- }
765
- }
766
- }
767
- }
768
- }
769
- } else {
770
- let configItems = this.config[codata[device][item].f_device_type].items[items.f_item_name]
771
- //tag)
772
- f_is_defect = items.isdefect
773
- f_defect_level = items.level
774
- f_item_value = items.f_item_value
775
- //tag
776
- //tag
777
- //tag
778
- let items_list = {
779
- f_is_defect: f_is_defect,
780
- f_item_value: f_item_value,
781
- f_defect_level: f_defect_level,
782
- f_create_time: Util.toStandardTimeString()
783
- }
784
- if (f_is_defect && f_item_value) {
785
- items.f_is_defect = true
786
- if (checkResults.result !== '有隐患') {
787
- checkResults.result = '有隐患'
788
- }
789
- if (!this.checkResult.hasOwnProperty(items.f_item_name)) {
790
- //tag
791
- this.checkResult[items.f_item_name] = []
792
- }
793
-
794
- //tag
795
- this.checkResult[items.f_item_name].push(f_item_value)
796
-
797
- }
798
- //tag)
799
- //tag)
800
- if (!items.f_item_lists) {
801
- //tag
802
- items.f_item_lists = []
803
- if (JSON.stringify(items_list) != '{}') {
804
- //tag
805
- items.f_item_lists.push(items_list)
806
- }
807
- } else {
808
- // items.f_item_lists[0].f_item_value = f_item_value
809
- if (JSON.stringify(items_list) != '{}') {
810
- //tag
811
- //tag)
812
- //tag)
813
- //tag
814
- items.f_item_lists.push(items_list)
815
- }
816
- }
817
- }
818
- if (hasOther !== '' && otherValue !== null) {
819
- //tag
820
- this.checkResult[hasOther].push(otherValue)
821
- hasOther = ''
822
- otherValue = null
823
- }
824
- items.f_item_value = ''
825
- }
826
- //tag)
827
- this.f_devices.push(codata[device][item])
828
- }
829
- }
830
- }
831
- if (this.checkResult) {
832
- for (let key in this.checkResult) {
833
- // 上次安检结果数据组织
834
- //tag
835
- //tag
836
- let temp = {}
837
- temp[key] = this.checkResult[key].join(',')
838
- checkResults.data.push(temp)
839
- // this.newcheckResult[key] = this.checkResult[key]
840
- // checkResults.data.push(this.newcheckResult)
841
- //tag)
842
- // this.newcheckResult = {}
843
- }
844
- this.checkResult = {}
845
- }
846
- //tag
847
- //tag)
848
- codata.f_defect_content = JSON.stringify(checkResults)
849
- this.data.f_defect_content = JSON.stringify(checkResults)
850
- //tag
851
- return codata
852
- },
853
- uploadCheckPaper(){
854
- this.saveNoclick()
855
- //tag
856
- //tag
857
- let errString = this.errorVerify()
858
- if (errString) {
859
- //tag
860
- //tag
861
- //tag
862
- if (Vue.android){
863
- // if(this.isUpload){
864
- // this.isUpload = false
865
- // }
866
- this.$showMessage(errString)
867
- }
868
- return
869
- } else {
870
- this.$set('data.f_offsite_time', Util.toStandardTimeString())
871
- this.$set('data.f_upload_time', Util.toStandardTimeString())
872
- this.$set('data.f_upload_date', Util.toStandardTimeString())
873
- //tag
874
- this.data.f_complete = '已完成'
875
- this.disableTimer()
876
- }
877
- //tag
878
- this.onlySave = false
879
- let res = this.save()
880
- // if(res) {
881
- // try {
882
- // let codata = this.getAllDefect()
883
- // //获取微信推送内容
884
- // let WxResult = this.getWeixin(codata)
885
- // let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
886
- // f_check_item_id: this.data.f_check_item_id
887
- // })
888
- // //如果是转维修上传,则不做校验,上传完成后自动转维修
889
- // //tag
890
- // //tag
891
- // if(!this.isToRepair){
892
- // if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
893
- // //tag
894
- // //tag
895
- // if(!this.isSafeCheckToRepair){
896
- // this.$showMessage('有未处理的隐患,请前往拍照上传中将安检转为维修单!')
897
- // return
898
- // }
899
- // }
900
- // }
901
- // //tag
902
- // for (let key in codata){
903
- // if(key.startsWith("device")){
904
- // codata[key] = []
905
- // }
906
- // }
907
- // //tag}`)
908
- //
909
- // //tag
910
- // let isStart = true
911
- // let res
912
- // for (let i in this.f_devices){
913
- // res = HostApp.organizeJSON({isStart:isStart,isDevice:true,device:this.f_devices[i]})
914
- // if(res.code == 200){
915
- // isStart = false
916
- // }else{
917
- // this.$showMessage("保存失败!")
918
- // }
919
- // }
920
- // let result = HostApp.organizeJSON({
921
- // isStart:false,
922
- // isJSON:true,
923
- // jsonstr:{
924
- // f_check_item_id: this.data.f_check_item_id,
925
- // f_checker_id: this.data.f_checker_id,
926
- // row: codata
927
- // }
928
- // })
929
- // if(result.code == 200){
930
- // HostApp.__this__ = this
931
- // this.runSyncLogic('上传安检信息','javascript:HostApp.__this__.uploadCallBack()',1)
932
- // }
933
- //
934
- //
935
- // // let response = this.$androidUtil.bzLogic('上传安检信息', {
936
- // // f_check_item_id: this.data.f_check_item_id,
937
- // // f_checker_id: this.data.f_checker_id,
938
- // // row: codata
939
- // // })
940
- // // if (response.code == 200) {
941
- // // //tag
942
- // // //tag)
943
- // // let f_paper_id
944
- // // if(response.data != '' && response.data != null){
945
- // // f_paper_id = JSON.parse(response.data).id
946
- // // }
947
- // // this.$set('data.f_paper_id', f_paper_id)
948
- // // //tag
949
- // // //tag)
950
- // // //tag
951
- // // //tag)
952
- // // for (let device in this.data){
953
- // // //tag
954
- // // //tag)
955
- // // if(device.startsWith("device")){
956
- // // for(let devices of this.data[device]) {
957
- // // devices.f_paper_id = f_paper_id
958
- // // let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
959
- // // row: devices
960
- // // })
961
- // // //tag}`)
962
- // // if(ret.code == 200){
963
- // // //tag
964
- // // devices.f_device_id = JSON.parse(ret.data.f_device_id).id
965
- // // }
966
- // // //tag
967
- // // //tag)
968
- // // if (ret.code != 200) {
969
- // // //TODO 失败后处理
970
- // // // this.isUpload = false
971
- // // this.$showMessage("上传失败!")
972
- // // return false
973
- // // }
974
- // // }
975
- // // }
976
- // // }
977
- // // // for (let device of this.f_devices) {
978
- // // // device.f_paper_id = f_paper_id
979
- // // // //tag
980
- // // // //tag)
981
- // // // let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
982
- // // // row: device
983
- // // // })
984
- // // // //tag
985
- // // // if (ret.code != 200) {
986
- // // // //TODO 失败后处理
987
- // // // HostApp.alert("上传失败!")
988
- // // // return false
989
- // // // }
990
- // // // }
991
- // // let result = this.$androidUtil.bzLogic('FinishUpload',
992
- // // {
993
- // // f_check_item_id: this.data.f_check_item_id,
994
- // // f_userinfo_id: codata.f_userinfoid,
995
- // // f_last_check_result: codata.f_defect_content
996
- // // })
997
- // // if(result.code == 200){
998
- // // // this.$showAlert('上传成功!', 'success', 2000)
999
- // // this.$showMessage('上传成功!')
1000
- // // this.isStrat=false
1001
- // // if(url != "" ){
1002
- // // this.$resetpost(`${url}`,{data:WxResult})
1003
- // // }
1004
- // // return true
1005
- // // }else{
1006
- // // // this.isUpload = false
1007
- // // this.$showMessage("上传失败!")
1008
- // // return false
1009
- // // }
1010
- // // }else{
1011
- // // // this.isUpload = false
1012
- // // this.$showMessage("上传失败!")
1013
- // // return false
1014
- // // }
1015
- // }catch (e) {
1016
- // //tag)
1017
- // // this.isUpload = false
1018
- // this.$showMessage("上传失败!")
1019
- // }
1020
- // }
1021
- },
1022
- save(type) {
1023
- this.saveNoclick()
1024
- //tag
1025
- //tag
1026
- if(type == 'temp'){
1027
- this.data.f_complete = '未完成'
1028
- this.disableTimer()
1029
- }else {
1030
- let errString = this.errorVerify()
1031
- if (errString) {
1032
- //tag
1033
- //tag
1034
- //tag
1035
- if (Vue.android){
1036
- this.$showMessage(errString)
1037
- }
1038
- return
1039
- } else {
1040
- this.data.f_complete = '已完成'
1041
- this.$set('data.f_offsite_time', Util.toStandardTimeString())
1042
- this.disableTimer()
1043
- }
1044
- }
1045
- //tag
1046
- if(this.data.f_blacklist!='是'){
1047
- delete this.data.f_blocking_cause
1048
- }
1049
- if (this.data.f_entry_status == '入户') {
1050
- this.data.f_rejectchecks_path = []
1051
- this.data.f_rejectcheck_path = null
1052
- this.data.f_rejectcheck1_path = null
1053
- this.data.f_rejectcheck2_path = null
1054
- this.data.f_noanswers_path=[]
1055
- this.data.f_noanswer_path = null
1056
- this.data.f_noanswer1_path = null
1057
- this.data.f_noanswer2_path = null
1058
- }else if (this.data.f_entry_status == '到访不遇') {
1059
- this.data.f_rejectchecks_path = []
1060
- this.data.f_rejectcheck_path = null
1061
- this.data.f_rejectcheck1_path = null
1062
- this.data.f_rejectcheck2_path = null
1063
- }else if (this.data.f_entry_status == '拒检') {
1064
- this.data.f_noanswers_path=[]
1065
- this.data.f_noanswer_path = null
1066
- this.data.f_noanswer1_path = null
1067
- this.data.f_noanswer2_path = null
1068
- }
1069
- // try {
1070
- let codata = this.getAllDefect()
1071
- //tag
1072
- //tag}`)
1073
- for (let key in codata) {
1074
- if (key.startsWith("device")) {
1075
- //tag)
1076
- codata[key] = []
1077
- }
1078
- }
1079
- //tag}`)
1080
- //tag}`)
1081
- //tag
1082
- if (Vue.android) {
1083
- //tag
1084
- let value = this.$androidUtil.path({
1085
- alias: 'getUserinfomation',
1086
- data: {condition: "f_userinfoid = '" + this.item.f_userinfoid + "' and f_no_checkplan = '无计划安检'"}
1087
- })
1088
- //tag)
1089
- if (this.item.f_no_checkplan == '无计划安检' && this.item.f_no_checkplan != '打回') {
1090
- // let result = this.$androidUtil.bzLogic('SafeSaveNoPaper', {
1091
- // f_check_item_id: this.data.f_check_item_id,
1092
- // f_checker_id: this.data.f_checker_id,
1093
- // f_upload_state:'未传',
1094
- // row: codata
1095
- // })
1096
- //tag
1097
- let isStart = true
1098
- // let res
1099
- // for (let i in this.f_devices) {
1100
- // res = HostApp.organizeJSON({isStart: isStart, isDevice: true, device: this.f_devices[i]})
1101
- // if (res.code == 200) {
1102
- // isStart = false
1103
- // } else {
1104
- // this.$showMessage("保存失败!")
1105
- // }
1106
- // }
1107
- // let result = HostApp.organizeJSON({
1108
- // isStart: false,
1109
- // isJSON: true,
1110
- // jsonstr: {
1111
- // f_check_item_id: this.data.f_check_item_id,
1112
- // f_checker_id: this.data.f_checker_id,
1113
- // f_upload_state: '未传',
1114
- // row: codata
1115
- // }
1116
- // })
1117
- codata.f_devices = this.f_devices
1118
- let param = {
1119
- f_check_item_id: this.data.f_check_item_id,
1120
- f_checker_id: this.data.f_checker_id,
1121
- f_upload_state: '未传',
1122
- row: codata
1123
- }
1124
- //tag)
1125
- let paramStr = JSON.stringify(param)
1126
- // 多长截断一次
1127
- let subLength = 800
1128
- for (let i = 0; i < paramStr.length; i += subLength) {
1129
- HostApp.param_cache(paramStr.substr(i, subLength))
1130
- }
1131
- HostApp.__this__ = this
1132
- HostApp.syncLogic({
1133
- // logic别名,key必须为logic
1134
- 'logic': 'SafeSaveNoPaper',
1135
- // 回调执行方法名,key必须为callback
1136
- 'callback': 'javascript:HostApp.__this__.saveCallBack()',
1137
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1138
- // 执行回调方法传入key为backresult
1139
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1140
- 'backresult': 1
1141
- })
1142
- } else {
1143
- //tag
1144
- let isStart = true
1145
- let res
1146
- //tag)
1147
- // for (let i in this.f_devices) {
1148
- // //tag)
1149
- // for (let j = 0; j < this.f_devices[i].f_items.length; j++) {
1150
- // //tag)
1151
- // }
1152
- // res = HostApp.organizeJSON({isStart: isStart, isDevice: true, device: this.f_devices[i]})
1153
- // //tag)
1154
- // if (res.code == 200) {
1155
- // isStart = false
1156
- // } else {
1157
- // this.$showMessage("保存失败!")
1158
- // }
1159
- // }
1160
- //tag)
1161
- //tag)
1162
- //tag)
1163
- // let result = HostApp.organizeJSON({
1164
- // isStart: false,
1165
- // isJSON: true,
1166
- // jsonstr: {
1167
- // f_check_item_id: this.data.f_check_item_id,
1168
- // f_checker_id: this.data.f_checker_id,
1169
- // row: codata
1170
- // }
1171
- // })
1172
- codata.f_devices = this.f_devices
1173
- let param = {
1174
- f_check_item_id: this.data.f_check_item_id,
1175
- f_checker_id: this.data.f_checker_id,
1176
- row: codata
1177
- }
1178
- //tag)
1179
- let paramStr = JSON.stringify(param)
1180
- // 多长截断一次
1181
- let subLength = 800
1182
- for (let i = 0; i < paramStr.length; i += subLength) {
1183
- HostApp.param_cache(paramStr.substr(i, subLength))
1184
- }
1185
- HostApp.__this__ = this
1186
- HostApp.syncLogic({
1187
- // logic别名,key必须为logic
1188
- 'logic': '保存安检单信息',
1189
- // 回调执行方法名,key必须为callback
1190
- 'callback': 'javascript:HostApp.__this__.saveCallBack()',
1191
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1192
- // 执行回调方法传入key为backresult
1193
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1194
- 'backresult': 1
1195
- })
1196
- }
1197
-
1198
- } else {
1199
- //tag
1200
- let value = this.$androidUtil.path({
1201
- alias: 'getUserinfomation',
1202
- data: {condition: "f_userinfoid = '" + this.item.f_userinfoid + "' and f_no_checkplan = '无计划安检'"}
1203
- })
1204
-
1205
- if (this.item.f_no_checkplan == '无计划安检' && value.data.length == 0 && this.item.f_no_checkplan != '打回') {
1206
- this.$androidUtil.bzLogic('SafeSaveNoPaper', {
1207
- f_check_item_id: this.data.f_check_item_id,
1208
- f_checker_id: this.data.f_checker_id,
1209
- f_upload_state: '未传',
1210
- row: codata
1211
- }).then((res) => {
1212
- if (res.data.code == 200) {
1213
- //保存devices
1214
- this.$androidUtil.bzLogic('getPaperInfo', {
1215
- f_check_item_id: this.data.f_check_item_id
1216
- }).then((res) => {
1217
- //tag
1218
- if (res.data.code == 200) {
1219
-
1220
- let f_paper_id = res.data.data[0].id
1221
- for (let device of this.f_devices) {
1222
- device.f_paper_id = f_paper_id
1223
- //tag
1224
- this.$androidUtil.bzLogic('saveDevice', {
1225
- row: device
1226
- }).then((ret) => {
1227
- //tag
1228
- if (ret.code != 200) {
1229
- // if(this.isUpload){
1230
- // this.isUpload = false
1231
- // }
1232
- //TODO 失败后处理
1233
- this.$showMessage("保存失败!")
1234
- return false
1235
- }
1236
- })
1237
- }
1238
- }
1239
- })
1240
- // this.$showAlert('保存成功!', 'success', 2000)
1241
- this.$showMessage('保存成功!')
1242
- return true
1243
- } else {
1244
- // if(this.isUpload){
1245
- // this.isUpload = false
1246
- // }
1247
- this.$showMessage("保存失败!")
1248
- return false
1249
- }
1250
- })
1251
- } else {
1252
- this.$androidUtil.bzLogic('保存安检单信息', {
1253
- f_check_item_id: this.data.f_check_item_id,
1254
- f_checker_id: this.data.f_checker_id,
1255
- row: codata
1256
- }).then((res) => {
1257
- //tag
1258
- if (res.data.code == 200) {
1259
- //保存devices
1260
- this.$androidUtil.bzLogic('getPaperInfo', {
1261
- f_check_item_id: this.data.f_check_item_id
1262
- }).then((res) => {
1263
- //tag
1264
- if (res.data.code == 200) {
1265
-
1266
- let f_paper_id = res.data.data[0].id
1267
- for (let device of this.f_devices) {
1268
- device.f_paper_id = f_paper_id
1269
- //tag
1270
- this.$androidUtil.bzLogic('saveDevice', {
1271
- row: device
1272
- }).then((ret) => {
1273
- //tag
1274
- if (ret.code != 200) {
1275
- // if(this.isUpload){
1276
- // this.isUpload = false
1277
- // }
1278
- //TODO 失败后处理
1279
- this.$showMessage("保存失败!")
1280
- return false
1281
- }
1282
- })
1283
- }
1284
- }
1285
- })
1286
- // this.$showAlert('保存成功!', 'success', 2000)
1287
- this.$showMessage('保存成功!')
1288
- return true
1289
- } else {
1290
- // if(this.isUpload){
1291
- // this.isUpload = false
1292
- // }
1293
- this.$showMessage("保存失败!")
1294
- return false
1295
- }
1296
- })
1297
- }
1298
- }
1299
- // }catch (e) {
1300
- // //tag)
1301
- // // this.isUpload = false
1302
- // this.$showMessage("保存失败!")
1303
- // }
1304
- },
1305
- runSyncLogic(logic,callback,backresult){
1306
- HostApp.runSyncLogic({
1307
- // logic别名,key必须为logic
1308
- 'logic': logic,
1309
- // 回调执行方法名,key必须为callback
1310
- 'callback': callback,
1311
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1312
- // 执行回调方法传入key为backresult
1313
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1314
- 'backresult':backresult
1315
- })
1316
- },
1317
- logicWithHint(logic,data,callback,backresult){
1318
- HostApp.logicWithHint({
1319
- // logic别名,key必须为logic
1320
- 'logic': logic,
1321
- // 回调执行方法名,key必须为callback
1322
- 'callback': callback,
1323
- // logic执行需要的业务参数
1324
- 'data': data,
1325
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1326
- // 执行回调方法传入key为backresult
1327
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1328
- 'backresult':backresult
1329
- })
1330
- },
1331
- saveCallBack(jo){
1332
- //tag)
1333
- if(jo.state == 'ok'){
1334
- let res = JSON.parse(jo.result)
1335
- //tag)
1336
- if(res.code == 200){
1337
- //tag
1338
- if(!this.onlySave){
1339
- let codata = this.getAllDefect()
1340
- //获取微信推送内容
1341
- // let WxResult = this.getWeixin(codata)
1342
- let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
1343
- f_check_item_id: this.data.f_check_item_id
1344
- })
1345
- //如果是转维修上传,则不做校验,上传完成后自动转维修
1346
- //tag
1347
- //tag
1348
- if(!this.isToRepair){
1349
- if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
1350
- //tag
1351
- //tag
1352
- if(!this.isSafeCheckToRepair){
1353
-
1354
- }
1355
- }
1356
- }
1357
- //tag
1358
- for (let key in codata){
1359
- if(key.startsWith("device")){
1360
- codata[key] = []
1361
- }
1362
- }
1363
- //tag}`)
1364
-
1365
- //tag
1366
- // let isStart = true
1367
- // let res
1368
- // for (let i in this.f_devices){
1369
- // res = HostApp.organizeJSON({isStart:isStart,isDevice:true,device:this.f_devices[i]})
1370
- // if(res.code == 200){
1371
- // isStart = false
1372
- // }else{
1373
- // this.$showMessage("上传失败!")
1374
- // return
1375
- // }
1376
- // }
1377
- // let result = HostApp.organizeJSON({
1378
- // isStart:false,
1379
- // isJSON:true,
1380
- // jsonstr:{
1381
- // f_check_item_id: this.data.f_check_item_id,
1382
- // f_checker_id: this.data.f_checker_id,
1383
- // row: codata
1384
- // }
1385
- // })
1386
- codata.f_devices = this.f_devices
1387
- let param = {
1388
- f_check_item_id: this.data.f_check_item_id,
1389
- f_checker_id: this.data.f_checker_id,
1390
- row: codata
1391
- }
1392
- //tag)
1393
- let paramStr = JSON.stringify(param)
1394
- // 多长截断一次
1395
- let subLength = 800
1396
- for (let i = 0; i < paramStr.length; i += subLength) {
1397
- HostApp.param_cache(paramStr.substr(i, subLength))
1398
- }
1399
- HostApp.__this__ = this
1400
- HostApp.syncLogic({
1401
- // logic别名,key必须为logic
1402
- 'logic': '上传安检信息',
1403
- // 回调执行方法名,key必须为callback
1404
- 'callback': 'javascript:HostApp.__this__.uploadCallBack()',
1405
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1406
- // 执行回调方法传入key为backresult
1407
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1408
- 'backresult': 1
1409
- })
1410
- }else{
1411
- this.$showMessage('保存成功!')
1412
- if(this.clickBack){
1413
- this.isStrat = false
1414
- this.$dispatch('confirm')
1415
- //this.$back()
1416
- }
1417
- }
1418
- }else{
1419
- this.$showMessage('保存失败!')
1420
- return
1421
- }
1422
- }else{
1423
- this.$showMessage('服务器内部错误,保存失败!')
1424
- return
1425
- }
1426
- },
1427
- uploadCallBack(jo){
1428
- //获取微信推送路径
1429
- let url = ""
1430
- if(Vue.config.safecheck != undefined) {
1431
- if (Vue.config.safecheck.ApproveConfig != undefined) {
1432
- if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
1433
- url = Vue.config.safecheck.ApproveConfig.weixinurl
1434
- }
1435
- }
1436
- }
1437
- //tag)
1438
- //tag)
1439
- if(jo.state == 'ok'){
1440
- let res = JSON.parse(jo.result)
1441
- //tag)
1442
- //tag)
1443
- if(res.code == 200){
1444
- this.$set('data.f_paper_id', res.id)
1445
- this.isStrat=false
1446
- if(url != ""){
1447
- this.$resetpost(`${url}`,{data:WxResult})
1448
- }
1449
- //tag
1450
- if(this.isToRepair){
1451
- for (let device in this.data){
1452
- if(device.startsWith("device")){
1453
- this.data[device] = []
1454
- if(res.data.length > 0){
1455
- for(let i in res.data[0].f_devices){
1456
- if(this.data[device].length > 0){
1457
- if(this.data[device][0].f_device_type == res.data[0].f_devices[i].f_device_type){
1458
- this.data[device].push(res.data[0].f_devices[i])
1459
- res.data[0].f_devices.splice(i,1)
1460
- }
1461
- }else{
1462
- this.data[device].push(res.data[0].f_devices[i])
1463
- res.data[0].f_devices.splice(i,1)
1464
- }
1465
- }
1466
- }
1467
- }
1468
- }
1469
- this.todo()
1470
- }else{
1471
- this.$showMessage('上传成功!')
1472
- //tag
1473
- this.$dispatch('confirm')
1474
- // this.$back()
1475
- }
1476
- }else if(res.code == 309){
1477
- this.$showMessage('该安检单已作废!')
1478
- //tag
1479
- this.$dispatch('confirm')
1480
- }else{
1481
- this.$showMessage('上传失败!')
1482
- this.onlySave = true
1483
- }
1484
- }else {
1485
- this.$showMessage('服务器内部错误,上传失败!')
1486
- this.onlySave = true
1487
- }
1488
- },
1489
- safecheckToRepairCallBack(jo){
1490
- //获取微信推送路径
1491
- if(jo.state == 'ok'){
1492
- let res = JSON.parse(jo.result)
1493
- //tag)
1494
- if(res.code == 200){
1495
- //tag
1496
- if(res.data.code == 200){
1497
- this.$showMessage('上传并转维修成功!')
1498
- }else{
1499
- this.$showMessage('上传并转维修成功,回写安检单失败!')
1500
- }
1501
- this.$dispatch('confirm')
1502
- // this.$back()
1503
- }else{
1504
- this.$showMessage('上传失败!')
1505
- this.onlySave = true
1506
- }
1507
- }else{
1508
- this.$showMessage('服务器内部错误,上传失败!')
1509
- this.onlySave = true
1510
- }
1511
- },
1512
- todo(){
1513
- let gen = getRepairParam(this)
1514
- co(gen)
1515
- },
1516
- undo(){
1517
- this.showCheckToRepair = !this.showCheckToRepair
1518
- this.model.serviceacitivity[0].f_reciever = ''
1519
- this.model.serviceacitivity[0].f_meetunit = ''
1520
- this.model.f_repairtype = ''
1521
- this.meading = '转站点'
1522
- },
1523
- disableTimer() {
1524
- if(this.timer) {
1525
- window.clearTimeout(this.timer)
1526
- this.timer = null
1527
- }
1528
- },
1529
- loaded(paper) {
1530
- if(!paper.hasOwnProperty('id')) {
1531
- this.$showMessage("该安检单在手机上已经不存在,可能是卸载过程序。可以进入重新安检,或返回安检计划。")
1532
- this.init()
1533
- } else {
1534
- Util.booleanFilter(paper)
1535
- HostApp.__this__.$set('data', paper)
1536
- HostApp.__this__.$goto('safecheck-userinfo', {}, 'paper-router')
1537
- // 如果打回重检则重新计时
1538
- //tag
1539
- if(HostApp.__this__.role == 'inspect'
1540
- && HostApp.__this__.data.f_approved
1541
- && HostApp.__this__.data.f_approved == '打回') {
1542
- //tag
1543
- HostApp.__this__.data.f_onsite_time = Util.toStandardTimeString()
1544
- HostApp.__this__.tick()
1545
- }
1546
- }
1547
- HostApp.__callback__ = null
1548
- HostApp.__this__ = null
1549
- },
1550
- S4() {
1551
- return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
1552
- },
1553
- extend(initalObj, finalObj) {
1554
- var obj = finalObj || {};
1555
- for (var i in initalObj) {
1556
- var prop = initalObj[i];
1557
-
1558
- // 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
1559
- if (prop === obj) {
1560
- continue;
1561
- }
1562
-
1563
- if (typeof prop === 'object') {
1564
- if (obj[i]) {
1565
- this.extend(obj[i], prop)
1566
- } else {
1567
- obj[i] = prop;
1568
- }
1569
- }
1570
- }
1571
- return obj;
1572
- },
1573
- // async isoverDate(){
1574
- // let res= await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/androidGetuserinfo`, {data:{
1575
- // condition:"f_plan_item_id='"+this.item.id+"'"
1576
- // }
1577
- // })
1578
- // this.isneedDate=res.data[0]["f_subscribe_date"]
1579
- // },
1580
- putDevices() {
1581
- //tag)
1582
- //tag)
1583
- this.$set('data.approve', "true")
1584
- this.$set('data.writeback', "false")
1585
- if (Vue.config.safecheck != undefined) {
1586
- if (Vue.config.safecheck.ApproveConfig != undefined) {
1587
- if (Vue.config.safecheck.ApproveConfig.approve != undefined) {
1588
- this.$set('data.approve', Vue.config.safecheck.ApproveConfig.approve)
1589
- }
1590
- if (Vue.config.safecheck.ApproveConfig.writeback != undefined) {
1591
- this.$set('data.writeback', Vue.config.safecheck.ApproveConfig.writeback)
1592
- }
1593
- if (Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
1594
- this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
1595
- }
1596
- }
1597
- //tag
1598
- //tag)
1599
- //tag)
1600
- //tag
1601
- if(this.item.f_user_type == '民用'){
1602
- // 民用户
1603
-
1604
- if (Vue.config.safecheck.DevicesConfig != undefined){
1605
- if(this.item.f_safecheck_type == undefined || this.item.f_safecheck_type == '' || Vue.config.safecheck.SafecheckType == undefined) {
1606
- this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
1607
- }else{
1608
- //tag
1609
- //tag
1610
- //tag
1611
- this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_user_type]])
1612
- }
1613
- // this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
1614
- }
1615
- }else {
1616
- // 非民用
1617
- if (Vue.config.safecheck.DevicesSetConfig != undefined){
1618
- if(this.item.f_safecheck_type == undefined || this.item.f_safecheck_type == '' || Vue.config.safecheck.SafecheckType == undefined) {
1619
- this.config = this.extend(this.config, Vue.config.safecheck.DevicesSetConfig)
1620
- }else{
1621
- //tag
1622
- //tag
1623
- //tag
1624
- this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_user_type]])
1625
- }
1626
- //this.config = this.extend(this.config, Vue.config.safecheck.DevicesSetConfig)
1627
- }
1628
- }
1629
-
1630
- }
1631
- //tag)
1632
- // 预留设备项位置
1633
- for (let i in this.config) {
1634
- this.tabs.splice(1,0,null)
1635
- }
1636
- //遍历安检项配置
1637
- for (let i in this.config) {
1638
- //取得安检项索引值
1639
- let n = this.config[i].index
1640
- //tag
1641
- this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
1642
- this.$set('data.' + 'device' + n, [])
1643
- //tag
1644
- // this.tabs.splice(2 + n - 1, 0,
1645
- // {
1646
- // header:i,
1647
- // complete:'safecheck-devices',
1648
- // class:'repair-details-class',
1649
- // number:n
1650
- // })
1651
- this.tabs[n] = {
1652
- header: i,
1653
- complete: 'safecheck-devices',
1654
- class: 'repair-details-class',
1655
- number: n
1656
- }
1657
-
1658
- if(this.config[i].quantity && this.config[i].quantity >0){
1659
- let items = []
1660
- for (let it in this.config[i].items) {
1661
- //赋值下拉选项
1662
- if (this.config[i].items[it].type == 'selector') {
1663
- for (let op in this.config[i].items[it].options) {
1664
- if (this.config[i].items[it].options[op].isdefault == true) {
1665
- items.push({
1666
- f_defect_level: this.config[i].items[it].options[op].level,
1667
- f_is_defect: this.config[i].items[it].options[op].isdefect,
1668
- f_item_name: it,
1669
- f_item_value: this.config[i].items[it].options[op].data,
1670
- f_path: "",
1671
- type: "selector"
1672
- })
1673
- }
1674
- }
1675
- }
1676
- }
1677
- for(let q =0;q<this.config[i].quantity;q++) {
1678
- this.data['device' + n].push(
1679
- {f_device_type: i, f_items:items}
1680
- )
1681
- }
1682
- }
1683
- // this.data['device' + n].push(
1684
- // {f_device_type: i, f_items: items}
1685
- // )
1686
- n = n + 1
1687
- }
1688
- //tag
1689
- this.faultshow.number = this.tabs.length
1690
- },
1691
- init () {
1692
- //tag
1693
- // this.data.f_noplan_item_id = this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()
1694
- this.data.ename = Vue.user.ename
1695
- this.data.f_outlets = Vue.user.f_parentname
1696
- this.data.f_meetunit = Vue.user.orgpathnames
1697
- this.data.orgpathstr = Vue.user.orgpathstr
1698
- this.data.f_check_item_id = this.item.id
1699
- this.data.f_check_plan_id = this.f_plan_id
1700
- this.data.f_checker_id = Vue.user.id
1701
- this.data.f_checker_name = Vue.user.name
1702
- this.data.f_check_type = this.item.f_user_type
1703
- this.data.f_safecheck_type = this.item.f_safecheck_type
1704
- //this.data.f_exceed_reason = ''//存放送气超期原因
1705
- //tag
1706
- this.data.f_subcompany = this.item.f_subcompany
1707
- this.data.f_approved = this.item.f_approved
1708
- this.data.f_repair_approved = this.item.f_repair_approved
1709
- this.data.f_no_checkplan = this.item.f_no_checkplan
1710
- this.data.f_approved = this.item.f_approved
1711
- this.data.f_filialeid = this.item.f_filialeid
1712
- this.data.f_orgstr = this.item.f_orgstr
1713
- this.data.version = this.item.version
1714
- this.$set('data.f_meters', this.item.f_plan_meters)
1715
- this.$set('data.f_userinfo_code', this.item.f_userinfo_code)
1716
- // 安检状态
1717
- this.$set('data.f_entry_status', '入户')
1718
- this.$set('data.f_usegas', '已使用')
1719
- this.$set('data.f_state',this.item.f_state)
1720
- //tag
1721
- // 用户信息
1722
- this.$set('data.f_user_name', this.item.f_user_name)
1723
- this.$set('data.f_user_phone', this.item.f_user_phone)
1724
- this.$set('data.f_userinfoid', this.item.f_userinfoid)
1725
- this.$set('data.f_address', this.item.f_address)
1726
- this.$set('data.f_card_id', this.item.f_card_id)
1727
- this.$set('data.f_area', this.item.f_area)
1728
- this.$set('data.f_street', this.item.f_street)
1729
- this.$set('data.f_room', this.item.f_room)
1730
- this.$set('data.f_building', this.item.f_building)
1731
- this.$set('data.f_unit', this.item.f_unit)
1732
- //tag
1733
- this.$set('data.f_floor', this.item.f_floor)
1734
- this.$set('data.f_residential_area' , this.item.f_residential_area)
1735
- this.$set('data.f_idnumber', this.item.f_idnumber)
1736
- this.$set('data.f_comments', this.item.f_comments)
1737
- this.$set('data.f_userproperties', this.item.f_userproperties)
1738
- // this.$set('data.f_user_inhome_time', this.item.f_user_inhome_time)
1739
- // this.$set('data.f_user_check_time', this.item.f_user_check_time)
1740
- // this.$set('data.f_user_spare_phone', this.item.f_user_spare_phone)
1741
- // this.$set('data.f_user_family_remarks', this.item.f_user_family_remarks)
1742
- // this.$set('data.f_user_equipment_remarks', this.item.f_user_equipment_remarks)
1743
- // 处置方式
1744
- //tag
1745
- this.$set('data.f_no_gas_device', false)
1746
- this.$set('data.f_close_valve', false)
1747
- this.$set('data.f_unload_battery', false)
1748
- //tag
1749
- if (this.data.f_check_item_id == '' && this.item.f_no_checkplan == '无计划安检') {
1750
- this.data.f_check_item_id = this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4()
1751
- }
1752
- //tag
1753
- if(this.item.f_plan_meters) {
1754
- for (let de in this.devices) {
1755
- this.$set('data.device' + this.devices[de].n, [])
1756
- for (let i = 0; i < this.item.f_plan_meters.length; i++) {
1757
- if (this.item.f_plan_meters[i].f_meter_type) {
1758
- //tag)
1759
- if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_meter_type.indexOf('机表') > 0) {
1760
- this.data['device' + this.devices[de].n].push({
1761
- f_device_type: "燃气表",
1762
- f_items: [
1763
- {
1764
- f_defect_level: null,
1765
- f_device_id: "",
1766
- f_is_defect: "",
1767
- f_item_name: "基表编号",
1768
- f_item_value: this.item.f_plan_meters[i].f_meter_no,
1769
- f_path: "",
1770
- type: "number"
1771
- },
1772
- {
1773
- f_defect_level: null,
1774
- f_device_id: "",
1775
- f_is_defect: "",
1776
- f_item_name: "气表型号",
1777
- f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
1778
- f_path: "",
1779
- type: "string"
1780
- },
1781
- {
1782
- f_defect_level: null,
1783
- f_device_id: "",
1784
- f_is_defect: "",
1785
- f_item_name: "气表品牌",
1786
- f_item_value: this.item.f_plan_meters[i].f_aliasname,
1787
- f_path: "",
1788
- type: "string"
1789
- },
1790
- {
1791
- f_defect_level: null,
1792
- f_device_id: "",
1793
- f_is_defect: "",
1794
- f_item_name: "进气方向",
1795
- f_item_value: this.item.f_plan_meters[i].f_flow_direction,
1796
- f_path: "",
1797
- type: "string"
1798
- },
1799
- {
1800
- f_defect_level: null,
1801
- f_device_id: "",
1802
- f_is_defect: "",
1803
- f_item_name: "上期表读数",
1804
- f_item_value: this.item.f_plan_meters[i].f_prior_reading,
1805
- f_path: "",
1806
- type: "number"
1807
- },
1808
- {
1809
- f_defect_level: null,
1810
- f_device_id: "",
1811
- f_is_defect: "",
1812
- f_item_name: "表箱号",
1813
- f_item_value: this.item.f_plan_meters[i].f_metertitles,
1814
- f_path: "",
1815
- type: "string"
1816
- }
1817
- ]
1818
- })
1819
- }
1820
- else if (this.devices[de].device == "燃气表") {
1821
- // delete this.config['燃气表']['items']['表底数']
1822
- this.data['device' + this.devices[de].n].push({
1823
- f_device_type: "燃气表",
1824
- f_items: [
1825
- {
1826
- f_defect_level: null,
1827
- f_device_id: "",
1828
- f_is_defect: "",
1829
- f_item_name: "基表编号",
1830
- f_item_value: this.item.f_plan_meters[i].f_meter_no,
1831
- f_path: "",
1832
- type: "number"
1833
- },
1834
- {
1835
- f_defect_level: null,
1836
- f_device_id: "",
1837
- f_is_defect: "",
1838
- f_item_name: "气表型号",
1839
- f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
1840
- f_path: "",
1841
- type: "string"
1842
- },
1843
- {
1844
- f_defect_level: null,
1845
- f_device_id: "",
1846
- f_is_defect: "",
1847
- f_item_name: "气表品牌",
1848
- f_item_value: this.item.f_plan_meters[i].f_aliasname,
1849
- f_path: "",
1850
- type: "string"
1851
- },
1852
- {
1853
- f_defect_level: null,
1854
- f_device_id: "",
1855
- f_is_defect: "",
1856
- f_item_name: "进气方向",
1857
- f_item_value: this.item.f_plan_meters[i].f_flow_direction,
1858
- f_path: "",
1859
- type: "string"
1860
- },
1861
- {
1862
- f_defect_level: null,
1863
- f_device_id: "",
1864
- f_is_defect: "",
1865
- f_item_name: "上期表读数",
1866
- f_item_value: this.item.f_plan_meters[i].f_prior_reading,
1867
- f_path: "",
1868
- type: "number"
1869
- },
1870
- {
1871
- f_defect_level: null,
1872
- f_device_id: "",
1873
- f_is_defect: "",
1874
- f_item_name: "表箱号",
1875
- f_item_value: this.item.f_plan_meters[i].f_metertitles,
1876
- f_path: "",
1877
- type: "string"
1878
- }
1879
- ]
1880
- })
1881
- }
1882
- if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_collection_type) {
1883
- this.data['device' + this.devices[de].n].forEach(device => {
1884
- //tag)
1885
- //tag)
1886
- /*
1887
- "累购气量":{"index":8,"type":"number","readonly":true},
1888
- "累购金额":{"index":8,"type":"number","readonly":true},
1889
- "字轮读数":{"index":9,"type":"number","checkmust": true},
1890
- "已用金额":{"index":9,"type":"number","checkmust": true},
1891
- "剩余气量":{"index":10,"type":"number","checkmust": true},
1892
- "剩余金额":{"index":10,"type":"number","checkmust": true},
1893
- "气量异常差值":{"index":11,"type":"number","readonly": true},
1894
- "金额异常差值":{"index":11,"type":"number","readonly": true}
1895
- */
1896
- if (this.item.f_plan_meters[i].f_collection_type == '按金额') {
1897
- if (!this.data.f_collection_type) {
1898
- this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1899
- delete this.config['燃气表']['items']['累购气量']
1900
- delete this.config['燃气表']['items']['已用气量']
1901
- delete this.config['燃气表']['items']['剩余气量']
1902
- delete this.config['燃气表']['items']['气量异常差值']
1903
- device.f_items.push(
1904
- {
1905
- f_defect_level: null,
1906
- f_device_id: "",
1907
- f_is_defect: "",
1908
- f_item_name: "初始表底",
1909
- isshow: false,
1910
- f_item_value: '',
1911
- f_path: "",
1912
- type: "number"
1913
- },
1914
- // {
1915
- // f_defect_level: null,
1916
- // f_device_id: "",
1917
- // f_is_defect: "",
1918
- // f_item_name: "累购金额",
1919
- // f_item_value: this.item.f_plan_meters[i].f_total_fee,
1920
- // f_path: "",
1921
- // type: "number"
1922
- // },
1923
- {
1924
- f_defect_level: null,
1925
- f_device_id: "",
1926
- f_is_defect: "",
1927
- f_item_name: "已用金额",
1928
- f_item_value: null,
1929
- f_path: "",
1930
- type: "number"
1931
- },
1932
- {
1933
- f_defect_level: null,
1934
- f_device_id: "",
1935
- f_is_defect: "",
1936
- f_item_name: "剩余金额",
1937
- f_item_value: null,
1938
- f_path: "",
1939
- type: "number"
1940
- },
1941
- {
1942
- f_defect_level: null,
1943
- f_device_id: "",
1944
- f_is_defect: "",
1945
- f_item_name: "金额异常差值",
1946
- f_item_value: null,
1947
- f_path: "",
1948
- type: "number"
1949
- }
1950
- )
1951
- //tag)
1952
- }
1953
- } else if (this.item.f_plan_meters[i].f_collection_type == '按气量') {
1954
- if (!this.data.f_collection_type) {
1955
- this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1956
- delete this.config['燃气表']['items']['累购金额']
1957
- delete this.config['燃气表']['items']['已用金额']
1958
- delete this.config['燃气表']['items']['剩余金额']
1959
- delete this.config['燃气表']['items']['金额异常差值']
1960
- device.f_items.push(
1961
- {
1962
- f_defect_level: null,
1963
- f_device_id: "",
1964
- f_is_defect: "",
1965
- f_item_name: "初始表底",
1966
- isshow: true,
1967
- f_item_value: this.item.f_plan_meters[i].f_initial_base,
1968
- f_path: "",
1969
- type: "number"
1970
- },
1971
- {
1972
- f_defect_level: null,
1973
- f_device_id: "",
1974
- f_is_defect: "",
1975
- f_item_name: "累购气量",
1976
- f_item_value: this.item.f_plan_meters[i].f_total_gas,
1977
- f_path: "",
1978
- type: "number"
1979
- },
1980
- {
1981
- f_defect_level: null,
1982
- f_device_id: "",
1983
- f_is_defect: "",
1984
- f_item_name: "已用气量",
1985
- f_item_value: this.item.f_plan_meters[i].f_meter_base,
1986
- f_path: "",
1987
- type: "number"
1988
- },
1989
- {
1990
- f_defect_level: null,
1991
- f_device_id: "",
1992
- f_is_defect: "",
1993
- f_item_name: "剩余气量",
1994
- f_item_value: "",
1995
- f_path: "",
1996
- type: "number"
1997
- },
1998
- {
1999
- f_defect_level: null,
2000
- f_device_id: "",
2001
- f_is_defect: "",
2002
- f_item_name: "气量异常差值",
2003
- f_item_value: null,
2004
- f_path: "",
2005
- type: "number"
2006
- }
2007
- )
2008
- //tag)
2009
- }
2010
- }
2011
- })
2012
- }
2013
- else if(this.devices[de].device == "燃气表"){
2014
- //tag
2015
- this.data['device' + this.devices[de].n].forEach(device => {
2016
- //tag)
2017
- if (!this.data.f_collection_type) {
2018
- this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
2019
- delete this.config['燃气表']['items']['累购金额']
2020
- delete this.config['燃气表']['items']['已用金额']
2021
- delete this.config['燃气表']['items']['剩余金额']
2022
- delete this.config['燃气表']['items']['金额异常差值']
2023
- device.f_items.push(
2024
- {
2025
- f_defect_level: null,
2026
- f_device_id: "",
2027
- f_is_defect: "",
2028
- f_item_name: "初始表底",
2029
- isshow: true,
2030
- f_item_value: this.item.f_plan_meters[i].f_initial_base,
2031
- f_path: "",
2032
- type: "number"
2033
- },
2034
- {
2035
- f_defect_level: null,
2036
- f_device_id: "",
2037
- f_is_defect: "",
2038
- f_item_name: "累购气量",
2039
- f_item_value: this.item.f_plan_meters[i].f_total_gas,
2040
- f_path: "",
2041
- type: "number"
2042
- },
2043
- {
2044
- f_defect_level: null,
2045
- f_device_id: "",
2046
- f_is_defect: "",
2047
- f_item_name: "已用气量",
2048
- f_item_value: this.item.f_plan_meters[i].f_meter_base,
2049
- f_path: "",
2050
- type: "number"
2051
- },
2052
- {
2053
- f_defect_level: null,
2054
- f_device_id: "",
2055
- f_is_defect: "",
2056
- f_item_name: "剩余气量",
2057
- f_item_value: '',
2058
- f_path: "",
2059
- type: "number"
2060
- },
2061
- {
2062
- f_defect_level: null,
2063
- f_device_id: "",
2064
- f_is_defect: "",
2065
- f_item_name: "气量异常差值",
2066
- isshow:false,
2067
- f_item_value: null,
2068
- f_path: "",
2069
- type: "number"
2070
- }
2071
- )
2072
- //tag)
2073
- }
2074
- })
2075
- }
2076
- }
2077
- }
2078
- }
2079
- }
2080
- var pardate = {
2081
- _this:this,
2082
- tittle:'安检详情',
2083
- safe:true
2084
- }
2085
- // this.$dispatch('gotoson',pardate)
2086
- //tag
2087
- this.$goto('safecheck-userinfo', {userinfo:this.data}, 'repair')
2088
- }
2089
- },
2090
- watch: {
2091
- 'row' () {
2092
- //tag
2093
- this.copy()
2094
- }
2095
- },
2096
- async ready () {
2097
- //送气超期功能
2098
- //await this.isoverDate()
2099
- this.putDevices()
2100
- //如果已检,则提取安检单
2101
- if (this.item.f_state != '未检') {
2102
- if (this.role == 'inspect' || this.role == 'androidview') {
2103
- HostApp.__callback__ = this.loaded
2104
- HostApp.__this__ = this
2105
- let that = this
2106
- let value = {}
2107
- //tag
2108
- if (this.role == 'inspect') {
2109
- //tag
2110
- if (this.item.f_no_checkplan == '无计划安检') {
2111
- value = this.$androidUtil.path({
2112
- alias: 'getUserinfomation',
2113
- data: {condition: "f_check_item_id = '" + this.item.id + "' and f_no_checkplan = '无计划安检'"}
2114
- })
2115
- } else {
2116
- value = this.$androidUtil.bzLogic('FetchCheckPaper', {id: this.item.id})
2117
- }
2118
- } else {
2119
- value = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data: {condition: `id = '${this.item.f_paper_id}'`}})
2120
- }
2121
- Util.replaceFalse(value)
2122
- //tag)
2123
- if (value.data.length != 0) {
2124
- that.$set('data', value.data[0])
2125
- //tag)
2126
- if (this.data.f_collection_type == '按气量') {
2127
- delete this.config['燃气表']['items']['累购金额']
2128
- delete this.config['燃气表']['items']['已用金额']
2129
- delete this.config['燃气表']['items']['剩余金额']
2130
- delete this.config['燃气表']['items']['金额异常差值']
2131
- } else if (this.data.f_collection_type == '按金额') {
2132
- delete this.config['燃气表']['items']['累购气量']
2133
- delete this.config['燃气表']['items']['已用气量']
2134
- delete this.config['燃气表']['items']['剩余气量']
2135
- delete this.config['燃气表']['items']['气量异常差值']
2136
- }
2137
- //tag)
2138
- if (value.data[0].f_devices) {
2139
- for (let da in that.devices) {
2140
- that.$set('data.device' + that.devices[da].n, [])
2141
- }
2142
- value.data[0].f_devices.forEach((item) => {
2143
- //tag)
2144
- for (let i in item.f_items) {
2145
- // if (item.f_items[i].f_path != '' && item.f_items[i].f_path != null) {
2146
- // this.picture.push({f_path: item.f_items[i].f_path, name: item.f_items[i].f_item_name})
2147
- // }
2148
- for (let de in that.config[item.f_device_type].items) {
2149
- if (item.f_items[i].f_item_name == de) {
2150
- if (that.config[item.f_device_type].items[de].type == 'selector' || that.config[item.f_device_type].items[de].type == 'checkbox') {
2151
- item.f_items[i].f_item_value = []
2152
- } else {
2153
- item.f_items[i].f_item_value = ''
2154
- }
2155
- }
2156
- }
2157
- //tag)
2158
- for (let j in item.f_items[i].f_item_lists) {
2159
- //tag)
2160
- if (item.f_items[i].f_item_value instanceof Array) {
2161
- item.f_items[i].f_item_value.push(item.f_items[i].f_item_lists[j].f_item_value)
2162
- } else {
2163
- item.f_items[i].f_item_value = item.f_items[i].f_item_lists[j].f_item_value
2164
- }
2165
-
2166
- }
2167
- }
2168
- for (let de in that.devices) {
2169
- if (that.devices[de].device == item.f_device_type) {
2170
- that.data['device' + that.devices[de].n].push({
2171
- f_device_type: item.f_device_type,
2172
- f_items: item.f_items
2173
- })
2174
- //tag)
2175
- }
2176
- }
2177
- })
2178
- if (this.role == 'androidview') {
2179
- Util.androidRatifyPics(that.data, this.$androidUtil.getProxyUrl())
2180
- Util.androidRatifyPics(that.picture, this.$androidUtil.getProxyUrl())
2181
- Util.booleanFilter(that.data)
2182
- }
2183
- //tag)
2184
- }
2185
- } else {
2186
- //tag
2187
- this.init()
2188
- }
2189
- //tag
2190
- var pardate = {
2191
- _this:this,
2192
- tittle:'安检详情',
2193
- safe:true
2194
- }
2195
- // this.$dispatch('gotoson',pardate)getImgPath
2196
- this.$goto('safecheck-userinfo', {userinfo:this.data}, 'repair')
2197
- } else {
2198
- let that = this
2199
- let id
2200
- if (this.role == 'view') {
2201
- id = this.item.id
2202
- }
2203
- this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data:{condition:`id = '${id}'`}}).then((respanse)=> {
2204
- if (respanse.data.length != 0) {
2205
- that.data = Object.assign(that.data,respanse.data[0])
2206
- if(respanse.data[0].f_devices) {
2207
- for (let da in that.devices) {
2208
- that.$set('data.device' + that.devices[da].n, [])
2209
- }
2210
- respanse.data[0].f_devices.forEach((item) => {
2211
- for (let de in that.devices) {
2212
- if (that.devices[de].device == item.f_device_type) {
2213
- that.data['device' + that.devices[de].n].push({
2214
- f_device_type: item.f_device_type,
2215
- f_items: item.f_items
2216
- })
2217
- }
2218
- }
2219
- })
2220
- }
2221
- Util.replaceFalse(that.data)
2222
- Util.booleanFilter(that.data)
2223
- if(this.role == 'view'){
2224
- Util.ratifyPics(that.data)
2225
- }else{
2226
- Util.androidRatifyPics(that.data,this.$androidUtil.getProxyUrl())
2227
- }
2228
- //tag
2229
- } else {
2230
- alert("该安检单可能已不在本地!")
2231
- this.init()
2232
- }
2233
- var pardate = {
2234
- _this:this,
2235
- tittle:'安检详情',
2236
- safe:true
2237
- }
2238
- // this.$dispatch('gotoson',pardate)
2239
- this.$goto('safecheck-userinfo', {userinfo:this.data}, 'paper-router')
2240
- }
2241
- ).catch(
2242
- (respanse) => {
2243
- alert('查找安检单失败')
2244
- })
2245
- }
2246
- }else{
2247
- this.init()
2248
- }
2249
- // tbs合并数组
2250
- // if( this.model.serviceacitivity[0].servicerepair.length > 0){
2251
- // for(let i = 0;i < this.model.serviceacitivity[0].servicerepair.length;i++ ){
2252
- //
2253
- // }
2254
- // }
2255
- },
2256
- components: {
2257
- // 'door-service': DoorService,
2258
- // 'repair-info': RepairInfo,
2259
- // 'repair-user-info': RepairUserInfo,
2260
- // 'outlay': Outlay,
2261
- // 'fault-all': FaultAll,
2262
- // 'repair-details':RepairDetails
2263
- // 'pipeline': Pipeline,
2264
- // 'device-service': DeviceService,
2265
- // 'trouble-removal': TroubleRemoval,
2266
- // 'cooking-utensils': CookingUtensils,
2267
- // 'repair-matter-info': RepairMatterInfo,
2268
- // 'first-gas-check': FirstGasCheck,
2269
- // 'tel-change-matter': TelChangeMatter/
2270
- },
2271
- events: {
2272
- 'tijiao': function () {
2273
- // 事件回调内的 `this` 自动绑定到注册它的实例上
2274
- this.confirm()
2275
- }
2276
- }
2277
- }
2278
- </script>
2279
- <style lang="less">
2280
- @import "../../../../src/bootstrap/less/variables.less";
2281
- .noclickbut {
2282
- pointer-events: none;
2283
- }
2284
- .tab-befor-img (@url) {
2285
- content: '';
2286
- background-image: url("@{url}");
2287
- background-size: 20px;
2288
- display: inline-block;
2289
- margin-right: 8px;
2290
- margin-top: 0.3em;
2291
- height: 1.3em;
2292
- width: 1.3em;
2293
- vertical-align: -35%;
2294
- }
2295
-
2296
- @media screen and (min-width: 768px) {
2297
- .android-repair-order > div > ul a {
2298
- font-size: @font-size-h2;
2299
- margin: 0.3em 0;
2300
- }
2301
- }
2302
- .repair-details-class{
2303
- &::before {
2304
- .tab-befor-img("../../../assets/huneiweixiu1.png");
2305
- }
2306
- }
2307
- .repair-info-class {
2308
- &::before {
2309
- .tab-befor-img("../../../assets/baoxiuxinxi1.png");
2310
- }
2311
- }
2312
- .repair-user-info-class {
2313
- &::before {
2314
- .tab-befor-img("../../../assets/jibenxinxi1.png")
2315
- }
2316
- }
2317
-
2318
- .door-service-class {
2319
- &::before {
2320
- .tab-befor-img("../../../assets/huneiweixiu1.png")
2321
- }
2322
- }
2323
-
2324
- .pipeline-class {
2325
- &::before {
2326
- .tab-befor-img("../../../assets/guandao1.png")
2327
- }
2328
- }
2329
-
2330
- .device-service-class {
2331
- &::before {
2332
- .tab-befor-img("../../../assets/shebeiweixiu1.png")
2333
- }
2334
- }
2335
-
2336
- .trouble-removal-class {
2337
- &::before {
2338
- .tab-befor-img("../../../assets/shiguchuli.png")
2339
- }
2340
- }
2341
-
2342
- .cooking-utensils-class {
2343
- &::before {
2344
- .tab-befor-img("../../../assets/zaoju1.png")
2345
- }
2346
- }
2347
-
2348
- .outlay-class {
2349
- &::before {
2350
- .tab-befor-img("../../../assets/feiyong1.png")
2351
- }
2352
- }
2353
-
2354
- .fault-all-class {
2355
- &::before {
2356
- .tab-befor-img("../../../assets/guzhanghuizong1.png")
2357
- }
2358
- }
2359
- .photo-write-class {
2360
- &::before {
2361
- .tab-befor-img("../../../assets/zaoju.png")
2362
- }
2363
- }
2364
- .delay-apply-class {
2365
- &::before {
2366
- .tab-befor-img("../../../assets/yonghubaoxiu.png")
2367
- }
2368
- }
2369
-
2370
- .repair-back-class {
2371
- &::before {
2372
- .tab-befor-img("../../../assets/fanhui.png")
2373
- }
2374
- }
2375
- .butt2 {
2376
- display: inline;
2377
- float: right;
2378
- width: 10px;
2379
- text-align: center;
2380
- align-items:center;
2381
- position: absolute;
2382
- top:50%;
2383
-
2384
- left:90%;
2385
- transform: translate(-50%,-50%);
2386
- }
2387
- .linesty{
2388
- display: inline-block;
2389
- height:1px;
2390
- width:100%;
2391
- background:#d0d0d0;
2392
- overflow:hidden;
2393
- vertical-align: middle;
2394
- }
2395
- .spanboder{
2396
- border-bottom:2px solid #499edf;
2397
- padding-bottom: 8px
2398
- }
2399
- .app-botton {
2400
- position:fixed;
2401
- background: #87b2dd;
2402
- right:8px;
2403
- color: #FFF;
2404
- padding: 8px;
2405
- text-align: center;
2406
- font-size: 1.2em;
2407
- z-index: 10;
2408
- opacity:0.5;
2409
- bottom: 50px;
2410
- margin-top: -10px;
2411
- height: 40px;
2412
- }
2413
- .android-repair-order > div > ul a {
2414
- font-size: 12px;
2415
- color: #333333;
2416
- padding: 13px 16px;
2417
- }
2418
- </style>
1
+ <template>
2
+
3
+ <div class="no-close row android-repair-order" style="background-color: #f9f9f9">
4
+ <work-busy :is-busy="isSend"></work-busy>
5
+ <div class="col-sm-12 col-xs-12" >
6
+ <ul class="nav nav-tabs" style="background:#ffffff;overflow-y: hidden">
7
+ <li v-for="row in tabs" @click="tabSelect(row,$index)" :class="{active1: row.complete === componentName}"
8
+ v-if="$index < number+1 && $index < faultshow.number" >
9
+ <a href="#" style="background-color: #ffffff;color: #666666;font-size: 16px;font-family:SimSun" :class="row.class">
10
+ <span class="spanboder">{{row.header}}</span>
11
+ <img class="butt2" :src="imgback(row.complete === componentName,row.header === header)"></a>
12
+ <p></p>
13
+ </li>
14
+ <div class="col-sm-12 col-xs-12 repair-bg" v-show="routeShow">
15
+ <route name='repair' :reuse="false"></route>
16
+ </div>
17
+ <li v-for="row in tabs" @click="tabSelect(row,$index)" :class="{active1: row.complete === componentName}"
18
+ v-if="$index > number && $index < faultshow.number ">
19
+ <a href="#" style="background-color: #ffffff;color: #666666;font-size: 16px;font-family:SimSun" :class="row.class">
20
+ <span class="spanboder">{{row.header}}</span>
21
+ <img class="butt2" :src="imgback(row.complete === componentName,row.header === header)"></a>
22
+ <p></p>
23
+ </li>
24
+ <div class="col-sm-12 col-xs-12 repair-bg" v-if="actionEnabled ">
25
+ <div class="auto select-overspread form-horizontal repair-bg " style="padding-bottom:5px;">
26
+ <div class="bq-parent">
27
+ <blockquote class="blockquote">
28
+ <p>安检上传</p>
29
+ </blockquote>
30
+ </div>
31
+ <div class="panel panel-default auto repair-info-content">
32
+ <div class="panel-body ">
33
+ <div class="row auto">
34
+ <!--<div class="col-xs-12 col-sm-12 col-md-12" :style="timeSet(this.isneedDate)?'':'display:none'">-->
35
+ <!--<label>请输入超期原因:</label><br/>-->
36
+ <!--<textarea style="width: 100%;" v-model=""></textarea>-->
37
+ <!--</div>-->
38
+ <div id="savebut" class="col-xs-12 col-sm-12 col-md-12 flex-between" style="margin-top: 20px;">
39
+ <div class="col-xs-3 col-sm-3 col-md-3">
40
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="save('temp')">
41
+ 临时保存
42
+ </button>
43
+ </div>
44
+ <div class="col-xs-3 col-sm-3 col-md-3">
45
+ <button class="col-sm-3 btn btn-primary" @click="save('finish')">
46
+ 本地缓存
47
+ </button>
48
+ </div>
49
+ <div class="col-xs-3 col-sm-3 col-md-3">
50
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="uploadCheckPaper">
51
+ 上传
52
+ </button>
53
+ </div>
54
+ <div class="col-xs-3 col-sm-3 col-md-3">
55
+ <button type="button" name="button" class="col-sm-3 btn btn-primary" @click="openremark">
56
+ 转维修
57
+ </button>
58
+ </div>
59
+
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ </ul>
67
+ </div>
68
+ <modal :show.sync="showModal">
69
+ <div slot="modal-header" class="modal-header">
70
+ <h4 class="modal-title">
71
+ 请填写备注
72
+ </h4>
73
+ </div>
74
+ <div slot="modal-body" class="modal-body">
75
+ <textarea type="text" v-model="repairremark" rows="3"></textarea>
76
+ </div>
77
+ <div slot="modal-footer" class="modal-footer">
78
+ <button type="button" class="btn btn-default" @click="changetorepair">确认</button>
79
+ <button type="button" class="btn btn-default" @click="canalremark">取消</button>
80
+
81
+ </div>
82
+ </modal>
83
+ </div>
84
+ </template>
85
+
86
+ <script>
87
+ // 户内维修
88
+ import Vue from 'vue'
89
+ import * as Util from '../../Util'
90
+ // import DoorService from './DoorService'
91
+ // import Pipeline from './Pipeline'
92
+ // import DeviceService from './DeviceService'
93
+ // import TroubleRemoval from './TroubleRemoval'
94
+ // import FirstGasCheck from './FirstGasCheck'
95
+ // import RepairMatterInfo from './RepairMatterInfo'
96
+ // import TelChangeMatter from './TelChangeMatter'
97
+ import { HttpResetClass } from 'vue-client'
98
+ import co from 'co'
99
+ import $ from "jquery";
100
+ let loadParamGem = async function (self) {
101
+ await self.$LoadParams.loadParam()
102
+ }
103
+
104
+ export default {
105
+ title: '安检单',
106
+ props: ['f_plan_id', 'item', 'role'],
107
+ // props: ['f_plan_id', 'role'],
108
+ data() {
109
+ return {
110
+ isSend:false,
111
+ //测试数据
112
+ // f_plan_id:'',
113
+ // role:'inspect',
114
+ // item:{"f_approved_time":null,"f_user_family_remarks":null,"f_street":"测试街道","f_repair_approved_time":null,
115
+ // "f_user_type":null,"f_approved_by":null,"f_card_id":null,"f_remark":null,"f_building":"1","f_batch_number":null,
116
+ // "f_idnumber":null,"f_state":"未检","id":"0EFE0EE2-B155-46F9-8DE0-38C022664A4D","f_complete":null,"f_check_state":null,"f_last_check_state":"拒检",
117
+ // "f_user_inhome_time":null,"f_residential_area":"测试小区1","version":1,"f_processid":null,"f_last_check_result":"{\"result\":\"正常\",\"data\":[]}",
118
+ // "f_area":null,"f_usegas":null,"f_user_phone":"16566546548","f_slice_area":"营业大区","f_approved":"未审核","f_upload_state":"未传","f_user_check_time":null,
119
+ // "f_unit":"1","f_user_spare_phone":null,"f_last_check_date":null,"f_userproperties":null,"f_userfile_id":null,"f_prearranged_date":null,"f_filialeid":"453",
120
+ // "f_branch":null,"f_orgstr":null,"f_plan_year":2020,"f_orgid":null,"f_approval_notified":null,"f_plan_month":4,"f_approved_note":null,"f_filialeids":null,
121
+ // "f_floor":"1","f_flag":null,"f_repair_approved_note":null,"f_userinfo_code":"00000002","f_create_time":"2020-05-10 18:56:03","f_meter_no":"","f_station":null,
122
+ // "f_repair_approved":"未审核","f_no_checkplan":"有计划安检","f_plan_name":"关于","f_repair_approved_by":null,"f_room":"1","f_office":null,"f_comments":null,
123
+ // "f_address":"兰山街道泰盛小区1栋1单元1层1室","id_back":null,"f_userinfoid":"2","f_subcompany":null,"f_addressid":null,"f_user_phone2":null,
124
+ // "f_user_equipment_remarks":null,"f_plan_id":"0819ea6707ad4d9dad217c06a87f4227","f_user_name":"用户二",
125
+ // "f_plan_meters":[{"f_weizhi":null,"f_flow_direction":"右表","f_metertitles":"","f_prior_reading":0,"f_meter_no":"2119035714","f_collection_type":"按金额","f_aliasname":"先锋系统结算物联网表","f_meter_type":"物联网表","version":3,"f_maker":null,"f_metergasnums":0,"f_total_fee":100,"f_diaphgram_size":"G2.5","f_total_gas":0,"id":18663},{"f_weizhi":null,"f_flow_direction":"右表","f_metertitles":"","f_prior_reading":0,"f_meter_no":"2118999901","f_collection_type":"按金额","f_aliasname":"先锋系统结算物联网表","f_meter_type":"物联网表","version":1,"f_maker":null,"f_metergasnums":0,"f_total_fee":0,"f_diaphgram_size":"G2.5","f_total_gas":0,"id":18663}]
126
+ // },
127
+
128
+ data: {
129
+ f_devices: [],
130
+ f_defect_content:''
131
+ },
132
+ updateuserphone:false, //安检时是否更新用户电话
133
+ beforephone:'',
134
+ isUpload:false,
135
+ onlySave:true, //判断保存还是保存并上传
136
+ livedispose:'',
137
+ startClick:false, //开始安检按钮是否可点击
138
+ isStrat: false, //是否开始安检
139
+ checkResult:{},//查询结果
140
+ newcheckResult:{},
141
+ timer: null,
142
+ showModal: false,
143
+ pic_to_be_viewed: '',
144
+ repairremark:'',
145
+ showBack:true,
146
+ devices: [],
147
+ f_devices : [],
148
+ isToRepair:false,
149
+ clickBack:true, //是否点击返回按钮
150
+ isSafeCheckToRepair:false,//是否转维修
151
+ Url:this.$androidUtil.getProxyUrl(),
152
+ detail:{},
153
+ defectDevice:{},
154
+ user:{},
155
+ model: { //转维修数据
156
+ // 一次派单
157
+ serviceacitivity: [{
158
+ f_service_acitivity_type: '派单'
159
+ }],
160
+ f_source:'安检',
161
+ f_service_id: '',
162
+ f_contact_phone: '',
163
+ f_meetunit: '',
164
+ f_phone: '',
165
+ f_user_name: '',
166
+ f_address: '',
167
+ f_repair_date: Util.toStandardTimeString(),
168
+ f_card_id: '',
169
+ // f_department: '', 站点选择
170
+ f_reciever:'',
171
+ f_remarks: '',
172
+ f_user_type: '',
173
+ f_area: '',
174
+ f_unit_name:'',
175
+ f_street: '',
176
+ f_residential_area: '',
177
+ f_building: '',
178
+ f_unit: '',
179
+ f_floor: '',
180
+ f_room: '',
181
+ aState: null,
182
+ f_repairtype: '',
183
+ f_repairitems:{},
184
+ },
185
+ repairitems:[],
186
+ meading:'转站点',
187
+ config: {
188
+ "燃气表":{
189
+ "checkmust":true,
190
+ "index":1,
191
+ "items":{
192
+ //"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
193
+ "基表编号":{"index":1,"type":"string","readonly":true},
194
+ "气表型号":{"index":2,"type":"string","readonly":true},
195
+ "气表品牌":{"index":3,"type":"string","readonly":true},
196
+ "进气方向":{"index":4,"type":"string","readonly":true},
197
+ "初始表底":{"index":5,"type":"number","isshow":false,"readonly":true},
198
+ "上期表读数":{"index":6,"type":"number","readonly":true,isshow:false},
199
+ "已用气量":{"index":7,"type":"number","checkmust": false},//基表数
200
+ "已用金额":{"index":7,"type":"number","checkmust": false},
201
+ "剩余气量":{"index":8,"type":"number","checkmust": false},//累购-已用
202
+ //显示屏数 --实际剩余气量
203
+ "剩余金额":{"index":8,"type":"number","checkmust": false},
204
+ "表箱号":{"index":9,"type":"string","readonly": true}
205
+ }
206
+ // 注意,配置项的index必须与上面的固定配置保持'顺序'
207
+ },
208
+ // "燃气表2":{
209
+ // "checkmust":true,
210
+ // "index":2,src
211
+ // "items":{
212
+ // "燃气表照片":{"index":1,"type":"picture"},
213
+ // "表品牌":{"index":2,"type":"string","readonly":true},
214
+ // "表号":{"index":3,"type":"string","readonly":true},
215
+ // "表封号":{"index":4,"type":"number","readonly":true},
216
+ // "表型号":{"index":5,"type":"string","readonly":true},
217
+ // "位置":{"index":6,"type":"string","readonly":true},
218
+ // "表底数":{"index":7,"type":"number","readonly":true},
219
+ // "累购气量":{"index":8,"type":"number","readonly":true},
220
+ // "累购金额":{"index":8,"type":"number","readonly":true}
221
+ // }
222
+ // }
223
+ },
224
+ // 维修项
225
+ isneedDate:'',
226
+ routeShow:true,
227
+ number:0,
228
+ shupingshow:false,
229
+ pipeline: {},
230
+ details: [],
231
+ ids: '',
232
+ savevalid: {
233
+ uservalid: false,
234
+ doorvalid: true,
235
+ changetable: false
236
+ },
237
+ doordetails: {},
238
+ devicedetails: {},
239
+ cookdetails: {},
240
+ componentName: 'safecheck-userinfo',
241
+ header:'客户信息',
242
+ tabs: [
243
+
244
+ // 参数全部设置成空,在ready时,等model处理好了,再添加
245
+ {
246
+ header: '客户信息',complete:'safecheck-userinfo',class: 'repair-info-class', props: null
247
+ },
248
+ {
249
+ header: '拍照签名',complete:'paper-feedback', class: 'outlay-class', props: null
250
+ }
251
+ ],
252
+ faultshow:{
253
+ number : 8
254
+ } // 控制 故障汇总 在 菜单里显示与否,
255
+ }
256
+ },
257
+ computed: {
258
+ actionEnabled: {
259
+ get() {
260
+ return this.role == 'inspect'
261
+ }
262
+ }
263
+ },
264
+ methods: {
265
+ openremark(){
266
+ this.repairremark=''
267
+ this.showModal=true
268
+ },
269
+ canalremark(){
270
+ this.repairremark=''
271
+ this.showModal=false
272
+ },
273
+ changetorepair(){
274
+ let mdata={"model":{
275
+ "serviceacitivity":[
276
+ {
277
+ "f_service_acitivity_type":"派单",
278
+ "f_reciever":Vue.user.depids,
279
+ "f_meetunit":Vue.user.deps
280
+ }
281
+ ],
282
+ "f_source":"安检转单",
283
+ "f_service_id":"",
284
+ "f_contact_phone":this.data.f_user_phone,
285
+ "f_meetunit":Vue.user.deps,
286
+ "f_phone":"",
287
+ "f_user_name":this.data.f_user_name,
288
+ "f_address":this.data.f_address,
289
+ "f_repair_date":Util.toStandardTimeString(),
290
+ "f_reciever":"",
291
+ "f_remarks":this.repairremark,
292
+ "f_user_type":this.data.f_user_type,
293
+ "f_area":this.data.f_area,
294
+ "f_unit_name":this.data.f_unit_name,
295
+ "f_street":this.data.f_street,
296
+ "f_residential_area":this.data.f_residential_area,
297
+ "f_building":this.data.f_building,
298
+ "f_unit":this.data.f_unit,
299
+ "f_floor":this.data.f_floor,
300
+ "f_room":this.data.f_room,
301
+ "aState":null,
302
+ "f_handlingtype":"转站点",
303
+ "f_repairtype":"安检转维修",
304
+ "f_orgid":Vue.user.orgid,
305
+ "f_orgname":this.data.f_subcompany,
306
+ "f_depid":Vue.user.depids,
307
+ "f_operator":Vue.user.name,
308
+ "f_operatorid":Vue.user.id,
309
+ "f_filiale":this.data.f_subcompany,
310
+ "f_filiale_id":Vue.user.orgid,
311
+ "f_userinfo_id":this.data.f_userinfoid,
312
+ "f_userinfo_code":this.data.f_userinfo_code,
313
+ "f_orgstr":"",
314
+ "f_outlets":Vue.user.deps,
315
+ "f_repairman_phone":"",
316
+ "failure":"[{\"f_failure_type\":\"安检转维修\"}]",
317
+ "f_attendant":Vue.user.name
318
+ },
319
+ "loginUser":{
320
+ "name":Vue.user.name,
321
+ "ename":Vue.user.ename
322
+ },
323
+ "user":{
324
+ "f_street":this.data.f_street,
325
+ "f_unit":this.data.f_unit,
326
+ "f_floor_suffix":"层",
327
+ "f_rent_phone":this.data.f_user_phone,
328
+ "f_user_type":this.data.f_user_type,
329
+ "f_unit_suffix":"单元",
330
+ "f_orgid":Vue.user.orgid,
331
+ "f_building":this.data.f_building,
332
+ "f_userinfo_id":this.data.f_userinfoid,
333
+ "f_orgname":Vue.user.orgname,
334
+ "f_floor":this.data.f_floor,
335
+ "f_userinfo_code":this.data.f_userinfo_code,
336
+ "f_room":this.data.f_room,
337
+ "f_residential_area":this.data.f_residential_area,
338
+ "f_user_state":this.data.f_user_state,
339
+ "f_address":this.data.f_address,
340
+ "f_room_suffix":"室",
341
+ "f_user_phone":this.data.f_user_phone,
342
+ "f_slice_area":this.data.f_slice_area,
343
+ "f_depname":Vue.user.deps,
344
+ "f_user_name":this.data.f_user_name,
345
+ "f_building_suffix":"栋"
346
+ },
347
+ "callObj":null
348
+ }
349
+ //tag
350
+ //tag)
351
+ this.$showMessage('是否确认转维修!', ['confirm', 'cancel']).then((ress) => {
352
+ if (ress === 'confirm') {
353
+ new HttpResetClass().load('post',`${this.$androidUtil.getProxyUrl()}/rs/logic/callerSend`,mdata).then(res=> {
354
+ //tag)
355
+ if(res.data.f_service_id){
356
+ this.showModal=false
357
+ this.$showMessage('转维修成功,工单编号'+res.data.f_service_id)
358
+ }else{
359
+ this.$showMessage('网络异常,转维修失败,请稍后重试')
360
+ }
361
+ })
362
+ }
363
+ })
364
+
365
+ },
366
+ saveNoclick() {
367
+ // 禁用点击事件
368
+ $("#savebut").addClass("noclickbut");
369
+ //tag
370
+
371
+ // 5秒后启用点击事件
372
+ setTimeout(function(){
373
+ $("#savebut").removeClass("noclickbut");
374
+ },5000);
375
+ },
376
+ timeSet(val){
377
+ if (!val){
378
+ return
379
+ }
380
+ let time =new Date(val).getTime()
381
+ let time2=new Date().getTime()
382
+ if (time2>time) {
383
+ return true
384
+ }
385
+ },
386
+ imgback(val,isheader){
387
+ if(val && this.routeShow && isheader){
388
+ return require('../../../assets/xiangxia1.png')
389
+ }else{
390
+ return require('../../../assets/xiangyou1.png')
391
+ }
392
+ },
393
+ changediv(val){
394
+ //tag
395
+ return val
396
+ },
397
+ // 选择tab
398
+ tabSelect (item,number) {
399
+ this.header = item.header
400
+ //tag
401
+ //tag
402
+ //tag
403
+ //tag
404
+ // 处理关闭/显示 内容
405
+ if(this.number == number && !this.routeShow ){
406
+ this.routeShow = true
407
+ }else if(this.number == number && this.routeShow){
408
+ this.routeShow = false
409
+ }else if(this.number != item.complete){
410
+ this.routeShow = true
411
+ }
412
+ this.number = number
413
+ this.componentName = item.complete
414
+ //tag
415
+ if(item.complete == 'safecheck-devices'){
416
+ //tag
417
+ if(item.header != '燃气表' && this.data['device'+item.number].length == 0){
418
+ this.data['device' + item.number].push({})
419
+ }
420
+ //tag
421
+ //tag)
422
+ let idx=this.data['device' + item.number].length - 1
423
+ let itemprops = {
424
+ config:this.config,
425
+ device:this.devices[item.number-1],
426
+ idx:idx,
427
+ role:'inspect'
428
+ }
429
+ //tag
430
+ //tag)
431
+ //tag)
432
+ //tag
433
+ if(this.routeShow){
434
+ this.$goto(item.complete, itemprops, 'repair')
435
+ //tag
436
+ }
437
+ }else{
438
+ //tag
439
+ if(this.routeShow){
440
+ this.$goto(item.complete, {userinfo:this.data}, 'repair')
441
+ }
442
+ }
443
+ this.shupingshow = true
444
+ },
445
+ // 给组件添加参数
446
+ getImgPath() {
447
+ for (var i = 0; i < this.model.serviceacitivity[0].imgs.length; i++) {
448
+ this.ids += this.model.serviceacitivity[0].imgs[i].imgid + ','
449
+ }
450
+ this.ids = this.ids.substring(0, this.ids.length - 1)
451
+ if(this.ids){
452
+ this.getImgGen();
453
+ }
454
+ },
455
+ getImgGen(){
456
+ let http = new HttpResetClass()
457
+ http.load('POST','rs/sql/tel_singleTable_OrderBy', {data: {
458
+ items: '*',
459
+ tablename: 't_files',
460
+ condition: `id in (${this.ids})`,
461
+ orderitem: 'id'
462
+ }}, {resolveMsg: null, rejectMsg: null}).then((res) => {
463
+ for (let i = 0; i < res.data.length; i++) {
464
+ for (let j = 0; j < this.model.serviceacitivity[0].imgs.length; j++) {
465
+ //tag)
466
+ //tag
467
+ if (res.data[i].id.toString() === this.model.serviceacitivity[0].imgs[j].imgid) {
468
+ this.model.serviceacitivity[0].imgs[j] = Object.assign({}, res.data[i], this.model.serviceacitivity[0].imgs[j])
469
+ }
470
+ }
471
+
472
+ }
473
+ })
474
+ },
475
+
476
+ sortDetails(){
477
+ for (let i = 0; i < this.details.length; i++) {
478
+ if (this.details[i].details.length) {
479
+ for (let j = 0; j < this.details[i].details.length; j++) {
480
+ if (this.details[i].details[j].f_type === 'a') {
481
+ this.doordetails = {details: this.details[i].details}
482
+ break
483
+ }
484
+ if (this.details[i].details[j].f_type === 'b') {
485
+ this.devicedetails = {details: this.details[i].details}
486
+ break
487
+ }
488
+ if (this.details[i].details[j].f_type === 'c') {
489
+ this.cookdetails = {details: this.details[i].details}
490
+ break
491
+ }
492
+ }
493
+ }
494
+ }
495
+ },
496
+ // 复制数据
497
+ back () {
498
+ let _this = this
499
+ if(this.issee){
500
+ _this.$back()
501
+ return
502
+ }
503
+ this.$showMessage('所填写内容将不可恢复!', ['confirm', 'cancel']).then((res) => {
504
+ if (res === 'confirm') {
505
+ _this.$back()
506
+ }
507
+ })
508
+ },
509
+ confirm(){
510
+ this.$dispatch('confirm')
511
+ },
512
+ tick() {
513
+ this.timer = null
514
+ this.data.f_offsite_time = Util.toStandardTimeString()
515
+ this.timer = window.setTimeout(this.tick, 1000)
516
+ },
517
+ getRepairState() {
518
+ let repaired = true
519
+ this.data.f_defects.forEach((defect) => {
520
+ repaired = repaired & (defect.f_ratification == '已处理')
521
+ })
522
+ return repaired
523
+ },
524
+ verifyRepairDefects() {
525
+ this.data.f_repair_date = Util.toStandardTimeString()
526
+ this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
527
+ },
528
+ errorVerify() {
529
+ let hasError = this.verifyState()
530
+ if(hasError)
531
+ return hasError
532
+
533
+ if(this.data.f_entry_status != '入户')
534
+ return null
535
+ hasError = this.verifyUser()
536
+ if(hasError)
537
+ return hasError
538
+ hasError = this.verifyDevices()
539
+ if(hasError)
540
+ return hasError
541
+ hasError = this.verifyFeedback()
542
+ if(hasError)
543
+ return hasError
544
+ },
545
+ verifyState() {
546
+ if(Vue.android && this.data.f_entry_status == '未使用天然气' && this.data.f_nongasuser_path == Vue.nopic)
547
+ return '未使用天然气则必须拍照'
548
+ if(Vue.android && this.data.f_entry_status == '到访不遇' && this.data.f_noanswer_path == Vue.nopic)
549
+ return '到访不遇必须拍照'
550
+ },
551
+ verifyUser() {
552
+ //tag
553
+ //tag
554
+ //tag)
555
+ let prefix = '用户基本信息:'
556
+ if(Util.required(this.data.f_user_name))
557
+ return prefix + '用户名必须输入'
558
+ if(!(/^\d{11}$/.test(this.data.f_user_phone))) {
559
+
560
+ return '请输入正确的电话号码'
561
+ }
562
+ // if(Util.required(this.data.f_residential_area))
563
+ // return prefix + '小区名称必须输入'
564
+ if(Util.required(this.data.f_address))
565
+ return prefix + '地址必须输入'
566
+ },
567
+ verifyDevices() {
568
+ for (let dev in this.config) {
569
+ if (this.config[dev].checkmust == true) {
570
+ let error = true
571
+ for(let device in this.data) {
572
+ if (device.startsWith("device")) {
573
+ for (let item in this.data[device]) {
574
+ if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
575
+ error = false
576
+ }
577
+ }
578
+ }
579
+ }
580
+ if (error) {
581
+ return "请检查" + dev
582
+ }
583
+ }
584
+ }
585
+
586
+ for (let dev in this.config) {
587
+ for(let device in this.data) {
588
+ if (device.startsWith("device")) {
589
+ for (let item in this.data[device]) {
590
+ //检查每一条安检结果
591
+ if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
592
+ for (let i in this.data[device][item].f_items) {
593
+ for (let it in this.config[dev].items) {
594
+ if (it == this.data[device][item].f_items[i].f_item_name) {
595
+ let check=false
596
+ if (!this.data[device][item].f_items[i].f_item_value){
597
+ check=true
598
+ }else if (Array.isArray(this.data[device][item].f_items[i].f_item_value)){
599
+ if (this.data[device][item].f_items[i].f_item_value.length==0){
600
+ check=true
601
+ }
602
+ }
603
+
604
+ if(this.config[dev].items[it].type=='picture' && this.config[dev].items[it].checkmust == true && !this.data[device][item].f_items[i].f_path){
605
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
606
+ }
607
+ if (this.config[dev].items[it].type !='picture' && this.config[dev].items[it].checkmust == true && check) {
608
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
609
+ }
610
+ }
611
+ }
612
+ //检查安检下拉结果
613
+ if (this.data[device][item].f_items[i].type == 'selector' || this.data[device][item].f_items[i].type == 'radio') {
614
+ if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
615
+ return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + this.data[device][item].f_items[i].f_item_value + "选中必须拍照"
616
+ }
617
+ }
618
+ }
619
+ }
620
+ }
621
+ }
622
+ }
623
+ }
624
+ },
625
+
626
+
627
+ verifyFeedback() {
628
+ let prefix = '拍照签名:'
629
+ //tag)
630
+ if(Vue.android && (!this.data.f_overall_imgs || this.data.f_overall_imgs.length == 0) && this.data.f_entry_status == '入户')
631
+ return prefix + '必须有安检总体照片'
632
+ if(Vue.android && (!this.data.f_sign_path || this.data.f_sign_path.length == 0) && this.data.f_entry_status == '入户')
633
+ return prefix + '必须有用户签名'
634
+ if(Vue.android && this.data.f_defect_notified && this.data.f_notified_path == Vue.nopic)
635
+ return prefix + '下发安检通知书则必须给通知书拍照'
636
+ if(Vue.android && this.data.f_blacklist && this.data.f_blocking_cause=='')
637
+ return prefix + '请填写拉黑原因'
638
+ if(!this.data.f_client_evaluation && this.data.f_entry_status == '入户')
639
+ return prefix + '请选择服务评价'
640
+ },
641
+
642
+ getAllDefect() {
643
+ let checkResults = {
644
+ result: '正常',
645
+ data: []
646
+ }
647
+ let value = ''
648
+ let codata = JSON.parse(JSON.stringify(this.data))
649
+ //tag)
650
+ //tag)
651
+ codata.f_devices = []
652
+ this.f_devices = []
653
+ for (let device in codata) {
654
+ let f_device_type
655
+ if (device.startsWith("device")) {
656
+ //tag)
657
+ let hasOther = ''
658
+ let otherValue = null
659
+ for (let item in codata[device]) {
660
+ codata[device][item].f_create_time = Util.toStandardTimeString()
661
+ // if (codata[device].length > 1) {
662
+ // let j = Number.parseInt(item) + 1
663
+ // f_device_type = `${codata[device][item].f_device_type}${j}`
664
+ // } else {
665
+ // f_device_type = codata[device][item].f_device_type
666
+ // }
667
+ //tag
668
+ //tag
669
+ //tag)
670
+ //tag)
671
+ for (let i = 0; i < codata[device][item].f_items.length ; i++) {
672
+ //tag
673
+ if(i == 'sum'){
674
+ continue
675
+ }
676
+ //tag)
677
+ var items = codata[device][item].f_items[i]
678
+ items.f_create_time = Util.toStandardTimeString()
679
+ //tag)
680
+ items.f_item_lists = []
681
+ //tag)
682
+ // //tag)
683
+ // //tag} name => ${JSON.stringify(items.f_item_name)} value => ${JSON.stringify(items.f_item_value)}`)
684
+ // console.log(`f_is_defect => ${this.config[codata[device][item]
685
+ // .f_device_type]
686
+ // .items[items.f_item_name]
687
+ // .options
688
+ // .find((option)=>option.data === items.f_item_value)
689
+ // .map((option)=>option.f_is_defect)}`)
690
+ // if (items.f_is_defect && (items.f_is_defect == true || items.f_is_defect == 'true')) {
691
+ // //tag
692
+ // checkResults.result = '有隐患'
693
+ // //tag)
694
+ // //tag)
695
+ // // this.$set('checkResult.' + items.f_item_name, items.f_item_value)
696
+ // this.checkResult[items.f_item_name] = items.f_item_value
697
+ // //tag)
698
+ // // this.$set('checkResultsss.' + items.f_item_name, `${f_device_type}${items.f_item_value}`)
699
+ // // //tag)
700
+ // }
701
+ if (items.type == 'selector') {
702
+ items.selected = []
703
+ } else if (items.type == 'inputSelector') {
704
+ items.selected = ''
705
+ }
706
+ //遍历配置项 将所选隐患项的配置信息放入保存的数据中
707
+ let f_is_defect //是否是隐患
708
+ let f_defect_level //是否是隐患
709
+ let f_item_name = items.f_item_name
710
+ let f_item_value
711
+ let f_is_eliminate //隐患是否消除
712
+ let f_meternumber = ''
713
+ let f_user_defects = [] // 用户所有隐患
714
+ //tag
715
+ //tag
716
+ if (items.type == 'selector' || items.type == 'checkbox' || items.type == 'radio') {
717
+ for (let i in items.f_item_value) {
718
+ let configItems = this.config[codata[device][item].f_device_type].items[f_item_name]
719
+ //tag)
720
+ for (let k in configItems.options) {
721
+ //tag)
722
+ if (items.f_item_value[i] === configItems.options[k].data) {
723
+
724
+ f_is_defect = configItems.options[k].isdefect
725
+ f_item_value = items.f_item_value[i]
726
+ f_defect_level = configItems.options[k].level
727
+
728
+ //tag
729
+ //tag
730
+ //tag
731
+
732
+ if (f_is_defect) {
733
+ if (checkResults.result !== '有隐患') {
734
+ checkResults.result = '有隐患'
735
+ }
736
+ if (!this.checkResult.hasOwnProperty(f_item_name)) {
737
+ //tag
738
+ this.checkResult[f_item_name] = []
739
+ }
740
+
741
+ //tag
742
+ this.checkResult[f_item_name].push(f_item_value)
743
+
744
+ }
745
+
746
+ let items_list = {
747
+ f_is_defect: f_is_defect,
748
+ f_item_value: f_item_value,
749
+ f_defect_level: f_defect_level,
750
+ f_is_eliminate: null,
751
+ f_create_time: Util.toStandardTimeString()
752
+ }
753
+ if (!items.f_item_lists) {
754
+ //tag
755
+ items.f_item_lists = []
756
+ //tag)
757
+ if (JSON.stringify(items_list) !== '{}') {
758
+ //tag
759
+ items.f_item_lists.push(items_list)
760
+ }
761
+ } else {
762
+ //tag)
763
+ if (JSON.stringify(items_list) !== '{}') {
764
+ //tag
765
+ items.f_item_lists.push(items_list)
766
+ }
767
+ }
768
+ }
769
+ }
770
+ }
771
+ } else {
772
+ let configItems = this.config[codata[device][item].f_device_type].items[items.f_item_name]
773
+ //tag)
774
+ f_is_defect = items.isdefect
775
+ f_defect_level = items.level
776
+ f_item_value = items.f_item_value
777
+ //tag
778
+ //tag
779
+ //tag
780
+ let items_list = {
781
+ f_is_defect: f_is_defect,
782
+ f_item_value: f_item_value,
783
+ f_defect_level: f_defect_level,
784
+ f_create_time: Util.toStandardTimeString()
785
+ }
786
+ if (f_is_defect && f_item_value) {
787
+ items.f_is_defect = true
788
+ if (checkResults.result !== '有隐患') {
789
+ checkResults.result = '有隐患'
790
+ }
791
+ if (!this.checkResult.hasOwnProperty(items.f_item_name)) {
792
+ //tag
793
+ this.checkResult[items.f_item_name] = []
794
+ }
795
+
796
+ //tag
797
+ this.checkResult[items.f_item_name].push(f_item_value)
798
+
799
+ }
800
+ //tag)
801
+ //tag)
802
+ if (!items.f_item_lists) {
803
+ //tag
804
+ items.f_item_lists = []
805
+ if (JSON.stringify(items_list) != '{}') {
806
+ //tag
807
+ items.f_item_lists.push(items_list)
808
+ }
809
+ } else {
810
+ // items.f_item_lists[0].f_item_value = f_item_value
811
+ if (JSON.stringify(items_list) != '{}') {
812
+ //tag
813
+ //tag)
814
+ //tag)
815
+ //tag
816
+ items.f_item_lists.push(items_list)
817
+ }
818
+ }
819
+ }
820
+ if (hasOther !== '' && otherValue !== null) {
821
+ //tag
822
+ this.checkResult[hasOther].push(otherValue)
823
+ hasOther = ''
824
+ otherValue = null
825
+ }
826
+ items.f_item_value = ''
827
+ }
828
+ //tag)
829
+ this.f_devices.push(codata[device][item])
830
+ }
831
+ }
832
+ }
833
+ if (this.checkResult) {
834
+ for (let key in this.checkResult) {
835
+ // 上次安检结果数据组织
836
+ //tag
837
+ //tag
838
+ let temp = {}
839
+ temp[key] = this.checkResult[key].join(',')
840
+ checkResults.data.push(temp)
841
+ // this.newcheckResult[key] = this.checkResult[key]
842
+ // checkResults.data.push(this.newcheckResult)
843
+ //tag)
844
+ // this.newcheckResult = {}
845
+ }
846
+ this.checkResult = {}
847
+ }
848
+ //tag
849
+ //tag)
850
+ codata.f_defect_content = JSON.stringify(checkResults)
851
+ this.data.f_defect_content = JSON.stringify(checkResults)
852
+ //tag
853
+ return codata
854
+ },
855
+ uploadCheckPaper(){
856
+ this.isSend = true
857
+ this.saveNoclick()
858
+ //tag
859
+ //tag
860
+ let errString = this.errorVerify()
861
+ if (errString) {
862
+ //tag
863
+ //tag
864
+ //tag
865
+ if (Vue.android){
866
+ // if(this.isUpload){
867
+ // this.isUpload = false
868
+ // }
869
+ this.isSend = false
870
+ this.$showMessage(errString)
871
+ }
872
+ return
873
+ } else {
874
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
875
+ this.$set('data.f_upload_time', Util.toStandardTimeString())
876
+ this.$set('data.f_upload_date', Util.toStandardTimeString())
877
+ //tag
878
+ this.data.f_complete = '已完成'
879
+ this.disableTimer()
880
+ }
881
+ //tag
882
+ this.onlySave = false
883
+ let res = this.save()
884
+ // if(res) {
885
+ // try {
886
+ // let codata = this.getAllDefect()
887
+ // //获取微信推送内容
888
+ // let WxResult = this.getWeixin(codata)
889
+ // let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
890
+ // f_check_item_id: this.data.f_check_item_id
891
+ // })
892
+ // //如果是转维修上传,则不做校验,上传完成后自动转维修
893
+ // //tag
894
+ // //tag
895
+ // if(!this.isToRepair){
896
+ // if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
897
+ // //tag
898
+ // //tag
899
+ // if(!this.isSafeCheckToRepair){
900
+ // this.$showMessage('有未处理的隐患,请前往拍照上传中将安检转为维修单!')
901
+ // return
902
+ // }
903
+ // }
904
+ // }
905
+ // //tag
906
+ // for (let key in codata){
907
+ // if(key.startsWith("device")){
908
+ // codata[key] = []
909
+ // }
910
+ // }
911
+ // //tag}`)
912
+ //
913
+ // //tag
914
+ // let isStart = true
915
+ // let res
916
+ // for (let i in this.f_devices){
917
+ // res = HostApp.organizeJSON({isStart:isStart,isDevice:true,device:this.f_devices[i]})
918
+ // if(res.code == 200){
919
+ // isStart = false
920
+ // }else{
921
+ // this.$showMessage("保存失败!")
922
+ // }
923
+ // }
924
+ // let result = HostApp.organizeJSON({
925
+ // isStart:false,
926
+ // isJSON:true,
927
+ // jsonstr:{
928
+ // f_check_item_id: this.data.f_check_item_id,
929
+ // f_checker_id: this.data.f_checker_id,
930
+ // row: codata
931
+ // }
932
+ // })
933
+ // if(result.code == 200){
934
+ // HostApp.__this__ = this
935
+ // this.runSyncLogic('上传安检信息','javascript:HostApp.__this__.uploadCallBack()',1)
936
+ // }
937
+ //
938
+ //
939
+ // // let response = this.$androidUtil.bzLogic('上传安检信息', {
940
+ // // f_check_item_id: this.data.f_check_item_id,
941
+ // // f_checker_id: this.data.f_checker_id,
942
+ // // row: codata
943
+ // // })
944
+ // // if (response.code == 200) {
945
+ // // //tag
946
+ // // //tag)
947
+ // // let f_paper_id
948
+ // // if(response.data != '' && response.data != null){
949
+ // // f_paper_id = JSON.parse(response.data).id
950
+ // // }
951
+ // // this.$set('data.f_paper_id', f_paper_id)
952
+ // // //tag
953
+ // // //tag)
954
+ // // //tag
955
+ // // //tag)
956
+ // // for (let device in this.data){
957
+ // // //tag
958
+ // // //tag)
959
+ // // if(device.startsWith("device")){
960
+ // // for(let devices of this.data[device]) {
961
+ // // devices.f_paper_id = f_paper_id
962
+ // // let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
963
+ // // row: devices
964
+ // // })
965
+ // // //tag}`)
966
+ // // if(ret.code == 200){
967
+ // // //tag
968
+ // // devices.f_device_id = JSON.parse(ret.data.f_device_id).id
969
+ // // }
970
+ // // //tag
971
+ // // //tag)
972
+ // // if (ret.code != 200) {
973
+ // // //TODO 失败后处理
974
+ // // // this.isUpload = false
975
+ // // this.$showMessage("上传失败!")
976
+ // // return false
977
+ // // }
978
+ // // }
979
+ // // }
980
+ // // }
981
+ // // // for (let device of this.f_devices) {
982
+ // // // device.f_paper_id = f_paper_id
983
+ // // // //tag
984
+ // // // //tag)
985
+ // // // let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
986
+ // // // row: device
987
+ // // // })
988
+ // // // //tag
989
+ // // // if (ret.code != 200) {
990
+ // // // //TODO 失败后处理
991
+ // // // HostApp.alert("上传失败!")
992
+ // // // return false
993
+ // // // }
994
+ // // // }
995
+ // // let result = this.$androidUtil.bzLogic('FinishUpload',
996
+ // // {
997
+ // // f_check_item_id: this.data.f_check_item_id,
998
+ // // f_userinfo_id: codata.f_userinfoid,
999
+ // // f_last_check_result: codata.f_defect_content
1000
+ // // })
1001
+ // // if(result.code == 200){
1002
+ // // // this.$showAlert('上传成功!', 'success', 2000)
1003
+ // // this.$showMessage('上传成功!')
1004
+ // // this.isStrat=false
1005
+ // // if(url != "" ){
1006
+ // // this.$resetpost(`${url}`,{data:WxResult})
1007
+ // // }
1008
+ // // return true
1009
+ // // }else{
1010
+ // // // this.isUpload = false
1011
+ // // this.$showMessage("上传失败!")
1012
+ // // return false
1013
+ // // }
1014
+ // // }else{
1015
+ // // // this.isUpload = false
1016
+ // // this.$showMessage("上传失败!")
1017
+ // // return false
1018
+ // // }
1019
+ // }catch (e) {
1020
+ // //tag)
1021
+ // // this.isUpload = false
1022
+ // this.$showMessage("上传失败!")
1023
+ // }
1024
+ // }
1025
+ },
1026
+ save(type) {
1027
+ this.saveNoclick()
1028
+ //tag
1029
+ //tag
1030
+ if(type == 'temp'){
1031
+ this.data.f_complete = '未完成'
1032
+ this.disableTimer()
1033
+ }else {
1034
+ let errString = this.errorVerify()
1035
+ if (errString) {
1036
+ //tag
1037
+ //tag
1038
+ //tag
1039
+ if (Vue.android){
1040
+ this.$showMessage(errString)
1041
+ }
1042
+ this.isSend = false
1043
+ return
1044
+ } else {
1045
+ this.data.f_complete = '已完成'
1046
+ this.$set('data.f_offsite_time', Util.toStandardTimeString())
1047
+ this.disableTimer()
1048
+ }
1049
+ }
1050
+ //tag
1051
+ if(this.data.f_blacklist!='是'){
1052
+ delete this.data.f_blocking_cause
1053
+ }
1054
+ if (this.data.f_entry_status == '入户') {
1055
+ this.data.f_rejectchecks_path = []
1056
+ this.data.f_rejectcheck_path = null
1057
+ this.data.f_rejectcheck1_path = null
1058
+ this.data.f_rejectcheck2_path = null
1059
+ this.data.f_noanswers_path=[]
1060
+ this.data.f_noanswer_path = null
1061
+ this.data.f_noanswer1_path = null
1062
+ this.data.f_noanswer2_path = null
1063
+ }else if (this.data.f_entry_status == '到访不遇') {
1064
+ this.data.f_rejectchecks_path = []
1065
+ this.data.f_rejectcheck_path = null
1066
+ this.data.f_rejectcheck1_path = null
1067
+ this.data.f_rejectcheck2_path = null
1068
+ }else if (this.data.f_entry_status == '拒检') {
1069
+ this.data.f_noanswers_path=[]
1070
+ this.data.f_noanswer_path = null
1071
+ this.data.f_noanswer1_path = null
1072
+ this.data.f_noanswer2_path = null
1073
+ }
1074
+ // try {
1075
+ let codata = this.getAllDefect()
1076
+ //tag
1077
+ //tag}`)
1078
+ for (let key in codata) {
1079
+ if (key.startsWith("device")) {
1080
+ //tag)
1081
+ codata[key] = []
1082
+ }
1083
+ }
1084
+ //tag}`)
1085
+ //tag}`)
1086
+ //tag
1087
+ if (Vue.android) {
1088
+ //tag
1089
+ let value = this.$androidUtil.path({
1090
+ alias: 'getUserinfomation',
1091
+ data: {condition: "f_userinfoid = '" + this.item.f_userinfoid + "' and f_no_checkplan = '无计划安检'"}
1092
+ })
1093
+ //tag)
1094
+ if (this.item.f_no_checkplan == '无计划安检' && this.item.f_no_checkplan != '打回') {
1095
+ // let result = this.$androidUtil.bzLogic('SafeSaveNoPaper', {
1096
+ // f_check_item_id: this.data.f_check_item_id,
1097
+ // f_checker_id: this.data.f_checker_id,
1098
+ // f_upload_state:'未传',
1099
+ // row: codata
1100
+ // })
1101
+ //tag
1102
+ let isStart = true
1103
+ // let res
1104
+ // for (let i in this.f_devices) {
1105
+ // res = HostApp.organizeJSON({isStart: isStart, isDevice: true, device: this.f_devices[i]})
1106
+ // if (res.code == 200) {
1107
+ // isStart = false
1108
+ // } else {
1109
+ // this.$showMessage("保存失败!")
1110
+ // }
1111
+ // }
1112
+ // let result = HostApp.organizeJSON({
1113
+ // isStart: false,
1114
+ // isJSON: true,
1115
+ // jsonstr: {
1116
+ // f_check_item_id: this.data.f_check_item_id,
1117
+ // f_checker_id: this.data.f_checker_id,
1118
+ // f_upload_state: '未传',
1119
+ // row: codata
1120
+ // }
1121
+ // })
1122
+ codata.f_devices = this.f_devices
1123
+ let param = {
1124
+ f_check_item_id: this.data.f_check_item_id,
1125
+ f_checker_id: this.data.f_checker_id,
1126
+ f_upload_state: '未传',
1127
+ row: codata
1128
+ }
1129
+ //tag)
1130
+ let paramStr = JSON.stringify(param)
1131
+ // 多长截断一次
1132
+ let subLength = 800
1133
+ for (let i = 0; i < paramStr.length; i += subLength) {
1134
+ HostApp.param_cache(paramStr.substr(i, subLength))
1135
+ }
1136
+ HostApp.__this__ = this
1137
+ HostApp.syncLogic({
1138
+ // logic别名,key必须为logic
1139
+ 'logic': 'SafeSaveNoPaper',
1140
+ // 回调执行方法名,key必须为callback
1141
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
1142
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1143
+ // 执行回调方法传入key为backresult
1144
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1145
+ 'backresult': 1
1146
+ })
1147
+ } else {
1148
+ //tag
1149
+ let isStart = true
1150
+ let res
1151
+ //tag)
1152
+ // for (let i in this.f_devices) {
1153
+ // //tag)
1154
+ // for (let j = 0; j < this.f_devices[i].f_items.length; j++) {
1155
+ // //tag)
1156
+ // }
1157
+ // res = HostApp.organizeJSON({isStart: isStart, isDevice: true, device: this.f_devices[i]})
1158
+ // //tag)
1159
+ // if (res.code == 200) {
1160
+ // isStart = false
1161
+ // } else {
1162
+ // this.$showMessage("保存失败!")
1163
+ // }
1164
+ // }
1165
+ //tag)
1166
+ //tag)
1167
+ //tag)
1168
+ // let result = HostApp.organizeJSON({
1169
+ // isStart: false,
1170
+ // isJSON: true,
1171
+ // jsonstr: {
1172
+ // f_check_item_id: this.data.f_check_item_id,
1173
+ // f_checker_id: this.data.f_checker_id,
1174
+ // row: codata
1175
+ // }
1176
+ // })
1177
+ codata.f_devices = this.f_devices
1178
+ let param = {
1179
+ f_check_item_id: this.data.f_check_item_id,
1180
+ f_checker_id: this.data.f_checker_id,
1181
+ row: codata
1182
+ }
1183
+ //tag)
1184
+ let paramStr = JSON.stringify(param)
1185
+ // 多长截断一次
1186
+ let subLength = 800
1187
+ for (let i = 0; i < paramStr.length; i += subLength) {
1188
+ HostApp.param_cache(paramStr.substr(i, subLength))
1189
+ }
1190
+ HostApp.__this__ = this
1191
+ HostApp.syncLogic({
1192
+ // logic别名,key必须为logic
1193
+ 'logic': '保存安检单信息',
1194
+ // 回调执行方法名,key必须为callback
1195
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
1196
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1197
+ // 执行回调方法传入key为backresult
1198
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1199
+ 'backresult': 1
1200
+ })
1201
+ }
1202
+
1203
+ } else {
1204
+ //tag
1205
+ let value = this.$androidUtil.path({
1206
+ alias: 'getUserinfomation',
1207
+ data: {condition: "f_userinfoid = '" + this.item.f_userinfoid + "' and f_no_checkplan = '无计划安检'"}
1208
+ })
1209
+
1210
+ if (this.item.f_no_checkplan == '无计划安检' && value.data.length == 0 && this.item.f_no_checkplan != '打回') {
1211
+ this.$androidUtil.bzLogic('SafeSaveNoPaper', {
1212
+ f_check_item_id: this.data.f_check_item_id,
1213
+ f_checker_id: this.data.f_checker_id,
1214
+ f_upload_state: '未传',
1215
+ row: codata
1216
+ }).then((res) => {
1217
+ if (res.data.code == 200) {
1218
+ //保存devices
1219
+ this.$androidUtil.bzLogic('getPaperInfo', {
1220
+ f_check_item_id: this.data.f_check_item_id
1221
+ }).then((res) => {
1222
+ //tag
1223
+ if (res.data.code == 200) {
1224
+
1225
+ let f_paper_id = res.data.data[0].id
1226
+ for (let device of this.f_devices) {
1227
+ device.f_paper_id = f_paper_id
1228
+ //tag
1229
+ this.$androidUtil.bzLogic('saveDevice', {
1230
+ row: device
1231
+ }).then((ret) => {
1232
+ //tag
1233
+ if (ret.code != 200) {
1234
+ // if(this.isUpload){
1235
+ // this.isUpload = false
1236
+ // }
1237
+ //TODO 失败后处理
1238
+ this.$showMessage("保存失败!")
1239
+ return false
1240
+ }
1241
+ })
1242
+ }
1243
+ }
1244
+ })
1245
+ // this.$showAlert('保存成功!', 'success', 2000)
1246
+ this.$showMessage('保存成功!')
1247
+ return true
1248
+ } else {
1249
+ // if(this.isUpload){
1250
+ // this.isUpload = false
1251
+ // }
1252
+ this.$showMessage("保存失败!")
1253
+ return false
1254
+ }
1255
+ })
1256
+ } else {
1257
+ this.$androidUtil.bzLogic('保存安检单信息', {
1258
+ f_check_item_id: this.data.f_check_item_id,
1259
+ f_checker_id: this.data.f_checker_id,
1260
+ row: codata
1261
+ }).then((res) => {
1262
+ //tag
1263
+ if (res.data.code == 200) {
1264
+ //保存devices
1265
+ this.$androidUtil.bzLogic('getPaperInfo', {
1266
+ f_check_item_id: this.data.f_check_item_id
1267
+ }).then((res) => {
1268
+ //tag
1269
+ if (res.data.code == 200) {
1270
+
1271
+ let f_paper_id = res.data.data[0].id
1272
+ for (let device of this.f_devices) {
1273
+ device.f_paper_id = f_paper_id
1274
+ //tag
1275
+ this.$androidUtil.bzLogic('saveDevice', {
1276
+ row: device
1277
+ }).then((ret) => {
1278
+ //tag
1279
+ if (ret.code != 200) {
1280
+ // if(this.isUpload){
1281
+ // this.isUpload = false
1282
+ // }
1283
+ //TODO 失败后处理
1284
+ this.$showMessage("保存失败!")
1285
+ return false
1286
+ }
1287
+ })
1288
+ }
1289
+ }
1290
+ })
1291
+ // this.$showAlert('保存成功!', 'success', 2000)
1292
+ this.$showMessage('保存成功!')
1293
+ return true
1294
+ } else {
1295
+ // if(this.isUpload){
1296
+ // this.isUpload = false
1297
+ // }
1298
+ this.$showMessage("保存失败!")
1299
+ return false
1300
+ }
1301
+ })
1302
+ }
1303
+ }
1304
+ // }catch (e) {
1305
+ // //tag)
1306
+ // // this.isUpload = false
1307
+ // this.$showMessage("保存失败!")
1308
+ // }
1309
+ },
1310
+ runSyncLogic(logic,callback,backresult){
1311
+ HostApp.runSyncLogic({
1312
+ // logic别名,key必须为logic
1313
+ 'logic': logic,
1314
+ // 回调执行方法名,key必须为callback
1315
+ 'callback': callback,
1316
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1317
+ // 执行回调方法传入key为backresult
1318
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1319
+ 'backresult':backresult
1320
+ })
1321
+ },
1322
+ logicWithHint(logic,data,callback,backresult){
1323
+ HostApp.logicWithHint({
1324
+ // logic别名,key必须为logic
1325
+ 'logic': logic,
1326
+ // 回调执行方法名,key必须为callback
1327
+ 'callback': callback,
1328
+ // logic执行需要的业务参数
1329
+ 'data': data,
1330
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1331
+ // 执行回调方法传入key为backresult
1332
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1333
+ 'backresult':backresult
1334
+ })
1335
+ },
1336
+ saveCallBack(jo){
1337
+ this.isSend = false
1338
+ //tag)
1339
+ if(jo.state == 'ok'){
1340
+ let res = JSON.parse(jo.result)
1341
+ //tag)
1342
+ if(res.code == 200){
1343
+ //tag
1344
+ if(!this.onlySave){
1345
+ this.isSend = true
1346
+ let codata = this.getAllDefect()
1347
+ //获取微信推送内容
1348
+ // let WxResult = this.getWeixin(codata)
1349
+ let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
1350
+ f_check_item_id: this.data.f_check_item_id
1351
+ })
1352
+ //如果是转维修上传,则不做校验,上传完成后自动转维修
1353
+ //tag
1354
+ //tag
1355
+ if(!this.isToRepair){
1356
+ if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
1357
+ //tag
1358
+ //tag
1359
+ if(!this.isSafeCheckToRepair){
1360
+
1361
+ }
1362
+ }
1363
+ }
1364
+ //tag
1365
+ for (let key in codata){
1366
+ if(key.startsWith("device")){
1367
+ codata[key] = []
1368
+ }
1369
+ }
1370
+ //tag}`)
1371
+
1372
+ //tag
1373
+ // let isStart = true
1374
+ // let res
1375
+ // for (let i in this.f_devices){
1376
+ // res = HostApp.organizeJSON({isStart:isStart,isDevice:true,device:this.f_devices[i]})
1377
+ // if(res.code == 200){
1378
+ // isStart = false
1379
+ // }else{
1380
+ // this.$showMessage("上传失败!")
1381
+ // return
1382
+ // }
1383
+ // }
1384
+ // let result = HostApp.organizeJSON({
1385
+ // isStart:false,
1386
+ // isJSON:true,
1387
+ // jsonstr:{
1388
+ // f_check_item_id: this.data.f_check_item_id,
1389
+ // f_checker_id: this.data.f_checker_id,
1390
+ // row: codata
1391
+ // }
1392
+ // })
1393
+ codata.f_devices = this.f_devices
1394
+ let param = {
1395
+ f_check_item_id: this.data.f_check_item_id,
1396
+ f_checker_id: this.data.f_checker_id,
1397
+ row: codata
1398
+ }
1399
+ //tag)
1400
+ let paramStr = JSON.stringify(param)
1401
+ // 多长截断一次
1402
+ let subLength = 800
1403
+ for (let i = 0; i < paramStr.length; i += subLength) {
1404
+ HostApp.param_cache(paramStr.substr(i, subLength))
1405
+ }
1406
+ HostApp.__this__ = this
1407
+ HostApp.syncLogic({
1408
+ // logic别名,key必须为logic
1409
+ 'logic': '上传安检信息',
1410
+ // 回调执行方法名,key必须为callback
1411
+ 'callback': 'javascript:HostApp.__this__.uploadCallBack()',
1412
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
1413
+ // 执行回调方法传入key为backresult
1414
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
1415
+ 'backresult': 1
1416
+ })
1417
+ }else{
1418
+ this.$showMessage('保存成功!')
1419
+ if(this.clickBack){
1420
+ this.isStrat = false
1421
+ this.$dispatch('confirm')
1422
+ //this.$back()
1423
+ }
1424
+ }
1425
+ }else{
1426
+ this.$showMessage('保存失败!')
1427
+ return
1428
+ }
1429
+ }else{
1430
+ this.$showMessage('服务器内部错误,保存失败!')
1431
+ return
1432
+ }
1433
+ },
1434
+ uploadCallBack(jo){
1435
+ this.isSend = false
1436
+ //获取微信推送路径
1437
+ let url = ""
1438
+ if(Vue.config.safecheck != undefined) {
1439
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
1440
+ if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
1441
+ url = Vue.config.safecheck.ApproveConfig.weixinurl
1442
+ }
1443
+ }
1444
+ }
1445
+ //tag)
1446
+ //tag)
1447
+ if(jo.state == 'ok'){
1448
+ let res = JSON.parse(jo.result)
1449
+ //tag)
1450
+ //tag)
1451
+ if(res.code == 200){
1452
+ this.$set('data.f_paper_id', res.id)
1453
+ this.isStrat=false
1454
+ if(url != ""){
1455
+ this.$resetpost(`${url}`,{data:WxResult})
1456
+ }
1457
+ //tag
1458
+ if(this.isToRepair){
1459
+ for (let device in this.data){
1460
+ if(device.startsWith("device")){
1461
+ this.data[device] = []
1462
+ if(res.data.length > 0){
1463
+ for(let i in res.data[0].f_devices){
1464
+ if(this.data[device].length > 0){
1465
+ if(this.data[device][0].f_device_type == res.data[0].f_devices[i].f_device_type){
1466
+ this.data[device].push(res.data[0].f_devices[i])
1467
+ res.data[0].f_devices.splice(i,1)
1468
+ }
1469
+ }else{
1470
+ this.data[device].push(res.data[0].f_devices[i])
1471
+ res.data[0].f_devices.splice(i,1)
1472
+ }
1473
+ }
1474
+ }
1475
+ }
1476
+ }
1477
+ this.todo()
1478
+ }else{
1479
+ this.$showMessage('上传成功!')
1480
+ //tag
1481
+ this.$dispatch('confirm')
1482
+ // this.$back()
1483
+ }
1484
+ }else if(res.code == 309){
1485
+ this.$showMessage('该安检单已作废!')
1486
+ //tag
1487
+ this.$dispatch('confirm')
1488
+ }else{
1489
+ this.$showMessage('上传失败!')
1490
+ this.onlySave = true
1491
+ }
1492
+ }else {
1493
+ this.$showMessage('服务器内部错误,上传失败!')
1494
+ this.onlySave = true
1495
+ }
1496
+ },
1497
+ safecheckToRepairCallBack(jo){
1498
+ //获取微信推送路径
1499
+ if(jo.state == 'ok'){
1500
+ let res = JSON.parse(jo.result)
1501
+ //tag)
1502
+ if(res.code == 200){
1503
+ //tag
1504
+ if(res.data.code == 200){
1505
+ this.$showMessage('上传并转维修成功!')
1506
+ }else{
1507
+ this.$showMessage('上传并转维修成功,回写安检单失败!')
1508
+ }
1509
+ this.$dispatch('confirm')
1510
+ // this.$back()
1511
+ }else{
1512
+ this.$showMessage('上传失败!')
1513
+ this.onlySave = true
1514
+ }
1515
+ }else{
1516
+ this.$showMessage('服务器内部错误,上传失败!')
1517
+ this.onlySave = true
1518
+ }
1519
+ },
1520
+ todo(){
1521
+ let gen = getRepairParam(this)
1522
+ co(gen)
1523
+ },
1524
+ undo(){
1525
+ this.showCheckToRepair = !this.showCheckToRepair
1526
+ this.model.serviceacitivity[0].f_reciever = ''
1527
+ this.model.serviceacitivity[0].f_meetunit = ''
1528
+ this.model.f_repairtype = ''
1529
+ this.meading = '转站点'
1530
+ },
1531
+ disableTimer() {
1532
+ if(this.timer) {
1533
+ window.clearTimeout(this.timer)
1534
+ this.timer = null
1535
+ }
1536
+ },
1537
+ loaded(paper) {
1538
+ if(!paper.hasOwnProperty('id')) {
1539
+ this.$showMessage("该安检单在手机上已经不存在,可能是卸载过程序。可以进入重新安检,或返回安检计划。")
1540
+ this.init()
1541
+ } else {
1542
+ Util.booleanFilter(paper)
1543
+ HostApp.__this__.$set('data', paper)
1544
+ HostApp.__this__.$goto('safecheck-userinfo', {}, 'paper-router')
1545
+ // 如果打回重检则重新计时
1546
+ //tag
1547
+ if(HostApp.__this__.role == 'inspect'
1548
+ && HostApp.__this__.data.f_approved
1549
+ && HostApp.__this__.data.f_approved == '打回') {
1550
+ //tag
1551
+ HostApp.__this__.data.f_onsite_time = Util.toStandardTimeString()
1552
+ HostApp.__this__.tick()
1553
+ }
1554
+ }
1555
+ HostApp.__callback__ = null
1556
+ HostApp.__this__ = null
1557
+ },
1558
+ S4() {
1559
+ return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
1560
+ },
1561
+ extend(initalObj, finalObj) {
1562
+ var obj = finalObj || {};
1563
+ for (var i in initalObj) {
1564
+ var prop = initalObj[i];
1565
+
1566
+ // 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
1567
+ if (prop === obj) {
1568
+ continue;
1569
+ }
1570
+
1571
+ if (typeof prop === 'object') {
1572
+ if (obj[i]) {
1573
+ this.extend(obj[i], prop)
1574
+ } else {
1575
+ obj[i] = prop;
1576
+ }
1577
+ }
1578
+ }
1579
+ return obj;
1580
+ },
1581
+ // async isoverDate(){
1582
+ // let res= await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/androidGetuserinfo`, {data:{
1583
+ // condition:"f_plan_item_id='"+this.item.id+"'"
1584
+ // }
1585
+ // })
1586
+ // this.isneedDate=res.data[0]["f_subscribe_date"]
1587
+ // },
1588
+ putDevices() {
1589
+ //tag)
1590
+ //tag)
1591
+ this.$set('data.approve', "true")
1592
+ this.$set('data.writeback', "false")
1593
+ if (Vue.config.safecheck != undefined) {
1594
+ if (Vue.config.safecheck.ApproveConfig != undefined) {
1595
+ if (Vue.config.safecheck.ApproveConfig.approve != undefined) {
1596
+ this.$set('data.approve', Vue.config.safecheck.ApproveConfig.approve)
1597
+ }
1598
+ if (Vue.config.safecheck.ApproveConfig.writeback != undefined) {
1599
+ this.$set('data.writeback', Vue.config.safecheck.ApproveConfig.writeback)
1600
+ }
1601
+ if (Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
1602
+ this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
1603
+ }
1604
+ }
1605
+ //tag
1606
+ //tag)
1607
+ //tag)
1608
+ //tag
1609
+ if(this.item.f_user_type == '民用'){
1610
+ // 民用户
1611
+
1612
+ if (Vue.config.safecheck.DevicesConfig != undefined){
1613
+ if(this.item.f_safecheck_type == undefined || this.item.f_safecheck_type == '' || Vue.config.safecheck.SafecheckType == undefined) {
1614
+ this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
1615
+ }else{
1616
+ //tag
1617
+ //tag
1618
+ //tag
1619
+ this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_user_type]])
1620
+ }
1621
+ // this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
1622
+ }
1623
+ }else {
1624
+ // 非民用
1625
+ if (Vue.config.safecheck.DevicesSetConfig != undefined){
1626
+ if(this.item.f_safecheck_type == undefined || this.item.f_safecheck_type == '' || Vue.config.safecheck.SafecheckType == undefined) {
1627
+ this.config = this.extend(this.config, Vue.config.safecheck.DevicesSetConfig)
1628
+ }else{
1629
+ //tag
1630
+ //tag
1631
+ //tag
1632
+ this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_user_type]])
1633
+ }
1634
+ //this.config = this.extend(this.config, Vue.config.safecheck.DevicesSetConfig)
1635
+ }
1636
+ }
1637
+
1638
+ }
1639
+ //tag)
1640
+ // 预留设备项位置
1641
+ for (let i in this.config) {
1642
+ this.tabs.splice(1,0,null)
1643
+ }
1644
+ //遍历安检项配置
1645
+ for (let i in this.config) {
1646
+ //取得安检项索引值
1647
+ let n = this.config[i].index
1648
+ //tag
1649
+ this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
1650
+ this.$set('data.' + 'device' + n, [])
1651
+ //tag
1652
+ // this.tabs.splice(2 + n - 1, 0,
1653
+ // {
1654
+ // header:i,
1655
+ // complete:'safecheck-devices',
1656
+ // class:'repair-details-class',
1657
+ // number:n
1658
+ // })
1659
+ this.tabs[n] = {
1660
+ header: i,
1661
+ complete: 'safecheck-devices',
1662
+ class: 'repair-details-class',
1663
+ number: n
1664
+ }
1665
+
1666
+ if(this.config[i].quantity && this.config[i].quantity >0){
1667
+ let items = []
1668
+ for (let it in this.config[i].items) {
1669
+ //赋值下拉选项
1670
+ if (this.config[i].items[it].type == 'selector') {
1671
+ for (let op in this.config[i].items[it].options) {
1672
+ if (this.config[i].items[it].options[op].isdefault == true) {
1673
+ items.push({
1674
+ f_defect_level: this.config[i].items[it].options[op].level,
1675
+ f_is_defect: this.config[i].items[it].options[op].isdefect,
1676
+ f_item_name: it,
1677
+ f_item_value: this.config[i].items[it].options[op].data,
1678
+ f_path: "",
1679
+ type: "selector"
1680
+ })
1681
+ }
1682
+ }
1683
+ }
1684
+ }
1685
+ for(let q =0;q<this.config[i].quantity;q++) {
1686
+ this.data['device' + n].push(
1687
+ {f_device_type: i, f_items:items}
1688
+ )
1689
+ }
1690
+ }
1691
+ // this.data['device' + n].push(
1692
+ // {f_device_type: i, f_items: items}
1693
+ // )
1694
+ n = n + 1
1695
+ }
1696
+ //tag
1697
+ this.faultshow.number = this.tabs.length
1698
+ },
1699
+ init () {
1700
+ //tag
1701
+ // this.data.f_noplan_item_id = this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()
1702
+ this.data.ename = Vue.user.ename
1703
+ this.data.f_outlets = Vue.user.f_parentname
1704
+ this.data.f_meetunit = Vue.user.orgpathnames
1705
+ this.data.orgpathstr = Vue.user.orgpathstr
1706
+ this.data.f_check_item_id = this.item.id
1707
+ this.data.f_check_plan_id = this.f_plan_id
1708
+ this.data.f_checker_id = Vue.user.id
1709
+ this.data.f_checker_name = Vue.user.name
1710
+ this.data.f_check_type = this.item.f_user_type
1711
+ this.data.f_safecheck_type = this.item.f_safecheck_type
1712
+ //this.data.f_exceed_reason = ''//存放送气超期原因
1713
+ //tag
1714
+ this.data.f_subcompany = this.item.f_subcompany
1715
+ this.data.f_approved = this.item.f_approved
1716
+ this.data.f_repair_approved = this.item.f_repair_approved
1717
+ this.data.f_no_checkplan = this.item.f_no_checkplan
1718
+ this.data.f_approved = this.item.f_approved
1719
+ this.data.f_filialeid = this.item.f_filialeid
1720
+ this.data.f_orgstr = this.item.f_orgstr
1721
+ this.data.version = this.item.version
1722
+ this.$set('data.f_meters', this.item.f_plan_meters)
1723
+ this.$set('data.f_userinfo_code', this.item.f_userinfo_code)
1724
+ // 安检状态
1725
+ this.$set('data.f_entry_status', '入户')
1726
+ this.$set('data.f_usegas', '已使用')
1727
+ this.$set('data.f_state',this.item.f_state)
1728
+ //tag
1729
+ // 用户信息
1730
+ this.$set('data.f_user_name', this.item.f_user_name)
1731
+ this.$set('data.f_user_phone', this.item.f_user_phone)
1732
+ this.$set('data.f_userinfoid', this.item.f_userinfoid)
1733
+ this.$set('data.f_address', this.item.f_address)
1734
+ this.$set('data.f_card_id', this.item.f_card_id)
1735
+ this.$set('data.f_area', this.item.f_area)
1736
+ this.$set('data.f_street', this.item.f_street)
1737
+ this.$set('data.f_room', this.item.f_room)
1738
+ this.$set('data.f_building', this.item.f_building)
1739
+ this.$set('data.f_unit', this.item.f_unit)
1740
+ //tag
1741
+ this.$set('data.f_floor', this.item.f_floor)
1742
+ this.$set('data.f_residential_area' , this.item.f_residential_area)
1743
+ this.$set('data.f_idnumber', this.item.f_idnumber)
1744
+ this.$set('data.f_comments', this.item.f_comments)
1745
+ this.$set('data.f_userproperties', this.item.f_userproperties)
1746
+ // this.$set('data.f_user_inhome_time', this.item.f_user_inhome_time)
1747
+ // this.$set('data.f_user_check_time', this.item.f_user_check_time)
1748
+ // this.$set('data.f_user_spare_phone', this.item.f_user_spare_phone)
1749
+ // this.$set('data.f_user_family_remarks', this.item.f_user_family_remarks)
1750
+ // this.$set('data.f_user_equipment_remarks', this.item.f_user_equipment_remarks)
1751
+ // 处置方式
1752
+ //tag
1753
+ this.$set('data.f_no_gas_device', false)
1754
+ this.$set('data.f_close_valve', false)
1755
+ this.$set('data.f_unload_battery', false)
1756
+ //tag
1757
+ if (this.data.f_check_item_id == '' && this.item.f_no_checkplan == '无计划安检') {
1758
+ this.data.f_check_item_id = this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4() + "" + this.S4()
1759
+ }
1760
+ //tag
1761
+ if(this.item.f_plan_meters) {
1762
+ for (let de in this.devices) {
1763
+ this.$set('data.device' + this.devices[de].n, [])
1764
+ for (let i = 0; i < this.item.f_plan_meters.length; i++) {
1765
+ if (this.item.f_plan_meters[i].f_meter_type) {
1766
+ //tag)
1767
+ if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_meter_type.indexOf('机表') > 0) {
1768
+ this.data['device' + this.devices[de].n].push({
1769
+ f_device_type: "燃气表",
1770
+ f_items: [
1771
+ {
1772
+ f_defect_level: null,
1773
+ f_device_id: "",
1774
+ f_is_defect: "",
1775
+ f_item_name: "基表编号",
1776
+ f_item_value: this.item.f_plan_meters[i].f_meter_no,
1777
+ f_path: "",
1778
+ type: "number"
1779
+ },
1780
+ {
1781
+ f_defect_level: null,
1782
+ f_device_id: "",
1783
+ f_is_defect: "",
1784
+ f_item_name: "气表型号",
1785
+ f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
1786
+ f_path: "",
1787
+ type: "string"
1788
+ },
1789
+ {
1790
+ f_defect_level: null,
1791
+ f_device_id: "",
1792
+ f_is_defect: "",
1793
+ f_item_name: "气表品牌",
1794
+ f_item_value: this.item.f_plan_meters[i].f_aliasname,
1795
+ f_path: "",
1796
+ type: "string"
1797
+ },
1798
+ {
1799
+ f_defect_level: null,
1800
+ f_device_id: "",
1801
+ f_is_defect: "",
1802
+ f_item_name: "进气方向",
1803
+ f_item_value: this.item.f_plan_meters[i].f_flow_direction,
1804
+ f_path: "",
1805
+ type: "string"
1806
+ },
1807
+ {
1808
+ f_defect_level: null,
1809
+ f_device_id: "",
1810
+ f_is_defect: "",
1811
+ f_item_name: "上期表读数",
1812
+ f_item_value: this.item.f_plan_meters[i].f_prior_reading,
1813
+ f_path: "",
1814
+ type: "number"
1815
+ },
1816
+ {
1817
+ f_defect_level: null,
1818
+ f_device_id: "",
1819
+ f_is_defect: "",
1820
+ f_item_name: "表箱号",
1821
+ f_item_value: this.item.f_plan_meters[i].f_metertitles,
1822
+ f_path: "",
1823
+ type: "string"
1824
+ }
1825
+ ]
1826
+ })
1827
+ }
1828
+ else if (this.devices[de].device == "燃气表") {
1829
+ // delete this.config['燃气表']['items']['表底数']
1830
+ this.data['device' + this.devices[de].n].push({
1831
+ f_device_type: "燃气表",
1832
+ f_items: [
1833
+ {
1834
+ f_defect_level: null,
1835
+ f_device_id: "",
1836
+ f_is_defect: "",
1837
+ f_item_name: "基表编号",
1838
+ f_item_value: this.item.f_plan_meters[i].f_meter_no,
1839
+ f_path: "",
1840
+ type: "number"
1841
+ },
1842
+ {
1843
+ f_defect_level: null,
1844
+ f_device_id: "",
1845
+ f_is_defect: "",
1846
+ f_item_name: "气表型号",
1847
+ f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
1848
+ f_path: "",
1849
+ type: "string"
1850
+ },
1851
+ {
1852
+ f_defect_level: null,
1853
+ f_device_id: "",
1854
+ f_is_defect: "",
1855
+ f_item_name: "气表品牌",
1856
+ f_item_value: this.item.f_plan_meters[i].f_aliasname,
1857
+ f_path: "",
1858
+ type: "string"
1859
+ },
1860
+ {
1861
+ f_defect_level: null,
1862
+ f_device_id: "",
1863
+ f_is_defect: "",
1864
+ f_item_name: "进气方向",
1865
+ f_item_value: this.item.f_plan_meters[i].f_flow_direction,
1866
+ f_path: "",
1867
+ type: "string"
1868
+ },
1869
+ {
1870
+ f_defect_level: null,
1871
+ f_device_id: "",
1872
+ f_is_defect: "",
1873
+ f_item_name: "上期表读数",
1874
+ f_item_value: this.item.f_plan_meters[i].f_prior_reading,
1875
+ f_path: "",
1876
+ type: "number"
1877
+ },
1878
+ {
1879
+ f_defect_level: null,
1880
+ f_device_id: "",
1881
+ f_is_defect: "",
1882
+ f_item_name: "表箱号",
1883
+ f_item_value: this.item.f_plan_meters[i].f_metertitles,
1884
+ f_path: "",
1885
+ type: "string"
1886
+ }
1887
+ ]
1888
+ })
1889
+ }
1890
+ if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_collection_type) {
1891
+ this.data['device' + this.devices[de].n].forEach(device => {
1892
+ //tag)
1893
+ //tag)
1894
+ /*
1895
+ "累购气量":{"index":8,"type":"number","readonly":true},
1896
+ "累购金额":{"index":8,"type":"number","readonly":true},
1897
+ "字轮读数":{"index":9,"type":"number","checkmust": true},
1898
+ "已用金额":{"index":9,"type":"number","checkmust": true},
1899
+ "剩余气量":{"index":10,"type":"number","checkmust": true},
1900
+ "剩余金额":{"index":10,"type":"number","checkmust": true},
1901
+ "气量异常差值":{"index":11,"type":"number","readonly": true},
1902
+ "金额异常差值":{"index":11,"type":"number","readonly": true}
1903
+ */
1904
+ if (this.item.f_plan_meters[i].f_collection_type == '按金额') {
1905
+ if (!this.data.f_collection_type) {
1906
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1907
+ delete this.config['燃气表']['items']['累购气量']
1908
+ delete this.config['燃气表']['items']['已用气量']
1909
+ delete this.config['燃气表']['items']['剩余气量']
1910
+ delete this.config['燃气表']['items']['气量异常差值']
1911
+ device.f_items.push(
1912
+ {
1913
+ f_defect_level: null,
1914
+ f_device_id: "",
1915
+ f_is_defect: "",
1916
+ f_item_name: "初始表底",
1917
+ isshow: false,
1918
+ f_item_value: '',
1919
+ f_path: "",
1920
+ type: "number"
1921
+ },
1922
+ // {
1923
+ // f_defect_level: null,
1924
+ // f_device_id: "",
1925
+ // f_is_defect: "",
1926
+ // f_item_name: "累购金额",
1927
+ // f_item_value: this.item.f_plan_meters[i].f_total_fee,
1928
+ // f_path: "",
1929
+ // type: "number"
1930
+ // },
1931
+ {
1932
+ f_defect_level: null,
1933
+ f_device_id: "",
1934
+ f_is_defect: "",
1935
+ f_item_name: "已用金额",
1936
+ f_item_value: null,
1937
+ f_path: "",
1938
+ type: "number"
1939
+ },
1940
+ {
1941
+ f_defect_level: null,
1942
+ f_device_id: "",
1943
+ f_is_defect: "",
1944
+ f_item_name: "剩余金额",
1945
+ f_item_value: null,
1946
+ f_path: "",
1947
+ type: "number"
1948
+ },
1949
+ {
1950
+ f_defect_level: null,
1951
+ f_device_id: "",
1952
+ f_is_defect: "",
1953
+ f_item_name: "金额异常差值",
1954
+ f_item_value: null,
1955
+ f_path: "",
1956
+ type: "number"
1957
+ }
1958
+ )
1959
+ //tag)
1960
+ }
1961
+ } else if (this.item.f_plan_meters[i].f_collection_type == '按气量') {
1962
+ if (!this.data.f_collection_type) {
1963
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
1964
+ delete this.config['燃气表']['items']['累购金额']
1965
+ delete this.config['燃气表']['items']['已用金额']
1966
+ delete this.config['燃气表']['items']['剩余金额']
1967
+ delete this.config['燃气表']['items']['金额异常差值']
1968
+ device.f_items.push(
1969
+ {
1970
+ f_defect_level: null,
1971
+ f_device_id: "",
1972
+ f_is_defect: "",
1973
+ f_item_name: "初始表底",
1974
+ isshow: true,
1975
+ f_item_value: this.item.f_plan_meters[i].f_initial_base,
1976
+ f_path: "",
1977
+ type: "number"
1978
+ },
1979
+ {
1980
+ f_defect_level: null,
1981
+ f_device_id: "",
1982
+ f_is_defect: "",
1983
+ f_item_name: "累购气量",
1984
+ f_item_value: this.item.f_plan_meters[i].f_total_gas,
1985
+ f_path: "",
1986
+ type: "number"
1987
+ },
1988
+ {
1989
+ f_defect_level: null,
1990
+ f_device_id: "",
1991
+ f_is_defect: "",
1992
+ f_item_name: "已用气量",
1993
+ f_item_value: this.item.f_plan_meters[i].f_meter_base,
1994
+ f_path: "",
1995
+ type: "number"
1996
+ },
1997
+ {
1998
+ f_defect_level: null,
1999
+ f_device_id: "",
2000
+ f_is_defect: "",
2001
+ f_item_name: "剩余气量",
2002
+ f_item_value: "",
2003
+ f_path: "",
2004
+ type: "number"
2005
+ },
2006
+ {
2007
+ f_defect_level: null,
2008
+ f_device_id: "",
2009
+ f_is_defect: "",
2010
+ f_item_name: "气量异常差值",
2011
+ f_item_value: null,
2012
+ f_path: "",
2013
+ type: "number"
2014
+ }
2015
+ )
2016
+ //tag)
2017
+ }
2018
+ }
2019
+ })
2020
+ }
2021
+ else if(this.devices[de].device == "燃气表"){
2022
+ //tag
2023
+ this.data['device' + this.devices[de].n].forEach(device => {
2024
+ //tag)
2025
+ if (!this.data.f_collection_type) {
2026
+ this.data.f_collection_type = this.item.f_plan_meters[i].f_collection_type
2027
+ delete this.config['燃气表']['items']['累购金额']
2028
+ delete this.config['燃气表']['items']['已用金额']
2029
+ delete this.config['燃气表']['items']['剩余金额']
2030
+ delete this.config['燃气表']['items']['金额异常差值']
2031
+ device.f_items.push(
2032
+ {
2033
+ f_defect_level: null,
2034
+ f_device_id: "",
2035
+ f_is_defect: "",
2036
+ f_item_name: "初始表底",
2037
+ isshow: true,
2038
+ f_item_value: this.item.f_plan_meters[i].f_initial_base,
2039
+ f_path: "",
2040
+ type: "number"
2041
+ },
2042
+ {
2043
+ f_defect_level: null,
2044
+ f_device_id: "",
2045
+ f_is_defect: "",
2046
+ f_item_name: "累购气量",
2047
+ f_item_value: this.item.f_plan_meters[i].f_total_gas,
2048
+ f_path: "",
2049
+ type: "number"
2050
+ },
2051
+ {
2052
+ f_defect_level: null,
2053
+ f_device_id: "",
2054
+ f_is_defect: "",
2055
+ f_item_name: "已用气量",
2056
+ f_item_value: this.item.f_plan_meters[i].f_meter_base,
2057
+ f_path: "",
2058
+ type: "number"
2059
+ },
2060
+ {
2061
+ f_defect_level: null,
2062
+ f_device_id: "",
2063
+ f_is_defect: "",
2064
+ f_item_name: "剩余气量",
2065
+ f_item_value: '',
2066
+ f_path: "",
2067
+ type: "number"
2068
+ },
2069
+ {
2070
+ f_defect_level: null,
2071
+ f_device_id: "",
2072
+ f_is_defect: "",
2073
+ f_item_name: "气量异常差值",
2074
+ isshow:false,
2075
+ f_item_value: null,
2076
+ f_path: "",
2077
+ type: "number"
2078
+ }
2079
+ )
2080
+ //tag)
2081
+ }
2082
+ })
2083
+ }
2084
+ }
2085
+ }
2086
+ }
2087
+ }
2088
+ var pardate = {
2089
+ _this:this,
2090
+ tittle:'安检详情',
2091
+ safe:true
2092
+ }
2093
+ // this.$dispatch('gotoson',pardate)
2094
+ //tag
2095
+ this.$goto('safecheck-userinfo', {userinfo:this.data}, 'repair')
2096
+ }
2097
+ },
2098
+ watch: {
2099
+ 'row' () {
2100
+ //tag
2101
+ this.copy()
2102
+ }
2103
+ },
2104
+ async ready () {
2105
+ //送气超期功能
2106
+ //await this.isoverDate()
2107
+ this.putDevices()
2108
+ //如果已检,则提取安检单
2109
+ if (this.item.f_state != '未检') {
2110
+ if (this.role == 'inspect' || this.role == 'androidview') {
2111
+ HostApp.__callback__ = this.loaded
2112
+ HostApp.__this__ = this
2113
+ let that = this
2114
+ let value = {}
2115
+ //tag
2116
+ if (this.role == 'inspect') {
2117
+ //tag
2118
+ if (this.item.f_no_checkplan == '无计划安检') {
2119
+ value = this.$androidUtil.path({
2120
+ alias: 'getUserinfomation',
2121
+ data: {condition: "f_check_item_id = '" + this.item.id + "' and f_no_checkplan = '无计划安检'"}
2122
+ })
2123
+ } else {
2124
+ value = this.$androidUtil.bzLogic('FetchCheckPaper', {id: this.item.id})
2125
+ }
2126
+ } else {
2127
+ value = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data: {condition: `id = '${this.item.f_paper_id}'`}})
2128
+ }
2129
+ Util.replaceFalse(value)
2130
+ //tag)
2131
+ if (value.data.length != 0) {
2132
+ that.$set('data', value.data[0])
2133
+ //tag)
2134
+ if (this.data.f_collection_type == '按气量') {
2135
+ delete this.config['燃气表']['items']['累购金额']
2136
+ delete this.config['燃气表']['items']['已用金额']
2137
+ delete this.config['燃气表']['items']['剩余金额']
2138
+ delete this.config['燃气表']['items']['金额异常差值']
2139
+ } else if (this.data.f_collection_type == '按金额') {
2140
+ delete this.config['燃气表']['items']['累购气量']
2141
+ delete this.config['燃气表']['items']['已用气量']
2142
+ delete this.config['燃气表']['items']['剩余气量']
2143
+ delete this.config['燃气表']['items']['气量异常差值']
2144
+ }
2145
+ //tag)
2146
+ if (value.data[0].f_devices) {
2147
+ for (let da in that.devices) {
2148
+ that.$set('data.device' + that.devices[da].n, [])
2149
+ }
2150
+ value.data[0].f_devices.forEach((item) => {
2151
+ //tag)
2152
+ for (let i in item.f_items) {
2153
+ // if (item.f_items[i].f_path != '' && item.f_items[i].f_path != null) {
2154
+ // this.picture.push({f_path: item.f_items[i].f_path, name: item.f_items[i].f_item_name})
2155
+ // }
2156
+ for (let de in that.config[item.f_device_type].items) {
2157
+ if (item.f_items[i].f_item_name == de) {
2158
+ if (that.config[item.f_device_type].items[de].type == 'selector' || that.config[item.f_device_type].items[de].type == 'checkbox') {
2159
+ item.f_items[i].f_item_value = []
2160
+ } else {
2161
+ item.f_items[i].f_item_value = ''
2162
+ }
2163
+ }
2164
+ }
2165
+ //tag)
2166
+ for (let j in item.f_items[i].f_item_lists) {
2167
+ //tag)
2168
+ if (item.f_items[i].f_item_value instanceof Array) {
2169
+ item.f_items[i].f_item_value.push(item.f_items[i].f_item_lists[j].f_item_value)
2170
+ } else {
2171
+ item.f_items[i].f_item_value = item.f_items[i].f_item_lists[j].f_item_value
2172
+ }
2173
+
2174
+ }
2175
+ }
2176
+ for (let de in that.devices) {
2177
+ if (that.devices[de].device == item.f_device_type) {
2178
+ that.data['device' + that.devices[de].n].push({
2179
+ f_device_type: item.f_device_type,
2180
+ f_items: item.f_items
2181
+ })
2182
+ //tag)
2183
+ }
2184
+ }
2185
+ })
2186
+ if (this.role == 'androidview') {
2187
+ Util.androidRatifyPics(that.data, this.$androidUtil.getProxyUrl())
2188
+ Util.androidRatifyPics(that.picture, this.$androidUtil.getProxyUrl())
2189
+ Util.booleanFilter(that.data)
2190
+ }
2191
+ //tag)
2192
+ }
2193
+ } else {
2194
+ //tag
2195
+ this.init()
2196
+ }
2197
+ //tag
2198
+ var pardate = {
2199
+ _this:this,
2200
+ tittle:'安检详情',
2201
+ safe:true
2202
+ }
2203
+ // this.$dispatch('gotoson',pardate)getImgPath
2204
+ this.$goto('safecheck-userinfo', {userinfo:this.data}, 'repair')
2205
+ } else {
2206
+ let that = this
2207
+ let id
2208
+ if (this.role == 'view') {
2209
+ id = this.item.id
2210
+ }
2211
+ this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data:{condition:`id = '${id}'`}}).then((respanse)=> {
2212
+ if (respanse.data.length != 0) {
2213
+ that.data = Object.assign(that.data,respanse.data[0])
2214
+ if(respanse.data[0].f_devices) {
2215
+ for (let da in that.devices) {
2216
+ that.$set('data.device' + that.devices[da].n, [])
2217
+ }
2218
+ respanse.data[0].f_devices.forEach((item) => {
2219
+ for (let de in that.devices) {
2220
+ if (that.devices[de].device == item.f_device_type) {
2221
+ that.data['device' + that.devices[de].n].push({
2222
+ f_device_type: item.f_device_type,
2223
+ f_items: item.f_items
2224
+ })
2225
+ }
2226
+ }
2227
+ })
2228
+ }
2229
+ Util.replaceFalse(that.data)
2230
+ Util.booleanFilter(that.data)
2231
+ if(this.role == 'view'){
2232
+ Util.ratifyPics(that.data)
2233
+ }else{
2234
+ Util.androidRatifyPics(that.data,this.$androidUtil.getProxyUrl())
2235
+ }
2236
+ //tag
2237
+ } else {
2238
+ alert("该安检单可能已不在本地!")
2239
+ this.init()
2240
+ }
2241
+ var pardate = {
2242
+ _this:this,
2243
+ tittle:'安检详情',
2244
+ safe:true
2245
+ }
2246
+ // this.$dispatch('gotoson',pardate)
2247
+ this.$goto('safecheck-userinfo', {userinfo:this.data}, 'paper-router')
2248
+ }
2249
+ ).catch(
2250
+ (respanse) => {
2251
+ alert('查找安检单失败')
2252
+ })
2253
+ }
2254
+ }else{
2255
+ this.init()
2256
+ }
2257
+ // tbs合并数组
2258
+ // if( this.model.serviceacitivity[0].servicerepair.length > 0){
2259
+ // for(let i = 0;i < this.model.serviceacitivity[0].servicerepair.length;i++ ){
2260
+ //
2261
+ // }
2262
+ // }
2263
+ },
2264
+ components: {
2265
+ // 'door-service': DoorService,
2266
+ // 'repair-info': RepairInfo,
2267
+ // 'repair-user-info': RepairUserInfo,
2268
+ // 'outlay': Outlay,
2269
+ // 'fault-all': FaultAll,
2270
+ // 'repair-details':RepairDetails
2271
+ // 'pipeline': Pipeline,
2272
+ // 'device-service': DeviceService,
2273
+ // 'trouble-removal': TroubleRemoval,
2274
+ // 'cooking-utensils': CookingUtensils,
2275
+ // 'repair-matter-info': RepairMatterInfo,
2276
+ // 'first-gas-check': FirstGasCheck,
2277
+ // 'tel-change-matter': TelChangeMatter/
2278
+ },
2279
+ events: {
2280
+ 'tijiao': function () {
2281
+ // 事件回调内的 `this` 自动绑定到注册它的实例上
2282
+ this.confirm()
2283
+ }
2284
+ }
2285
+ }
2286
+ </script>
2287
+ <style lang="less">
2288
+ @import "../../../../src/bootstrap/less/variables.less";
2289
+ .noclickbut {
2290
+ pointer-events: none;
2291
+ }
2292
+ .tab-befor-img (@url) {
2293
+ content: '';
2294
+ background-image: url("@{url}");
2295
+ background-size: 20px;
2296
+ display: inline-block;
2297
+ margin-right: 8px;
2298
+ margin-top: 0.3em;
2299
+ height: 1.3em;
2300
+ width: 1.3em;
2301
+ vertical-align: -35%;
2302
+ }
2303
+
2304
+ @media screen and (min-width: 768px) {
2305
+ .android-repair-order > div > ul a {
2306
+ font-size: @font-size-h2;
2307
+ margin: 0.3em 0;
2308
+ }
2309
+ }
2310
+ .repair-details-class{
2311
+ &::before {
2312
+ .tab-befor-img("../../../assets/huneiweixiu1.png");
2313
+ }
2314
+ }
2315
+ .repair-info-class {
2316
+ &::before {
2317
+ .tab-befor-img("../../../assets/baoxiuxinxi1.png");
2318
+ }
2319
+ }
2320
+ .repair-user-info-class {
2321
+ &::before {
2322
+ .tab-befor-img("../../../assets/jibenxinxi1.png")
2323
+ }
2324
+ }
2325
+
2326
+ .door-service-class {
2327
+ &::before {
2328
+ .tab-befor-img("../../../assets/huneiweixiu1.png")
2329
+ }
2330
+ }
2331
+
2332
+ .pipeline-class {
2333
+ &::before {
2334
+ .tab-befor-img("../../../assets/guandao1.png")
2335
+ }
2336
+ }
2337
+
2338
+ .device-service-class {
2339
+ &::before {
2340
+ .tab-befor-img("../../../assets/shebeiweixiu1.png")
2341
+ }
2342
+ }
2343
+
2344
+ .trouble-removal-class {
2345
+ &::before {
2346
+ .tab-befor-img("../../../assets/shiguchuli.png")
2347
+ }
2348
+ }
2349
+
2350
+ .cooking-utensils-class {
2351
+ &::before {
2352
+ .tab-befor-img("../../../assets/zaoju1.png")
2353
+ }
2354
+ }
2355
+
2356
+ .outlay-class {
2357
+ &::before {
2358
+ .tab-befor-img("../../../assets/feiyong1.png")
2359
+ }
2360
+ }
2361
+
2362
+ .fault-all-class {
2363
+ &::before {
2364
+ .tab-befor-img("../../../assets/guzhanghuizong1.png")
2365
+ }
2366
+ }
2367
+ .photo-write-class {
2368
+ &::before {
2369
+ .tab-befor-img("../../../assets/zaoju.png")
2370
+ }
2371
+ }
2372
+ .delay-apply-class {
2373
+ &::before {
2374
+ .tab-befor-img("../../../assets/yonghubaoxiu.png")
2375
+ }
2376
+ }
2377
+
2378
+ .repair-back-class {
2379
+ &::before {
2380
+ .tab-befor-img("../../../assets/fanhui.png")
2381
+ }
2382
+ }
2383
+ .butt2 {
2384
+ display: inline;
2385
+ float: right;
2386
+ width: 10px;
2387
+ text-align: center;
2388
+ align-items:center;
2389
+ position: absolute;
2390
+ top:50%;
2391
+
2392
+ left:90%;
2393
+ transform: translate(-50%,-50%);
2394
+ }
2395
+ .linesty{
2396
+ display: inline-block;
2397
+ height:1px;
2398
+ width:100%;
2399
+ background:#d0d0d0;
2400
+ overflow:hidden;
2401
+ vertical-align: middle;
2402
+ }
2403
+ .spanboder{
2404
+ border-bottom:2px solid #499edf;
2405
+ padding-bottom: 8px
2406
+ }
2407
+ .app-botton {
2408
+ position:fixed;
2409
+ background: #87b2dd;
2410
+ right:8px;
2411
+ color: #FFF;
2412
+ padding: 8px;
2413
+ text-align: center;
2414
+ font-size: 1.2em;
2415
+ z-index: 10;
2416
+ opacity:0.5;
2417
+ bottom: 50px;
2418
+ margin-top: -10px;
2419
+ height: 40px;
2420
+ }
2421
+ .android-repair-order > div > ul a {
2422
+ font-size: 12px;
2423
+ color: #333333;
2424
+ padding: 13px 16px;
2425
+ }
2426
+ </style>