apply-clients 7.1.36-yuchuan-83 → 7.1.36-yuchuan-84

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 (36) hide show
  1. package/build/dev-server.js +3 -6
  2. package/package.json +1 -1
  3. package/src/components/android/AppServiceView.vue +603 -603
  4. package/src/components/android/Process/AppServiceControl.vue +1434 -1434
  5. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1032 -1032
  6. package/src/components/android/Process/Processes/newAppInstallationDetails.vue +671 -671
  7. package/src/components/android/SealBind.vue +426 -426
  8. package/src/components/product/ApplyCharge/ApplyChargeList.vue +1115 -1115
  9. package/src/components/product/ApplyGaiXianCharge/ApplyGaiXianChargeList.vue +211 -211
  10. package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +325 -325
  11. package/src/components/product/Function/Service/FunctionServiceControl.vue +581 -581
  12. package/src/components/product/GongJianPush/ApplyPushDispose.vue +299 -299
  13. package/src/components/product/GongJianPush/ApplyPushManage.vue +92 -92
  14. package/src/components/product/Ignition/IgnitionListManage.vue +604 -604
  15. package/src/components/product/List/OldShowDevices.vue +272 -272
  16. package/src/components/product/List/ShowAllActivity.vue +540 -540
  17. package/src/components/product/Print/BuildOrder/buildOrderList.vue +446 -446
  18. package/src/components/product/Print/BuildOrder/printGaiXianOrder.vue +271 -271
  19. package/src/components/product/Print/OrderPrint/GaiXianOrder.vue +314 -314
  20. package/src/components/product/Print/OrderPrint/printChaiChuOrder.vue +266 -266
  21. package/src/components/product/Process/ExplorationSelect.vue +593 -593
  22. package/src/components/product/Process/NewExplorationSelect.vue +587 -587
  23. package/src/components/product/Process/Processes/InstallationDetails.vue +1166 -1166
  24. package/src/components/product/Process/Processes/Print/printCharge.vue +250 -250
  25. package/src/components/product/Process/Processes/Print/printGaiXianCharge.vue +244 -244
  26. package/src/components/product/Process/Processes/chargeManagement.vue +766 -766
  27. package/src/components/product/Process/Processes/newInstallationDetails.vue +683 -683
  28. package/src/components/product/Process/Processes/supplementalAgreement.vue +298 -298
  29. package/src/components/product/Process/Service/ServiceControl.vue +2232 -2232
  30. package/src/components/product/ServiceView.vue +650 -650
  31. package/src/components/product/Supervisory/ExportExcel.vue +359 -359
  32. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +592 -592
  33. package/src/components/product/Supervisory/SupervisoryList.vue +585 -585
  34. package/src/components/product/Supervisory/YiBanSupervisoryList.vue +543 -543
  35. package/src/components/product/VueUtils/ApplyUpload.vue +302 -302
  36. package/src/components/product/VueUtils/HighMeter.vue +208 -208
@@ -1,426 +1,426 @@
1
- <template>
2
- <div class="auto">
3
- <div class="row app-row">
4
- <div class="col-xs-4">
5
- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
6
- <label for="f_userinfoid" class="font text-left">用户编号:</label>
7
- </div>
8
- <div class="col-xs-8" >
9
- <input id="f_userinfoid" class="search_input input-font" readonly
10
- v-model=row.f_userinfo_id :value.sync="row.f_userinfo_id" />
11
- </div>
12
- </div>
13
- <div class="row app-row">
14
- <div class="col-xs-4">
15
- <img src="../../assets/用户姓名.png" style="width: 20px;margin-bottom: 5px" alt="">
16
- <label class="font text-left">用户姓名:</label>
17
- </div>
18
- <div class="col-xs-8" >
19
- <input class="search_input input-font" v-model=row.f_user_name :value.sync="row.f_user_name" readonly />
20
- </div>
21
- </div>
22
- <div class="row app-row">
23
- <div class="col-xs-4">
24
- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">
25
- <label class="font text-left">用户地址:</label>
26
- </div>
27
- <div class="col-xs-8" >
28
- <input class="search_input input-font" v-model=row.f_address :value.sync="row.f_address" readonly />
29
- </div>
30
- </div>
31
- <div class="row app-row">
32
- <div class="col-xs-4">
33
- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
34
- <label class="font text-left">铅封编号:</label>
35
- </div>
36
- <div class="col-xs-5" >
37
- <input class="search_input input-font"
38
- v-model=sealUID :value.sync="sealUID" readonly />
39
- </div>
40
- <div class="col-xs-3">
41
- <button style="padding: 5px" type="button" class="btn btn-font btn-color" @click="scan()">NFC识别</button>
42
- </div>
43
- </div>
44
- <div class="row app-row">
45
- <div class="col-xs-4">
46
- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
47
- <label class="font text-left">二维码编号:</label>
48
- </div>
49
- <div class="col-xs-5" >
50
- <input class="search_input input-font"
51
- v-model=f_qr_code :value.sync="f_qr_code" readonly />
52
- </div>
53
- <div class="col-xs-3">
54
- <button style="padding: 5px" type="button" class="btn btn-font btn-color" @click="codeScan()">扫描二维码</button>
55
- </div>
56
- </div>
57
- <div class="row app-row">
58
- <div class="col-xs-4">
59
- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
60
- <label class="font text-left">经度:</label>
61
- </div>
62
- <div class="col-xs-5" >
63
- <input class="search_input input-font"
64
- v-model=longitude :value.sync="longitude" readonly />
65
- </div>
66
- </div>
67
- <div class="row app-row">
68
- <div class="col-xs-4">
69
- <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
70
- <label class="font text-left">维度:</label>
71
- </div>
72
- <div class="col-xs-5" >
73
- <input class="search_input input-font"
74
- v-model=latitude :value.sync="latitude" readonly />
75
- </div>
76
- <div class="col-xs-3">
77
- <button style="padding: 5px" type="button" class="btn btn-font btn-color" @click="getLocation2()">定位</button>
78
- </div>
79
- </div>
80
- <div class="row app-row">
81
- <div class="form-group col-sm-12 col-xs-12 col-md-12 " :class="style__">
82
- <label class="text-left font">铅封照片:</label>
83
-
84
- <div class="auto" :class="style__">
85
- <div class="panel" style="padding: 10px 10px 5px 10px;">
86
- <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
87
- <div class="row" style="height: 240px;overflow: scroll;top: 1px" >
88
- <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 35px" v-for="(index,img) in imgs">
89
- <img-self :src="img" alt="铅封照片" :width="140" :height="170"></img-self>
90
- <img src="../../assets/删除.png" @click="delfile(img,index)" style="width: 15px;margin-top: -80px" alt="">
91
- </div>
92
- </div>
93
- <div class="row text-right div-photo">
94
- <button type="button" name="button" class="btn btn-photo" @click="takePic()">拍照</button>
95
- </div>
96
- </div>
97
- </div>
98
- </div>
99
- </div>
100
- </div>
101
- <div class="row app-row">
102
- <div class="col-xs-4">
103
- <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">
104
- <label class="font text-left">施封原因:</label>
105
- </div>
106
- <div class="col s-8" >
107
- <v-select
108
- v-model="cause"
109
- :value.sync="cause"
110
- :value-single="true"
111
- :options='causeOption'
112
- placeholder='请选择施封原因'
113
- width="100%"
114
- close-on-select></v-select>
115
- </div>
116
- </div>
117
- <div class="row text-center" style="margin-top: 40 px;">
118
- <button style="font-size: 20px; padding: 8px 40px" type="button" name="button" class="col-sm-3 btn btn-primary" @click="bind">
119
- 施封
120
- </button>
121
- </div>
122
- </div>
123
- </template>
124
-
125
- <script>
126
- import {HttpResetClass, PagedList} from 'vue-client'
127
- import Vue from 'vue'
128
- import * as Util from '../Util'
129
-
130
- export default {
131
- title: '施封',
132
- props: ['row'],
133
- data () {
134
- return {
135
- sealUID: '',
136
- imgs: [],
137
- cause: '',
138
- address: '',
139
- longitude: 0,
140
- latitude: 0,
141
- f_qr_code: '',
142
- causeOption: []
143
- }
144
- },
145
- ready () {
146
- if (Vue.user.rolestr.includes('新安检员')) {
147
- this.causeOption = [{label: '安检施封', value: '安检施封'}]
148
- this.cause = '安检施封'
149
- } else if (Vue.user.rolestr.includes('通气组安检')) {
150
- this.causeOption = [{label: '通气施封', value: '通气施封'}]
151
- this.cause = '通气施封'
152
- } else if (Vue.user.rolestr.includes('新维修员')) {
153
- this.causeOption = [{label: '换表施封', value: '换表施封'}, {label: '维修施封', value: '维修施封'}]
154
- } else {
155
- this.causeOption = this.$appdata.getParam('施封原因')
156
- }
157
- this.$nextTick(()=>{
158
- this.getLocation()
159
- })
160
- },
161
- computed: {
162
-
163
- },
164
- methods:{
165
- codeScan() {
166
- console.log('codeScan=========')
167
- HostApp.__this__ = this
168
- HostApp.scanQRCode({callback:"javascript:HostApp.__this__.codeScanCallback()"})
169
- },
170
- codeScanCallback() {
171
- console.log('codeScanCallback=========')
172
- let result = HostApp.getQRCode()
173
- console.log('result=', result)
174
- if (result.code == 200){
175
- this.f_qr_code = result.data
176
- }else {
177
- this.$showMessage("未识别到二维码信息,请重新尝试!")
178
- }
179
- },
180
- generateUUID() {
181
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
182
- var r = (Math.random() * 16) | 0,
183
- v = c == 'x' ? r : (r & 0x3) | 0x8;
184
- return v.toString(16);
185
- });
186
- },
187
- getLocation() {
188
- const location = HostApp.getDetailAddress()
189
- this.address = location.data
190
- const longitude = HostApp.getPreference('longitude')
191
- this.longitude = longitude.data
192
- const latitude = HostApp.getPreference('latitude')
193
- this.latitude = latitude.data
194
- },
195
-
196
- getLocation2() {
197
- const result = HostApp.RestartGps()
198
- if(result.data==='重启Gps成功'){
199
- const location = HostApp.getDetailAddress()
200
- this.address = location.data
201
- const longitude = HostApp.getPreference('longitude')
202
- this.longitude = longitude.data
203
- const latitude = HostApp.getPreference('latitude')
204
- this.latitude = latitude.data
205
- }else{
206
- this.$showMessage("GPS定位异常")
207
- return
208
- }
209
- },
210
- bind() {
211
- if (!this.sealUID) {
212
- this.$showMessage("铅封编号不能为空!")
213
- return
214
- }
215
- if (!this.f_qr_code) {
216
- this.$showMessage("二维码编号不能为空!")
217
- return
218
- }
219
- if (!this.imgs.length) {
220
- this.$showMessage("请拍摄铅封照片!")
221
- return
222
- }
223
- if (!this.cause) {
224
- this.$showMessage("请选择施封原因!")
225
- return
226
- }
227
- //this.getLocation()
228
- if (this.longitude == 0){
229
- this.$showMessage("位置获取失败,请开启定位后进行施封!")
230
- return
231
- }
232
- const param = {
233
- seal: {
234
- f_uid: this.sealUID,
235
- f_qr_code: this.f_qr_code,
236
- f_userinfo_id: this.row.f_userinfo_id,
237
- f_filiale: this.row.f_filiale,
238
- f_filiale_id: this.row.f_filiale_id,
239
- f_user_id: this.row.f_user_id,
240
- f_address: this.address,
241
- f_longitude: this.longitude,
242
- f_latitude: this.latitude,
243
- f_operate_name: Vue.user.name,
244
- f_operate_id: Vue.user.id,
245
- f_operate_date: Util.toStandardTimeString(),
246
- f_state: '有效'
247
- },
248
- operateList: {
249
- f_cause: this.cause,
250
- f_operate_date: Util.toStandardTimeString(),
251
- f_creation_date: Util.toStandardTimeString(),
252
- f_creation_name: Vue.user.name,
253
- f_creation_name_id: Vue.user.id
254
- },
255
- files: [],
256
- imgs: [],
257
- f_devices_no: this.generateUUID()
258
- }
259
- for (const img of this.imgs) {
260
- const i1 = img.lastIndexOf('?')
261
- const i2 = img.lastIndexOf('/')
262
- const key = img.substring(i2+1, i1)
263
- const filename = img.substring(0, i1)
264
- param.files.push({
265
- f_img_url: key,
266
- f_operate_date: Util.toStandardTimeString(),
267
- f_operator: Vue.user.name,
268
- f_operatorid: Vue.user.id
269
- })
270
- param.imgs.push({
271
- key: key,
272
- filename: filename
273
- })
274
- }
275
- //tag)
276
- let paramStr = JSON.stringify(param)
277
- console.log('paramStr=', paramStr)
278
- // 多长截断一次
279
- let subLength = 800
280
- for (let i = 0; i < paramStr.length; i += subLength) {
281
- HostApp.param_cache(paramStr.substr(i, subLength))
282
- }
283
- HostApp.__this__ = this
284
- HostApp.syncLogic({
285
- 'logic': 'sealBind',
286
- 'callback': 'javascript:HostApp.__this__.sealBindBack()',
287
- 'backresult': 1
288
- })
289
- },
290
- sealBindBack(jo) {
291
- if(jo.state == 'ok') {
292
- let res = JSON.parse(jo.result)
293
- if (res.code == 200 && res.data.code == 200) {
294
- this.$showMessage('施封成功!')
295
- this.$back(this.sealUID)
296
- return
297
- }
298
- this.$showMessage(res.data.msg)
299
- return
300
- }
301
- this.$showMessage('网络异常!')
302
- },
303
- scan() {
304
- HostApp.__this__ = this
305
- HostApp.readNfc({
306
- 'callback': 'javascript:HostApp.__this__.scanCallback()',
307
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
308
- // 执行回调方法传入key为backresult
309
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
310
- 'backresult': 1
311
- })
312
- },
313
- scanCallback() {
314
- console.log('scanCallback=========')
315
- const result = HostApp.getNfcUUID()
316
- console.log('result=', result)
317
- if (result.code == 200){
318
- this.sealUID = result.data
319
- }else {
320
- this.$showMessage("未识别到铅封信息,请重新尝试!")
321
- return
322
- }
323
- },
324
- takePic() {
325
- HostApp.__callback__ = this.cameraCallBack
326
- HostApp.__this__ = this
327
-
328
- let fileName = `${Util.guid()}.jpg`
329
- HostApp._open_a_page({
330
- type: 'boomerang',
331
- page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
332
- param: {
333
- file: fileName,
334
- requestCode: 111,
335
- callback: 'javascript:HostApp.__callback__("%s");',
336
- watermark: '铅封照片\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name + '\t' + this.row.f_userinfo_id+ '\t' + this.row.f_user_name+ '\t' + this.row.f_address
337
- }
338
- })
339
- },
340
- cameraCallBack(fileName) {
341
- // if (prop == 'f_overall_path') {
342
- // let f_overall_path = fileName + '?' + Math.random()
343
- // HostApp.__this__.paper.f_overall_imgs.push({
344
- // f_overall_path: f_overall_path
345
- // })
346
- // } else {
347
- // HostApp.__this__.paper[prop] = fileName + '?' + Math.random()
348
- // }
349
- this.imgs.push(fileName + '?' + Math.random())
350
- HostApp.__callback__ = null
351
- HostApp.__this__ = null
352
- },
353
- delfile(fileName, index) {
354
- if (fileName == Vue.nopic)
355
- return
356
- else {
357
- this.imgs.splice(index, 1)
358
- HostApp.delfile(fileName)
359
- }
360
- }
361
- },
362
- // 添加组件销毁前清理定时器
363
- beforeDestroy() {
364
- }
365
- }
366
- </script>
367
- <style scoped>
368
- .app-row {
369
- background-color: white;
370
- padding: 10px 10px 0 10px;
371
- border-bottom: 1px solid rgba(235, 235, 235, 0.5);
372
- }
373
- .search_input {
374
- border: 0;
375
- outline: none;
376
- }
377
- .font{
378
- font: 15px PingFang-SC-Medium;
379
- color: #666666;
380
- }
381
- .input-font{
382
- font: 15px PingFang-SC-Medium;
383
- color: #333333;
384
- }
385
- .btn-font{
386
- font:600 16px PingFang-SC-Bold;
387
- color: #499EDF;
388
- }
389
- .btn-color{
390
- background-color: #FFFFFF;
391
- border-radius: 10px ;
392
- border: 1px solid #499EDF;
393
- }
394
- .app-text {
395
- font-size: 12px;
396
- }
397
- .panel-self{
398
- border-radius: 10px;
399
- border:1px solid #499EDF;
400
- background-color: #F8F8F8;
401
- }
402
- .yybtn-color{
403
- border-radius: 4px ;
404
- border: 1px solid #499EDF;
405
- }
406
- .qxbtn-color{
407
- background-color: #FFFFFF;
408
- border-radius: 4px ;
409
- border: 1px solid #499EDF;
410
- }
411
- .btn-photo{
412
- border: 0;
413
- border-radius: 7px;
414
- background-color: #7dc1f4;
415
- font: 15px PingFang-SC-Bold;
416
- height: 20%;
417
- }
418
- .div-photo{
419
- width: auto;
420
- height: auto;
421
- /* margin-top: 10px; */
422
- position: absolute;
423
- bottom: 10px;
424
- right: 10px;
425
- }
426
- </style>
1
+ <template>
2
+ <div class="auto">
3
+ <div class="row app-row">
4
+ <div class="col-xs-4">
5
+ <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
6
+ <label for="f_userinfoid" class="font text-left">用户编号:</label>
7
+ </div>
8
+ <div class="col-xs-8" >
9
+ <input id="f_userinfoid" class="search_input input-font" readonly
10
+ v-model=row.f_userinfo_id :value.sync="row.f_userinfo_id" />
11
+ </div>
12
+ </div>
13
+ <div class="row app-row">
14
+ <div class="col-xs-4">
15
+ <img src="../../assets/用户姓名.png" style="width: 20px;margin-bottom: 5px" alt="">
16
+ <label class="font text-left">用户姓名:</label>
17
+ </div>
18
+ <div class="col-xs-8" >
19
+ <input class="search_input input-font" v-model=row.f_user_name :value.sync="row.f_user_name" readonly />
20
+ </div>
21
+ </div>
22
+ <div class="row app-row">
23
+ <div class="col-xs-4">
24
+ <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">
25
+ <label class="font text-left">用户地址:</label>
26
+ </div>
27
+ <div class="col-xs-8" >
28
+ <input class="search_input input-font" v-model=row.f_address :value.sync="row.f_address" readonly />
29
+ </div>
30
+ </div>
31
+ <div class="row app-row">
32
+ <div class="col-xs-4">
33
+ <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
34
+ <label class="font text-left">铅封编号:</label>
35
+ </div>
36
+ <div class="col-xs-5" >
37
+ <input class="search_input input-font"
38
+ v-model=sealUID :value.sync="sealUID" readonly />
39
+ </div>
40
+ <div class="col-xs-3">
41
+ <button style="padding: 5px" type="button" class="btn btn-font btn-color" @click="scan()">NFC识别</button>
42
+ </div>
43
+ </div>
44
+ <div class="row app-row">
45
+ <div class="col-xs-4">
46
+ <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
47
+ <label class="font text-left">二维码编号:</label>
48
+ </div>
49
+ <div class="col-xs-5" >
50
+ <input class="search_input input-font"
51
+ v-model=f_qr_code :value.sync="f_qr_code" readonly />
52
+ </div>
53
+ <div class="col-xs-3">
54
+ <button style="padding: 5px" type="button" class="btn btn-font btn-color" @click="codeScan()">扫描二维码</button>
55
+ </div>
56
+ </div>
57
+ <div class="row app-row">
58
+ <div class="col-xs-4">
59
+ <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
60
+ <label class="font text-left">经度:</label>
61
+ </div>
62
+ <div class="col-xs-5" >
63
+ <input class="search_input input-font"
64
+ v-model=longitude :value.sync="longitude" readonly />
65
+ </div>
66
+ </div>
67
+ <div class="row app-row">
68
+ <div class="col-xs-4">
69
+ <img src="../../assets/用户ID.png" style="width: 20px;margin-bottom: 5px" alt="">
70
+ <label class="font text-left">维度:</label>
71
+ </div>
72
+ <div class="col-xs-5" >
73
+ <input class="search_input input-font"
74
+ v-model=latitude :value.sync="latitude" readonly />
75
+ </div>
76
+ <div class="col-xs-3">
77
+ <button style="padding: 5px" type="button" class="btn btn-font btn-color" @click="getLocation2()">定位</button>
78
+ </div>
79
+ </div>
80
+ <div class="row app-row">
81
+ <div class="form-group col-sm-12 col-xs-12 col-md-12 " :class="style__">
82
+ <label class="text-left font">铅封照片:</label>
83
+
84
+ <div class="auto" :class="style__">
85
+ <div class="panel" style="padding: 10px 10px 5px 10px;">
86
+ <div class="panel-body panel-self" style="background-color: #F8F8F8;width: 100%;height: 260px;position: relative">
87
+ <div class="row" style="height: 240px;overflow: scroll;top: 1px" >
88
+ <div class="col-xs-4 col-sm-3 col-md-2" style="margin-bottom: 35px" v-for="(index,img) in imgs">
89
+ <img-self :src="img" alt="铅封照片" :width="140" :height="170"></img-self>
90
+ <img src="../../assets/删除.png" @click="delfile(img,index)" style="width: 15px;margin-top: -80px" alt="">
91
+ </div>
92
+ </div>
93
+ <div class="row text-right div-photo">
94
+ <button type="button" name="button" class="btn btn-photo" @click="takePic()">拍照</button>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ <div class="row app-row">
102
+ <div class="col-xs-4">
103
+ <img src="../../assets/小区.png" style="width: 20px;margin-bottom: 5px" alt="">
104
+ <label class="font text-left">施封原因:</label>
105
+ </div>
106
+ <div class="col s-8" >
107
+ <v-select
108
+ v-model="cause"
109
+ :value.sync="cause"
110
+ :value-single="true"
111
+ :options='causeOption'
112
+ placeholder='请选择施封原因'
113
+ width="100%"
114
+ close-on-select></v-select>
115
+ </div>
116
+ </div>
117
+ <div class="row text-center" style="margin-top: 40 px;">
118
+ <button style="font-size: 20px; padding: 8px 40px" type="button" name="button" class="col-sm-3 btn btn-primary" @click="bind">
119
+ 施封
120
+ </button>
121
+ </div>
122
+ </div>
123
+ </template>
124
+
125
+ <script>
126
+ import {HttpResetClass, PagedList} from 'vue-client'
127
+ import Vue from 'vue'
128
+ import * as Util from '../Util'
129
+
130
+ export default {
131
+ title: '施封',
132
+ props: ['row'],
133
+ data () {
134
+ return {
135
+ sealUID: '',
136
+ imgs: [],
137
+ cause: '',
138
+ address: '',
139
+ longitude: 0,
140
+ latitude: 0,
141
+ f_qr_code: '',
142
+ causeOption: []
143
+ }
144
+ },
145
+ ready () {
146
+ if (Vue.user.rolestr.includes('新安检员')) {
147
+ this.causeOption = [{label: '安检施封', value: '安检施封'}]
148
+ this.cause = '安检施封'
149
+ } else if (Vue.user.rolestr.includes('通气组安检')) {
150
+ this.causeOption = [{label: '通气施封', value: '通气施封'}]
151
+ this.cause = '通气施封'
152
+ } else if (Vue.user.rolestr.includes('新维修员')) {
153
+ this.causeOption = [{label: '换表施封', value: '换表施封'}, {label: '维修施封', value: '维修施封'}]
154
+ } else {
155
+ this.causeOption = this.$appdata.getParam('施封原因')
156
+ }
157
+ this.$nextTick(()=>{
158
+ this.getLocation()
159
+ })
160
+ },
161
+ computed: {
162
+
163
+ },
164
+ methods:{
165
+ codeScan() {
166
+ console.log('codeScan=========')
167
+ HostApp.__this__ = this
168
+ HostApp.scanQRCode({callback:"javascript:HostApp.__this__.codeScanCallback()"})
169
+ },
170
+ codeScanCallback() {
171
+ console.log('codeScanCallback=========')
172
+ let result = HostApp.getQRCode()
173
+ console.log('result=', result)
174
+ if (result.code == 200){
175
+ this.f_qr_code = result.data
176
+ }else {
177
+ this.$showMessage("未识别到二维码信息,请重新尝试!")
178
+ }
179
+ },
180
+ generateUUID() {
181
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
182
+ var r = (Math.random() * 16) | 0,
183
+ v = c == 'x' ? r : (r & 0x3) | 0x8;
184
+ return v.toString(16);
185
+ });
186
+ },
187
+ getLocation() {
188
+ const location = HostApp.getDetailAddress()
189
+ this.address = location.data
190
+ const longitude = HostApp.getPreference('longitude')
191
+ this.longitude = longitude.data
192
+ const latitude = HostApp.getPreference('latitude')
193
+ this.latitude = latitude.data
194
+ },
195
+
196
+ getLocation2() {
197
+ const result = HostApp.RestartGps()
198
+ if(result.data==='重启Gps成功'){
199
+ const location = HostApp.getDetailAddress()
200
+ this.address = location.data
201
+ const longitude = HostApp.getPreference('longitude')
202
+ this.longitude = longitude.data
203
+ const latitude = HostApp.getPreference('latitude')
204
+ this.latitude = latitude.data
205
+ }else{
206
+ this.$showMessage("GPS定位异常")
207
+ return
208
+ }
209
+ },
210
+ bind() {
211
+ if (!this.sealUID) {
212
+ this.$showMessage("铅封编号不能为空!")
213
+ return
214
+ }
215
+ if (!this.f_qr_code) {
216
+ this.$showMessage("二维码编号不能为空!")
217
+ return
218
+ }
219
+ if (!this.imgs.length) {
220
+ this.$showMessage("请拍摄铅封照片!")
221
+ return
222
+ }
223
+ if (!this.cause) {
224
+ this.$showMessage("请选择施封原因!")
225
+ return
226
+ }
227
+ //this.getLocation()
228
+ if (this.longitude == 0){
229
+ this.$showMessage("位置获取失败,请开启定位后进行施封!")
230
+ return
231
+ }
232
+ const param = {
233
+ seal: {
234
+ f_uid: this.sealUID,
235
+ f_qr_code: this.f_qr_code,
236
+ f_userinfo_id: this.row.f_userinfo_id,
237
+ f_filiale: this.row.f_filiale,
238
+ f_filiale_id: this.row.f_filiale_id,
239
+ f_user_id: this.row.f_user_id,
240
+ f_address: this.address,
241
+ f_longitude: this.longitude,
242
+ f_latitude: this.latitude,
243
+ f_operate_name: Vue.user.name,
244
+ f_operate_id: Vue.user.id,
245
+ f_operate_date: Util.toStandardTimeString(),
246
+ f_state: '有效'
247
+ },
248
+ operateList: {
249
+ f_cause: this.cause,
250
+ f_operate_date: Util.toStandardTimeString(),
251
+ f_creation_date: Util.toStandardTimeString(),
252
+ f_creation_name: Vue.user.name,
253
+ f_creation_name_id: Vue.user.id
254
+ },
255
+ files: [],
256
+ imgs: [],
257
+ f_devices_no: this.generateUUID()
258
+ }
259
+ for (const img of this.imgs) {
260
+ const i1 = img.lastIndexOf('?')
261
+ const i2 = img.lastIndexOf('/')
262
+ const key = img.substring(i2+1, i1)
263
+ const filename = img.substring(0, i1)
264
+ param.files.push({
265
+ f_img_url: key,
266
+ f_operate_date: Util.toStandardTimeString(),
267
+ f_operator: Vue.user.name,
268
+ f_operatorid: Vue.user.id
269
+ })
270
+ param.imgs.push({
271
+ key: key,
272
+ filename: filename
273
+ })
274
+ }
275
+ //tag)
276
+ let paramStr = JSON.stringify(param)
277
+ console.log('paramStr=', paramStr)
278
+ // 多长截断一次
279
+ let subLength = 800
280
+ for (let i = 0; i < paramStr.length; i += subLength) {
281
+ HostApp.param_cache(paramStr.substr(i, subLength))
282
+ }
283
+ HostApp.__this__ = this
284
+ HostApp.syncLogic({
285
+ 'logic': 'sealBind',
286
+ 'callback': 'javascript:HostApp.__this__.sealBindBack()',
287
+ 'backresult': 1
288
+ })
289
+ },
290
+ sealBindBack(jo) {
291
+ if(jo.state == 'ok') {
292
+ let res = JSON.parse(jo.result)
293
+ if (res.code == 200 && res.data.code == 200) {
294
+ this.$showMessage('施封成功!')
295
+ this.$back(this.sealUID)
296
+ return
297
+ }
298
+ this.$showMessage(res.data.msg)
299
+ return
300
+ }
301
+ this.$showMessage('网络异常!')
302
+ },
303
+ scan() {
304
+ HostApp.__this__ = this
305
+ HostApp.readNfc({
306
+ 'callback': 'javascript:HostApp.__this__.scanCallback()',
307
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
308
+ // 执行回调方法传入key为backresult
309
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
310
+ 'backresult': 1
311
+ })
312
+ },
313
+ scanCallback() {
314
+ console.log('scanCallback=========')
315
+ const result = HostApp.getNfcUUID()
316
+ console.log('result=', result)
317
+ if (result.code == 200){
318
+ this.sealUID = result.data
319
+ }else {
320
+ this.$showMessage("未识别到铅封信息,请重新尝试!")
321
+ return
322
+ }
323
+ },
324
+ takePic() {
325
+ HostApp.__callback__ = this.cameraCallBack
326
+ HostApp.__this__ = this
327
+
328
+ let fileName = `${Util.guid()}.jpg`
329
+ HostApp._open_a_page({
330
+ type: 'boomerang',
331
+ page: 'com.aofeng.hybrid.android.peripheral.CameraActivity',
332
+ param: {
333
+ file: fileName,
334
+ requestCode: 111,
335
+ callback: 'javascript:HostApp.__callback__("%s");',
336
+ watermark: '铅封照片\t时间:' + Util.toStandardTimeString() + '\t' + Vue.user.name + '\t' + this.row.f_userinfo_id+ '\t' + this.row.f_user_name+ '\t' + this.row.f_address
337
+ }
338
+ })
339
+ },
340
+ cameraCallBack(fileName) {
341
+ // if (prop == 'f_overall_path') {
342
+ // let f_overall_path = fileName + '?' + Math.random()
343
+ // HostApp.__this__.paper.f_overall_imgs.push({
344
+ // f_overall_path: f_overall_path
345
+ // })
346
+ // } else {
347
+ // HostApp.__this__.paper[prop] = fileName + '?' + Math.random()
348
+ // }
349
+ this.imgs.push(fileName + '?' + Math.random())
350
+ HostApp.__callback__ = null
351
+ HostApp.__this__ = null
352
+ },
353
+ delfile(fileName, index) {
354
+ if (fileName == Vue.nopic)
355
+ return
356
+ else {
357
+ this.imgs.splice(index, 1)
358
+ HostApp.delfile(fileName)
359
+ }
360
+ }
361
+ },
362
+ // 添加组件销毁前清理定时器
363
+ beforeDestroy() {
364
+ }
365
+ }
366
+ </script>
367
+ <style scoped>
368
+ .app-row {
369
+ background-color: white;
370
+ padding: 10px 10px 0 10px;
371
+ border-bottom: 1px solid rgba(235, 235, 235, 0.5);
372
+ }
373
+ .search_input {
374
+ border: 0;
375
+ outline: none;
376
+ }
377
+ .font{
378
+ font: 15px PingFang-SC-Medium;
379
+ color: #666666;
380
+ }
381
+ .input-font{
382
+ font: 15px PingFang-SC-Medium;
383
+ color: #333333;
384
+ }
385
+ .btn-font{
386
+ font:600 16px PingFang-SC-Bold;
387
+ color: #499EDF;
388
+ }
389
+ .btn-color{
390
+ background-color: #FFFFFF;
391
+ border-radius: 10px ;
392
+ border: 1px solid #499EDF;
393
+ }
394
+ .app-text {
395
+ font-size: 12px;
396
+ }
397
+ .panel-self{
398
+ border-radius: 10px;
399
+ border:1px solid #499EDF;
400
+ background-color: #F8F8F8;
401
+ }
402
+ .yybtn-color{
403
+ border-radius: 4px ;
404
+ border: 1px solid #499EDF;
405
+ }
406
+ .qxbtn-color{
407
+ background-color: #FFFFFF;
408
+ border-radius: 4px ;
409
+ border: 1px solid #499EDF;
410
+ }
411
+ .btn-photo{
412
+ border: 0;
413
+ border-radius: 7px;
414
+ background-color: #7dc1f4;
415
+ font: 15px PingFang-SC-Bold;
416
+ height: 20%;
417
+ }
418
+ .div-photo{
419
+ width: auto;
420
+ height: auto;
421
+ /* margin-top: 10px; */
422
+ position: absolute;
423
+ bottom: 10px;
424
+ right: 10px;
425
+ }
426
+ </style>