<template>
|
<view>
|
<view class="itemstyle">
|
<uni-forms label-width="180">
|
<uni-forms-item label="原始托盘条码:">
|
<uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="sourceFocus"
|
v-model="soussAddress" @input="barcodeInput" />
|
</uni-forms-item>
|
<uni-forms-item label="目标托盘条码:">
|
<uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="targetFocus"
|
v-model="targetAddress" @input="barcodeInput" />
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="AGVTasks" type="primary" size="default" style="margin-top: 2%;">确认完成</button>
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
sourceFocus: true, // 默认原始托盘输入框获得焦点
|
targetFocus: false, // 目标托盘输入框不获得焦点
|
soussAddress: "",
|
targetAddress: "",
|
warehouseId: "",
|
}
|
},
|
onLoad(res) {
|
this.warehouseId = res.warehouseId;
|
},
|
methods: {
|
barcodeInput(type) {
|
if (type != '') {
|
if (this.soussAddress == "") {
|
setTimeout(() => {
|
this.sourceFocus = false;
|
this.targetFocus = true;
|
}, 100);
|
}
|
}
|
},
|
AGVTasks() {
|
if (this.soussAddress == "") {
|
this.$refs.uToast.show({
|
title: "请扫描原始托盘条码",
|
type: 'error'
|
})
|
this.sourceFocus = true;
|
this.targetFocus = false;
|
return;
|
}
|
if (this.targetAddress == "") {
|
this.$refs.uToast.show({
|
title: "请扫描目标托盘条码",
|
type: 'error'
|
})
|
this.sourceFocus = false;
|
this.targetFocus = true;
|
return;
|
}
|
|
var postDate = {
|
MainData: {
|
soussAddress: this.soussAddress,
|
targetAddress: this.targetAddress,
|
warehouseId: this.warehouseId,
|
}
|
}
|
this.$u.post('/api/InboundOrder/SYMaterielGroup', postDate).then(
|
res => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "合托成功",
|
type: "success"
|
})
|
this.soussAddress = "";
|
this.targetAddress = "";
|
this.sourceFocus = true;
|
this.targetFocus = false;
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
|
this.sourceFocus = true;
|
this.targetFocus = false;
|
}
|
})
|
},
|
}
|
}
|
</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>
|