118 lines
3.2 KiB
Vue
118 lines
3.2 KiB
Vue
<template>
|
|
<view class="zd_container">
|
|
<!-- <nav-bar title="空轴回库"></nav-bar> -->
|
|
<nav-bar :title="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="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
<view class="filter_item">
|
|
<view class="filter_label_wraper">
|
|
<span class="filter_label">尺寸</span>
|
|
</view>
|
|
<view class="filter_input_wraper">
|
|
<uni-data-select v-model="index3" :localdata="options3"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
<view class="filter_item">
|
|
<view class="filter_label_wraper">
|
|
<span class="filter_label">代数</span>
|
|
</view>
|
|
<view class="filter_input_wraper">
|
|
<uni-data-select v-model="index4" :localdata="options4"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="zd-row submitbar">
|
|
<button class="zd-col-5 btn-submit btn-default" @tap="clearUp">清空</button>
|
|
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !index2 || !index3 || !index4}" :disabled="disabled" @tap="_shaftGoBack">空轴回库</button>
|
|
<button class="zd-col-8 btn-submit btn-success" :class="{'btn-info': !index2 || !index3 || !index4}" :disabled="disabled1" @tap="_callNeedShaft">呼叫空轴</button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import NavBar from '@/components/NavBar.vue'
|
|
import {queryProductArea} from '@/utils/getData2.js'
|
|
import {shaftGoBack, callNeedShaft} from '@/utils/getData3.js'
|
|
export default {
|
|
components: {
|
|
NavBar
|
|
},
|
|
data() {
|
|
return {
|
|
title: '',
|
|
options2: [],
|
|
index2: '',
|
|
options3: [{value: '3', text: '3寸'}, {value: '6', text: '6寸'}],
|
|
index3: '',
|
|
options4: [{value: '4', text: '4'}, {value: '5', text: '5'}],
|
|
index4: '',
|
|
disabled: false,
|
|
disabled1: false
|
|
};
|
|
},
|
|
onLoad (options) {
|
|
this.title = options.title
|
|
},
|
|
created () {
|
|
this._queryProductArea()
|
|
},
|
|
methods: {
|
|
/** 生产区域下拉框查询 */
|
|
async _queryProductArea () {
|
|
let res = await queryProductArea()
|
|
this.options2 = [...res.data]
|
|
},
|
|
selectChange2(e) {
|
|
this.index2 = e
|
|
},
|
|
async _shaftGoBack () {
|
|
this.disabled = true
|
|
if (!this.index2 || !this.index3 || !this.index4) {
|
|
this.disabled = false
|
|
return
|
|
}
|
|
try {
|
|
let res = await shaftGoBack(this.index2, this.index3, this.index4)
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
this.disabled = false
|
|
} catch (e) {
|
|
this.disabled = false
|
|
}
|
|
},
|
|
async _callNeedShaft () {
|
|
this.disabled1 = true
|
|
if (!this.index2 || !this.index3 || !this.index4) {
|
|
this.disabled1 = false
|
|
return
|
|
}
|
|
try {
|
|
let res = await callNeedShaft(this.index2, this.index3, this.index4)
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
this.disabled1 = false
|
|
} catch (e) {
|
|
this.disabled1 = false
|
|
}
|
|
},
|
|
clearUp () {
|
|
this.index2 = ''
|
|
this.index3 = ''
|
|
this.index4 = ''
|
|
this.disabled = false
|
|
this.disabled1 = false
|
|
}
|
|
}
|
|
}
|
|
</script> |