<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="180">
|
<uni-forms-item :label="orderNolabel">
|
</uni-forms-item>
|
<uni-forms-item :label="batchNolabel">
|
</uni-forms-item>
|
<uni-forms-item label="托盘条码:">
|
<uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus"
|
v-model="barcode" @input="barcodeInput" />
|
</uni-forms-item>
|
<!-- <uni-forms-item>
|
<checkbox checked="check">是否满盘</checkbox>
|
</uni-forms-item> -->
|
<uni-forms-item>
|
<button @click="submit" type="primary" size="default" style="margin-top: 2%;">组盘入库</button>
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="ReleaseCompleted" 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,
|
orderNo: "",
|
batchNo: "",
|
orderNolabel: "",
|
batchNolabel: "",
|
orderInfo: [],
|
focus: false,
|
barcode: "",
|
}
|
},
|
onShow() {},
|
onLoad(res) {
|
this.orderNo = res.orderNo;
|
this.batchNo = res.batchNo;
|
this.orderNolabel = "批号:" + this.orderNo;
|
this.batchNolabel = "柜号:" + this.batchNo;
|
// this.getData();
|
},
|
methods: {
|
voiceSpeech(src) {
|
innerAudioContext.src = src; // '../../static/success.mp3';
|
innerAudioContext.play();
|
},
|
updateFocus() {
|
debugger
|
this.$nextTick(() => {
|
this.materSn = '';
|
if (!this.focus) {
|
this.focus = true;
|
}
|
});
|
},
|
barcodeFocus() {
|
debugger
|
this.barcode = '';
|
if (this.focus) {
|
this.focus = false;
|
}
|
},
|
getData() {
|
// var postData = {
|
// MainData: {
|
// orderNo: this.orderNo
|
// },
|
// }
|
// this.$u.post('/api/InboundOrderDetail/GetInboundOrderDetails', postData).then((res) => {
|
// if (res.status) {
|
// this.orderInfo = res.data;
|
// if (this.orderInfo.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) {
|
// if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
|
this.focus = true;
|
// } else {
|
// this.$refs.uToast.show({
|
// title: "扫码错误,请扫描托盘码",
|
// type: "error"
|
// })
|
// }
|
}
|
})
|
},
|
ReleaseCompleted() {
|
this.$u.post('http://192.168.10.88:8099/api/AGV/ReleaseCompleted').then(
|
res => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "放货完成成功",
|
type: "success"
|
})
|
this.qty = "";
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
})
|
},
|
submit() {
|
if (this.barcode == "") {
|
this.$refs.uToast.show({
|
title: "请扫描托盘条码",
|
type: 'error'
|
})
|
return;
|
}
|
this.$u.post('/api/PDA/InMateriel', {
|
MainData: {
|
"palletCode": this.barcode,
|
"orderNo": this.orderNo,
|
"batchNo":this.batchNo
|
},
|
DelKeys: this.sns
|
}).then(res => {
|
this.Testcheck = false;
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "组盘成功",
|
type: "success"
|
})
|
this.focus = false;
|
this.barcode = "";
|
} 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>
|