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