safecheck-client 4.0.0-57 → 4.0.0-59

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