safecheck-client 3.0.34-42 → 3.0.34-44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/android/QRCode/QRCodeBinding.vue +300 -300
- package/src/components/android/QRCode/QRCodePage.vue +212 -212
- package/src/components/android/examples/SafeListExamples.vue +1 -1
- package/src/components/android/examples/UserExamples.vue +1 -1
- package/src/components/rongcheng/AspiratedPaperFeedbackm.vue +1045 -1045
- package/src/components/rongcheng/AspiratedPaperMessage.vue +1378 -1378
- package/src/components/rongcheng/PaperListNPSQ.vue +455 -455
- package/src/components/rongcheng/PaperListSQ.vue +444 -444
- package/src/components/rongcheng/PaperStatem.vue +419 -414
- package/src/components/rongcheng/PhoneUpUserinfo.vue +1328 -1328
- package/src/filiale/bayan/android/SafecheckOrderV.vue +2889 -2889
- package/src/filiale/tongchuan/android/Select.vue +421 -421
- package/src/filiale/tongchuan/android.js +21 -21
- package/src/filiale/tongchuan/utils/EventListener.js +29 -29
- package/src/filiale/tongchuan/utils/coerceBoolean.js +7 -7
- package/src/main.js +33 -33
- package/src/rongcheng.js +316 -316
@@ -1,1378 +1,1378 @@
|
|
1
|
-
<style scoped>
|
2
|
-
.divmask {
|
3
|
-
pointer-events: none;
|
4
|
-
}
|
5
|
-
.app-header {
|
6
|
-
border-radius: 50%;
|
7
|
-
background: rgba(73, 158, 223, 0.4);
|
8
|
-
color: #FFF;
|
9
|
-
padding: 20px;
|
10
|
-
text-align: center;
|
11
|
-
font-size: 1.2em;
|
12
|
-
z-index: 10;
|
13
|
-
opacity:0.5;
|
14
|
-
bottom: 50px;
|
15
|
-
margin-top: -20px;
|
16
|
-
position: absolute;
|
17
|
-
top: 10%;
|
18
|
-
right: 2%;
|
19
|
-
height: 8%;
|
20
|
-
}
|
21
|
-
</style>
|
22
|
-
|
23
|
-
<template>
|
24
|
-
<div style="overflow-y: scroll;background-color: #FFFFFF">
|
25
|
-
<div class="auto" style="height:auto;" id="safecheck" v-if="isshow">
|
26
|
-
<div class="page-header app-header auto">
|
27
|
-
<div @click="back()">
|
28
|
-
<img src="../../assets/back.png"/>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
<div style="width: 50%;height: 462px; margin-left: 20px;margin-top: 0px;margin-bottom: 20px;float:left" id="one">
|
32
|
-
<paper-userm></paper-userm>
|
33
|
-
</div>
|
34
|
-
<div style="width: 45%;height: 462px; margin-left: 20px;margin-top: 0px;margin-bottom: 20px;float:left">
|
35
|
-
<asp-paper-statem></asp-paper-statem>
|
36
|
-
</div>
|
37
|
-
<div style="width: 95%;height: auto;margin-left: 20px;margin-bottom: 30px;float: left">
|
38
|
-
<devicesm> </devicesm>
|
39
|
-
</div>
|
40
|
-
<div style="width: 95%;height: 900px;margin-left: 20px;float: left;">
|
41
|
-
<asp-paper-feedbackm v-bind:paper="this.data" :item="item" ></asp-paper-feedbackm>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
</div>
|
45
|
-
</template>
|
46
|
-
|
47
|
-
<script>
|
48
|
-
import PaperUserm from '../android/PaperUserm'
|
49
|
-
import PaperStatem from './AspPaperStatem'
|
50
|
-
import Devicesm from '../android/Devicesm'
|
51
|
-
import PaperFeedbackm from './AspiratedPaperFeedbackm'
|
52
|
-
import RadioGroup from 'vue-client/src/vue-strap/src/radioGroup'
|
53
|
-
import Radio from 'vue-client/src/vue-strap/src/radioBtn'
|
54
|
-
import Vue from 'vue'
|
55
|
-
import * as Util from '../Util'
|
56
|
-
|
57
|
-
export default {
|
58
|
-
title: '安检单',
|
59
|
-
props: ['f_plan_id', 'item', 'role'],
|
60
|
-
data() {
|
61
|
-
return {
|
62
|
-
data: {
|
63
|
-
f_devices: [],
|
64
|
-
f_defect_content:''
|
65
|
-
},
|
66
|
-
isshow:false,
|
67
|
-
isUpload:false,
|
68
|
-
livedispose:'',
|
69
|
-
startClick:false, //开始安检按钮是否可点击
|
70
|
-
isStrat: false, //是否开始安检
|
71
|
-
checkResult:{},//查询结果
|
72
|
-
newcheckResult:{},
|
73
|
-
timer: null,
|
74
|
-
showModal: false,
|
75
|
-
pic_to_be_viewed: '',
|
76
|
-
showBack:true,
|
77
|
-
devices: [],
|
78
|
-
f_devices : [],
|
79
|
-
isToRepair:false,
|
80
|
-
isSafeCheckToRepair:false,//是否转维修
|
81
|
-
config: {
|
82
|
-
"燃气表":{
|
83
|
-
"checkmust":true,
|
84
|
-
"index":1,
|
85
|
-
"items":{
|
86
|
-
//"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
|
87
|
-
"基表编号":{"index":1,"type":"string","readonly":false,"checkmust":true},
|
88
|
-
"气表型号":{"index":2,"type":"string","readonly":true},
|
89
|
-
"气表品牌":{"index":3,"type":"string","readonly":true},
|
90
|
-
"进气方向":{"index":4,"type":"selector",
|
91
|
-
"multiple": false,
|
92
|
-
"checkmust":true,
|
93
|
-
"options": [
|
94
|
-
{
|
95
|
-
"data": "左表",
|
96
|
-
"isdefect": false,
|
97
|
-
"isdefault": false
|
98
|
-
},
|
99
|
-
{
|
100
|
-
"data": "右表",
|
101
|
-
"isdefect": false,
|
102
|
-
"isdefault": false
|
103
|
-
}
|
104
|
-
]
|
105
|
-
},
|
106
|
-
"初始表底":{"index":5,"type":"number"},
|
107
|
-
"上期表读数":{"index":6,"type":"number","readonly":true,"isshow":true},
|
108
|
-
"本期表读数":{"index":7,"type":"number","checkmust":true},
|
109
|
-
"累购气量":{"index":8,"type":"number","readonly":true},
|
110
|
-
"累购金额":{"index":8,"type":"number","readonly":true},
|
111
|
-
"已用气量":{"index":9,"type":"number","checkmust": false,"isshow":false},//基表数
|
112
|
-
"已用金额":{"index":9,"type":"number","checkmust": false,"isshow":false},
|
113
|
-
"表初始数":{"index":10,"type":"number","checkmust": false},//累购-已用
|
114
|
-
//显示屏数 --实际剩余气量
|
115
|
-
"表初始数":{"index":10,"type":"number","checkmust": false},
|
116
|
-
"气量异常差值":{"index":11,"type":"number","readonly": true,"isshow":false},
|
117
|
-
"金额异常差值":{"index":11,"type":"number","readonly": true,"isshow":false}
|
118
|
-
}
|
119
|
-
// 注意,配置项的index必须与上面的固定配置保持'顺序'
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}
|
123
|
-
},
|
124
|
-
components: {
|
125
|
-
RadioGroup,
|
126
|
-
Radio,
|
127
|
-
"paper-userm":PaperUserm,
|
128
|
-
"paper-statem":PaperStatem,
|
129
|
-
"devicesm":Devicesm,
|
130
|
-
"paper-feedbackm":PaperFeedbackm
|
131
|
-
},
|
132
|
-
computed: {
|
133
|
-
selector: {
|
134
|
-
get() {
|
135
|
-
return 'paper-state'
|
136
|
-
},
|
137
|
-
set(val) {
|
138
|
-
if(this.isStrat){
|
139
|
-
//;
|
140
|
-
this.$goto(val, {userinfo:this.data}, 'paper-router')
|
141
|
-
}else{
|
142
|
-
this.$showMessage('未开始安检!')
|
143
|
-
}
|
144
|
-
}
|
145
|
-
},
|
146
|
-
actionEnabled: {
|
147
|
-
get() {
|
148
|
-
return this.role == 'inspect'
|
149
|
-
}
|
150
|
-
}
|
151
|
-
},
|
152
|
-
methods: {
|
153
|
-
back(){
|
154
|
-
if (this.role == 'inspect') {
|
155
|
-
if(!this.isStrat){
|
156
|
-
this.$back()
|
157
|
-
return
|
158
|
-
}else{
|
159
|
-
this.savePaper(true).then(()=>{
|
160
|
-
this.$back()
|
161
|
-
this.isStrat = false
|
162
|
-
})
|
163
|
-
}
|
164
|
-
}else{
|
165
|
-
this.$back()
|
166
|
-
}
|
167
|
-
},
|
168
|
-
checkIsStart(){
|
169
|
-
alert('asdad')
|
170
|
-
return
|
171
|
-
},
|
172
|
-
viewPic(fileName) {
|
173
|
-
//tag
|
174
|
-
if(this.role == 'view') {
|
175
|
-
if(!fileName.endsWith('nopic.png')) {
|
176
|
-
this.pic_to_be_viewed = fileName
|
177
|
-
this.showModal = true
|
178
|
-
}
|
179
|
-
} else {
|
180
|
-
HostApp.viewPic(fileName)
|
181
|
-
}
|
182
|
-
},
|
183
|
-
tick() {
|
184
|
-
this.timer = null
|
185
|
-
this.data.f_offsite_time = Util.toStandardTimeString()
|
186
|
-
this.timer = window.setTimeout(this.tick, 1000)
|
187
|
-
},
|
188
|
-
getRepairState() {
|
189
|
-
let repaired = true
|
190
|
-
this.data.f_defects.forEach((defect) => {
|
191
|
-
repaired = repaired & (defect.f_ratification == '已处理')
|
192
|
-
})
|
193
|
-
return repaired
|
194
|
-
},
|
195
|
-
verifyRepairDefects() {
|
196
|
-
this.data.f_repair_date = Util.toStandardTimeString()
|
197
|
-
this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
|
198
|
-
},
|
199
|
-
async savePaper(saveOnly) {
|
200
|
-
//tag
|
201
|
-
//tag
|
202
|
-
if(this.role == 'repair') {
|
203
|
-
let errorMsg = this.verifyRepairDefects()
|
204
|
-
if(errorMsg) {
|
205
|
-
this.$showMessage(errorMsg)
|
206
|
-
return false
|
207
|
-
}
|
208
|
-
return this.save()
|
209
|
-
} else {
|
210
|
-
//保存时做校验
|
211
|
-
let errString = this.errorVerify()
|
212
|
-
if(saveOnly){
|
213
|
-
if (errString) {
|
214
|
-
this.data.f_complete = '未完成'
|
215
|
-
this.disableTimer()
|
216
|
-
return this.save()
|
217
|
-
} else {
|
218
|
-
//tag
|
219
|
-
if(!this.data.f_offsite_time){
|
220
|
-
this.$set('data.f_offsite_time', Util.toStandardTimeString())
|
221
|
-
}
|
222
|
-
//tag
|
223
|
-
this.data.f_complete = '已完成'
|
224
|
-
this.disableTimer()
|
225
|
-
return this.save()
|
226
|
-
}
|
227
|
-
}else {
|
228
|
-
//tag
|
229
|
-
if (errString) {
|
230
|
-
//tag
|
231
|
-
//tag
|
232
|
-
//tag
|
233
|
-
if (Vue.android){
|
234
|
-
// if(this.isUpload){
|
235
|
-
// this.isUpload = false
|
236
|
-
// }
|
237
|
-
this.$showMessage(errString)
|
238
|
-
}
|
239
|
-
return false
|
240
|
-
} else {
|
241
|
-
if(!this.data.f_offsite_time){
|
242
|
-
this.$set('data.f_offsite_time', Util.toStandardTimeString())
|
243
|
-
}
|
244
|
-
//tag
|
245
|
-
this.data.f_complete = '已完成'
|
246
|
-
this.disableTimer()
|
247
|
-
return this.uploadCheckPaper()
|
248
|
-
}
|
249
|
-
}
|
250
|
-
}
|
251
|
-
},
|
252
|
-
genuineSave(saveOnly) {
|
253
|
-
HostApp.__this__.save(saveOnly)
|
254
|
-
if(!saveOnly)
|
255
|
-
HostApp.__this__.disableTimer()
|
256
|
-
HostApp.__callback__ = null
|
257
|
-
HostApp.__this__ = null
|
258
|
-
},
|
259
|
-
uploadPaper() {
|
260
|
-
// this.isUpload = true
|
261
|
-
//tag
|
262
|
-
this.savePaper(false).then((res) => {
|
263
|
-
//tag
|
264
|
-
// //tag
|
265
|
-
// this.isUpload = false
|
266
|
-
// //tag
|
267
|
-
if(res != true){
|
268
|
-
//tag
|
269
|
-
return
|
270
|
-
}else{
|
271
|
-
this.$back()
|
272
|
-
}
|
273
|
-
})
|
274
|
-
},
|
275
|
-
errorVerify() {
|
276
|
-
let hasError = this.verifyState()
|
277
|
-
if(hasError)
|
278
|
-
return hasError
|
279
|
-
|
280
|
-
if(this.data.f_entry_status != '入户')
|
281
|
-
return null
|
282
|
-
hasError = this.verifyUser()
|
283
|
-
if(hasError)
|
284
|
-
return hasError
|
285
|
-
hasError = this.verifyDevices()
|
286
|
-
if(hasError)
|
287
|
-
return hasError
|
288
|
-
hasError = this.verifyFeedback()
|
289
|
-
if(hasError)
|
290
|
-
return hasError
|
291
|
-
},
|
292
|
-
verifyState() {
|
293
|
-
if(Vue.android && this.data.f_entry_status == '未使用天然气' && this.data.f_nongasuser_path == Vue.nopic)
|
294
|
-
return '未使用天然气则必须拍照'
|
295
|
-
if(Vue.android && this.data.f_entry_status == '到访不遇' && this.data.f_noanswer_path == Vue.nopic)
|
296
|
-
return '到访不遇必须拍照'
|
297
|
-
},
|
298
|
-
verifyUser() {
|
299
|
-
let prefix = '用户基本信息:'
|
300
|
-
if(Util.required(this.data.f_user_name))
|
301
|
-
return prefix + '用户名必须输入'
|
302
|
-
if(Util.required(this.data.f_user_phone))
|
303
|
-
return prefix + '用户电话必须输入'
|
304
|
-
// if(Util.required(this.data.f_residential_area))
|
305
|
-
// return prefix + '小区名称必须输入'
|
306
|
-
if(Util.required(this.data.f_address))
|
307
|
-
return prefix + '地址必须输入'
|
308
|
-
},
|
309
|
-
verifyDevices() {
|
310
|
-
for (let dev in this.config) {
|
311
|
-
if (this.config[dev].checkmust == true) {
|
312
|
-
let error = true
|
313
|
-
for(let device in this.data) {
|
314
|
-
if (device.startsWith("device")) {
|
315
|
-
for (let item in this.data[device]) {
|
316
|
-
if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
|
317
|
-
error = false
|
318
|
-
}
|
319
|
-
}
|
320
|
-
}
|
321
|
-
}
|
322
|
-
if (error) {
|
323
|
-
return "请检查" + dev
|
324
|
-
}
|
325
|
-
}
|
326
|
-
}
|
327
|
-
|
328
|
-
for (let dev in this.config) {
|
329
|
-
for(let device in this.data) {
|
330
|
-
if (device.startsWith("device")) {
|
331
|
-
for (let item in this.data[device]) {
|
332
|
-
//检查每一条安检结果
|
333
|
-
if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
|
334
|
-
for (let i in this.data[device][item].f_items) {
|
335
|
-
for (let it in this.config[dev].items) {
|
336
|
-
if (this.config[dev].items[it].checkmust == true && this.data[device][item].f_items[i].f_item_value == '' && this.data[device][item].f_items[i].f_path == '' && it == this.data[device][item].f_items[i].f_item_name) {
|
337
|
-
return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
|
338
|
-
}
|
339
|
-
}
|
340
|
-
//检查安检下拉结果
|
341
|
-
if (this.data[device][item].f_items[i].type == 'selector') {
|
342
|
-
if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
|
343
|
-
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 + "选中必须拍照"
|
344
|
-
}
|
345
|
-
}
|
346
|
-
}
|
347
|
-
}
|
348
|
-
}
|
349
|
-
}
|
350
|
-
}
|
351
|
-
}
|
352
|
-
},
|
353
|
-
|
354
|
-
|
355
|
-
verifyFeedback() {
|
356
|
-
let prefix = '用户反馈:'
|
357
|
-
if(Vue.android && (!this.data.f_overall_path || this.data.f_overall_path == Vue.nopic) && this.data.f_entry_status == '入户')
|
358
|
-
return prefix + '必须有安检总体照片'
|
359
|
-
if(Vue.android && this.data.f_defect_notified && this.data.f_notified_path == Vue.nopic)
|
360
|
-
return prefix + '下发安检通知书则必须给通知书拍照'
|
361
|
-
if(!this.data.f_client_evaluation && this.data.f_entry_status == '入户')
|
362
|
-
return prefix + '请选择服务评价'
|
363
|
-
},
|
364
|
-
|
365
|
-
setUrgency() {
|
366
|
-
this.data.f_defect_urgency = 'Z'
|
367
|
-
let that = this
|
368
|
-
this.data.f_defects.forEach(function(defect) {
|
369
|
-
if(that.data.f_defect_urgency > defect.f_defect_level.charAt(0))
|
370
|
-
that.data.f_defect_urgency = defect.f_defect_level.charAt(0)
|
371
|
-
})
|
372
|
-
if(this.data.f_defect_urgency == 'Z')
|
373
|
-
this.data.f_defect_urgency = null
|
374
|
-
},
|
375
|
-
|
376
|
-
getAllDefect(){
|
377
|
-
let checkResults={
|
378
|
-
result:'正常',
|
379
|
-
data:[]
|
380
|
-
}
|
381
|
-
let value = ''
|
382
|
-
let codata = JSON.parse(JSON.stringify(this.data))
|
383
|
-
codata.f_devices = []
|
384
|
-
this.f_devices = []
|
385
|
-
for(let device in codata){
|
386
|
-
let f_device_type
|
387
|
-
if(device.startsWith("device")){
|
388
|
-
for(let item in codata[device]) {
|
389
|
-
if(codata[device].length > 1 ){
|
390
|
-
let j = Number.parseInt(item)+1
|
391
|
-
f_device_type = `${codata[device][item].f_device_type}${j}`
|
392
|
-
}else{
|
393
|
-
f_device_type = codata[device][item].f_device_type
|
394
|
-
}
|
395
|
-
// //tag
|
396
|
-
for(let i in codata[device][item].f_items){
|
397
|
-
let items = codata[device][item].f_items[i]
|
398
|
-
//tag
|
399
|
-
//tag
|
400
|
-
if(items.f_is_defect == true || items.f_is_defect == 'true'){
|
401
|
-
//tag
|
402
|
-
checkResults.result = '有隐患'
|
403
|
-
if(!this.checkResult.hasOwnProperty(items.f_defect_level)){
|
404
|
-
if(f_device_type.indexOf('其他') != -1){
|
405
|
-
this.$set('checkResult.' + items.f_defect_level,`${f_device_type}${items.f_item_name}`)
|
406
|
-
}else{
|
407
|
-
this.$set('checkResult.' + items.f_defect_level,`${f_device_type}${items.f_item_name}${items.f_item_value}`)
|
408
|
-
}
|
409
|
-
}else{
|
410
|
-
//tag
|
411
|
-
if(f_device_type.indexOf('其他') != -1){
|
412
|
-
this.$set('checkResult.' + items.f_defect_level,`${this.checkResult[items.f_defect_level]},${f_device_type}${items.f_item_name}`)
|
413
|
-
}else{
|
414
|
-
this.$set('checkResult.' + items.f_defect_level,`${this.checkResult[items.f_defect_level]},${f_device_type}${items.f_item_name}${items.f_item_value}`)
|
415
|
-
}
|
416
|
-
|
417
|
-
}
|
418
|
-
}
|
419
|
-
if(items.type == 'selector'){
|
420
|
-
items.selected = ''
|
421
|
-
}
|
422
|
-
}
|
423
|
-
//tag
|
424
|
-
this.f_devices.push(codata[device][item])
|
425
|
-
}
|
426
|
-
}
|
427
|
-
}
|
428
|
-
if(this.checkResult){
|
429
|
-
for (let key in this.checkResult){
|
430
|
-
//tag
|
431
|
-
this.$set('newcheckResult.'+key,this.checkResult[key])
|
432
|
-
checkResults.data.push(this.newcheckResult)
|
433
|
-
this.newcheckResult = {}
|
434
|
-
}
|
435
|
-
this.checkResult = {}
|
436
|
-
}
|
437
|
-
//tag
|
438
|
-
codata.f_defect_content = JSON.stringify(checkResults)
|
439
|
-
//tag
|
440
|
-
return codata
|
441
|
-
},
|
442
|
-
|
443
|
-
getWeixin(backData){
|
444
|
-
let result = {f_user_name:backData.f_user_name,checker: Vue.user.name, f_check_date: Util.toStandardDateString(),f_userinfo_id:backData.f_userinfoid,f_address:backData.f_address}
|
445
|
-
|
446
|
-
let Resultstr = ''
|
447
|
-
|
448
|
-
for (let dev in this.config) {
|
449
|
-
for (let device in backData) {
|
450
|
-
if (device.startsWith("device")) {
|
451
|
-
for (let item in backData[device]) {
|
452
|
-
//遍历结果
|
453
|
-
if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
|
454
|
-
let error = true
|
455
|
-
let n = 0
|
456
|
-
let level = ''
|
457
|
-
for (let i in backData[device][item].f_items) {
|
458
|
-
if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
|
459
|
-
error = false
|
460
|
-
n +=1
|
461
|
-
if(level == ''){
|
462
|
-
level = backData[device][item].f_items[i].f_defect_level
|
463
|
-
}
|
464
|
-
let le = backData[device][item].f_items[i].f_defect_level
|
465
|
-
if(le.startsWith('A')){
|
466
|
-
let i = parseInt(le.substring(1))
|
467
|
-
if(i<parseInt(le.substring(level))){
|
468
|
-
level = le
|
469
|
-
}
|
470
|
-
}else if (le.startsWith('B')){
|
471
|
-
let i = parseInt(le.substring(1))
|
472
|
-
if(i<parseInt(le.substring(level))){
|
473
|
-
level = le
|
474
|
-
}
|
475
|
-
}else if(le.startsWith('C')){
|
476
|
-
let i = parseInt(le.substring(1))
|
477
|
-
if(i<parseInt(le.substring(level))){
|
478
|
-
level = le
|
479
|
-
}
|
480
|
-
}
|
481
|
-
}
|
482
|
-
}
|
483
|
-
if (error) {
|
484
|
-
Resultstr += dev + (backData[device].indexOf(backData[device][item]) + 1) + ':正常;'
|
485
|
-
} else {
|
486
|
-
Resultstr += dev + (backData[device].indexOf(backData[device][item]) + 1) + ':有隐患;'
|
487
|
-
}
|
488
|
-
result['f_err_number'] = n
|
489
|
-
result['f_danger_lever'] = level
|
490
|
-
}
|
491
|
-
}
|
492
|
-
}
|
493
|
-
}
|
494
|
-
}
|
495
|
-
for (let dev in this.config) {
|
496
|
-
for (let device in backData) {
|
497
|
-
if (device.startsWith("device")) {
|
498
|
-
for (let item in backData[device]) {
|
499
|
-
if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
|
500
|
-
for (let i in backData[device][item].f_items) {
|
501
|
-
if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
|
502
|
-
Resultstr += dev + (backData[device].indexOf(backData[device][item]) + 1)+ backData[device][item].f_items[i].f_item_name + ' ' + backData[device][item].f_items[i].f_item_value + ';'
|
503
|
-
|
504
|
-
}
|
505
|
-
}
|
506
|
-
}
|
507
|
-
}
|
508
|
-
}
|
509
|
-
}
|
510
|
-
}
|
511
|
-
|
512
|
-
|
513
|
-
return result
|
514
|
-
},
|
515
|
-
|
516
|
-
uploadCheckPaper(){
|
517
|
-
//tag
|
518
|
-
//获取微信推送路径
|
519
|
-
let url = ""
|
520
|
-
if(Vue.config.safecheck != undefined) {
|
521
|
-
if (Vue.config.safecheck.ApproveConfig != undefined) {
|
522
|
-
if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
|
523
|
-
url = Vue.config.safecheck.ApproveConfig.weixinurl
|
524
|
-
}
|
525
|
-
}
|
526
|
-
}
|
527
|
-
|
528
|
-
let res = this.save()
|
529
|
-
if(res) {
|
530
|
-
let codata = this.getAllDefect()
|
531
|
-
//获取微信推送内容
|
532
|
-
let WxResult = this.getWeixin(codata)
|
533
|
-
let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
|
534
|
-
f_check_item_id: this.data.f_check_item_id
|
535
|
-
})
|
536
|
-
//如果是转维修上传,则不做校验,上传完成后自动转维修
|
537
|
-
//tag
|
538
|
-
//tag
|
539
|
-
if(!this.isToRepair){
|
540
|
-
if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
|
541
|
-
//tag
|
542
|
-
//tag
|
543
|
-
if(!this.isSafeCheckToRepair){
|
544
|
-
this.$showMessage('有未处理的隐患,请前往拍照上传中将安检转为维修单!')
|
545
|
-
return
|
546
|
-
}
|
547
|
-
}
|
548
|
-
}
|
549
|
-
//tag
|
550
|
-
for (let key in codata){
|
551
|
-
if(key.startsWith("device")){
|
552
|
-
codata[key] = []
|
553
|
-
}
|
554
|
-
}
|
555
|
-
//tag}`)
|
556
|
-
// HostApp.uploadPaper({f_check_item_id: this.data.f_check_item_id, f_checker_id: this.data.f_checker_id, data: this.data})
|
557
|
-
try {
|
558
|
-
let response = this.$androidUtil.bzLogic('上传安检信息', {
|
559
|
-
f_check_item_id: this.data.f_check_item_id,
|
560
|
-
f_checker_id: this.data.f_checker_id,
|
561
|
-
row: codata
|
562
|
-
})
|
563
|
-
if (response.code == 200) {
|
564
|
-
//tag
|
565
|
-
//tag)
|
566
|
-
let f_paper_id
|
567
|
-
if(response.data != '' && response.data != null){
|
568
|
-
f_paper_id = JSON.parse(response.data).id
|
569
|
-
}
|
570
|
-
this.$set('data.f_paper_id', f_paper_id)
|
571
|
-
//tag
|
572
|
-
//tag)
|
573
|
-
//tag
|
574
|
-
//tag)
|
575
|
-
for (let device in this.data){
|
576
|
-
//tag
|
577
|
-
//tag)
|
578
|
-
if(device.startsWith("device")){
|
579
|
-
for(let devices of this.data[device]) {
|
580
|
-
devices.f_paper_id = f_paper_id
|
581
|
-
let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
|
582
|
-
row: devices
|
583
|
-
})
|
584
|
-
//tag}`)
|
585
|
-
if(ret.code == 200){
|
586
|
-
//tag
|
587
|
-
devices.f_device_id = JSON.parse(ret.data.f_device_id).id
|
588
|
-
}
|
589
|
-
//tag
|
590
|
-
//tag)
|
591
|
-
if (ret.code != 200) {
|
592
|
-
//TODO 失败后处理
|
593
|
-
// this.isUpload = false
|
594
|
-
this.$showMessage("上传失败!")
|
595
|
-
return false
|
596
|
-
}
|
597
|
-
}
|
598
|
-
}
|
599
|
-
}
|
600
|
-
// for (let device of this.f_devices) {
|
601
|
-
// device.f_paper_id = f_paper_id
|
602
|
-
// //tag
|
603
|
-
// //tag)
|
604
|
-
// let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
|
605
|
-
// row: device
|
606
|
-
// })
|
607
|
-
// //tag
|
608
|
-
// if (ret.code != 200) {
|
609
|
-
// //TODO 失败后处理
|
610
|
-
// HostApp.alert("上传失败!")
|
611
|
-
// return false
|
612
|
-
// }
|
613
|
-
// }
|
614
|
-
let result = this.$androidUtil.bzLogic('FinishUpload',
|
615
|
-
{
|
616
|
-
f_check_item_id: this.data.f_check_item_id,
|
617
|
-
f_userinfo_id: codata.f_userinfoid,
|
618
|
-
f_last_check_result: codata.f_defect_content
|
619
|
-
})
|
620
|
-
if(result.code == 200){
|
621
|
-
// this.$showAlert('上传成功!', 'success', 2000)
|
622
|
-
this.$showMessage('上传成功!')
|
623
|
-
this.isStrat=false
|
624
|
-
if(url != "" ){
|
625
|
-
this.$resetpost(`${url}`,{data:WxResult})
|
626
|
-
}
|
627
|
-
return true
|
628
|
-
}else{
|
629
|
-
// this.isUpload = false
|
630
|
-
this.$showMessage("上传失败!")
|
631
|
-
return false
|
632
|
-
}
|
633
|
-
}else{
|
634
|
-
// this.isUpload = false
|
635
|
-
this.$showMessage("上传失败!")
|
636
|
-
return false
|
637
|
-
}
|
638
|
-
}catch (e) {
|
639
|
-
//tag)
|
640
|
-
// this.isUpload = false
|
641
|
-
this.$showMessage("上传失败!")
|
642
|
-
}
|
643
|
-
}
|
644
|
-
},
|
645
|
-
|
646
|
-
save() {
|
647
|
-
let codata = this.getAllDefect()
|
648
|
-
//tag
|
649
|
-
//tag}`)
|
650
|
-
for (let key in codata){
|
651
|
-
if(key.startsWith("device")){
|
652
|
-
codata[key] = []
|
653
|
-
}
|
654
|
-
}
|
655
|
-
//tag}`)
|
656
|
-
if(Vue.android) {
|
657
|
-
let value = this.$androidUtil.path({alias: 'getUserinfomation', data:{condition: "f_userinfoid = '"+ this.item.f_userinfoid+"' and f_no_checkplan = '无计划安检'"}})
|
658
|
-
|
659
|
-
if(this.item.f_no_checkplan == '无计划安检' && value.data.length == 0 && this.item.f_no_checkplan != '打回'){
|
660
|
-
let result = this.$androidUtil.bzLogic('SafeSaveNoPaper', {
|
661
|
-
f_check_item_id: this.data.f_check_item_id,
|
662
|
-
f_checker_id: this.data.f_checker_id,
|
663
|
-
f_upload_state:'未传',
|
664
|
-
row: codata
|
665
|
-
})
|
666
|
-
if (result.code == 200) {
|
667
|
-
//保存devices
|
668
|
-
let res = this.$androidUtil.bzLogic('getPaperInfo', {
|
669
|
-
f_check_item_id: this.data.f_noplan_item_id
|
670
|
-
})
|
671
|
-
//tag
|
672
|
-
if(res.code == 200){
|
673
|
-
let f_paper_id = res.data[0].id
|
674
|
-
for (let device of this.f_devices){
|
675
|
-
device.f_paper_id = f_paper_id
|
676
|
-
//tag
|
677
|
-
let ret = this.$androidUtil.bzLogic('saveDevice', {
|
678
|
-
row:device
|
679
|
-
})
|
680
|
-
if(ret.code != 200){
|
681
|
-
//TODO 失败后处理
|
682
|
-
// if(this.isUpload){
|
683
|
-
// this.isUpload = false
|
684
|
-
// }
|
685
|
-
this.$showMessage("保存失败!")
|
686
|
-
return false
|
687
|
-
}
|
688
|
-
}
|
689
|
-
}
|
690
|
-
// this.$showAlert('保存成功!', 'success', 2000)
|
691
|
-
this.$showMessage('保存成功!')
|
692
|
-
return true
|
693
|
-
} else {
|
694
|
-
// if(this.isUpload){
|
695
|
-
// this.isUpload = false
|
696
|
-
// }
|
697
|
-
this.$showMessage("保存失败!")
|
698
|
-
return false
|
699
|
-
}
|
700
|
-
}else {
|
701
|
-
//保存paper
|
702
|
-
let result = this.$androidUtil.bzLogic('保存安检单信息', {
|
703
|
-
f_check_item_id: this.data.f_check_item_id,
|
704
|
-
f_checker_id: this.data.f_checker_id,
|
705
|
-
row: codata
|
706
|
-
})
|
707
|
-
if (result.code == 200) {
|
708
|
-
//保存devices
|
709
|
-
let res = this.$androidUtil.bzLogic('getPaperInfo', {
|
710
|
-
f_check_item_id: this.data.f_check_item_id
|
711
|
-
})
|
712
|
-
//tag
|
713
|
-
if(res.code == 200){
|
714
|
-
let f_paper_id = res.data[0].id
|
715
|
-
for (let device of this.f_devices){
|
716
|
-
device.f_paper_id = f_paper_id
|
717
|
-
//tag
|
718
|
-
let ret = this.$androidUtil.bzLogic('saveDevice', {
|
719
|
-
row:device
|
720
|
-
})
|
721
|
-
if(ret.code != 200){
|
722
|
-
//TODO 失败后处理
|
723
|
-
// if(this.isUpload){
|
724
|
-
// this.isUpload = false
|
725
|
-
// }
|
726
|
-
this.$showMessage("保存失败!")
|
727
|
-
return false
|
728
|
-
}
|
729
|
-
}
|
730
|
-
}
|
731
|
-
// this.$showAlert('保存成功!', 'success', 2000)
|
732
|
-
this.$showMessage('保存成功!')
|
733
|
-
return true
|
734
|
-
} else {
|
735
|
-
// if(this.isUpload){
|
736
|
-
// this.isUpload = false
|
737
|
-
// }
|
738
|
-
this.$showMessage("保存失败!")
|
739
|
-
return false
|
740
|
-
}
|
741
|
-
}
|
742
|
-
|
743
|
-
}else{
|
744
|
-
//tag
|
745
|
-
let value = this.$androidUtil.path({alias: 'getUserinfomation', data:{condition: "f_userinfoid = '"+ this.item.f_userinfoid+"' and f_no_checkplan = '无计划安检'"}})
|
746
|
-
|
747
|
-
if(this.item.f_no_checkplan == '无计划安检' && value.data.length == 0 && this.item.f_no_checkplan != '打回'){
|
748
|
-
this.$androidUtil.bzLogic('SafeSaveNoPaper', {
|
749
|
-
f_check_item_id: this.data.f_check_item_id,
|
750
|
-
f_checker_id: this.data.f_checker_id,
|
751
|
-
f_upload_state: '未传',
|
752
|
-
row: codata
|
753
|
-
}).then((res)=> {
|
754
|
-
if (res.data.code == 200) {
|
755
|
-
//保存devices
|
756
|
-
this.$androidUtil.bzLogic('getPaperInfo', {
|
757
|
-
f_check_item_id: this.data.f_check_item_id
|
758
|
-
}).then((res)=>{
|
759
|
-
//tag
|
760
|
-
if(res.data.code == 200){
|
761
|
-
|
762
|
-
let f_paper_id = res.data.data[0].id
|
763
|
-
for (let device of this.f_devices){
|
764
|
-
device.f_paper_id = f_paper_id
|
765
|
-
//tag
|
766
|
-
this.$androidUtil.bzLogic('saveDevice', {
|
767
|
-
row:device
|
768
|
-
}).then((ret)=>{
|
769
|
-
//tag
|
770
|
-
if(ret.code != 200){
|
771
|
-
// if(this.isUpload){
|
772
|
-
// this.isUpload = false
|
773
|
-
// }
|
774
|
-
//TODO 失败后处理
|
775
|
-
this.$showMessage("保存失败!")
|
776
|
-
return false
|
777
|
-
}
|
778
|
-
})
|
779
|
-
}
|
780
|
-
}
|
781
|
-
})
|
782
|
-
// this.$showAlert('保存成功!', 'success', 2000)
|
783
|
-
this.$showMessage('保存成功!')
|
784
|
-
return true
|
785
|
-
} else {
|
786
|
-
// if(this.isUpload){
|
787
|
-
// this.isUpload = false
|
788
|
-
// }
|
789
|
-
this.$showMessage("保存失败!")
|
790
|
-
return false
|
791
|
-
}
|
792
|
-
})
|
793
|
-
}else{
|
794
|
-
this.$androidUtil.bzLogic('保存安检单信息', {
|
795
|
-
f_check_item_id: this.data.f_check_item_id,
|
796
|
-
f_checker_id: this.data.f_checker_id,
|
797
|
-
row: codata
|
798
|
-
}).then((res)=> {
|
799
|
-
//tag
|
800
|
-
if (res.data.code == 200) {
|
801
|
-
//保存devices
|
802
|
-
this.$androidUtil.bzLogic('getPaperInfo', {
|
803
|
-
f_check_item_id: this.data.f_check_item_id
|
804
|
-
}).then((res)=>{
|
805
|
-
//tag
|
806
|
-
if(res.data.code == 200){
|
807
|
-
|
808
|
-
let f_paper_id = res.data.data[0].id
|
809
|
-
for (let device of this.f_devices){
|
810
|
-
device.f_paper_id = f_paper_id
|
811
|
-
//tag
|
812
|
-
this.$androidUtil.bzLogic('saveDevice', {
|
813
|
-
row:device
|
814
|
-
}).then((ret)=>{
|
815
|
-
//tag
|
816
|
-
if(ret.code != 200){
|
817
|
-
// if(this.isUpload){
|
818
|
-
// this.isUpload = false
|
819
|
-
// }
|
820
|
-
//TODO 失败后处理
|
821
|
-
this.$showMessage("保存失败!")
|
822
|
-
return false
|
823
|
-
}
|
824
|
-
})
|
825
|
-
}
|
826
|
-
}
|
827
|
-
})
|
828
|
-
// this.$showAlert('保存成功!', 'success', 2000)
|
829
|
-
this.$showMessage('保存成功!')
|
830
|
-
return true
|
831
|
-
} else {
|
832
|
-
// if(this.isUpload){
|
833
|
-
// this.isUpload = false
|
834
|
-
// }
|
835
|
-
this.$showMessage("保存失败!")
|
836
|
-
return false
|
837
|
-
}
|
838
|
-
})
|
839
|
-
}}},
|
840
|
-
|
841
|
-
disableTimer() {
|
842
|
-
if(this.timer) {
|
843
|
-
window.clearTimeout(this.timer)
|
844
|
-
this.timer = null
|
845
|
-
}
|
846
|
-
},
|
847
|
-
loaded(paper) {
|
848
|
-
if(!paper.hasOwnProperty('id')) {
|
849
|
-
this.$showMessage("该安检单在手机上已经不存在,可能是卸载过程序。可以进入重新安检,或返回安检计划。")
|
850
|
-
this.init()
|
851
|
-
} else {
|
852
|
-
Util.booleanFilter(paper)
|
853
|
-
HostApp.__this__.$set('data', paper)
|
854
|
-
HostApp.__this__.$goto('paper-state', {}, 'paper-router')
|
855
|
-
// 如果打回重检则重新计时
|
856
|
-
//tag
|
857
|
-
if(HostApp.__this__.role == 'inspect'
|
858
|
-
&& HostApp.__this__.data.f_approved
|
859
|
-
&& HostApp.__this__.data.f_approved == '打回') {
|
860
|
-
//tag
|
861
|
-
HostApp.__this__.data.f_onsite_time = Util.toStandardTimeString()
|
862
|
-
HostApp.__this__.tick()
|
863
|
-
}
|
864
|
-
}
|
865
|
-
HostApp.__callback__ = null
|
866
|
-
HostApp.__this__ = null
|
867
|
-
},
|
868
|
-
S4() {
|
869
|
-
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
|
870
|
-
},
|
871
|
-
init1 () {
|
872
|
-
if(this.item.f_collection_type=='按金额'){
|
873
|
-
this.config= {
|
874
|
-
"燃气表":{
|
875
|
-
"checkmust":true,
|
876
|
-
"index":1,
|
877
|
-
"items":{
|
878
|
-
//"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
|
879
|
-
"基表编号":{"index":1,"type":"string","readonly":false,"checkmust":true},
|
880
|
-
"气表型号":{"index":2,"type":"string","readonly":true},
|
881
|
-
"气表品牌":{"index":3,"type":"string","readonly":true},
|
882
|
-
"进气方向":{"index":4,"type":"selector",
|
883
|
-
"multiple": false,
|
884
|
-
"checkmust":true,
|
885
|
-
"options": [
|
886
|
-
{
|
887
|
-
"data": "左表",
|
888
|
-
"isdefect": false,
|
889
|
-
"isdefault": false
|
890
|
-
},
|
891
|
-
{
|
892
|
-
"data": "右表",
|
893
|
-
"isdefect": false,
|
894
|
-
"isdefault": false
|
895
|
-
}
|
896
|
-
]
|
897
|
-
},
|
898
|
-
"初始表底":{"index":5,"type":"number"},
|
899
|
-
"上期表读数":{"index":6,"type":"number","readonly":true,"isshow":true},
|
900
|
-
"本期表读数":{"index":7,"type":"number","checkmust":true},
|
901
|
-
"累购金额":{"index":8,"type":"number","readonly":true},
|
902
|
-
"已用金额":{"index":9,"type":"number","checkmust": false,"isshow":false},
|
903
|
-
//显示屏数 --实际剩余气量
|
904
|
-
"表初始数":{"index":10,"type":"number","checkmust": false},
|
905
|
-
"金额异常差值":{"index":11,"type":"number","readonly": true,"isshow":false}
|
906
|
-
}
|
907
|
-
// 注意,配置项的index必须与上面的固定配置保持'顺序'
|
908
|
-
}
|
909
|
-
}
|
910
|
-
}else{
|
911
|
-
this.config= {
|
912
|
-
"燃气表":{
|
913
|
-
"checkmust":true,
|
914
|
-
"index":1,
|
915
|
-
"items":{
|
916
|
-
//"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
|
917
|
-
"基表编号":{"index":1,"type":"string","readonly":false,"checkmust":true},
|
918
|
-
"气表型号":{"index":2,"type":"string","readonly":true},
|
919
|
-
"气表品牌":{"index":3,"type":"string","readonly":true},
|
920
|
-
"进气方向":{"index":4,"type":"selector",
|
921
|
-
"multiple": false,
|
922
|
-
"checkmust":true,
|
923
|
-
"options": [
|
924
|
-
{
|
925
|
-
"data": "左表",
|
926
|
-
"isdefect": false,
|
927
|
-
"isdefault": false
|
928
|
-
},
|
929
|
-
{
|
930
|
-
"data": "右表",
|
931
|
-
"isdefect": false,
|
932
|
-
"isdefault": false
|
933
|
-
}
|
934
|
-
]
|
935
|
-
},
|
936
|
-
"初始表底":{"index":5,"type":"number"},
|
937
|
-
"上期表读数":{"index":6,"type":"number","readonly":true,"isshow":true},
|
938
|
-
"本期表读数":{"index":7,"type":"number","checkmust":true},
|
939
|
-
"累购气量":{"index":8,"type":"number","readonly":true},
|
940
|
-
"已用气量":{"index":9,"type":"number","checkmust": false,"isshow":false},//基表数
|
941
|
-
"表初始数":{"index":10,"type":"number","checkmust": false},//累购-已用
|
942
|
-
//显示屏数 --实际剩余气量
|
943
|
-
"气量异常差值":{"index":11,"type":"number","readonly": true,"isshow":false},
|
944
|
-
}
|
945
|
-
// 注意,配置项的index必须与上面的固定配置保持'顺序'
|
946
|
-
}
|
947
|
-
}
|
948
|
-
}
|
949
|
-
},
|
950
|
-
init () {
|
951
|
-
this.data.f_noplan_item_id = this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()
|
952
|
-
this.data.ename = Vue.user.ename
|
953
|
-
this.data.f_outlets = Vue.user.f_parentname
|
954
|
-
this.data.f_meetunit = Vue.user.orgpathnames
|
955
|
-
this.data.orgpathstr = Vue.user.orgpathstr
|
956
|
-
this.data.f_check_item_id = this.item.id
|
957
|
-
this.data.f_check_plan_id = this.f_plan_id
|
958
|
-
this.data.f_checker_id = Vue.user.id
|
959
|
-
this.data.f_checker_name = Vue.user.name
|
960
|
-
this.data.f_check_type = this.item.f_user_type
|
961
|
-
this.data.f_subcompany = this.item.f_subcompany
|
962
|
-
this.data.f_approved = this.item.f_approved
|
963
|
-
this.data.f_repair_approved = this.item.f_repair_approved
|
964
|
-
this.data.f_no_checkplan = this.item.f_no_checkplan
|
965
|
-
this.data.f_approved = this.item.f_approved
|
966
|
-
this.data.f_filialeid = this.item.f_filialeid
|
967
|
-
this.data.f_orgstr = this.item.f_orgstr
|
968
|
-
this.data.version = this.item.version
|
969
|
-
this.$set('data.f_meters', this.item.f_plan_meters)
|
970
|
-
this.$set('data.f_userinfo_code', this.item.f_userinfo_code)
|
971
|
-
// 安检状态
|
972
|
-
this.$set('data.f_entry_status', '入户')
|
973
|
-
this.$set('data.f_usegas', '已使用')
|
974
|
-
this.$set('data.f_state',this.item.f_state)
|
975
|
-
// 用户信息
|
976
|
-
this.$set('data.f_user_name', this.item.f_user_name)
|
977
|
-
this.$set('data.f_user_phone', this.item.f_user_phone)
|
978
|
-
this.$set('data.f_userinfoid', this.item.f_userinfoid)
|
979
|
-
this.$set('data.f_address', this.item.f_address)
|
980
|
-
this.$set('data.f_card_id', this.item.f_card_id)
|
981
|
-
this.$set('data.f_area', this.item.f_area)
|
982
|
-
this.$set('data.f_street', this.item.f_street)
|
983
|
-
this.$set('data.f_room',this.item.f_room)
|
984
|
-
this.$set('data.f_building', this.item.f_building)
|
985
|
-
this.$set('data.f_unit',this.item.f_unit)
|
986
|
-
this.$set('data.f_floor', this.item.f_floor)
|
987
|
-
this.$set('data.f_residential_area' , this.item.f_residential_area)
|
988
|
-
this.$set('data.f_idnumber', this.item.f_idnumber)
|
989
|
-
this.$set('data.f_comments', this.item.f_comments)
|
990
|
-
this.$set('data.f_userproperties', this.item.f_userproperties)
|
991
|
-
// 处置方式
|
992
|
-
this.$set('data.f_no_gas_device', false)
|
993
|
-
this.$set('data.f_close_valve', false)
|
994
|
-
this.$set('data.f_unload_battery', false)
|
995
|
-
if (this.data.f_check_item_id == '' && this.item.f_no_checkplan == '无计划安检') {
|
996
|
-
this.data.f_check_item_id = this.data.f_noplan_item_id
|
997
|
-
}
|
998
|
-
|
999
|
-
//房屋结构
|
1000
|
-
// this.$set('data.f_room_style', '多层')
|
1001
|
-
//供暖方式
|
1002
|
-
// this.$set('data.f_heating_style', '热力公司集中供暖')
|
1003
|
-
if(this.item.f_plan_meters) {
|
1004
|
-
for (let de in this.devices) {
|
1005
|
-
this.$set('data.device' + this.devices[de].n, [])
|
1006
|
-
for (let i = 0; i < this.item.f_plan_meters.length; i++) {
|
1007
|
-
if(this.item.f_plan_meters[i].f_meter_type) {
|
1008
|
-
if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_meter_type.indexOf('机表') > 0) {
|
1009
|
-
delete this.config['燃气表']['items']['累计购气量']
|
1010
|
-
this.data['device' + this.devices[de].n].push({
|
1011
|
-
f_device_type: "燃气表",
|
1012
|
-
f_items: [{
|
1013
|
-
f_defect_level: null,
|
1014
|
-
f_device_id: "",
|
1015
|
-
f_is_defect: "",
|
1016
|
-
f_item_name: "表品牌",
|
1017
|
-
f_item_value: this.item.f_plan_meters[i].f_aliasname,
|
1018
|
-
f_path: "",
|
1019
|
-
type: "string"
|
1020
|
-
},
|
1021
|
-
{
|
1022
|
-
f_defect_level: null,
|
1023
|
-
f_device_id: "",
|
1024
|
-
f_is_defect: "",
|
1025
|
-
f_item_name: "位置",
|
1026
|
-
f_item_value: this.item.f_plan_meters[i].f_weizhi,
|
1027
|
-
f_path: "",
|
1028
|
-
type: "selector"
|
1029
|
-
},
|
1030
|
-
{
|
1031
|
-
f_defect_level: null,
|
1032
|
-
f_device_id: "",
|
1033
|
-
f_is_defect: "",
|
1034
|
-
f_item_name: "表号",
|
1035
|
-
f_item_value: this.item.f_plan_meters[i].f_meter_no,
|
1036
|
-
f_path: "",
|
1037
|
-
type: "number"
|
1038
|
-
},
|
1039
|
-
{
|
1040
|
-
f_defect_level: null,
|
1041
|
-
f_device_id: "",
|
1042
|
-
f_is_defect: "",
|
1043
|
-
f_item_name: "表封号",
|
1044
|
-
f_item_value: this.item.f_plan_meters[i].f_metertitles,
|
1045
|
-
f_path: "",
|
1046
|
-
type: "number"
|
1047
|
-
},
|
1048
|
-
{
|
1049
|
-
f_defect_level: null,
|
1050
|
-
f_device_id: "",
|
1051
|
-
f_is_defect: "",
|
1052
|
-
f_item_name: "表型号",
|
1053
|
-
f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
|
1054
|
-
f_path: "",
|
1055
|
-
type: "selector"
|
1056
|
-
},
|
1057
|
-
{
|
1058
|
-
f_defect_level: null,
|
1059
|
-
f_device_id: "",
|
1060
|
-
f_is_defect: "",
|
1061
|
-
f_item_name: "表底数",
|
1062
|
-
f_item_value: this.item.f_plan_meters[i].f_prior_reading,
|
1063
|
-
f_path: "",
|
1064
|
-
type: "number"
|
1065
|
-
}
|
1066
|
-
]
|
1067
|
-
})
|
1068
|
-
} else if (this.devices[de].device == "燃气表") {
|
1069
|
-
delete this.config['燃气表']['items']['表底数']
|
1070
|
-
this.data['device' + this.devices[de].n].push({
|
1071
|
-
f_device_type: "燃气表",
|
1072
|
-
f_items: [{
|
1073
|
-
f_defect_level: null,
|
1074
|
-
f_device_id: "",
|
1075
|
-
f_is_defect: "",
|
1076
|
-
f_item_name: "表品牌",
|
1077
|
-
f_item_value: this.item.f_plan_meters[i].f_aliasname,
|
1078
|
-
f_path: "",
|
1079
|
-
type: "string"
|
1080
|
-
},
|
1081
|
-
{
|
1082
|
-
f_defect_level: null,
|
1083
|
-
f_device_id: "",
|
1084
|
-
f_is_defect: "",
|
1085
|
-
f_item_name: "位置",
|
1086
|
-
f_item_value: this.item.f_plan_meters[i].f_weizhi,
|
1087
|
-
f_path: "",
|
1088
|
-
type: "selector"
|
1089
|
-
},
|
1090
|
-
{
|
1091
|
-
f_defect_level: null,
|
1092
|
-
f_device_id: "",
|
1093
|
-
f_is_defect: "",
|
1094
|
-
f_item_name: "表号",
|
1095
|
-
f_item_value: this.item.f_plan_meters[i].f_meter_no,
|
1096
|
-
f_path: "",
|
1097
|
-
type: "number"
|
1098
|
-
},
|
1099
|
-
{
|
1100
|
-
f_defect_level: null,
|
1101
|
-
f_device_id: "",
|
1102
|
-
f_is_defect: "",
|
1103
|
-
f_item_name: "表封号",
|
1104
|
-
f_item_value: this.item.f_plan_meters[i].f_metertitles,
|
1105
|
-
f_path: "",
|
1106
|
-
type: "number"
|
1107
|
-
},
|
1108
|
-
{
|
1109
|
-
f_defect_level: null,
|
1110
|
-
f_device_id: "",
|
1111
|
-
f_is_defect: "",
|
1112
|
-
f_item_name: "表型号",
|
1113
|
-
f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
|
1114
|
-
f_path: "",
|
1115
|
-
type: "selector"
|
1116
|
-
},
|
1117
|
-
{
|
1118
|
-
f_defect_level: null,
|
1119
|
-
f_device_id: "",
|
1120
|
-
f_is_defect: "",
|
1121
|
-
f_item_name: "累计购气量",
|
1122
|
-
f_item_value: this.item.f_plan_meters[i].f_prior_reading,
|
1123
|
-
f_path: "",
|
1124
|
-
type: "number"
|
1125
|
-
}
|
1126
|
-
]
|
1127
|
-
})
|
1128
|
-
}
|
1129
|
-
}
|
1130
|
-
}
|
1131
|
-
}
|
1132
|
-
}
|
1133
|
-
|
1134
|
-
this.$goto('paper-state', {}, 'paper-router')
|
1135
|
-
},
|
1136
|
-
extend(initalObj, finalObj) {
|
1137
|
-
var obj = finalObj || {};
|
1138
|
-
for (var i in initalObj) {
|
1139
|
-
var prop = initalObj[i];
|
1140
|
-
|
1141
|
-
// 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
|
1142
|
-
if (prop === obj) {
|
1143
|
-
continue;
|
1144
|
-
}
|
1145
|
-
|
1146
|
-
if (typeof prop === 'object') {
|
1147
|
-
if (obj[i]) {
|
1148
|
-
this.extend(obj[i], prop)
|
1149
|
-
} else {
|
1150
|
-
obj[i] = prop;
|
1151
|
-
}
|
1152
|
-
}
|
1153
|
-
}
|
1154
|
-
return obj;
|
1155
|
-
},
|
1156
|
-
/*
|
1157
|
-
var a = {
|
1158
|
-
"燃气表":{
|
1159
|
-
"index": 1,
|
1160
|
-
"checkmust":true,
|
1161
|
-
"items":{
|
1162
|
-
"表具故障":{"index": 13,"multiple":true,"type":"selector","options":[{"data":"死表","isdefect":true,"level":"安检维修"},{"data":"常通","isdefect":true,"level":"安检维修"},{"data":"表体漏气","isdefect":true,"level":"一级隐患安检维修"},{"data":"接口漏气","isdefect":true,"level":"一级隐患安检维修"},{"data":"偷气","isdefect":true,"level":"一级隐患"},{"data":"反装","isdefect":true},{"data":"气量不符","isdefect":true,"level":"安检维修"},{"data":"其他","isdefect":true,"level":"一级隐患"}]},
|
1163
|
-
"其他":{"index": 14,"isshow":false,"type":"string"},
|
1164
|
-
"表具隐患类型":{"index": 15,"multiple":true,"type":"selector","options":[{"data":"挂物","isdefect":true},{"data":"包裹","isdefect":true},{"data":"不便维修","isdefect":true},{"data":"封闭包裹","isdefect":true,"level":"一级隐患"},{"data":"与电源或火源过近","isdefect":true,"level":"三级隐患"}]}
|
1165
|
-
}
|
1166
|
-
},
|
1167
|
-
"报警器":{
|
1168
|
-
"index": 2,
|
1169
|
-
"checkmust":true,
|
1170
|
-
"items":{
|
1171
|
-
"有否":{"index": 1,"multiple":false,"type":"selector","options":[{"data":"有","isdefect":false,"isdefault":true},{"data":"无","isdefect":false}]},
|
1172
|
-
"厂家":{"index": 2,"multiple":false,"isshow":false,"type":"selector","options":[{"data":"汉威","isdefect":false},{"data":"鑫豪斯","isdefect":false},{"data":"友谊","isdefect":false},{"data":"其他","isdefect":false},{"data":"富昌","isdefect":false},{"data":"科信","isdefect":false}]},
|
1173
|
-
"安装时间":{"index": 3,"isshow": false,"type":"date"},
|
1174
|
-
"到期时间":{"index": 4,"isshow": false,"type":"date"},
|
1175
|
-
"是否通电":{"index": 5,"multiple":false,"isshow": false,"type":"selector","options":[{"data":"是","isdefect":false,"isdefault":true},{"data":"否","isdefect":true}]},
|
1176
|
-
"安装渠道":{"index": 6,"isshow": false,"multiple":false,"type":"selector","options":[{"data":"惠众","isdefect":false},{"data":"其他","isdefect":false}]},
|
1177
|
-
"电磁阀接口漏气":{"index": 7,"multiple":false,"isshow": false,"type":"selector","options":[{"data":"否","isdefect":false,"isdefault":true},{"data":"是","isdefect":true,"level":"一级隐患安检维修"}]}
|
1178
|
-
}
|
1179
|
-
}}
|
1180
|
-
*/
|
1181
|
-
putDevices() {
|
1182
|
-
////tag
|
1183
|
-
this.$set('data.approve', "true")
|
1184
|
-
this.$set('data.writeback', "false")
|
1185
|
-
if (Vue.config.safecheck.ApproveConfig != undefined) {
|
1186
|
-
if (Vue.config.safecheck.ApproveConfig.approve != undefined) {
|
1187
|
-
this.$set('data.approve', Vue.config.safecheck.ApproveConfig.approve)
|
1188
|
-
}
|
1189
|
-
if (Vue.config.safecheck.ApproveConfig.writeback != undefined) {
|
1190
|
-
this.$set('data.writeback', Vue.config.safecheck.ApproveConfig.writeback)
|
1191
|
-
}
|
1192
|
-
if (Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
|
1193
|
-
this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
|
1194
|
-
}
|
1195
|
-
}
|
1196
|
-
//tag
|
1197
|
-
|
1198
|
-
// 民用户
|
1199
|
-
this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_check_type]])
|
1200
|
-
// this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
|
1201
|
-
|
1202
|
-
/*if(this.item.f_user_type == '民用'){
|
1203
|
-
// 民用户
|
1204
|
-
this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType['送气类型']['民用']])
|
1205
|
-
// this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
|
1206
|
-
}else {
|
1207
|
-
// 非民用
|
1208
|
-
this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType['送气类型']['非民用']])
|
1209
|
-
}*/
|
1210
|
-
//遍历安检项配置
|
1211
|
-
for (let i in this.config) {
|
1212
|
-
//取得安检项索引值
|
1213
|
-
let n = this.config[i].index
|
1214
|
-
this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
|
1215
|
-
this.$set('data.' + 'device' + n, [])
|
1216
|
-
let items = []
|
1217
|
-
for (let it in this.config[i].items) {
|
1218
|
-
//赋值下拉选项
|
1219
|
-
if (this.config[i].items[it].type == 'selector') {
|
1220
|
-
for (let op in this.config[i].items[it].options)
|
1221
|
-
if (this.config[i].items[it].options[op].isdefault == true) {
|
1222
|
-
items.push({
|
1223
|
-
f_defect_level: this.config[i].items[it].options[op].level,
|
1224
|
-
f_is_defect: this.config[i].items[it].options[op].isdefect,
|
1225
|
-
f_item_name: it,
|
1226
|
-
f_item_value: this.config[i].items[it].options[op].data,
|
1227
|
-
f_path: "",
|
1228
|
-
type: "selector"
|
1229
|
-
})
|
1230
|
-
}
|
1231
|
-
}
|
1232
|
-
}
|
1233
|
-
n = n + 1
|
1234
|
-
}
|
1235
|
-
|
1236
|
-
},
|
1237
|
-
//获取当前时间
|
1238
|
-
getNowFormatDate(){
|
1239
|
-
var date = new Date();
|
1240
|
-
var seperator1 = "-";
|
1241
|
-
var seperator2 = ":";
|
1242
|
-
var month = date.getMonth() + 1;
|
1243
|
-
var strDate = date.getDate();
|
1244
|
-
if (month >= 1 && month <= 9) {
|
1245
|
-
month = "0" + month;
|
1246
|
-
}
|
1247
|
-
if (strDate >= 0 && strDate <= 9) {
|
1248
|
-
strDate = "0" + strDate;
|
1249
|
-
}
|
1250
|
-
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
1251
|
-
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
1252
|
-
+ seperator2 + date.getSeconds();
|
1253
|
-
return currentdate;
|
1254
|
-
}
|
1255
|
-
},
|
1256
|
-
ready() {
|
1257
|
-
this.init1()
|
1258
|
-
this.putDevices()
|
1259
|
-
//如果已检,则提取安检单
|
1260
|
-
|
1261
|
-
if (this.item.f_state != '未检' || this.item.f_no_checkplan == '无计划安检') {
|
1262
|
-
if (this.role != 'inspect') {
|
1263
|
-
let that = this
|
1264
|
-
let id
|
1265
|
-
if (this.role == 'view') {
|
1266
|
-
id = this.item.id
|
1267
|
-
} else if (this.role == 'androidview') {
|
1268
|
-
id = this.item.f_paper_id
|
1269
|
-
}
|
1270
|
-
this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data: {condition: `id = '${id}'`}}).then((respanse) => {
|
1271
|
-
//tag
|
1272
|
-
if (respanse.data.length != 0) {
|
1273
|
-
// 包含 其它 特殊处理的数组
|
1274
|
-
// 对应位置
|
1275
|
-
|
1276
|
-
//tag
|
1277
|
-
|
1278
|
-
that.data = Object.assign(that.data, respanse.data[0])
|
1279
|
-
if (respanse.data[0].f_devices) {
|
1280
|
-
for (let da in that.devices) {
|
1281
|
-
that.$set('data.device' + that.devices[da].n, [])
|
1282
|
-
}
|
1283
|
-
respanse.data[0].f_devices.forEach((item) => {
|
1284
|
-
for (let de in that.devices) {
|
1285
|
-
if (that.devices[de].device == item.f_device_type) {
|
1286
|
-
item.f_items.forEach((f_item) => {
|
1287
|
-
//tag
|
1288
|
-
//tag
|
1289
|
-
let itemValues = []
|
1290
|
-
f_item.f_item_lists.forEach((tempItem) => {
|
1291
|
-
//tag
|
1292
|
-
if (tempItem.f_item_value !== 'null') {
|
1293
|
-
itemValues.push(tempItem.f_item_value)
|
1294
|
-
}
|
1295
|
-
})
|
1296
|
-
f_item.f_item_value = itemValues
|
1297
|
-
})
|
1298
|
-
that.data['device' + that.devices[de].n].push({
|
1299
|
-
f_device_type: item.f_device_type,
|
1300
|
-
f_items: item.f_items
|
1301
|
-
})
|
1302
|
-
}
|
1303
|
-
}
|
1304
|
-
})
|
1305
|
-
}
|
1306
|
-
Util.replaceFalse(that.data)
|
1307
|
-
Util.booleanFilter(that.data)
|
1308
|
-
if (this.role == 'view') {
|
1309
|
-
Util.ratifyPics(that.data)
|
1310
|
-
Util.ratifyPics(that.picture)
|
1311
|
-
} else {
|
1312
|
-
Util.androidRatifyPics(that.data, this.$androidUtil.getProxyUrl())
|
1313
|
-
}
|
1314
|
-
//tag
|
1315
|
-
} else {
|
1316
|
-
alert("该安检单可能已不在本地!")
|
1317
|
-
this.init()
|
1318
|
-
}
|
1319
|
-
// this.$goto('paper-message-blank', {userinfo:this.data,devices:this.devices,config:this.config,role:this.role}, 'self')
|
1320
|
-
this.isshow = true
|
1321
|
-
}
|
1322
|
-
).catch(
|
1323
|
-
(respanse) => {
|
1324
|
-
//tag
|
1325
|
-
alert('查找安检单失败')
|
1326
|
-
})
|
1327
|
-
}
|
1328
|
-
// else {
|
1329
|
-
// let that = this
|
1330
|
-
// this.$androidUtil.bzLogic('FetchCheckPaper', {id: this.item.id}).then((respanse) => {
|
1331
|
-
// if (respanse.data.data.length != 0) {
|
1332
|
-
// that.data = Object.assign(that.data, respanse.data.data[0])
|
1333
|
-
// if (respanse.data.data[0].f_devices) {
|
1334
|
-
// for (let da in that.devices) {
|
1335
|
-
// that.$set('data.device' + that.devices[da].n, [])
|
1336
|
-
// }
|
1337
|
-
// respanse.data.data[0].f_devices.forEach((item) => {
|
1338
|
-
// for (let de in that.devices) {
|
1339
|
-
// if (that.devices[de].device == item.f_device_type) {
|
1340
|
-
// that.$set('data.device' + that.devices[de].n, [])
|
1341
|
-
// that.data['device' + that.devices[de].n].push({
|
1342
|
-
// f_device_type: item.f_device_type,
|
1343
|
-
// f_items: item.f_items
|
1344
|
-
// })
|
1345
|
-
// }
|
1346
|
-
// }
|
1347
|
-
// })
|
1348
|
-
// }
|
1349
|
-
// Util.booleanFilter(that.data)
|
1350
|
-
// //tag
|
1351
|
-
// } else {
|
1352
|
-
// alert("该安检单可能已不在本地!")
|
1353
|
-
// this.init()
|
1354
|
-
// }
|
1355
|
-
// // this.$goto('paper-message-blank', {userinfo:this.data,devices:this.devices,config:this.config,role:this.role}, 'self')
|
1356
|
-
// this.isshow = true
|
1357
|
-
// }
|
1358
|
-
// ).catch(
|
1359
|
-
// (respanse) => {
|
1360
|
-
// alert('查找安检单失败')
|
1361
|
-
// })
|
1362
|
-
// }
|
1363
|
-
} else {
|
1364
|
-
this.init()
|
1365
|
-
}
|
1366
|
-
},
|
1367
|
-
watch:{
|
1368
|
-
// 'isUpload'(val){
|
1369
|
-
// //tag
|
1370
|
-
// }
|
1371
|
-
},
|
1372
|
-
destroyed() {
|
1373
|
-
//tag
|
1374
|
-
this.disableTimer()
|
1375
|
-
}
|
1376
|
-
}
|
1377
|
-
|
1378
|
-
</script>
|
1
|
+
<style scoped>
|
2
|
+
.divmask {
|
3
|
+
pointer-events: none;
|
4
|
+
}
|
5
|
+
.app-header {
|
6
|
+
border-radius: 50%;
|
7
|
+
background: rgba(73, 158, 223, 0.4);
|
8
|
+
color: #FFF;
|
9
|
+
padding: 20px;
|
10
|
+
text-align: center;
|
11
|
+
font-size: 1.2em;
|
12
|
+
z-index: 10;
|
13
|
+
opacity:0.5;
|
14
|
+
bottom: 50px;
|
15
|
+
margin-top: -20px;
|
16
|
+
position: absolute;
|
17
|
+
top: 10%;
|
18
|
+
right: 2%;
|
19
|
+
height: 8%;
|
20
|
+
}
|
21
|
+
</style>
|
22
|
+
|
23
|
+
<template>
|
24
|
+
<div style="overflow-y: scroll;background-color: #FFFFFF">
|
25
|
+
<div class="auto" style="height:auto;" id="safecheck" v-if="isshow">
|
26
|
+
<div class="page-header app-header auto">
|
27
|
+
<div @click="back()">
|
28
|
+
<img src="../../assets/back.png"/>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<div style="width: 50%;height: 462px; margin-left: 20px;margin-top: 0px;margin-bottom: 20px;float:left" id="one">
|
32
|
+
<paper-userm></paper-userm>
|
33
|
+
</div>
|
34
|
+
<div style="width: 45%;height: 462px; margin-left: 20px;margin-top: 0px;margin-bottom: 20px;float:left">
|
35
|
+
<asp-paper-statem></asp-paper-statem>
|
36
|
+
</div>
|
37
|
+
<div style="width: 95%;height: auto;margin-left: 20px;margin-bottom: 30px;float: left">
|
38
|
+
<devicesm> </devicesm>
|
39
|
+
</div>
|
40
|
+
<div style="width: 95%;height: 900px;margin-left: 20px;float: left;">
|
41
|
+
<asp-paper-feedbackm v-bind:paper="this.data" :item="item" ></asp-paper-feedbackm>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</template>
|
46
|
+
|
47
|
+
<script>
|
48
|
+
import PaperUserm from '../android/PaperUserm'
|
49
|
+
import PaperStatem from './AspPaperStatem'
|
50
|
+
import Devicesm from '../android/Devicesm'
|
51
|
+
import PaperFeedbackm from './AspiratedPaperFeedbackm'
|
52
|
+
import RadioGroup from 'vue-client/src/vue-strap/src/radioGroup'
|
53
|
+
import Radio from 'vue-client/src/vue-strap/src/radioBtn'
|
54
|
+
import Vue from 'vue'
|
55
|
+
import * as Util from '../Util'
|
56
|
+
|
57
|
+
export default {
|
58
|
+
title: '安检单',
|
59
|
+
props: ['f_plan_id', 'item', 'role'],
|
60
|
+
data() {
|
61
|
+
return {
|
62
|
+
data: {
|
63
|
+
f_devices: [],
|
64
|
+
f_defect_content:''
|
65
|
+
},
|
66
|
+
isshow:false,
|
67
|
+
isUpload:false,
|
68
|
+
livedispose:'',
|
69
|
+
startClick:false, //开始安检按钮是否可点击
|
70
|
+
isStrat: false, //是否开始安检
|
71
|
+
checkResult:{},//查询结果
|
72
|
+
newcheckResult:{},
|
73
|
+
timer: null,
|
74
|
+
showModal: false,
|
75
|
+
pic_to_be_viewed: '',
|
76
|
+
showBack:true,
|
77
|
+
devices: [],
|
78
|
+
f_devices : [],
|
79
|
+
isToRepair:false,
|
80
|
+
isSafeCheckToRepair:false,//是否转维修
|
81
|
+
config: {
|
82
|
+
"燃气表":{
|
83
|
+
"checkmust":true,
|
84
|
+
"index":1,
|
85
|
+
"items":{
|
86
|
+
//"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
|
87
|
+
"基表编号":{"index":1,"type":"string","readonly":false,"checkmust":true},
|
88
|
+
"气表型号":{"index":2,"type":"string","readonly":true},
|
89
|
+
"气表品牌":{"index":3,"type":"string","readonly":true},
|
90
|
+
"进气方向":{"index":4,"type":"selector",
|
91
|
+
"multiple": false,
|
92
|
+
"checkmust":true,
|
93
|
+
"options": [
|
94
|
+
{
|
95
|
+
"data": "左表",
|
96
|
+
"isdefect": false,
|
97
|
+
"isdefault": false
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"data": "右表",
|
101
|
+
"isdefect": false,
|
102
|
+
"isdefault": false
|
103
|
+
}
|
104
|
+
]
|
105
|
+
},
|
106
|
+
"初始表底":{"index":5,"type":"number"},
|
107
|
+
"上期表读数":{"index":6,"type":"number","readonly":true,"isshow":true},
|
108
|
+
"本期表读数":{"index":7,"type":"number","checkmust":true},
|
109
|
+
"累购气量":{"index":8,"type":"number","readonly":true},
|
110
|
+
"累购金额":{"index":8,"type":"number","readonly":true},
|
111
|
+
"已用气量":{"index":9,"type":"number","checkmust": false,"isshow":false},//基表数
|
112
|
+
"已用金额":{"index":9,"type":"number","checkmust": false,"isshow":false},
|
113
|
+
"表初始数":{"index":10,"type":"number","checkmust": false},//累购-已用
|
114
|
+
//显示屏数 --实际剩余气量
|
115
|
+
"表初始数":{"index":10,"type":"number","checkmust": false},
|
116
|
+
"气量异常差值":{"index":11,"type":"number","readonly": true,"isshow":false},
|
117
|
+
"金额异常差值":{"index":11,"type":"number","readonly": true,"isshow":false}
|
118
|
+
}
|
119
|
+
// 注意,配置项的index必须与上面的固定配置保持'顺序'
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
},
|
124
|
+
components: {
|
125
|
+
RadioGroup,
|
126
|
+
Radio,
|
127
|
+
"paper-userm":PaperUserm,
|
128
|
+
"paper-statem":PaperStatem,
|
129
|
+
"devicesm":Devicesm,
|
130
|
+
"paper-feedbackm":PaperFeedbackm
|
131
|
+
},
|
132
|
+
computed: {
|
133
|
+
selector: {
|
134
|
+
get() {
|
135
|
+
return 'paper-state'
|
136
|
+
},
|
137
|
+
set(val) {
|
138
|
+
if(this.isStrat){
|
139
|
+
//;
|
140
|
+
this.$goto(val, {userinfo:this.data}, 'paper-router')
|
141
|
+
}else{
|
142
|
+
this.$showMessage('未开始安检!')
|
143
|
+
}
|
144
|
+
}
|
145
|
+
},
|
146
|
+
actionEnabled: {
|
147
|
+
get() {
|
148
|
+
return this.role == 'inspect'
|
149
|
+
}
|
150
|
+
}
|
151
|
+
},
|
152
|
+
methods: {
|
153
|
+
back(){
|
154
|
+
if (this.role == 'inspect') {
|
155
|
+
if(!this.isStrat){
|
156
|
+
this.$back()
|
157
|
+
return
|
158
|
+
}else{
|
159
|
+
this.savePaper(true).then(()=>{
|
160
|
+
this.$back()
|
161
|
+
this.isStrat = false
|
162
|
+
})
|
163
|
+
}
|
164
|
+
}else{
|
165
|
+
this.$back()
|
166
|
+
}
|
167
|
+
},
|
168
|
+
checkIsStart(){
|
169
|
+
alert('asdad')
|
170
|
+
return
|
171
|
+
},
|
172
|
+
viewPic(fileName) {
|
173
|
+
//tag
|
174
|
+
if(this.role == 'view') {
|
175
|
+
if(!fileName.endsWith('nopic.png')) {
|
176
|
+
this.pic_to_be_viewed = fileName
|
177
|
+
this.showModal = true
|
178
|
+
}
|
179
|
+
} else {
|
180
|
+
HostApp.viewPic(fileName)
|
181
|
+
}
|
182
|
+
},
|
183
|
+
tick() {
|
184
|
+
this.timer = null
|
185
|
+
this.data.f_offsite_time = Util.toStandardTimeString()
|
186
|
+
this.timer = window.setTimeout(this.tick, 1000)
|
187
|
+
},
|
188
|
+
getRepairState() {
|
189
|
+
let repaired = true
|
190
|
+
this.data.f_defects.forEach((defect) => {
|
191
|
+
repaired = repaired & (defect.f_ratification == '已处理')
|
192
|
+
})
|
193
|
+
return repaired
|
194
|
+
},
|
195
|
+
verifyRepairDefects() {
|
196
|
+
this.data.f_repair_date = Util.toStandardTimeString()
|
197
|
+
this.data.f_repaired = this.getRepairState() ? '已修' : '在修'
|
198
|
+
},
|
199
|
+
async savePaper(saveOnly) {
|
200
|
+
//tag
|
201
|
+
//tag
|
202
|
+
if(this.role == 'repair') {
|
203
|
+
let errorMsg = this.verifyRepairDefects()
|
204
|
+
if(errorMsg) {
|
205
|
+
this.$showMessage(errorMsg)
|
206
|
+
return false
|
207
|
+
}
|
208
|
+
return this.save()
|
209
|
+
} else {
|
210
|
+
//保存时做校验
|
211
|
+
let errString = this.errorVerify()
|
212
|
+
if(saveOnly){
|
213
|
+
if (errString) {
|
214
|
+
this.data.f_complete = '未完成'
|
215
|
+
this.disableTimer()
|
216
|
+
return this.save()
|
217
|
+
} else {
|
218
|
+
//tag
|
219
|
+
if(!this.data.f_offsite_time){
|
220
|
+
this.$set('data.f_offsite_time', Util.toStandardTimeString())
|
221
|
+
}
|
222
|
+
//tag
|
223
|
+
this.data.f_complete = '已完成'
|
224
|
+
this.disableTimer()
|
225
|
+
return this.save()
|
226
|
+
}
|
227
|
+
}else {
|
228
|
+
//tag
|
229
|
+
if (errString) {
|
230
|
+
//tag
|
231
|
+
//tag
|
232
|
+
//tag
|
233
|
+
if (Vue.android){
|
234
|
+
// if(this.isUpload){
|
235
|
+
// this.isUpload = false
|
236
|
+
// }
|
237
|
+
this.$showMessage(errString)
|
238
|
+
}
|
239
|
+
return false
|
240
|
+
} else {
|
241
|
+
if(!this.data.f_offsite_time){
|
242
|
+
this.$set('data.f_offsite_time', Util.toStandardTimeString())
|
243
|
+
}
|
244
|
+
//tag
|
245
|
+
this.data.f_complete = '已完成'
|
246
|
+
this.disableTimer()
|
247
|
+
return this.uploadCheckPaper()
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
},
|
252
|
+
genuineSave(saveOnly) {
|
253
|
+
HostApp.__this__.save(saveOnly)
|
254
|
+
if(!saveOnly)
|
255
|
+
HostApp.__this__.disableTimer()
|
256
|
+
HostApp.__callback__ = null
|
257
|
+
HostApp.__this__ = null
|
258
|
+
},
|
259
|
+
uploadPaper() {
|
260
|
+
// this.isUpload = true
|
261
|
+
//tag
|
262
|
+
this.savePaper(false).then((res) => {
|
263
|
+
//tag
|
264
|
+
// //tag
|
265
|
+
// this.isUpload = false
|
266
|
+
// //tag
|
267
|
+
if(res != true){
|
268
|
+
//tag
|
269
|
+
return
|
270
|
+
}else{
|
271
|
+
this.$back()
|
272
|
+
}
|
273
|
+
})
|
274
|
+
},
|
275
|
+
errorVerify() {
|
276
|
+
let hasError = this.verifyState()
|
277
|
+
if(hasError)
|
278
|
+
return hasError
|
279
|
+
|
280
|
+
if(this.data.f_entry_status != '入户')
|
281
|
+
return null
|
282
|
+
hasError = this.verifyUser()
|
283
|
+
if(hasError)
|
284
|
+
return hasError
|
285
|
+
hasError = this.verifyDevices()
|
286
|
+
if(hasError)
|
287
|
+
return hasError
|
288
|
+
hasError = this.verifyFeedback()
|
289
|
+
if(hasError)
|
290
|
+
return hasError
|
291
|
+
},
|
292
|
+
verifyState() {
|
293
|
+
if(Vue.android && this.data.f_entry_status == '未使用天然气' && this.data.f_nongasuser_path == Vue.nopic)
|
294
|
+
return '未使用天然气则必须拍照'
|
295
|
+
if(Vue.android && this.data.f_entry_status == '到访不遇' && this.data.f_noanswer_path == Vue.nopic)
|
296
|
+
return '到访不遇必须拍照'
|
297
|
+
},
|
298
|
+
verifyUser() {
|
299
|
+
let prefix = '用户基本信息:'
|
300
|
+
if(Util.required(this.data.f_user_name))
|
301
|
+
return prefix + '用户名必须输入'
|
302
|
+
if(Util.required(this.data.f_user_phone))
|
303
|
+
return prefix + '用户电话必须输入'
|
304
|
+
// if(Util.required(this.data.f_residential_area))
|
305
|
+
// return prefix + '小区名称必须输入'
|
306
|
+
if(Util.required(this.data.f_address))
|
307
|
+
return prefix + '地址必须输入'
|
308
|
+
},
|
309
|
+
verifyDevices() {
|
310
|
+
for (let dev in this.config) {
|
311
|
+
if (this.config[dev].checkmust == true) {
|
312
|
+
let error = true
|
313
|
+
for(let device in this.data) {
|
314
|
+
if (device.startsWith("device")) {
|
315
|
+
for (let item in this.data[device]) {
|
316
|
+
if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
|
317
|
+
error = false
|
318
|
+
}
|
319
|
+
}
|
320
|
+
}
|
321
|
+
}
|
322
|
+
if (error) {
|
323
|
+
return "请检查" + dev
|
324
|
+
}
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
for (let dev in this.config) {
|
329
|
+
for(let device in this.data) {
|
330
|
+
if (device.startsWith("device")) {
|
331
|
+
for (let item in this.data[device]) {
|
332
|
+
//检查每一条安检结果
|
333
|
+
if (this.data[device].length != 0 && this.data[device][item].f_device_type == dev) {
|
334
|
+
for (let i in this.data[device][item].f_items) {
|
335
|
+
for (let it in this.config[dev].items) {
|
336
|
+
if (this.config[dev].items[it].checkmust == true && this.data[device][item].f_items[i].f_item_value == '' && this.data[device][item].f_items[i].f_path == '' && it == this.data[device][item].f_items[i].f_item_name) {
|
337
|
+
return dev + (this.data[device].indexOf(this.data[device][item]) + 1) + this.data[device][item].f_items[i].f_item_name + "未检查"
|
338
|
+
}
|
339
|
+
}
|
340
|
+
//检查安检下拉结果
|
341
|
+
if (this.data[device][item].f_items[i].type == 'selector') {
|
342
|
+
if (this.data[device][item].f_items[i].f_is_defect == true && this.data[device][item].f_items[i].f_path == Vue.nopic) {
|
343
|
+
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 + "选中必须拍照"
|
344
|
+
}
|
345
|
+
}
|
346
|
+
}
|
347
|
+
}
|
348
|
+
}
|
349
|
+
}
|
350
|
+
}
|
351
|
+
}
|
352
|
+
},
|
353
|
+
|
354
|
+
|
355
|
+
verifyFeedback() {
|
356
|
+
let prefix = '用户反馈:'
|
357
|
+
if(Vue.android && (!this.data.f_overall_path || this.data.f_overall_path == Vue.nopic) && this.data.f_entry_status == '入户')
|
358
|
+
return prefix + '必须有安检总体照片'
|
359
|
+
if(Vue.android && this.data.f_defect_notified && this.data.f_notified_path == Vue.nopic)
|
360
|
+
return prefix + '下发安检通知书则必须给通知书拍照'
|
361
|
+
if(!this.data.f_client_evaluation && this.data.f_entry_status == '入户')
|
362
|
+
return prefix + '请选择服务评价'
|
363
|
+
},
|
364
|
+
|
365
|
+
setUrgency() {
|
366
|
+
this.data.f_defect_urgency = 'Z'
|
367
|
+
let that = this
|
368
|
+
this.data.f_defects.forEach(function(defect) {
|
369
|
+
if(that.data.f_defect_urgency > defect.f_defect_level.charAt(0))
|
370
|
+
that.data.f_defect_urgency = defect.f_defect_level.charAt(0)
|
371
|
+
})
|
372
|
+
if(this.data.f_defect_urgency == 'Z')
|
373
|
+
this.data.f_defect_urgency = null
|
374
|
+
},
|
375
|
+
|
376
|
+
getAllDefect(){
|
377
|
+
let checkResults={
|
378
|
+
result:'正常',
|
379
|
+
data:[]
|
380
|
+
}
|
381
|
+
let value = ''
|
382
|
+
let codata = JSON.parse(JSON.stringify(this.data))
|
383
|
+
codata.f_devices = []
|
384
|
+
this.f_devices = []
|
385
|
+
for(let device in codata){
|
386
|
+
let f_device_type
|
387
|
+
if(device.startsWith("device")){
|
388
|
+
for(let item in codata[device]) {
|
389
|
+
if(codata[device].length > 1 ){
|
390
|
+
let j = Number.parseInt(item)+1
|
391
|
+
f_device_type = `${codata[device][item].f_device_type}${j}`
|
392
|
+
}else{
|
393
|
+
f_device_type = codata[device][item].f_device_type
|
394
|
+
}
|
395
|
+
// //tag
|
396
|
+
for(let i in codata[device][item].f_items){
|
397
|
+
let items = codata[device][item].f_items[i]
|
398
|
+
//tag
|
399
|
+
//tag
|
400
|
+
if(items.f_is_defect == true || items.f_is_defect == 'true'){
|
401
|
+
//tag
|
402
|
+
checkResults.result = '有隐患'
|
403
|
+
if(!this.checkResult.hasOwnProperty(items.f_defect_level)){
|
404
|
+
if(f_device_type.indexOf('其他') != -1){
|
405
|
+
this.$set('checkResult.' + items.f_defect_level,`${f_device_type}${items.f_item_name}`)
|
406
|
+
}else{
|
407
|
+
this.$set('checkResult.' + items.f_defect_level,`${f_device_type}${items.f_item_name}${items.f_item_value}`)
|
408
|
+
}
|
409
|
+
}else{
|
410
|
+
//tag
|
411
|
+
if(f_device_type.indexOf('其他') != -1){
|
412
|
+
this.$set('checkResult.' + items.f_defect_level,`${this.checkResult[items.f_defect_level]},${f_device_type}${items.f_item_name}`)
|
413
|
+
}else{
|
414
|
+
this.$set('checkResult.' + items.f_defect_level,`${this.checkResult[items.f_defect_level]},${f_device_type}${items.f_item_name}${items.f_item_value}`)
|
415
|
+
}
|
416
|
+
|
417
|
+
}
|
418
|
+
}
|
419
|
+
if(items.type == 'selector'){
|
420
|
+
items.selected = ''
|
421
|
+
}
|
422
|
+
}
|
423
|
+
//tag
|
424
|
+
this.f_devices.push(codata[device][item])
|
425
|
+
}
|
426
|
+
}
|
427
|
+
}
|
428
|
+
if(this.checkResult){
|
429
|
+
for (let key in this.checkResult){
|
430
|
+
//tag
|
431
|
+
this.$set('newcheckResult.'+key,this.checkResult[key])
|
432
|
+
checkResults.data.push(this.newcheckResult)
|
433
|
+
this.newcheckResult = {}
|
434
|
+
}
|
435
|
+
this.checkResult = {}
|
436
|
+
}
|
437
|
+
//tag
|
438
|
+
codata.f_defect_content = JSON.stringify(checkResults)
|
439
|
+
//tag
|
440
|
+
return codata
|
441
|
+
},
|
442
|
+
|
443
|
+
getWeixin(backData){
|
444
|
+
let result = {f_user_name:backData.f_user_name,checker: Vue.user.name, f_check_date: Util.toStandardDateString(),f_userinfo_id:backData.f_userinfoid,f_address:backData.f_address}
|
445
|
+
|
446
|
+
let Resultstr = ''
|
447
|
+
|
448
|
+
for (let dev in this.config) {
|
449
|
+
for (let device in backData) {
|
450
|
+
if (device.startsWith("device")) {
|
451
|
+
for (let item in backData[device]) {
|
452
|
+
//遍历结果
|
453
|
+
if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
|
454
|
+
let error = true
|
455
|
+
let n = 0
|
456
|
+
let level = ''
|
457
|
+
for (let i in backData[device][item].f_items) {
|
458
|
+
if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
|
459
|
+
error = false
|
460
|
+
n +=1
|
461
|
+
if(level == ''){
|
462
|
+
level = backData[device][item].f_items[i].f_defect_level
|
463
|
+
}
|
464
|
+
let le = backData[device][item].f_items[i].f_defect_level
|
465
|
+
if(le.startsWith('A')){
|
466
|
+
let i = parseInt(le.substring(1))
|
467
|
+
if(i<parseInt(le.substring(level))){
|
468
|
+
level = le
|
469
|
+
}
|
470
|
+
}else if (le.startsWith('B')){
|
471
|
+
let i = parseInt(le.substring(1))
|
472
|
+
if(i<parseInt(le.substring(level))){
|
473
|
+
level = le
|
474
|
+
}
|
475
|
+
}else if(le.startsWith('C')){
|
476
|
+
let i = parseInt(le.substring(1))
|
477
|
+
if(i<parseInt(le.substring(level))){
|
478
|
+
level = le
|
479
|
+
}
|
480
|
+
}
|
481
|
+
}
|
482
|
+
}
|
483
|
+
if (error) {
|
484
|
+
Resultstr += dev + (backData[device].indexOf(backData[device][item]) + 1) + ':正常;'
|
485
|
+
} else {
|
486
|
+
Resultstr += dev + (backData[device].indexOf(backData[device][item]) + 1) + ':有隐患;'
|
487
|
+
}
|
488
|
+
result['f_err_number'] = n
|
489
|
+
result['f_danger_lever'] = level
|
490
|
+
}
|
491
|
+
}
|
492
|
+
}
|
493
|
+
}
|
494
|
+
}
|
495
|
+
for (let dev in this.config) {
|
496
|
+
for (let device in backData) {
|
497
|
+
if (device.startsWith("device")) {
|
498
|
+
for (let item in backData[device]) {
|
499
|
+
if (backData[device].length != 0 && backData[device][item].f_device_type == dev) {
|
500
|
+
for (let i in backData[device][item].f_items) {
|
501
|
+
if (backData[device][item].f_items[i].f_is_defect == true || backData[device][item].f_items[i].f_is_defect == 'true') {
|
502
|
+
Resultstr += dev + (backData[device].indexOf(backData[device][item]) + 1)+ backData[device][item].f_items[i].f_item_name + ' ' + backData[device][item].f_items[i].f_item_value + ';'
|
503
|
+
|
504
|
+
}
|
505
|
+
}
|
506
|
+
}
|
507
|
+
}
|
508
|
+
}
|
509
|
+
}
|
510
|
+
}
|
511
|
+
|
512
|
+
|
513
|
+
return result
|
514
|
+
},
|
515
|
+
|
516
|
+
uploadCheckPaper(){
|
517
|
+
//tag
|
518
|
+
//获取微信推送路径
|
519
|
+
let url = ""
|
520
|
+
if(Vue.config.safecheck != undefined) {
|
521
|
+
if (Vue.config.safecheck.ApproveConfig != undefined) {
|
522
|
+
if (Vue.config.safecheck.ApproveConfig.weixinurl != undefined) {
|
523
|
+
url = Vue.config.safecheck.ApproveConfig.weixinurl
|
524
|
+
}
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
528
|
+
let res = this.save()
|
529
|
+
if(res) {
|
530
|
+
let codata = this.getAllDefect()
|
531
|
+
//获取微信推送内容
|
532
|
+
let WxResult = this.getWeixin(codata)
|
533
|
+
let haslivedispose = this.$androidUtil.bzLogic('getLiveDispose', {
|
534
|
+
f_check_item_id: this.data.f_check_item_id
|
535
|
+
})
|
536
|
+
//如果是转维修上传,则不做校验,上传完成后自动转维修
|
537
|
+
//tag
|
538
|
+
//tag
|
539
|
+
if(!this.isToRepair){
|
540
|
+
if(haslivedispose.data.length > 0 && (this.livedispose == 'true' || this.livedispose == true)){
|
541
|
+
//tag
|
542
|
+
//tag
|
543
|
+
if(!this.isSafeCheckToRepair){
|
544
|
+
this.$showMessage('有未处理的隐患,请前往拍照上传中将安检转为维修单!')
|
545
|
+
return
|
546
|
+
}
|
547
|
+
}
|
548
|
+
}
|
549
|
+
//tag
|
550
|
+
for (let key in codata){
|
551
|
+
if(key.startsWith("device")){
|
552
|
+
codata[key] = []
|
553
|
+
}
|
554
|
+
}
|
555
|
+
//tag}`)
|
556
|
+
// HostApp.uploadPaper({f_check_item_id: this.data.f_check_item_id, f_checker_id: this.data.f_checker_id, data: this.data})
|
557
|
+
try {
|
558
|
+
let response = this.$androidUtil.bzLogic('上传安检信息', {
|
559
|
+
f_check_item_id: this.data.f_check_item_id,
|
560
|
+
f_checker_id: this.data.f_checker_id,
|
561
|
+
row: codata
|
562
|
+
})
|
563
|
+
if (response.code == 200) {
|
564
|
+
//tag
|
565
|
+
//tag)
|
566
|
+
let f_paper_id
|
567
|
+
if(response.data != '' && response.data != null){
|
568
|
+
f_paper_id = JSON.parse(response.data).id
|
569
|
+
}
|
570
|
+
this.$set('data.f_paper_id', f_paper_id)
|
571
|
+
//tag
|
572
|
+
//tag)
|
573
|
+
//tag
|
574
|
+
//tag)
|
575
|
+
for (let device in this.data){
|
576
|
+
//tag
|
577
|
+
//tag)
|
578
|
+
if(device.startsWith("device")){
|
579
|
+
for(let devices of this.data[device]) {
|
580
|
+
devices.f_paper_id = f_paper_id
|
581
|
+
let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
|
582
|
+
row: devices
|
583
|
+
})
|
584
|
+
//tag}`)
|
585
|
+
if(ret.code == 200){
|
586
|
+
//tag
|
587
|
+
devices.f_device_id = JSON.parse(ret.data.f_device_id).id
|
588
|
+
}
|
589
|
+
//tag
|
590
|
+
//tag)
|
591
|
+
if (ret.code != 200) {
|
592
|
+
//TODO 失败后处理
|
593
|
+
// this.isUpload = false
|
594
|
+
this.$showMessage("上传失败!")
|
595
|
+
return false
|
596
|
+
}
|
597
|
+
}
|
598
|
+
}
|
599
|
+
}
|
600
|
+
// for (let device of this.f_devices) {
|
601
|
+
// device.f_paper_id = f_paper_id
|
602
|
+
// //tag
|
603
|
+
// //tag)
|
604
|
+
// let ret = this.$androidUtil.bzLogic('UpCheckPaperDevices', {
|
605
|
+
// row: device
|
606
|
+
// })
|
607
|
+
// //tag
|
608
|
+
// if (ret.code != 200) {
|
609
|
+
// //TODO 失败后处理
|
610
|
+
// HostApp.alert("上传失败!")
|
611
|
+
// return false
|
612
|
+
// }
|
613
|
+
// }
|
614
|
+
let result = this.$androidUtil.bzLogic('FinishUpload',
|
615
|
+
{
|
616
|
+
f_check_item_id: this.data.f_check_item_id,
|
617
|
+
f_userinfo_id: codata.f_userinfoid,
|
618
|
+
f_last_check_result: codata.f_defect_content
|
619
|
+
})
|
620
|
+
if(result.code == 200){
|
621
|
+
// this.$showAlert('上传成功!', 'success', 2000)
|
622
|
+
this.$showMessage('上传成功!')
|
623
|
+
this.isStrat=false
|
624
|
+
if(url != "" ){
|
625
|
+
this.$resetpost(`${url}`,{data:WxResult})
|
626
|
+
}
|
627
|
+
return true
|
628
|
+
}else{
|
629
|
+
// this.isUpload = false
|
630
|
+
this.$showMessage("上传失败!")
|
631
|
+
return false
|
632
|
+
}
|
633
|
+
}else{
|
634
|
+
// this.isUpload = false
|
635
|
+
this.$showMessage("上传失败!")
|
636
|
+
return false
|
637
|
+
}
|
638
|
+
}catch (e) {
|
639
|
+
//tag)
|
640
|
+
// this.isUpload = false
|
641
|
+
this.$showMessage("上传失败!")
|
642
|
+
}
|
643
|
+
}
|
644
|
+
},
|
645
|
+
|
646
|
+
save() {
|
647
|
+
let codata = this.getAllDefect()
|
648
|
+
//tag
|
649
|
+
//tag}`)
|
650
|
+
for (let key in codata){
|
651
|
+
if(key.startsWith("device")){
|
652
|
+
codata[key] = []
|
653
|
+
}
|
654
|
+
}
|
655
|
+
//tag}`)
|
656
|
+
if(Vue.android) {
|
657
|
+
let value = this.$androidUtil.path({alias: 'getUserinfomation', data:{condition: "f_userinfoid = '"+ this.item.f_userinfoid+"' and f_no_checkplan = '无计划安检'"}})
|
658
|
+
|
659
|
+
if(this.item.f_no_checkplan == '无计划安检' && value.data.length == 0 && this.item.f_no_checkplan != '打回'){
|
660
|
+
let result = this.$androidUtil.bzLogic('SafeSaveNoPaper', {
|
661
|
+
f_check_item_id: this.data.f_check_item_id,
|
662
|
+
f_checker_id: this.data.f_checker_id,
|
663
|
+
f_upload_state:'未传',
|
664
|
+
row: codata
|
665
|
+
})
|
666
|
+
if (result.code == 200) {
|
667
|
+
//保存devices
|
668
|
+
let res = this.$androidUtil.bzLogic('getPaperInfo', {
|
669
|
+
f_check_item_id: this.data.f_noplan_item_id
|
670
|
+
})
|
671
|
+
//tag
|
672
|
+
if(res.code == 200){
|
673
|
+
let f_paper_id = res.data[0].id
|
674
|
+
for (let device of this.f_devices){
|
675
|
+
device.f_paper_id = f_paper_id
|
676
|
+
//tag
|
677
|
+
let ret = this.$androidUtil.bzLogic('saveDevice', {
|
678
|
+
row:device
|
679
|
+
})
|
680
|
+
if(ret.code != 200){
|
681
|
+
//TODO 失败后处理
|
682
|
+
// if(this.isUpload){
|
683
|
+
// this.isUpload = false
|
684
|
+
// }
|
685
|
+
this.$showMessage("保存失败!")
|
686
|
+
return false
|
687
|
+
}
|
688
|
+
}
|
689
|
+
}
|
690
|
+
// this.$showAlert('保存成功!', 'success', 2000)
|
691
|
+
this.$showMessage('保存成功!')
|
692
|
+
return true
|
693
|
+
} else {
|
694
|
+
// if(this.isUpload){
|
695
|
+
// this.isUpload = false
|
696
|
+
// }
|
697
|
+
this.$showMessage("保存失败!")
|
698
|
+
return false
|
699
|
+
}
|
700
|
+
}else {
|
701
|
+
//保存paper
|
702
|
+
let result = this.$androidUtil.bzLogic('保存安检单信息', {
|
703
|
+
f_check_item_id: this.data.f_check_item_id,
|
704
|
+
f_checker_id: this.data.f_checker_id,
|
705
|
+
row: codata
|
706
|
+
})
|
707
|
+
if (result.code == 200) {
|
708
|
+
//保存devices
|
709
|
+
let res = this.$androidUtil.bzLogic('getPaperInfo', {
|
710
|
+
f_check_item_id: this.data.f_check_item_id
|
711
|
+
})
|
712
|
+
//tag
|
713
|
+
if(res.code == 200){
|
714
|
+
let f_paper_id = res.data[0].id
|
715
|
+
for (let device of this.f_devices){
|
716
|
+
device.f_paper_id = f_paper_id
|
717
|
+
//tag
|
718
|
+
let ret = this.$androidUtil.bzLogic('saveDevice', {
|
719
|
+
row:device
|
720
|
+
})
|
721
|
+
if(ret.code != 200){
|
722
|
+
//TODO 失败后处理
|
723
|
+
// if(this.isUpload){
|
724
|
+
// this.isUpload = false
|
725
|
+
// }
|
726
|
+
this.$showMessage("保存失败!")
|
727
|
+
return false
|
728
|
+
}
|
729
|
+
}
|
730
|
+
}
|
731
|
+
// this.$showAlert('保存成功!', 'success', 2000)
|
732
|
+
this.$showMessage('保存成功!')
|
733
|
+
return true
|
734
|
+
} else {
|
735
|
+
// if(this.isUpload){
|
736
|
+
// this.isUpload = false
|
737
|
+
// }
|
738
|
+
this.$showMessage("保存失败!")
|
739
|
+
return false
|
740
|
+
}
|
741
|
+
}
|
742
|
+
|
743
|
+
}else{
|
744
|
+
//tag
|
745
|
+
let value = this.$androidUtil.path({alias: 'getUserinfomation', data:{condition: "f_userinfoid = '"+ this.item.f_userinfoid+"' and f_no_checkplan = '无计划安检'"}})
|
746
|
+
|
747
|
+
if(this.item.f_no_checkplan == '无计划安检' && value.data.length == 0 && this.item.f_no_checkplan != '打回'){
|
748
|
+
this.$androidUtil.bzLogic('SafeSaveNoPaper', {
|
749
|
+
f_check_item_id: this.data.f_check_item_id,
|
750
|
+
f_checker_id: this.data.f_checker_id,
|
751
|
+
f_upload_state: '未传',
|
752
|
+
row: codata
|
753
|
+
}).then((res)=> {
|
754
|
+
if (res.data.code == 200) {
|
755
|
+
//保存devices
|
756
|
+
this.$androidUtil.bzLogic('getPaperInfo', {
|
757
|
+
f_check_item_id: this.data.f_check_item_id
|
758
|
+
}).then((res)=>{
|
759
|
+
//tag
|
760
|
+
if(res.data.code == 200){
|
761
|
+
|
762
|
+
let f_paper_id = res.data.data[0].id
|
763
|
+
for (let device of this.f_devices){
|
764
|
+
device.f_paper_id = f_paper_id
|
765
|
+
//tag
|
766
|
+
this.$androidUtil.bzLogic('saveDevice', {
|
767
|
+
row:device
|
768
|
+
}).then((ret)=>{
|
769
|
+
//tag
|
770
|
+
if(ret.code != 200){
|
771
|
+
// if(this.isUpload){
|
772
|
+
// this.isUpload = false
|
773
|
+
// }
|
774
|
+
//TODO 失败后处理
|
775
|
+
this.$showMessage("保存失败!")
|
776
|
+
return false
|
777
|
+
}
|
778
|
+
})
|
779
|
+
}
|
780
|
+
}
|
781
|
+
})
|
782
|
+
// this.$showAlert('保存成功!', 'success', 2000)
|
783
|
+
this.$showMessage('保存成功!')
|
784
|
+
return true
|
785
|
+
} else {
|
786
|
+
// if(this.isUpload){
|
787
|
+
// this.isUpload = false
|
788
|
+
// }
|
789
|
+
this.$showMessage("保存失败!")
|
790
|
+
return false
|
791
|
+
}
|
792
|
+
})
|
793
|
+
}else{
|
794
|
+
this.$androidUtil.bzLogic('保存安检单信息', {
|
795
|
+
f_check_item_id: this.data.f_check_item_id,
|
796
|
+
f_checker_id: this.data.f_checker_id,
|
797
|
+
row: codata
|
798
|
+
}).then((res)=> {
|
799
|
+
//tag
|
800
|
+
if (res.data.code == 200) {
|
801
|
+
//保存devices
|
802
|
+
this.$androidUtil.bzLogic('getPaperInfo', {
|
803
|
+
f_check_item_id: this.data.f_check_item_id
|
804
|
+
}).then((res)=>{
|
805
|
+
//tag
|
806
|
+
if(res.data.code == 200){
|
807
|
+
|
808
|
+
let f_paper_id = res.data.data[0].id
|
809
|
+
for (let device of this.f_devices){
|
810
|
+
device.f_paper_id = f_paper_id
|
811
|
+
//tag
|
812
|
+
this.$androidUtil.bzLogic('saveDevice', {
|
813
|
+
row:device
|
814
|
+
}).then((ret)=>{
|
815
|
+
//tag
|
816
|
+
if(ret.code != 200){
|
817
|
+
// if(this.isUpload){
|
818
|
+
// this.isUpload = false
|
819
|
+
// }
|
820
|
+
//TODO 失败后处理
|
821
|
+
this.$showMessage("保存失败!")
|
822
|
+
return false
|
823
|
+
}
|
824
|
+
})
|
825
|
+
}
|
826
|
+
}
|
827
|
+
})
|
828
|
+
// this.$showAlert('保存成功!', 'success', 2000)
|
829
|
+
this.$showMessage('保存成功!')
|
830
|
+
return true
|
831
|
+
} else {
|
832
|
+
// if(this.isUpload){
|
833
|
+
// this.isUpload = false
|
834
|
+
// }
|
835
|
+
this.$showMessage("保存失败!")
|
836
|
+
return false
|
837
|
+
}
|
838
|
+
})
|
839
|
+
}}},
|
840
|
+
|
841
|
+
disableTimer() {
|
842
|
+
if(this.timer) {
|
843
|
+
window.clearTimeout(this.timer)
|
844
|
+
this.timer = null
|
845
|
+
}
|
846
|
+
},
|
847
|
+
loaded(paper) {
|
848
|
+
if(!paper.hasOwnProperty('id')) {
|
849
|
+
this.$showMessage("该安检单在手机上已经不存在,可能是卸载过程序。可以进入重新安检,或返回安检计划。")
|
850
|
+
this.init()
|
851
|
+
} else {
|
852
|
+
Util.booleanFilter(paper)
|
853
|
+
HostApp.__this__.$set('data', paper)
|
854
|
+
HostApp.__this__.$goto('paper-state', {}, 'paper-router')
|
855
|
+
// 如果打回重检则重新计时
|
856
|
+
//tag
|
857
|
+
if(HostApp.__this__.role == 'inspect'
|
858
|
+
&& HostApp.__this__.data.f_approved
|
859
|
+
&& HostApp.__this__.data.f_approved == '打回') {
|
860
|
+
//tag
|
861
|
+
HostApp.__this__.data.f_onsite_time = Util.toStandardTimeString()
|
862
|
+
HostApp.__this__.tick()
|
863
|
+
}
|
864
|
+
}
|
865
|
+
HostApp.__callback__ = null
|
866
|
+
HostApp.__this__ = null
|
867
|
+
},
|
868
|
+
S4() {
|
869
|
+
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
|
870
|
+
},
|
871
|
+
init1 () {
|
872
|
+
if(this.item.f_collection_type=='按金额'){
|
873
|
+
this.config= {
|
874
|
+
"燃气表":{
|
875
|
+
"checkmust":true,
|
876
|
+
"index":1,
|
877
|
+
"items":{
|
878
|
+
//"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
|
879
|
+
"基表编号":{"index":1,"type":"string","readonly":false,"checkmust":true},
|
880
|
+
"气表型号":{"index":2,"type":"string","readonly":true},
|
881
|
+
"气表品牌":{"index":3,"type":"string","readonly":true},
|
882
|
+
"进气方向":{"index":4,"type":"selector",
|
883
|
+
"multiple": false,
|
884
|
+
"checkmust":true,
|
885
|
+
"options": [
|
886
|
+
{
|
887
|
+
"data": "左表",
|
888
|
+
"isdefect": false,
|
889
|
+
"isdefault": false
|
890
|
+
},
|
891
|
+
{
|
892
|
+
"data": "右表",
|
893
|
+
"isdefect": false,
|
894
|
+
"isdefault": false
|
895
|
+
}
|
896
|
+
]
|
897
|
+
},
|
898
|
+
"初始表底":{"index":5,"type":"number"},
|
899
|
+
"上期表读数":{"index":6,"type":"number","readonly":true,"isshow":true},
|
900
|
+
"本期表读数":{"index":7,"type":"number","checkmust":true},
|
901
|
+
"累购金额":{"index":8,"type":"number","readonly":true},
|
902
|
+
"已用金额":{"index":9,"type":"number","checkmust": false,"isshow":false},
|
903
|
+
//显示屏数 --实际剩余气量
|
904
|
+
"表初始数":{"index":10,"type":"number","checkmust": false},
|
905
|
+
"金额异常差值":{"index":11,"type":"number","readonly": true,"isshow":false}
|
906
|
+
}
|
907
|
+
// 注意,配置项的index必须与上面的固定配置保持'顺序'
|
908
|
+
}
|
909
|
+
}
|
910
|
+
}else{
|
911
|
+
this.config= {
|
912
|
+
"燃气表":{
|
913
|
+
"checkmust":true,
|
914
|
+
"index":1,
|
915
|
+
"items":{
|
916
|
+
//"燃气表照片":{"index":1,"type":"picture","remark":"(拍摄清晰的表具编号、字轮数、剩余气量等)"},
|
917
|
+
"基表编号":{"index":1,"type":"string","readonly":false,"checkmust":true},
|
918
|
+
"气表型号":{"index":2,"type":"string","readonly":true},
|
919
|
+
"气表品牌":{"index":3,"type":"string","readonly":true},
|
920
|
+
"进气方向":{"index":4,"type":"selector",
|
921
|
+
"multiple": false,
|
922
|
+
"checkmust":true,
|
923
|
+
"options": [
|
924
|
+
{
|
925
|
+
"data": "左表",
|
926
|
+
"isdefect": false,
|
927
|
+
"isdefault": false
|
928
|
+
},
|
929
|
+
{
|
930
|
+
"data": "右表",
|
931
|
+
"isdefect": false,
|
932
|
+
"isdefault": false
|
933
|
+
}
|
934
|
+
]
|
935
|
+
},
|
936
|
+
"初始表底":{"index":5,"type":"number"},
|
937
|
+
"上期表读数":{"index":6,"type":"number","readonly":true,"isshow":true},
|
938
|
+
"本期表读数":{"index":7,"type":"number","checkmust":true},
|
939
|
+
"累购气量":{"index":8,"type":"number","readonly":true},
|
940
|
+
"已用气量":{"index":9,"type":"number","checkmust": false,"isshow":false},//基表数
|
941
|
+
"表初始数":{"index":10,"type":"number","checkmust": false},//累购-已用
|
942
|
+
//显示屏数 --实际剩余气量
|
943
|
+
"气量异常差值":{"index":11,"type":"number","readonly": true,"isshow":false},
|
944
|
+
}
|
945
|
+
// 注意,配置项的index必须与上面的固定配置保持'顺序'
|
946
|
+
}
|
947
|
+
}
|
948
|
+
}
|
949
|
+
},
|
950
|
+
init () {
|
951
|
+
this.data.f_noplan_item_id = this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()+""+this.S4()
|
952
|
+
this.data.ename = Vue.user.ename
|
953
|
+
this.data.f_outlets = Vue.user.f_parentname
|
954
|
+
this.data.f_meetunit = Vue.user.orgpathnames
|
955
|
+
this.data.orgpathstr = Vue.user.orgpathstr
|
956
|
+
this.data.f_check_item_id = this.item.id
|
957
|
+
this.data.f_check_plan_id = this.f_plan_id
|
958
|
+
this.data.f_checker_id = Vue.user.id
|
959
|
+
this.data.f_checker_name = Vue.user.name
|
960
|
+
this.data.f_check_type = this.item.f_user_type
|
961
|
+
this.data.f_subcompany = this.item.f_subcompany
|
962
|
+
this.data.f_approved = this.item.f_approved
|
963
|
+
this.data.f_repair_approved = this.item.f_repair_approved
|
964
|
+
this.data.f_no_checkplan = this.item.f_no_checkplan
|
965
|
+
this.data.f_approved = this.item.f_approved
|
966
|
+
this.data.f_filialeid = this.item.f_filialeid
|
967
|
+
this.data.f_orgstr = this.item.f_orgstr
|
968
|
+
this.data.version = this.item.version
|
969
|
+
this.$set('data.f_meters', this.item.f_plan_meters)
|
970
|
+
this.$set('data.f_userinfo_code', this.item.f_userinfo_code)
|
971
|
+
// 安检状态
|
972
|
+
this.$set('data.f_entry_status', '入户')
|
973
|
+
this.$set('data.f_usegas', '已使用')
|
974
|
+
this.$set('data.f_state',this.item.f_state)
|
975
|
+
// 用户信息
|
976
|
+
this.$set('data.f_user_name', this.item.f_user_name)
|
977
|
+
this.$set('data.f_user_phone', this.item.f_user_phone)
|
978
|
+
this.$set('data.f_userinfoid', this.item.f_userinfoid)
|
979
|
+
this.$set('data.f_address', this.item.f_address)
|
980
|
+
this.$set('data.f_card_id', this.item.f_card_id)
|
981
|
+
this.$set('data.f_area', this.item.f_area)
|
982
|
+
this.$set('data.f_street', this.item.f_street)
|
983
|
+
this.$set('data.f_room',this.item.f_room)
|
984
|
+
this.$set('data.f_building', this.item.f_building)
|
985
|
+
this.$set('data.f_unit',this.item.f_unit)
|
986
|
+
this.$set('data.f_floor', this.item.f_floor)
|
987
|
+
this.$set('data.f_residential_area' , this.item.f_residential_area)
|
988
|
+
this.$set('data.f_idnumber', this.item.f_idnumber)
|
989
|
+
this.$set('data.f_comments', this.item.f_comments)
|
990
|
+
this.$set('data.f_userproperties', this.item.f_userproperties)
|
991
|
+
// 处置方式
|
992
|
+
this.$set('data.f_no_gas_device', false)
|
993
|
+
this.$set('data.f_close_valve', false)
|
994
|
+
this.$set('data.f_unload_battery', false)
|
995
|
+
if (this.data.f_check_item_id == '' && this.item.f_no_checkplan == '无计划安检') {
|
996
|
+
this.data.f_check_item_id = this.data.f_noplan_item_id
|
997
|
+
}
|
998
|
+
|
999
|
+
//房屋结构
|
1000
|
+
// this.$set('data.f_room_style', '多层')
|
1001
|
+
//供暖方式
|
1002
|
+
// this.$set('data.f_heating_style', '热力公司集中供暖')
|
1003
|
+
if(this.item.f_plan_meters) {
|
1004
|
+
for (let de in this.devices) {
|
1005
|
+
this.$set('data.device' + this.devices[de].n, [])
|
1006
|
+
for (let i = 0; i < this.item.f_plan_meters.length; i++) {
|
1007
|
+
if(this.item.f_plan_meters[i].f_meter_type) {
|
1008
|
+
if (this.devices[de].device == "燃气表" && this.item.f_plan_meters[i].f_meter_type.indexOf('机表') > 0) {
|
1009
|
+
delete this.config['燃气表']['items']['累计购气量']
|
1010
|
+
this.data['device' + this.devices[de].n].push({
|
1011
|
+
f_device_type: "燃气表",
|
1012
|
+
f_items: [{
|
1013
|
+
f_defect_level: null,
|
1014
|
+
f_device_id: "",
|
1015
|
+
f_is_defect: "",
|
1016
|
+
f_item_name: "表品牌",
|
1017
|
+
f_item_value: this.item.f_plan_meters[i].f_aliasname,
|
1018
|
+
f_path: "",
|
1019
|
+
type: "string"
|
1020
|
+
},
|
1021
|
+
{
|
1022
|
+
f_defect_level: null,
|
1023
|
+
f_device_id: "",
|
1024
|
+
f_is_defect: "",
|
1025
|
+
f_item_name: "位置",
|
1026
|
+
f_item_value: this.item.f_plan_meters[i].f_weizhi,
|
1027
|
+
f_path: "",
|
1028
|
+
type: "selector"
|
1029
|
+
},
|
1030
|
+
{
|
1031
|
+
f_defect_level: null,
|
1032
|
+
f_device_id: "",
|
1033
|
+
f_is_defect: "",
|
1034
|
+
f_item_name: "表号",
|
1035
|
+
f_item_value: this.item.f_plan_meters[i].f_meter_no,
|
1036
|
+
f_path: "",
|
1037
|
+
type: "number"
|
1038
|
+
},
|
1039
|
+
{
|
1040
|
+
f_defect_level: null,
|
1041
|
+
f_device_id: "",
|
1042
|
+
f_is_defect: "",
|
1043
|
+
f_item_name: "表封号",
|
1044
|
+
f_item_value: this.item.f_plan_meters[i].f_metertitles,
|
1045
|
+
f_path: "",
|
1046
|
+
type: "number"
|
1047
|
+
},
|
1048
|
+
{
|
1049
|
+
f_defect_level: null,
|
1050
|
+
f_device_id: "",
|
1051
|
+
f_is_defect: "",
|
1052
|
+
f_item_name: "表型号",
|
1053
|
+
f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
|
1054
|
+
f_path: "",
|
1055
|
+
type: "selector"
|
1056
|
+
},
|
1057
|
+
{
|
1058
|
+
f_defect_level: null,
|
1059
|
+
f_device_id: "",
|
1060
|
+
f_is_defect: "",
|
1061
|
+
f_item_name: "表底数",
|
1062
|
+
f_item_value: this.item.f_plan_meters[i].f_prior_reading,
|
1063
|
+
f_path: "",
|
1064
|
+
type: "number"
|
1065
|
+
}
|
1066
|
+
]
|
1067
|
+
})
|
1068
|
+
} else if (this.devices[de].device == "燃气表") {
|
1069
|
+
delete this.config['燃气表']['items']['表底数']
|
1070
|
+
this.data['device' + this.devices[de].n].push({
|
1071
|
+
f_device_type: "燃气表",
|
1072
|
+
f_items: [{
|
1073
|
+
f_defect_level: null,
|
1074
|
+
f_device_id: "",
|
1075
|
+
f_is_defect: "",
|
1076
|
+
f_item_name: "表品牌",
|
1077
|
+
f_item_value: this.item.f_plan_meters[i].f_aliasname,
|
1078
|
+
f_path: "",
|
1079
|
+
type: "string"
|
1080
|
+
},
|
1081
|
+
{
|
1082
|
+
f_defect_level: null,
|
1083
|
+
f_device_id: "",
|
1084
|
+
f_is_defect: "",
|
1085
|
+
f_item_name: "位置",
|
1086
|
+
f_item_value: this.item.f_plan_meters[i].f_weizhi,
|
1087
|
+
f_path: "",
|
1088
|
+
type: "selector"
|
1089
|
+
},
|
1090
|
+
{
|
1091
|
+
f_defect_level: null,
|
1092
|
+
f_device_id: "",
|
1093
|
+
f_is_defect: "",
|
1094
|
+
f_item_name: "表号",
|
1095
|
+
f_item_value: this.item.f_plan_meters[i].f_meter_no,
|
1096
|
+
f_path: "",
|
1097
|
+
type: "number"
|
1098
|
+
},
|
1099
|
+
{
|
1100
|
+
f_defect_level: null,
|
1101
|
+
f_device_id: "",
|
1102
|
+
f_is_defect: "",
|
1103
|
+
f_item_name: "表封号",
|
1104
|
+
f_item_value: this.item.f_plan_meters[i].f_metertitles,
|
1105
|
+
f_path: "",
|
1106
|
+
type: "number"
|
1107
|
+
},
|
1108
|
+
{
|
1109
|
+
f_defect_level: null,
|
1110
|
+
f_device_id: "",
|
1111
|
+
f_is_defect: "",
|
1112
|
+
f_item_name: "表型号",
|
1113
|
+
f_item_value: this.item.f_plan_meters[i].f_diaphgram_size,
|
1114
|
+
f_path: "",
|
1115
|
+
type: "selector"
|
1116
|
+
},
|
1117
|
+
{
|
1118
|
+
f_defect_level: null,
|
1119
|
+
f_device_id: "",
|
1120
|
+
f_is_defect: "",
|
1121
|
+
f_item_name: "累计购气量",
|
1122
|
+
f_item_value: this.item.f_plan_meters[i].f_prior_reading,
|
1123
|
+
f_path: "",
|
1124
|
+
type: "number"
|
1125
|
+
}
|
1126
|
+
]
|
1127
|
+
})
|
1128
|
+
}
|
1129
|
+
}
|
1130
|
+
}
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
this.$goto('paper-state', {}, 'paper-router')
|
1135
|
+
},
|
1136
|
+
extend(initalObj, finalObj) {
|
1137
|
+
var obj = finalObj || {};
|
1138
|
+
for (var i in initalObj) {
|
1139
|
+
var prop = initalObj[i];
|
1140
|
+
|
1141
|
+
// 避免相互引用对象导致死循环,如initalObj.a = initalObj的情况
|
1142
|
+
if (prop === obj) {
|
1143
|
+
continue;
|
1144
|
+
}
|
1145
|
+
|
1146
|
+
if (typeof prop === 'object') {
|
1147
|
+
if (obj[i]) {
|
1148
|
+
this.extend(obj[i], prop)
|
1149
|
+
} else {
|
1150
|
+
obj[i] = prop;
|
1151
|
+
}
|
1152
|
+
}
|
1153
|
+
}
|
1154
|
+
return obj;
|
1155
|
+
},
|
1156
|
+
/*
|
1157
|
+
var a = {
|
1158
|
+
"燃气表":{
|
1159
|
+
"index": 1,
|
1160
|
+
"checkmust":true,
|
1161
|
+
"items":{
|
1162
|
+
"表具故障":{"index": 13,"multiple":true,"type":"selector","options":[{"data":"死表","isdefect":true,"level":"安检维修"},{"data":"常通","isdefect":true,"level":"安检维修"},{"data":"表体漏气","isdefect":true,"level":"一级隐患安检维修"},{"data":"接口漏气","isdefect":true,"level":"一级隐患安检维修"},{"data":"偷气","isdefect":true,"level":"一级隐患"},{"data":"反装","isdefect":true},{"data":"气量不符","isdefect":true,"level":"安检维修"},{"data":"其他","isdefect":true,"level":"一级隐患"}]},
|
1163
|
+
"其他":{"index": 14,"isshow":false,"type":"string"},
|
1164
|
+
"表具隐患类型":{"index": 15,"multiple":true,"type":"selector","options":[{"data":"挂物","isdefect":true},{"data":"包裹","isdefect":true},{"data":"不便维修","isdefect":true},{"data":"封闭包裹","isdefect":true,"level":"一级隐患"},{"data":"与电源或火源过近","isdefect":true,"level":"三级隐患"}]}
|
1165
|
+
}
|
1166
|
+
},
|
1167
|
+
"报警器":{
|
1168
|
+
"index": 2,
|
1169
|
+
"checkmust":true,
|
1170
|
+
"items":{
|
1171
|
+
"有否":{"index": 1,"multiple":false,"type":"selector","options":[{"data":"有","isdefect":false,"isdefault":true},{"data":"无","isdefect":false}]},
|
1172
|
+
"厂家":{"index": 2,"multiple":false,"isshow":false,"type":"selector","options":[{"data":"汉威","isdefect":false},{"data":"鑫豪斯","isdefect":false},{"data":"友谊","isdefect":false},{"data":"其他","isdefect":false},{"data":"富昌","isdefect":false},{"data":"科信","isdefect":false}]},
|
1173
|
+
"安装时间":{"index": 3,"isshow": false,"type":"date"},
|
1174
|
+
"到期时间":{"index": 4,"isshow": false,"type":"date"},
|
1175
|
+
"是否通电":{"index": 5,"multiple":false,"isshow": false,"type":"selector","options":[{"data":"是","isdefect":false,"isdefault":true},{"data":"否","isdefect":true}]},
|
1176
|
+
"安装渠道":{"index": 6,"isshow": false,"multiple":false,"type":"selector","options":[{"data":"惠众","isdefect":false},{"data":"其他","isdefect":false}]},
|
1177
|
+
"电磁阀接口漏气":{"index": 7,"multiple":false,"isshow": false,"type":"selector","options":[{"data":"否","isdefect":false,"isdefault":true},{"data":"是","isdefect":true,"level":"一级隐患安检维修"}]}
|
1178
|
+
}
|
1179
|
+
}}
|
1180
|
+
*/
|
1181
|
+
putDevices() {
|
1182
|
+
////tag
|
1183
|
+
this.$set('data.approve', "true")
|
1184
|
+
this.$set('data.writeback', "false")
|
1185
|
+
if (Vue.config.safecheck.ApproveConfig != undefined) {
|
1186
|
+
if (Vue.config.safecheck.ApproveConfig.approve != undefined) {
|
1187
|
+
this.$set('data.approve', Vue.config.safecheck.ApproveConfig.approve)
|
1188
|
+
}
|
1189
|
+
if (Vue.config.safecheck.ApproveConfig.writeback != undefined) {
|
1190
|
+
this.$set('data.writeback', Vue.config.safecheck.ApproveConfig.writeback)
|
1191
|
+
}
|
1192
|
+
if (Vue.config.safecheck.ApproveConfig.livedispose != undefined) {
|
1193
|
+
this.livedispose = Vue.config.safecheck.ApproveConfig.livedispose
|
1194
|
+
}
|
1195
|
+
}
|
1196
|
+
//tag
|
1197
|
+
|
1198
|
+
// 民用户
|
1199
|
+
this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType[this.item.f_safecheck_type][this.item.f_check_type]])
|
1200
|
+
// this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
|
1201
|
+
|
1202
|
+
/*if(this.item.f_user_type == '民用'){
|
1203
|
+
// 民用户
|
1204
|
+
this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType['送气类型']['民用']])
|
1205
|
+
// this.config = this.extend(this.config, Vue.config.safecheck.DevicesConfig)
|
1206
|
+
}else {
|
1207
|
+
// 非民用
|
1208
|
+
this.config = this.extend(this.config, Vue.config.safecheck[Vue.config.safecheck.SafecheckType['送气类型']['非民用']])
|
1209
|
+
}*/
|
1210
|
+
//遍历安检项配置
|
1211
|
+
for (let i in this.config) {
|
1212
|
+
//取得安检项索引值
|
1213
|
+
let n = this.config[i].index
|
1214
|
+
this.devices[n - 1] = {device: i, n: n, checkmust: this.config[i].checkmust}
|
1215
|
+
this.$set('data.' + 'device' + n, [])
|
1216
|
+
let items = []
|
1217
|
+
for (let it in this.config[i].items) {
|
1218
|
+
//赋值下拉选项
|
1219
|
+
if (this.config[i].items[it].type == 'selector') {
|
1220
|
+
for (let op in this.config[i].items[it].options)
|
1221
|
+
if (this.config[i].items[it].options[op].isdefault == true) {
|
1222
|
+
items.push({
|
1223
|
+
f_defect_level: this.config[i].items[it].options[op].level,
|
1224
|
+
f_is_defect: this.config[i].items[it].options[op].isdefect,
|
1225
|
+
f_item_name: it,
|
1226
|
+
f_item_value: this.config[i].items[it].options[op].data,
|
1227
|
+
f_path: "",
|
1228
|
+
type: "selector"
|
1229
|
+
})
|
1230
|
+
}
|
1231
|
+
}
|
1232
|
+
}
|
1233
|
+
n = n + 1
|
1234
|
+
}
|
1235
|
+
|
1236
|
+
},
|
1237
|
+
//获取当前时间
|
1238
|
+
getNowFormatDate(){
|
1239
|
+
var date = new Date();
|
1240
|
+
var seperator1 = "-";
|
1241
|
+
var seperator2 = ":";
|
1242
|
+
var month = date.getMonth() + 1;
|
1243
|
+
var strDate = date.getDate();
|
1244
|
+
if (month >= 1 && month <= 9) {
|
1245
|
+
month = "0" + month;
|
1246
|
+
}
|
1247
|
+
if (strDate >= 0 && strDate <= 9) {
|
1248
|
+
strDate = "0" + strDate;
|
1249
|
+
}
|
1250
|
+
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
1251
|
+
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
1252
|
+
+ seperator2 + date.getSeconds();
|
1253
|
+
return currentdate;
|
1254
|
+
}
|
1255
|
+
},
|
1256
|
+
ready() {
|
1257
|
+
this.init1()
|
1258
|
+
this.putDevices()
|
1259
|
+
//如果已检,则提取安检单
|
1260
|
+
|
1261
|
+
if (this.item.f_state != '未检' || this.item.f_no_checkplan == '无计划安检') {
|
1262
|
+
if (this.role != 'inspect') {
|
1263
|
+
let that = this
|
1264
|
+
let id
|
1265
|
+
if (this.role == 'view') {
|
1266
|
+
id = this.item.id
|
1267
|
+
} else if (this.role == 'androidview') {
|
1268
|
+
id = this.item.f_paper_id
|
1269
|
+
}
|
1270
|
+
this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/path/getUserinfomation`, {data: {condition: `id = '${id}'`}}).then((respanse) => {
|
1271
|
+
//tag
|
1272
|
+
if (respanse.data.length != 0) {
|
1273
|
+
// 包含 其它 特殊处理的数组
|
1274
|
+
// 对应位置
|
1275
|
+
|
1276
|
+
//tag
|
1277
|
+
|
1278
|
+
that.data = Object.assign(that.data, respanse.data[0])
|
1279
|
+
if (respanse.data[0].f_devices) {
|
1280
|
+
for (let da in that.devices) {
|
1281
|
+
that.$set('data.device' + that.devices[da].n, [])
|
1282
|
+
}
|
1283
|
+
respanse.data[0].f_devices.forEach((item) => {
|
1284
|
+
for (let de in that.devices) {
|
1285
|
+
if (that.devices[de].device == item.f_device_type) {
|
1286
|
+
item.f_items.forEach((f_item) => {
|
1287
|
+
//tag
|
1288
|
+
//tag
|
1289
|
+
let itemValues = []
|
1290
|
+
f_item.f_item_lists.forEach((tempItem) => {
|
1291
|
+
//tag
|
1292
|
+
if (tempItem.f_item_value !== 'null') {
|
1293
|
+
itemValues.push(tempItem.f_item_value)
|
1294
|
+
}
|
1295
|
+
})
|
1296
|
+
f_item.f_item_value = itemValues
|
1297
|
+
})
|
1298
|
+
that.data['device' + that.devices[de].n].push({
|
1299
|
+
f_device_type: item.f_device_type,
|
1300
|
+
f_items: item.f_items
|
1301
|
+
})
|
1302
|
+
}
|
1303
|
+
}
|
1304
|
+
})
|
1305
|
+
}
|
1306
|
+
Util.replaceFalse(that.data)
|
1307
|
+
Util.booleanFilter(that.data)
|
1308
|
+
if (this.role == 'view') {
|
1309
|
+
Util.ratifyPics(that.data)
|
1310
|
+
Util.ratifyPics(that.picture)
|
1311
|
+
} else {
|
1312
|
+
Util.androidRatifyPics(that.data, this.$androidUtil.getProxyUrl())
|
1313
|
+
}
|
1314
|
+
//tag
|
1315
|
+
} else {
|
1316
|
+
alert("该安检单可能已不在本地!")
|
1317
|
+
this.init()
|
1318
|
+
}
|
1319
|
+
// this.$goto('paper-message-blank', {userinfo:this.data,devices:this.devices,config:this.config,role:this.role}, 'self')
|
1320
|
+
this.isshow = true
|
1321
|
+
}
|
1322
|
+
).catch(
|
1323
|
+
(respanse) => {
|
1324
|
+
//tag
|
1325
|
+
alert('查找安检单失败')
|
1326
|
+
})
|
1327
|
+
}
|
1328
|
+
// else {
|
1329
|
+
// let that = this
|
1330
|
+
// this.$androidUtil.bzLogic('FetchCheckPaper', {id: this.item.id}).then((respanse) => {
|
1331
|
+
// if (respanse.data.data.length != 0) {
|
1332
|
+
// that.data = Object.assign(that.data, respanse.data.data[0])
|
1333
|
+
// if (respanse.data.data[0].f_devices) {
|
1334
|
+
// for (let da in that.devices) {
|
1335
|
+
// that.$set('data.device' + that.devices[da].n, [])
|
1336
|
+
// }
|
1337
|
+
// respanse.data.data[0].f_devices.forEach((item) => {
|
1338
|
+
// for (let de in that.devices) {
|
1339
|
+
// if (that.devices[de].device == item.f_device_type) {
|
1340
|
+
// that.$set('data.device' + that.devices[de].n, [])
|
1341
|
+
// that.data['device' + that.devices[de].n].push({
|
1342
|
+
// f_device_type: item.f_device_type,
|
1343
|
+
// f_items: item.f_items
|
1344
|
+
// })
|
1345
|
+
// }
|
1346
|
+
// }
|
1347
|
+
// })
|
1348
|
+
// }
|
1349
|
+
// Util.booleanFilter(that.data)
|
1350
|
+
// //tag
|
1351
|
+
// } else {
|
1352
|
+
// alert("该安检单可能已不在本地!")
|
1353
|
+
// this.init()
|
1354
|
+
// }
|
1355
|
+
// // this.$goto('paper-message-blank', {userinfo:this.data,devices:this.devices,config:this.config,role:this.role}, 'self')
|
1356
|
+
// this.isshow = true
|
1357
|
+
// }
|
1358
|
+
// ).catch(
|
1359
|
+
// (respanse) => {
|
1360
|
+
// alert('查找安检单失败')
|
1361
|
+
// })
|
1362
|
+
// }
|
1363
|
+
} else {
|
1364
|
+
this.init()
|
1365
|
+
}
|
1366
|
+
},
|
1367
|
+
watch:{
|
1368
|
+
// 'isUpload'(val){
|
1369
|
+
// //tag
|
1370
|
+
// }
|
1371
|
+
},
|
1372
|
+
destroyed() {
|
1373
|
+
//tag
|
1374
|
+
this.disableTimer()
|
1375
|
+
}
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
</script>
|