<template>
|
<view>
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
|
</uni-segmented-control>
|
<view class="content">
|
<view v-if="current === 0" class="headerstyle">
|
<view class="itemstyle">
|
<uni-forms label-width="120">
|
<uni-forms-item label="烘烤出料编码">
|
<uni-easyinput type="text" :focus="!addressFocus" v-model="sourceAddress"
|
placeholder="请扫描烘烤编码" ref='midInput' @input="inputChangebarcode" />
|
</uni-easyinput>
|
</uni-forms-item>
|
<button @click="inbound" type="primary" size="default" style="margin-top: 2%;">搬运确认</button>
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
</view>
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
const innerAudioContext = uni.createInnerAudioContext();
|
export default {
|
data() {
|
return {
|
items: ['输送线搬运'],
|
current: 0,
|
label: "",
|
focus: false,
|
addressFocus: false,
|
sourceAddress: "",
|
}
|
},
|
methods: {
|
voiceSpeech(src) {
|
innerAudioContext.src = src; // '../../static/success.mp3';
|
innerAudioContext.play();
|
},
|
onClickItem(e) {
|
this.focus = false;
|
this.addressFocus = false;
|
if (this.current !== e.currentIndex) {
|
this.current = e.currentIndex;
|
if (this.current == 2) {
|
this.getData();
|
}
|
}
|
},
|
inbound() {
|
var postData = {
|
MainData: {
|
"sourceAddress": this.sourceAddress,
|
}
|
}
|
// 提取输入框的值
|
// const sourceAddress = this.sourceAddress;
|
|
// if (sourceAddress == "") {
|
// this.$t.message.toast('请选择起点位置');
|
// return;
|
// }
|
// console.log(Exception);
|
this.$u.post('/api/PDA/OutBoundTask', postData).then(res => {
|
this.$t.message.closeLoading();
|
if (res.code == 200) {
|
this.$t.message.toast('呼叫成功');
|
this.sourceAddress = "";
|
// this.$refs.popup.close();
|
// this.submit();
|
} else {
|
this.$t.message.toast(res.message);
|
}
|
}).catch(err => {
|
this.$refs.uToast.show({
|
title: err.message,
|
type: "error"
|
})
|
})
|
},
|
|
inputChangebarcode() {
|
this.addressFocus = false;
|
this.$nextTick(function(x) {
|
if (this.sourceAddress != '') {
|
this.addressFocus = true;
|
}
|
})
|
},
|
}
|
}
|
</script>
|
<style lang="scss">
|
@import '@/common/uni-ui.scss';
|
|
.content {
|
display: flex;
|
height: 150px;
|
}
|
|
.content-text {
|
font-size: 14px;
|
color: #666;
|
}
|
|
.itemstyle {
|
margin-top: 30px;
|
margin-left: 5%;
|
}
|
|
.headerstyle {
|
width: 90%;
|
}
|
</style>
|