载具绑定

This commit is contained in:
2024-01-03 16:10:57 +08:00
parent 9fef242404
commit f1ea8bb00d
2 changed files with 47 additions and 6 deletions

View File

@@ -35,6 +35,18 @@
</dropdown-menu>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">点位状态</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option4"
:active="active4"
:open="open4"
@toggleItem="toggleItem4"
@dropdownMenu="dropdownMenu4">
</dropdown-menu>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">载具类型</div>
<div class="fxcol mgl20 visible" >
@@ -69,7 +81,7 @@
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {pdaRegion, pdaPoint, pdavehicleType, vehicleBind} from '@config/getData2'
import {pdaRegion, pdaPoint, pdapointStatus, pdavehicleType, vehicleBind} from '@config/getData2'
export default {
name: 'VehicleBind',
components: {
@@ -95,14 +107,27 @@ export default {
open3: false,
val3: '',
disabled1: false,
val4: ''
val4: '',
option4: [],
active4: '',
open4: false
}
},
created () {
this._pdaRegion()
this._pdavehicleType()
this._pdapointStatus()
},
methods: {
/** 查询点位状态 */
async _pdapointStatus () {
let res = await pdapointStatus()
if (res.code === '1') {
this.option4 = [...res.result]
} else {
this.Dialog(res.desc)
}
},
/** 查询载具类型 */
async _pdavehicleType () {
let res = await pdavehicleType('vehicle_bind')
@@ -260,10 +285,21 @@ export default {
this.val3 = this.optionNew3[i].label
}
},
toggleItem4 () {
if (!this.open4) {
this.open4 = true
} else {
this.open4 = false
}
},
dropdownMenu4 (i) {
this.active4 = i + ''
this.open4 = false
},
/** 确认 */
async _vehicleBind () {
this.disabled1 = true
if (this.val2 === '' || this.val3 === '' || this.val4 === '') {
if (this.val2 === '' || this.val3 === '' || this.val4 === '' || this.active4 === '') {
this.disabled1 = false
return
}
@@ -280,7 +316,7 @@ export default {
code3 = el.value
}
})
let res = await vehicleBind(code, code3, this.val4)
let res = await vehicleBind(code, code3, this.val4, this.option4[this.active4].value)
if (res.code === '1') {
this.toast(res.desc)
this.toCancle()
@@ -302,6 +338,7 @@ export default {
this.active3 = ''
this.disabled1 = false
this.val4 = ''
this.active4 = ''
}
}
}