<template>
|
<view>
|
<view class="itemstyle">
|
<uni-forms label-width="120">
|
<uni-forms-item label="半成品码:" style="margin-left: 5%;">
|
<uni-easyinput style="width: 85%;" type="text" placeholder="请扫描半成品码" ref='midInput' :focus="!focus" v-model="barcode"
|
@confirm="barcodeInput"/>
|
</uni-forms-item>
|
<uni-forms-item label="托盘条码:" style="margin-left: 5%;">
|
<uni-easyinput style="width: 85%;" type="text" placeholder="请扫描托盘条码:" ref='midInput' :focus="focus" v-model="palletCode"
|
@confirm="palletCodeInput"/>
|
</uni-forms-item>
|
<uni-forms-item label="地址条码:" style="margin-left: 5%;">
|
<uni-easyinput style="width: 85%;" type="text" placeholder="请扫描地址条码" ref='midInput' :focus="addressfocus" v-model="address"/>
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="semiProIn" type="primary" size="default" style="margin-top: 5%;width: 80%;">半成品入库</button>
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
const innerAudioContext = uni.createInnerAudioContext();
|
export default {
|
data() {
|
return {
|
focus: false,
|
addressfocus: false,
|
barcode: "",
|
palletCode: "",
|
address: "",
|
WarehouseId: ""
|
}
|
},
|
onShow() {},
|
onLoad(res) {
|
this.WarehouseId = res.warehouseId;
|
this.focus = false;
|
},
|
methods: {
|
barcodeInput() {
|
this.$nextTick(function(x) {
|
if (this.barcode.length > 0) {
|
this.focus = true;
|
}
|
})
|
},
|
palletCodeInput() {
|
this.$nextTick(function(x) {
|
if (this.palletCode.length > 0) {
|
this.addressfocus = true;
|
}
|
})
|
},
|
semiProIn() {
|
if (this.barcode == "") {
|
this.$refs.uToast.show({
|
title: "请扫描半成品码",
|
type: 'error'
|
})
|
return;
|
}
|
if (this.palletCode == "") {
|
this.$refs.uToast.show({
|
title: "请扫描托盘码",
|
type: 'error'
|
})
|
return;
|
}
|
if (this.address == "") {
|
this.$refs.uToast.show({
|
title: "请扫描地址码",
|
type: 'error'
|
})
|
return;
|
}
|
this.$u.post('/api/Task/SemiProIn?barcode=' + this.barcode + '&palletCode=' +
|
this.palletCode + '&address=' + this.address ).then(
|
res => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "成功",
|
type: "success"
|
})
|
this.barcode = "";
|
this.palletCode = "";
|
this.address = "";
|
this.focus = false;
|
this.addressfocus = false;
|
} 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>
|