change
This commit is contained in:
@@ -36,8 +36,8 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button> -->
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">绑定</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">解绑</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindEmptyVehicle">绑定</button>
|
||||
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_unBindEmptyVehicle">解绑</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -45,7 +45,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getPdaSect, getPointCodeByVehicleCode, vehicleInConfirm} from '@/utils/getData4.js'
|
||||
import {queryVehicleType, bindEmptyVehicle, unBindEmptyVehicle} from '@/utils/getData1.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -65,17 +65,12 @@
|
||||
this.title = options.title
|
||||
},
|
||||
created () {
|
||||
this._getPdaSect()
|
||||
this._queryVehicleType()
|
||||
},
|
||||
methods: {
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getPointCodeByVehicleCode()
|
||||
}
|
||||
},
|
||||
async _getPdaSect () {
|
||||
async _queryVehicleType () {
|
||||
try {
|
||||
let res = await getPdaSect()
|
||||
let res = await queryVehicleType()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
@@ -90,40 +85,46 @@
|
||||
},
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.index = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _getPointCodeByVehicleCode () {
|
||||
try {
|
||||
let res = await getPointCodeByVehicleCode(this.val1)
|
||||
if (res.code === '200') {
|
||||
this.val2 = res.data
|
||||
} else {
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
async _vehicleInConfirm () {
|
||||
async _bindEmptyVehicle () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2 || !this.index) {
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await vehicleInConfirm(this.val1, this.index, this.val2)
|
||||
if (res.code === '200') {
|
||||
let res = await bindEmptyVehicle(this.val1, this.val2)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
} else {
|
||||
}
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _unBindEmptyVehicle () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.val2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await unBindEmptyVehicle(this.val1, this.val2)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.disabled = false
|
||||
this.clearUp()
|
||||
}
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user