区域锁定页

This commit is contained in:
2024-08-26 16:05:16 +08:00
parent cf138cf88b
commit 6b9756435b
4 changed files with 170 additions and 32 deletions

View File

@@ -8,15 +8,15 @@
<span class="filter_label">区域</span>
</view>
<view class="zd-col-19 filter_select">
<zxz-uni-data-select v-model="index1" filterable :localdata="options1" @change="selectChange"></zxz-uni-data-select>
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === ''}" :disabled="disabled" @tap="_fullVehicleOut">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === ''}" :disabled="disabled" @tap="_fullVehicleOut">释放</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index === ''}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index === ''}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
</view>
</view>
</template>
@@ -24,7 +24,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {queryMaterial, queryLinkMaterial, fullVehicleOut} from '@/utils/getData2.js'
import {regionList, handheldLock} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -33,33 +33,34 @@
data() {
return {
title: '',
options1: [],
index1: '',
options: [],
index: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._regionList()
},
methods: {
async _queryMaterial (e) {
let res = await queryMaterial(e)
res.map(el => {
this.$set(el, 'value', el.material_id)
this.$set(el, 'text', el.material_name)
async _regionList () {
let res = await regionList()
this.options = [...res.content]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
this.options1 = [...res]
},
selectChange (e) {
this.index = e
},
async _fullVehicleOut () {
async _handheldLock (type) {
this.disabled = true
if (this.index1 === '') {
if (this.index === '') {
this.disabled = false
return
}
try {
let res = await fullVehicleOut(this.index1)
let res = await handheldLock(this.index, type)
this.clearUp()
uni.showToast({
title: res.message,
@@ -70,7 +71,7 @@
}
},
clearUp () {
this.index1 = ''
this.index = ''
this.disabled = false
}
}