This commit is contained in:
2025-08-21 14:39:09 +08:00
parent 26ed7822b2
commit 3a43e50e15
9 changed files with 341 additions and 66 deletions

View File

@@ -11,6 +11,17 @@
<view class="zd-col-17">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val2"
/>
</view>
</view>
@@ -26,7 +37,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">确认</button>
</view>
</view>
</template>
@@ -34,7 +45,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getPdaSect, vehicleInConfirm} from '@/utils/getData4.js'
import {getPdaSect, getPointCodeByVehicleCode, vehicleInConfirm} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -44,6 +55,7 @@
return {
title: '',
val1: '',
val2: '',
options: [],
index: '',
disabled: false
@@ -56,6 +68,11 @@
this._getPdaSect()
},
methods: {
handleChange (e) {
if (e) {
this._getPointCodeByVehicleCode()
}
},
async _getPdaSect () {
try {
let res = await getPdaSect()
@@ -76,14 +93,24 @@
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 () {
this.disabled = true
if (!this.val1 || !this.index) {
if (!this.val1 || !this.val2 || !this.index) {
this.disabled = false
return
}
try {
let res = await vehicleInConfirm(this.val1, this.index)
let res = await vehicleInConfirm(this.val1, this.index, this.val2)
if (res.code === '200') {
uni.showToast({
title: res.message,