任务
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
<nav-bar title="搬运任务"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
<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>
|
||||
<view class="filter_item">
|
||||
<view class="filter_label">起始区域</view>
|
||||
<view class="filter_input_wraper">
|
||||
@@ -31,21 +37,20 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar_new">
|
||||
<button class="zd-col-7 submit-button_c" @tap="toClear">清空</button>
|
||||
<button class="zd-col-15 submit-button_new" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled" @tap="_taskCarry">确认</button>
|
||||
<button class="zd-col-15 submit-button_new" :class="{'btn-disabled': !index1 || !index2}" :disabled="disabled" @tap="_callTask">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {regionSearch, pointSearch, taskCarry} from '@/utils/getData1.js'
|
||||
import {queryArea, queryPointByArea, callTask} from '@/utils/getData0.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataList: [],
|
||||
disabled: false,
|
||||
options1: [],
|
||||
index1: '',
|
||||
@@ -55,11 +60,13 @@
|
||||
index3: '',
|
||||
options4: [],
|
||||
index4: '',
|
||||
options5: [],
|
||||
index5: ''
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this._regionSearch3('')
|
||||
this._regionSearch4('')
|
||||
this._queryArea3('')
|
||||
this._queryArea4('')
|
||||
},
|
||||
methods: {
|
||||
selectChange1 (e) {
|
||||
@@ -70,22 +77,22 @@
|
||||
},
|
||||
selectChange3 (e) {
|
||||
this.index3 = e
|
||||
this._pointSearch1(e)
|
||||
this._queryPointByArea1(e)
|
||||
},
|
||||
selectChange4 (e) {
|
||||
this.index4 = e
|
||||
this._pointSearch2(e)
|
||||
this._queryPointByArea2(e)
|
||||
},
|
||||
async _regionSearch3 (a) {
|
||||
let res = await regionSearch(a)
|
||||
async _queryArea3 (a) {
|
||||
let res = await queryArea(a)
|
||||
this.options3 = [...res]
|
||||
this.options3.map(el => {
|
||||
this.$set(el, 'value', el.region_code)
|
||||
this.$set(el, 'text', el.region_name)
|
||||
})
|
||||
},
|
||||
async _regionSearch4 (a) {
|
||||
let res = await regionSearch(a)
|
||||
async _queryArea4 (a) {
|
||||
let res = await queryArea(a)
|
||||
this.options4 = [...res]
|
||||
this.options4.map(el => {
|
||||
this.$set(el, 'value', el.region_code)
|
||||
@@ -93,35 +100,35 @@
|
||||
})
|
||||
},
|
||||
/** 点位查询1 */
|
||||
async _pointSearch1 (a) {
|
||||
let res = await pointSearch(a)
|
||||
async _queryPointByArea1 (a) {
|
||||
let res = await queryPointByArea(a)
|
||||
this.options1 = [...res]
|
||||
this.options1.map(el => {
|
||||
this.$set(el, 'value', el.point_code)
|
||||
this.$set(el, 'text', el.point_name)
|
||||
this.$set(el, 'value', el.device_code)
|
||||
this.$set(el, 'text', el.device_name)
|
||||
})
|
||||
},
|
||||
/** 点位查询2 */
|
||||
async _pointSearch2 (a) {
|
||||
let res = await pointSearch(a)
|
||||
async _queryPointByArea2 (a) {
|
||||
let res = await queryPointByArea(a)
|
||||
this.options2 = [...res]
|
||||
this.options2.map(el => {
|
||||
this.$set(el, 'value', el.point_code)
|
||||
this.$set(el, 'text', el.point_name)
|
||||
this.$set(el, 'value', el.device_code)
|
||||
this.$set(el, 'text', el.device_name)
|
||||
})
|
||||
},
|
||||
toClear () {
|
||||
this.index1 = ''
|
||||
this.index2 = ''
|
||||
},
|
||||
async _taskCarry () {
|
||||
async _callTask () {
|
||||
this.disabled = true
|
||||
if (!this.index1 || !this.index2) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await taskCarry(this.index1, this.index2)
|
||||
let res = await callTask(this.index1, this.index2, '3', '')
|
||||
this.disabled = false
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
Reference in New Issue
Block a user