FACILITY_CODE: number,
|
|
421
|
FACILITY_TYPE: type,
|
|
422
|
FACILITY_NAME: name
|
|
423
|
}
|
|
424
|
}))
|
|
425
|
this.$test.post(services.equipment.GET_EQUIPMENT, params
|
|
426
|
).then(res => {
|
|
427
|
// 请求成功处理...
|
|
428
|
this.table.data = res.data.result.list
|
|
429
|
this.table.pager.total = res.data.result.total
|
|
430
|
this.table.pager.currentPage = res.data.result.pageNum
|
|
431
|
}).catch(res => {
|
|
432
|
// 请求失败处理...
|
|
433
|
})
|
316
|
434
|
},
|
317
|
435
|
onChange(value) {
|
318
|
436
|
console.log('date change:' + value)
|
319
|
437
|
},
|
320
|
438
|
onReset() {
|
321
|
|
|
|
439
|
this.queryCondition.equipmentType = ''
|
|
440
|
this.queryCondition.equipmentName = ''
|
|
441
|
this.queryCondition.equipmentNumber = ''
|
|
442
|
this.searchResult = [
|
|
443
|
{
|
|
444
|
FACILITY_CODE: '',
|
|
445
|
FACILITY_ID: '',
|
|
446
|
FACILITY_NAME: '',
|
|
447
|
FACILITY_TYPE: '',
|
|
448
|
LATITUDE: '',
|
|
449
|
LONGITUDE: ''
|
|
450
|
}
|
|
451
|
]
|
|
452
|
this.searchResult_n = [
|
|
453
|
{
|
|
454
|
FACILITY_CODE: '',
|
|
455
|
FACILITY_ID: '',
|
|
456
|
FACILITY_NAME: '',
|
|
457
|
FACILITY_TYPE: '',
|
|
458
|
LATITUDE: '',
|
|
459
|
LONGITUDE: ''
|
|
460
|
}
|
|
461
|
]
|
|
462
|
this.onSearch()
|
322
|
463
|
},
|
323
|
464
|
onSearch() {
|
324
|
|
|
|
465
|
console.log(this.queryCondition.equipmentType)
|
|
466
|
console.log(this.queryCondition.equipmentName)
|
|
467
|
this.getList(1, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
|
325
|
468
|
},
|
326
|
469
|
toExport() {
|
327
|
470
|
|
328
|
471
|
},
|
329
|
472
|
onPagerChange(page) {
|
330
|
|
|
|
473
|
this.getList(page, this.table.pager.size, '', '', '')
|
331
|
474
|
},
|
332
|
475
|
onSizeChange(number) {
|
333
|
|
|
|
476
|
this.getList(1, number, '', '', '')
|
334
|
477
|
},
|
335
|
478
|
cancel() {
|
336
|
479
|
this.modal = false
|
|
480
|
this.updateModal = false
|
|
481
|
this.formValidate.type = ''
|
|
482
|
this.formValidate.name = ''
|
|
483
|
this.formValidate.number = ''
|
|
484
|
this.formValidate.lng = ''
|
|
485
|
this.formValidate.lat = ''
|
|
486
|
this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
|
337
|
487
|
},
|
338
|
488
|
submit() {
|
339
|
489
|
debugger
|
340
|
490
|
this.$refs.formValidate.validate(valid => {
|
341
|
491
|
console.log(valid)
|
342
|
492
|
if (valid) {
|
343
|
|
this.$Message.success('提交成功!')
|
|
493
|
var params = new FormData()
|
|
494
|
params.append('data', JSON.stringify({
|
|
495
|
params: {
|
|
496
|
FACILITY_TYPE: this.formValidate.type,
|
|
497
|
FACILITY_NAME: this.formValidate.name,
|
|
498
|
FACILITY_CODE: this.formValidate.number,
|
|
499
|
LONGITUDE: this.formValidate.lng,
|
|
500
|
LATITUDE: this.formValidate.lat
|
|
501
|
}
|
|
502
|
}))
|
|
503
|
this.$test.post(services.equipment.ADD_EQUIPMENT, params
|
|
504
|
).then(res => {
|
|
505
|
// 请求成功处理...
|
|
506
|
this.$Message.success('提交成功!')
|
|
507
|
this.cancel()
|
|
508
|
// this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
|
|
509
|
}).catch(res => {
|
|
510
|
// 请求失败处理...
|
|
511
|
})
|
|
512
|
} else {
|
|
513
|
this.$Message.danger('表单验证失败!')
|
|
514
|
}
|
|
515
|
})
|
|
516
|
},
|
|
517
|
updateSubmit() {
|
|
518
|
debugger
|
|
519
|
this.$refs.updateRow.validate(valid => {
|
|
520
|
console.log(valid)
|
|
521
|
if (valid) {
|
|
522
|
var params = new FormData()
|
|
523
|
params.append('data', JSON.stringify({
|
|
524
|
params: {
|
|
525
|
FACILITY_ID: this.updateRow.FACILITY_ID,
|
|
526
|
FACILITY_TYPE: this.updateRow.FACILITY_TYPE,
|
|
527
|
FACILITY_NAME: this.updateRow.FACILITY_NAME,
|
|
528
|
LONGITUDE: this.updateRow.LONGITUDE,
|
|
529
|
LATITUDE: this.updateRow.LATITUDE
|
|
530
|
}
|
|
531
|
}))
|
|
532
|
this.$test.post(services.equipment.ADD_EQUIPMENT, params
|
|
533
|
).then(res => {
|
|
534
|
// 请求成功处理...
|
|
535
|
this.$Message.success('提交成功!')
|
|
536
|
this.cancel()
|
|
537
|
}).catch(res => {
|
|
538
|
// 请求失败处理...
|
|
539
|
})
|
344
|
540
|
} else {
|
345
|
541
|
this.$Message.danger('表单验证失败!')
|
346
|
542
|
}
|
|
@ -350,7 +546,8 @@ export default {
|
350
|
546
|
this.modal = true
|
351
|
547
|
},
|
352
|
548
|
handleClick(row) {
|
353
|
|
this.modal = true
|
|
549
|
this.updateModal = true
|
|
550
|
this.updateRow = row
|
354
|
551
|
},
|
355
|
552
|
remove(row) {
|
356
|
553
|
let that = this
|
|
@ -360,16 +557,18 @@ export default {
|
360
|
557
|
ok: function () {
|
361
|
558
|
var params = new FormData()
|
362
|
559
|
params.append('data', JSON.stringify({
|
363
|
|
MAP_TAG_ID: row.MAP_TAG_ID
|
|
560
|
params: {
|
|
561
|
FACILITY_ID: row.FACILITY_ID
|
|
562
|
}
|
364
|
563
|
}))
|
365
|
|
// this.$test.post(services.mapTag.DEL_MAP_TAG, params
|
366
|
|
// ).then(res => {
|
367
|
|
// // 请求成功处理...
|
368
|
|
this.$Message.success('操作成功')
|
369
|
|
// that.getList(that.table.pager.currentPage, that.table.pager.size, that.queryCondition.userName)
|
370
|
|
// }).catch(res => {
|
371
|
|
// // 请求失败处理...
|
372
|
|
// })
|
|
564
|
this.$test.post(services.equipment.DEL_EQUIPMENT, params
|
|
565
|
).then(res => {
|
|
566
|
// 请求成功处理...
|
|
567
|
that.$Message.success('操作成功')
|
|
568
|
that.getList(that.table.pager.currentPage, that.table.pager.size, that.queryCondition.equipmentType, that.queryCondition.equipmentName, that.queryCondition.equipmentNumber)
|
|
569
|
}).catch(res => {
|
|
570
|
// 请求失败处理...
|
|
571
|
})
|
373
|
572
|
}
|
374
|
573
|
}
|
375
|
574
|
this.$Confirm.confirm(confirm)
|