safecheck-client 3.0.35-46 → 3.0.35-48

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