<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="条码:">
|
<uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus"
|
v-model="barcode" @confirm="barcodeInput" />
|
</uni-forms-item>
|
<uni-forms-item label="物料:">
|
<uni-easyinput type="text" placeholder="请输入物料" ref='midInput' v-model="materSn" />
|
</uni-forms-item>
|
<uni-forms-item label="直径:">
|
<uni-easyinput type="text" placeholder="请输入直径(mm)" ref='midInput' v-model="thickness" />
|
</uni-forms-item>
|
<uni-forms-item label="幅宽:">
|
<uni-easyinput type="text" placeholder="请输入幅宽(mm)" ref='midInput' v-model="wide" />
|
</uni-forms-item>
|
<uni-forms-item label="重量:">
|
<uni-easyinput type="text" trim="all" placeholder="请输入重量(kg)" ref='midInput'
|
v-model="weight" />
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="submit" type="primary" size="default" style="margin-top: 2%;">组盘</button>
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
</view>
|
<view v-if="current === 1" class="headerstyle" >
|
<view class="itemstyle">
|
<uni-forms label-width="120">
|
<uni-forms-item label="托盘条码">
|
<uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode"
|
placeholder="请扫描托盘条码" ref='midInput' @input="inputChangebarcode" />
|
</uni-forms-item>
|
<uni-forms-item label="地址条码">
|
<uni-easyinput type="text" v-model="address" :disabled="addressdisabled"
|
placeholder="请扫描地址条码" ref='midInput' :focus="addressFocus" />
|
</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: ['组盘', '入库'], //, '单据信息', '解盘'
|
materSn:"",
|
wide:"",
|
weight:"",
|
thickness:"",
|
barcode: "",
|
focus:false,
|
inboundBarcode: "",
|
address: "",
|
addressdisabled: true,
|
addressFocus: false,
|
current: 0,
|
orderNo: "",
|
warehouseId: "",
|
Test: false,
|
}
|
},
|
onShow() {},
|
onLoad(res) {
|
this.focus = false;
|
this.addressFocus = false;
|
this.warehouseId = res.warehouseId;
|
if (this.warehouseId == 1) {
|
this.items=['组盘'];
|
}
|
},
|
methods: {
|
barcodeInput() {
|
this.$nextTick(function(x) {
|
if (this.barcode.length > 0) {
|
this.focus = true;
|
}
|
})
|
},
|
inbound() {
|
if (this.inboundBarcode == "") {
|
this.$refs.uToast.show({
|
title: "请扫描托盘条码",
|
type: "error"
|
})
|
return;
|
}
|
if (this.address == "") {
|
this.$refs.uToast.show({
|
title: "请扫描地址条码",
|
type: "error"
|
})
|
return;
|
}
|
var postData = {
|
MainData: {
|
"barcode": this.inboundBarcode,
|
"startPoint": this.address,
|
"warehouseId": this.warehouseId
|
}
|
}
|
this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
|
if (res.status) {
|
this.inboundBarcode = "";
|
if (this.warehouseId != 5 && this.warehouseId != 3) this.address = "";
|
this.stockInfoDetail = [];
|
//获取总数量
|
this.Summmary = 0;
|
setTimeout(() => {
|
this.addressFocus = false;
|
this.$refs.uToast.show({
|
title: "成功",
|
type: "success"
|
})
|
}, 200);
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
}).catch(err => {
|
this.$refs.uToast.show({
|
title: err.message,
|
type: "error"
|
})
|
})
|
},
|
submit() {
|
if (this.barcode == "") {
|
this.$refs.uToast.show({
|
title: "请扫描条码",
|
type: 'error'
|
})
|
return;
|
}
|
this.$u.post('/api/StockInfo/ManualMaterielGroup' ,{
|
MainData: {
|
"palletCode": this.barcode,
|
"thickness": this.thickness,
|
"weight": this.weight,
|
"wide": this.wide,
|
"materSn": this.materSn,
|
// "isFull": this.check
|
"warehouseId": this.warehouseId
|
},
|
}).then(res => {
|
this.Testcheck = false;
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "组盘成功",
|
type: "success"
|
})
|
this.focus = false;
|
this.barcode = "";
|
this.matInfos = [];
|
this.sns = [];
|
this.matTotal = [];
|
} 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>
|