下拉
This commit is contained in:
@@ -36,18 +36,26 @@
|
||||
<uni-data-select v-model="index4" :localdata="options4" @change="selectChange4"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">载具类型</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index5" :localdata="options5" @change="selectChange5"></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-18 button-primary" :class="{'button-info': !index || !index2 || !index3 || !index4}" :disabled="disabled" @tap="_callTask">确认</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !index || !index2 || !index3 || !index4 || !index5}" :disabled="disabled" @tap="_callTask">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {queryArea, queryPointByArea , callTask } from '@/utils/getData3.js'
|
||||
import {queryArea, queryPointByArea, queryVehicleType, callTask } from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
@@ -65,6 +73,8 @@
|
||||
index3: '',
|
||||
options4: [],
|
||||
index4: '',
|
||||
options5: [],
|
||||
index5: '',
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
@@ -74,6 +84,7 @@
|
||||
created () {
|
||||
this._queryArea ()
|
||||
this._queryArea2()
|
||||
this._queryVehicleType()
|
||||
},
|
||||
methods: {
|
||||
async _queryArea () {
|
||||
@@ -124,6 +135,18 @@
|
||||
this.options4 = []
|
||||
}
|
||||
},
|
||||
async _queryVehicleType () {
|
||||
try {
|
||||
let res = await queryVehicleType ()
|
||||
if (res) {
|
||||
this.options5 = res.data
|
||||
} else {
|
||||
this.options5 = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options5 = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (e) {
|
||||
@@ -142,21 +165,25 @@
|
||||
selectChange4 (e) {
|
||||
this.index4 = e
|
||||
},
|
||||
selectChange5 (e) {
|
||||
this.index5 = e
|
||||
},
|
||||
clearUp () {
|
||||
this.index = ''
|
||||
this.index2 = ''
|
||||
this.index3 = ''
|
||||
this.index4 = ''
|
||||
this.index5 = ''
|
||||
this.disabled = false
|
||||
},
|
||||
async _callTask () {
|
||||
this.disabled = true
|
||||
if (!this.index3 || !this.index4) {
|
||||
if (!this.index3 || !this.index4 || !this.index5) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await callTask (this.index3, this.index4, '3')
|
||||
let res = await callTask (this.index3, this.index4, '3', this.index5)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
@@ -25,12 +25,13 @@ export const handLogin = (user, password) => request({
|
||||
* 任务下发
|
||||
*/
|
||||
// 一、生成任务
|
||||
export const callTask = (scode, ncode, type) => request({
|
||||
export const callTask = (scode, ncode, type, vtype) => request({
|
||||
url:'api/hand/callTask',
|
||||
data: {
|
||||
start_device_code: scode,
|
||||
next_device_code: ncode,
|
||||
task_type: type
|
||||
task_type: type,
|
||||
vehicle_type: vtype
|
||||
}
|
||||
})
|
||||
// 二、查询区域
|
||||
@@ -63,3 +64,8 @@ export const taskoperation = (id, type) => request({
|
||||
type: type
|
||||
}
|
||||
})
|
||||
// 六、获取载具类型
|
||||
export const queryVehicleType = () => request({
|
||||
url:'api/hand/queryVehicleType',
|
||||
data: {}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user