<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-data-select v-model="value" :localdata="rangs"></uni-data-select>
|
</uni-forms-item>
|
<uni-forms-item label="终点地址">
|
<uni-easyinput type="text" :focus="!addressFocus" v-model="targetAddress"
|
placeholder="请扫描终点地址" ref='midInput' @input="inputChangebarcode" />
|
</uni-forms-item>
|
<uni-forms-item label="第一托盘条码">
|
<uni-easyinput type="text" :focus="!addressFocus" v-model="pallcode" placeholder="请扫描托盘条码"
|
ref='midInput' @input="inputChangebarcode" />
|
</uni-forms-item>
|
<uni-forms-item label="第二托盘条码">
|
<uni-easyinput type="text" :focus="!addressFocus" v-model="pallcode1" placeholder="请扫描托盘条码"
|
ref='midInput' @input="inputChangebarcode" />
|
</uni-forms-item>
|
<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,
|
matTotal: [],
|
matInfos: [],
|
orderNo: "",
|
label: "",
|
orderDetail: [],
|
focus: false,
|
barcode: "",
|
materSn: "",
|
sns: [],
|
addressFocus: false,
|
targetAddress: "",
|
sourceAddress: "",
|
pallcode: "",
|
pallcode1: "",
|
Exception: "",
|
address: "",
|
check: true,
|
value: "",
|
matInfo: [],
|
value2: "",
|
matTotals: [],
|
value: 0,
|
rangs: [{
|
value: "FJXL-KPHLX001",
|
text: "FJXL-KPHLX001"
|
},
|
{
|
value: "ZJXL-KPHLX001",
|
text: "ZJXL-KPHLX001"
|
},
|
],
|
// range: [],
|
}
|
},
|
onShow() {},
|
// onLoad(res) {
|
// this.focus = false;
|
// this.addressFocus = false;
|
// this.orderNo = res.orderNo;
|
// this.label = "单据编号:" + this.orderNo;
|
// this.getData();
|
// // this.getEndLocations();
|
// },
|
methods: {
|
voiceSpeech(src) {
|
innerAudioContext.src = src; // '../../static/success.mp3';
|
innerAudioContext.play();
|
},
|
|
updateFocus() {
|
this.$nextTick(() => {
|
this.materSn = '';
|
if (!this.focus) {
|
this.focus = true;
|
}
|
});
|
},
|
barcodeFocus() {
|
this.barcode = '';
|
if (this.focus) {
|
this.focus = false;
|
}
|
},
|
// getData() {
|
// var postData = this.orderNo
|
|
// this.$u.post('/api/InboundOrder/GetInboundOrderDetail', postData).then((res) => {
|
// if (res.status) {
|
// this.orderDetail = res.data;
|
// if (this.orderDetail.length > 3) {
|
// this.loadVisible = true;
|
// }
|
// }
|
// })
|
// },
|
onClickItem(e) {
|
this.focus = false;
|
this.addressFocus = false;
|
if (this.current !== e.currentIndex) {
|
this.current = e.currentIndex;
|
if (this.current == 2) {
|
this.getData();
|
}
|
}
|
},
|
barcodeInput() {
|
this.$nextTick(function(x) {
|
if (this.barcode.length > 0) {
|
this.focus = true;
|
}
|
})
|
},
|
inbound() {
|
// 提取输入框的值
|
const sourceAddress = this.value;
|
const targetAddress = this.targetAddress;
|
// 提取工单编号
|
const pallcode =this.pallcode;
|
// 提取型号
|
const pallcode1 = this.pallcode1;
|
|
if (sourceAddress == "") {
|
this.$t.message.toast('请选择起点位置');
|
return;
|
}
|
if (targetAddress == "") {
|
this.$t.message.toast('请扫瞄终点位置');
|
return;
|
}
|
// if (pallcode == "") {
|
// this.$t.message.toast('请扫描第一拖盘条码');
|
// return;
|
// }
|
// if (pallcode1 == "") {
|
// this.$t.message.toast('请扫描第二拖盘条码');
|
// return;
|
// }
|
var postData = {
|
MainData: {
|
"sourceAddress": this.value,
|
"targetAddress": this.targetAddress,
|
"Exception": this.pallcode + "," + this.pallcode1
|
}
|
}
|
// console.log(Exception);
|
this.$u.post('/api/PDA/EmptyTask', postData).then(res => {
|
this.$t.message.closeLoading();
|
console.log(postData);
|
if (res.code == 200) {
|
this.$t.message.toast('呼叫成功');
|
this.value="",
|
this.targetAddress="",
|
this.pallcode="",
|
this.pallcode1="",
|
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;
|
}
|
})
|
},
|
// getEndLocations() {
|
// this.$u.post('/api/CachePoint/GetEndPoints', null).then(res => {
|
// if (res.status) {
|
// this.range = res.data;
|
// } else {
|
// this.$refs.uToast.show({
|
// title: res.message,
|
// type: "error"
|
// })
|
// }
|
// })
|
// }
|
}
|
}
|
</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>
|