|
316
|
}
|
312
|
317
|
}).then(res => {
|
313
|
318
|
// 请求成功处理...
|
|
319
|
this.tableLoading = false
|
314
|
320
|
this.table.data = res.data.dataList
|
315
|
321
|
this.table.pager.total = res.data.dataNum
|
316
|
322
|
}).catch(res => {
|
317
|
323
|
// 请求失败处理...
|
|
324
|
this.tableLoading = false
|
318
|
325
|
})
|
319
|
326
|
},
|
320
|
327
|
initItemList(name) { // 获取人员和设备的数据
|
321
|
|
this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '1', name:name} // 查询人员
|
|
328
|
this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '1', name: name} // 查询人员
|
322
|
329
|
).then(res => {
|
323
|
330
|
// 请求成功处理...
|
324
|
331
|
this.currentLoading = false
|
|
@ -326,7 +333,7 @@ export default {
|
326
|
333
|
}).catch(res => {
|
327
|
334
|
// 请求失败处理...
|
328
|
335
|
})
|
329
|
|
this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '2', name:name} // 查询设备
|
|
336
|
this.$test.post(services.device.GET_ASSOCIATINFO, {bindType: '2', name: name} // 查询设备
|
330
|
337
|
).then(res => {
|
331
|
338
|
// 请求成功处理...
|
332
|
339
|
this.currentLoading = false
|
|
@ -354,40 +361,42 @@ export default {
|
354
|
361
|
this.initItemList(filterValue)
|
355
|
362
|
},
|
356
|
363
|
cancelUserModal() {
|
357
|
|
this.relevance = false
|
358
|
364
|
this.$refs['relevanceValidate'].resetFields()
|
|
365
|
this.itemList.forEach(e => {
|
|
366
|
e.isShow = false
|
|
367
|
})
|
|
368
|
this.relevance = false
|
359
|
369
|
},
|
360
|
370
|
confirmUserModal() { // 绑定操作提交
|
|
371
|
var that = this
|
361
|
372
|
this.$refs['relevanceValidate'].validate(valid => {
|
362
|
373
|
if (valid) {
|
363
|
|
var params = new FormData()
|
364
|
|
if (this.relevanceValidate.type === '1') {
|
365
|
|
params.append('data', JSON.stringify({
|
366
|
|
type: '1',
|
367
|
|
PARTY_TYPE: 1,
|
368
|
|
PARTY_CODE: this.relevanceValidate.user.employeeNo,
|
369
|
|
PARTY_TERMINAL_ID: this.relevanceValidate.PARTY_TERMINAL_ID,
|
370
|
|
PARTY_NAME: this.relevanceValidate.user.userName,
|
371
|
|
PARTY_POST: this.relevanceValidate.user.duty,
|
372
|
|
DEVICE_ID: this.relevanceValidate.id
|
373
|
|
}))
|
|
374
|
this.loading = true
|
|
375
|
var id = ''
|
|
376
|
if (that.relevanceValidate.type === '1') {
|
|
377
|
id = that.relevanceValidate.user.id
|
374
|
378
|
} else {
|
375
|
|
params.append('data', JSON.stringify({
|
376
|
|
type: '2',
|
377
|
|
FACILITY_ID: this.relevanceValidate.user.id,
|
378
|
|
DEVICE_ID: this.relevanceValidate.id
|
379
|
|
}))
|
|
379
|
id = that.relevanceValidate.user.id
|
|
380
|
}
|
|
381
|
that.fullLoading = true
|
|
382
|
that.$test.post(services.device.BIND_DEVICE, {
|
|
383
|
bindType: this.relevanceValidate.type,
|
|
384
|
deviceId: this.relevanceValidate.id,
|
|
385
|
associatedId: id
|
380
|
386
|
}
|
381
|
|
this.$test.post(services.device.BIND_DEVICE, params
|
382
|
387
|
).then(res => {
|
383
|
388
|
// 请求成功处理...
|
|
389
|
this.fullLoading = false
|
384
|
390
|
if (res.data.result) {
|
385
|
391
|
this.relevance = false
|
|
392
|
this.loading = false
|
386
|
393
|
this.$Message.success('提交成功!')
|
387
|
394
|
this.getList()
|
388
|
395
|
}
|
389
|
396
|
}).catch(res => {
|
390
|
397
|
// 请求失败处理...
|
|
398
|
this.loading = false
|
|
399
|
this.fullLoading = false
|
391
|
400
|
})
|
392
|
401
|
}
|
393
|
402
|
})
|
|
@ -414,7 +423,7 @@ export default {
|
414
|
423
|
})
|
415
|
424
|
},
|
416
|
425
|
onReset() {
|
417
|
|
this.queryCondition.isBindDevice = 0
|
|
426
|
this.queryCondition.isBindDevice = ''
|
418
|
427
|
this.queryCondition.type = ''
|
419
|
428
|
this.queryCondition.deviceNo = ''
|
420
|
429
|
this.onSearch()
|
|
@ -447,7 +456,7 @@ export default {
|
447
|
456
|
var that = this
|
448
|
457
|
this.$refs.formValidate.validate(valid => {
|
449
|
458
|
if (valid) {
|
450
|
|
debugger
|
|
459
|
that.fullLoading = true
|
451
|
460
|
that.$test.post(services.device.ADD_DEVICE, {
|
452
|
461
|
deviceTypeId: that.formValidate.type.value,
|
453
|
462
|
deviceTypeName: that.formValidate.type.label,
|
|
@ -455,12 +464,13 @@ export default {
|
455
|
464
|
remarks: that.formValidate.desc
|
456
|
465
|
}).then(res => {
|
457
|
466
|
// 请求成功处理...
|
|
467
|
that.fullLoading = false
|
458
|
468
|
if (res.data.result) {
|
459
|
469
|
that.$Message.success('提交成功!')
|
460
|
470
|
that.cancel()
|
461
|
|
this.getList()
|
|
471
|
that.getList()
|
462
|
472
|
} else {
|
463
|
|
this.$Message.danger(res.data.errMsg)
|
|
473
|
that.$Message.danger(res.data.errMsg)
|
464
|
474
|
}
|
465
|
475
|
}).catch(res => {
|
466
|
476
|
// 请求失败处理...
|
|
@ -471,6 +481,7 @@ export default {
|
471
|
481
|
})
|
472
|
482
|
},
|
473
|
483
|
updateSubmit() { // 编辑提交
|
|
484
|
this.fullLoading = true
|
474
|
485
|
this.$test.post(services.device.UPD_DEVICE, {
|
475
|
486
|
deviceId: this.updateFormValidate.id,
|
476
|
487
|
deviceTypeName: this.updateFormValidate.type,
|
|
@ -478,6 +489,7 @@ export default {
|
478
|
489
|
remarks: this.updateFormValidate.desc
|
479
|
490
|
}).then(res => {
|
480
|
491
|
// 请求成功处理...
|
|
492
|
this.fullLoading = false
|
481
|
493
|
if (res.data.result) {
|
482
|
494
|
this.$Message.success('提交成功!')
|
483
|
495
|
this.cancel()
|
|
@ -487,6 +499,7 @@ export default {
|
487
|
499
|
}
|
488
|
500
|
}).catch(res => {
|
489
|
501
|
// 请求失败处理...
|
|
502
|
this.fullLoading = false
|
490
|
503
|
})
|
491
|
504
|
},
|
492
|
505
|
solution(row) { // 解绑
|
|
@ -498,16 +511,13 @@ export default {
|
498
|
511
|
} else {
|
499
|
512
|
this.$Confirm.confirm({
|
500
|
513
|
title: '确认要解除终端' + row.deviceNo + '和' + row.bindName + '的关联关系吗?',
|
501
|
|
content: '解绑后将不可通过终端' + row.deviceNo + '获取' + row.bindName + '的定位信息',
|
|
514
|
content: '解绑后将不可通过终端 ' + row.deviceNo + ' 获取 ' + row.bindName + '的定位信息',
|
502
|
515
|
ok: () => {
|
503
|
|
var params = new FormData()
|
504
|
|
params.append('data', JSON.stringify({
|
505
|
|
DEVICE_ID: row.deviceId
|
506
|
|
}))
|
507
|
|
// console.log(that.formValidate.desc)
|
508
|
|
this.$test.post(services.device.UNBIND_DEVICE, params
|
|
516
|
this.fullLoading = true
|
|
517
|
this.$test.post(services.device.UNBIND_DEVICE, {deviceId: row.deviceId}
|
509
|
518
|
).then(res => {
|
510
|
519
|
// 请求成功处理...
|
|
520
|
this.fullLoading = false
|
511
|
521
|
if (res.data.result) {
|
512
|
522
|
this.$Message.success('解绑成功!')
|
513
|
523
|
this.getList()
|
|
@ -516,6 +526,7 @@ export default {
|
516
|
526
|
}
|
517
|
527
|
}).catch(res => {
|
518
|
528
|
// 请求失败处理...
|
|
529
|
this.fullLoading = false
|
519
|
530
|
})
|
520
|
531
|
},
|
521
|
532
|
cancel: () => {
|
|
@ -525,39 +536,42 @@ export default {
|
525
|
536
|
}
|
526
|
537
|
},
|
527
|
538
|
toBatchSolution(row) { // 批量解绑
|
528
|
|
// if (row.bindName === '--') {
|
529
|
|
// this.$Confirm.info({
|
530
|
|
// title: '提示',
|
531
|
|
// content: '该终端未绑定对象,无需解绑'
|
532
|
|
// })
|
533
|
|
// } else {
|
534
|
|
// this.$Confirm.confirm({
|
535
|
|
// title: '确认要解除终端' + row.deviceNo + '和' + row.bindName + '的关联关系吗?',
|
536
|
|
// content: '解绑后将不可通过终端' + row.deviceNo + '获取' + row.bindName + '的定位信息',
|
537
|
|
// ok: () => {
|
538
|
|
// var params = new FormData()
|
539
|
|
// params.append('data', JSON.stringify({
|
540
|
|
// DEVICE_ID: row.deviceId
|
541
|
|
// }))
|
542
|
|
// // console.log(that.formValidate.desc)
|
543
|
|
// this.$test.post(services.device.UNBIND_DEVICE, params
|
544
|
|
// ).then(res => {
|
545
|
|
// // 请求成功处理...
|
546
|
|
// if (res.data.result) {
|
547
|
|
// this.$Message.success('解绑成功!')
|
548
|
|
// this.getList()
|
549
|
|
// } else {
|
550
|
|
// this.$Message.danger('解绑失败!')
|
551
|
|
// }
|
552
|
|
// }).catch(res => {
|
553
|
|
// // 请求失败处理...
|
554
|
|
// })
|
555
|
|
// },
|
556
|
|
// cancel: () => {
|
557
|
|
// console.log('点击了取消')
|
558
|
|
// }
|
559
|
|
// })
|
560
|
|
// }
|
|
539
|
if (this.selections.length === 0) {
|
|
540
|
this.$Confirm.info({
|
|
541
|
title: '提示',
|
|
542
|
content: '请选中需要删除的终端。'
|
|
543
|
})
|
|
544
|
} else {
|
|
545
|
var deviceId = ''
|
|
546
|
for (let i = 0; i < this.selections.length; i++) {
|
|
547
|
deviceId += this.selections[i].deviceId + ','
|
|
548
|
}
|
|
549
|
deviceId = deviceId.substring(0, deviceId.length - 1)
|
|
550
|
this.$Confirm.confirm({
|
|
551
|
title: '确认要解除选中终端的关联关系吗?',
|
|
552
|
content: '解绑后将不可通过终端获取定位信息',
|
|
553
|
ok: () => {
|
|
554
|
this.fullLoading = true
|
|
555
|
this.$test.post(services.device.UNBIND_DEVICE, {deviceId: deviceId}
|
|
556
|
).then(res => {
|
|
557
|
// 请求成功处理...
|
|
558
|
this.fullLoading = false
|
|
559
|
if (res.data.result) {
|
|
560
|
this.$Message.success('解绑成功!')
|
|
561
|
this.getList()
|
|
562
|
} else {
|
|
563
|
this.$Message.danger('解绑失败!')
|
|
564
|
}
|
|
565
|
}).catch(res => {
|
|
566
|
// 请求失败处理...
|
|
567
|
this.fullLoading = false
|
|
568
|
})
|
|
569
|
},
|
|
570
|
cancel: () => {
|
|
571
|
console.log('点击了取消')
|
|
572
|
}
|
|
573
|
})
|
|
574
|
}
|
561
|
575
|
},
|
562
|
576
|
handleClick(row) {
|
563
|
577
|
this.$test.post(services.device.GET_ONE_DEVICE, {deviceId: row.deviceId}
|
|
@ -589,34 +603,42 @@ export default {
|
589
|
603
|
this.$test.post(services.device.GET_BIND_DEVICE, {deviceId: row.deviceId}
|
590
|
604
|
).then(res => {
|
591
|
605
|
// 请求成功处理...
|
592
|
|
if (res.data.resultData.bindName == '--') {
|
|
606
|
if (res.data.resultData == null) {
|
593
|
607
|
this.relevanceValidate.msgisShow = false
|
594
|
608
|
this.relevanceValidate.msg = ''
|
595
|
609
|
} else {
|
596
|
610
|
this.relevanceValidate.msgisShow = true
|
597
|
|
this.relevanceValidate.msg = '当前终端已关联 ' + res.data.resultData.bindName + ' ,点击保存更改关联关系'
|
|
611
|
var name = ''
|
|
612
|
if (res.data.resultData.bindType === '1') {
|
|
613
|
name = res.data.resultData.name
|
|
614
|
} else {
|
|
615
|
name = res.data.resultData.resourceToolName
|
|
616
|
}
|
|
617
|
this.relevanceValidate.msg = '当前终端已关联 ' + name + ' ,点击保存更改关联关系'
|
598
|
618
|
}
|
599
|
619
|
}).catch(res => {
|
600
|
620
|
// 请求失败处理...
|
601
|
621
|
})
|
602
|
622
|
},
|
603
|
623
|
removeD(row) {
|
604
|
|
let that = this
|
605
|
624
|
let confirm = {
|
606
|
625
|
title: '请确认',
|
607
|
626
|
content: '删除后不可恢复,确认删除吗?',
|
608
|
|
ok: function () {
|
|
627
|
ok: () => {
|
|
628
|
this.fullLoading = true
|
609
|
629
|
this.$test.post(services.device.DEL_DEVICE, {deviceId: row.deviceId}
|
610
|
630
|
).then(res => {
|
611
|
631
|
// 请求成功处理...
|
|
632
|
this.fullLoading = false
|
612
|
633
|
if (res.data.result) {
|
613
|
|
that.$Message.success('操作成功')
|
614
|
|
that.getList()
|
|
634
|
this.$Message.success('操作成功')
|
|
635
|
this.getList()
|
615
|
636
|
} else {
|
616
|
|
that.$Message.danger(res.data.errMsg)
|
|
637
|
this.$Message.danger(res.data.errMsg)
|
617
|
638
|
}
|
618
|
639
|
}).catch(res => {
|
619
|
640
|
// 请求失败处理...
|
|
641
|
this.fullLoading = false
|
620
|
642
|
})
|
621
|
643
|
}
|
622
|
644
|
}
|
|
@ -634,22 +656,24 @@ export default {
|
634
|
656
|
deviceId += this.selections[i].deviceId + ','
|
635
|
657
|
}
|
636
|
658
|
deviceId = deviceId.substring(0, deviceId.length - 1)
|
637
|
|
let that = this
|
638
|
659
|
let confirm = {
|
639
|
660
|
title: '请确认',
|
640
|
661
|
content: '删除后不可恢复,确认删除吗?',
|
641
|
|
ok: function () {
|
|
662
|
ok: () => {
|
|
663
|
this.fullLoading = true
|
642
|
664
|
this.$test.post(services.device.DEL_DEVICE, {deviceId: deviceId}
|
643
|
665
|
).then(res => {
|
644
|
666
|
// 请求成功处理...
|
|
667
|
this.fullLoading = false
|
645
|
668
|
if (res.data.result) {
|
646
|
|
that.$Message.success('操作成功')
|
647
|
|
that.getList()
|
|
669
|
this.$Message.success('操作成功')
|
|
670
|
this.getList()
|
648
|
671
|
} else {
|
649
|
|
that.$Message.danger(res.data.errMsg)
|
|
672
|
this.$Message.danger(res.data.errMsg)
|
650
|
673
|
}
|
651
|
674
|
}).catch(res => {
|
652
|
675
|
// 请求失败处理...
|
|
676
|
this.fullLoading = false
|
653
|
677
|
})
|
654
|
678
|
}
|
655
|
679
|
}
|