This commit is contained in:
2025-11-25 14:31:03 +08:00
parent 93591a9d29
commit 882ad35cc9
2 changed files with 39 additions and 6 deletions

View File

@@ -36,18 +36,26 @@
<uni-data-select v-model="index4" :localdata="options4" @change="selectChange4"></uni-data-select> <uni-data-select v-model="index4" :localdata="options4" @change="selectChange4"></uni-data-select>
</view> </view>
</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> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button> <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>
</view> </view>
</template> </template>
<script> <script>
import NavBar from '@/components/NavBar.vue' 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 { export default {
components: { components: {
NavBar NavBar
@@ -65,6 +73,8 @@
index3: '', index3: '',
options4: [], options4: [],
index4: '', index4: '',
options5: [],
index5: '',
disabled: false disabled: false
}; };
}, },
@@ -74,6 +84,7 @@
created () { created () {
this._queryArea () this._queryArea ()
this._queryArea2() this._queryArea2()
this._queryVehicleType()
}, },
methods: { methods: {
async _queryArea () { async _queryArea () {
@@ -124,6 +135,18 @@
this.options4 = [] this.options4 = []
} }
}, },
async _queryVehicleType () {
try {
let res = await queryVehicleType ()
if (res) {
this.options5 = res.data
} else {
this.options5 = []
}
} catch (e) {
this.options5 = []
}
},
selectChange (e) { selectChange (e) {
this.index = e this.index = e
if (e) { if (e) {
@@ -142,21 +165,25 @@
selectChange4 (e) { selectChange4 (e) {
this.index4 = e this.index4 = e
}, },
selectChange5 (e) {
this.index5 = e
},
clearUp () { clearUp () {
this.index = '' this.index = ''
this.index2 = '' this.index2 = ''
this.index3 = '' this.index3 = ''
this.index4 = '' this.index4 = ''
this.index5 = ''
this.disabled = false this.disabled = false
}, },
async _callTask () { async _callTask () {
this.disabled = true this.disabled = true
if (!this.index3 || !this.index4) { if (!this.index3 || !this.index4 || !this.index5) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await callTask (this.index3, this.index4, '3') let res = await callTask (this.index3, this.index4, '3', this.index5)
if (res) { if (res) {
uni.showToast({ uni.showToast({
title: res.message, title: res.message,

View File

@@ -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', url:'api/hand/callTask',
data: { data: {
start_device_code: scode, start_device_code: scode,
next_device_code: ncode, 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 type: type
} }
}) })
// 六、获取载具类型
export const queryVehicleType = () => request({
url:'api/hand/queryVehicleType',
data: {}
})