2025-02-06 16:32:24 +08:00
|
|
|
<template>
|
|
|
|
|
<view class="zd_container">
|
|
|
|
|
<nav-bar title="搬运任务"></nav-bar>
|
|
|
|
|
<view class="zd_content">
|
|
|
|
|
<view class="zd_wrapper">
|
2025-02-08 13:24:33 +08:00
|
|
|
<view class="filter_item">
|
|
|
|
|
<view class="filter_label">任务模式</view>
|
|
|
|
|
<view class="filter_input_wraper">
|
|
|
|
|
<uni-data-select v-model="index5" :localdata="options5" @change="selectChange5"></uni-data-select>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-02-06 16:32:24 +08:00
|
|
|
<view class="filter_item">
|
|
|
|
|
<view class="filter_label">起始区域</view>
|
|
|
|
|
<view class="filter_input_wraper">
|
|
|
|
|
<uni-data-select v-model="index3" :localdata="options3" @change="selectChange3"></uni-data-select>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="filter_item">
|
|
|
|
|
<view class="filter_label">目标区域</view>
|
|
|
|
|
<view class="filter_input_wraper">
|
|
|
|
|
<uni-data-select v-model="index4" :localdata="options4" @change="selectChange4"></uni-data-select>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="filter_item">
|
|
|
|
|
<view class="filter_label">起始点位</view>
|
|
|
|
|
<view class="filter_input_wraper">
|
|
|
|
|
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="filter_item">
|
|
|
|
|
<view class="filter_label">目标点位</view>
|
|
|
|
|
<view class="filter_input_wraper">
|
|
|
|
|
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="zd-row submit-bar_new">
|
|
|
|
|
<button class="zd-col-7 submit-button_c" @tap="toClear">清空</button>
|
2025-02-08 13:24:33 +08:00
|
|
|
<button class="zd-col-15 submit-button_new" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled" @tap="_callTask">确认</button>
|
2025-02-06 16:32:24 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import NavBar from '@/components/NavBar.vue'
|
2025-02-08 13:24:33 +08:00
|
|
|
import {queryArea, queryPointByArea, callTask} from '@/utils/getData0.js'
|
2025-02-06 16:32:24 +08:00
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
NavBar
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
disabled: false,
|
|
|
|
|
options1: [],
|
|
|
|
|
index1: '',
|
|
|
|
|
options2: [],
|
|
|
|
|
index2: '',
|
|
|
|
|
options3: [],
|
|
|
|
|
index3: '',
|
|
|
|
|
options4: [],
|
|
|
|
|
index4: '',
|
2025-02-08 13:24:33 +08:00
|
|
|
options5: [],
|
|
|
|
|
index5: ''
|
2025-02-06 16:32:24 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created () {
|
2025-02-08 13:24:33 +08:00
|
|
|
this._queryArea3('')
|
|
|
|
|
this._queryArea4('')
|
2025-02-06 16:32:24 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
selectChange1 (e) {
|
|
|
|
|
this.index1 = e
|
|
|
|
|
},
|
|
|
|
|
selectChange2 (e) {
|
|
|
|
|
this.index2 = e
|
|
|
|
|
},
|
|
|
|
|
selectChange3 (e) {
|
|
|
|
|
this.index3 = e
|
2025-02-08 13:24:33 +08:00
|
|
|
this._queryPointByArea1(e)
|
2025-02-06 16:32:24 +08:00
|
|
|
},
|
|
|
|
|
selectChange4 (e) {
|
|
|
|
|
this.index4 = e
|
2025-02-08 13:24:33 +08:00
|
|
|
this._queryPointByArea2(e)
|
2025-02-06 16:32:24 +08:00
|
|
|
},
|
2025-02-08 13:24:33 +08:00
|
|
|
async _queryArea3 (a) {
|
|
|
|
|
let res = await queryArea(a)
|
2025-02-06 16:32:24 +08:00
|
|
|
this.options3 = [...res]
|
|
|
|
|
this.options3.map(el => {
|
|
|
|
|
this.$set(el, 'value', el.region_code)
|
|
|
|
|
this.$set(el, 'text', el.region_name)
|
|
|
|
|
})
|
|
|
|
|
},
|
2025-02-08 13:24:33 +08:00
|
|
|
async _queryArea4 (a) {
|
|
|
|
|
let res = await queryArea(a)
|
2025-02-06 16:32:24 +08:00
|
|
|
this.options4 = [...res]
|
|
|
|
|
this.options4.map(el => {
|
|
|
|
|
this.$set(el, 'value', el.region_code)
|
|
|
|
|
this.$set(el, 'text', el.region_name)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 点位查询1 */
|
2025-02-08 13:24:33 +08:00
|
|
|
async _queryPointByArea1 (a) {
|
|
|
|
|
let res = await queryPointByArea(a)
|
2025-02-06 16:32:24 +08:00
|
|
|
this.options1 = [...res]
|
|
|
|
|
this.options1.map(el => {
|
2025-02-08 13:24:33 +08:00
|
|
|
this.$set(el, 'value', el.device_code)
|
|
|
|
|
this.$set(el, 'text', el.device_name)
|
2025-02-06 16:32:24 +08:00
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 点位查询2 */
|
2025-02-08 13:24:33 +08:00
|
|
|
async _queryPointByArea2 (a) {
|
|
|
|
|
let res = await queryPointByArea(a)
|
2025-02-06 16:32:24 +08:00
|
|
|
this.options2 = [...res]
|
|
|
|
|
this.options2.map(el => {
|
2025-02-08 13:24:33 +08:00
|
|
|
this.$set(el, 'value', el.device_code)
|
|
|
|
|
this.$set(el, 'text', el.device_name)
|
2025-02-06 16:32:24 +08:00
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toClear () {
|
|
|
|
|
this.index1 = ''
|
|
|
|
|
this.index2 = ''
|
|
|
|
|
},
|
2025-02-08 13:24:33 +08:00
|
|
|
async _callTask () {
|
2025-02-06 16:32:24 +08:00
|
|
|
this.disabled = true
|
|
|
|
|
if (!this.index1 || !this.index2) {
|
|
|
|
|
this.disabled = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
try {
|
2025-02-08 13:24:33 +08:00
|
|
|
let res = await callTask(this.index1, this.index2, '3', '')
|
2025-02-06 16:32:24 +08:00
|
|
|
this.disabled = false
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: res.message,
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.disabled = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="stylus">
|
|
|
|
|
</style>
|