区域锁定页

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
}
}

View File

@@ -5,7 +5,7 @@
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">地面点位</span>
<span class="filter_label">当前点位</span>
</view>
<view class="zd-col-19">
<search-box
@@ -15,20 +15,17 @@
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">载具类型</span>
<span class="filter_label">载具</span>
</view>
<view class="zd-col-17 filter_picker">
<picker @change="pickerChange" :value="index1" :range="options1" range-key="text">
<view class="uni-input">{{index1 !== '' ? options1[index1].text : ''}}</view>
</picker>
<view class="zd-col-19">
<link-scan ref="scanChild" @getScanlist="getScanlist"/>
</view>
<uni-icons type="right" size="14" color="#999"></uni-icons>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': index1 === '' || !val1}" :disabled="disabled" @tap="_callEmptyVehicle">送回确认</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_callEmptyVehicle">送回确认</button>
</view>
</view>
</template>
@@ -36,20 +33,19 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import LinkScan from '@/components/LinkScan.vue'
import {getVehicleType, callEmptyVehicle} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
SearchBox,
LinkScan
},
data() {
return {
title: '',
options1: [],
index1: '',
// options2: [],
// index2: '',
val1: '',
val2: '',
disabled: false
};
},
@@ -57,6 +53,9 @@
this.title = options.title
},
methods: {
getScanlist (e) {
this.val2 = e.join()
},
/** 载具类型下拉框 */
async _getVehicleType () {
let res = await getVehicleType()
@@ -67,12 +66,12 @@
},
async _callEmptyVehicle () {
this.disabled = true
if (!this.val1 || this.index1 === '') {
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await callEmptyVehicle(this.options1[this.index1].value, this.val1)
let res = await callEmptyVehicle(this.val1)
this.clearUp()
uni.showToast({
title: res.message,
@@ -83,8 +82,9 @@
}
},
clearUp () {
this.index1 = ''
this.val1 = ''
this.val2 = ''
this.$refs.scanChild.toDel()
this.disabled = false
}
}