<template>
|
<view>
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
|
</uni-segmented-control>
|
<view v-if="current === 0" class="headerstyle">
|
<view class="itemstyle">
|
<uni-forms class="customcss" label-width="120">
|
<uni-forms-item label="托盘条码">
|
<uni-easyinput type="text" :focus="!barcodefocus" v-model="barcode" placeholder="请扫描托盘条码"
|
ref='midInput' @input="barcodeinputChange" @confirm="submit" />
|
</uni-forms-item>
|
<uni-forms-item label="货位编号">
|
<uni-easyinput type="text" :focus="barcodefocus" v-model="locationNo" placeholder="请输入货位编号"
|
ref='midInput' @confirm="submit" />
|
</uni-forms-item>
|
|
<uni-forms-item>
|
<button @click="confirm" type="primary" size="default" style="margin-top: 2%;">数量确认</button>
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="trainStockBind" 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 class="customcss" label-width="120">
|
<uni-forms-item label="托盘条码">
|
<uni-easyinput type="text" :focus="!checkbarcodefocus" v-model="checkbarcode"
|
placeholder="请扫描托盘条码" ref='midInput' @input="checkbarcodeinputChange" />
|
</uni-forms-item>
|
<uni-forms-item label="货位编号">
|
<uni-easyinput type="text" :focus="checkbarcodefocus" v-model="checklocationNo"
|
@input="locationNoinputChange" placeholder="请扫描货位编号" ref='midInput' />
|
</uni-forms-item>
|
<uni-forms-item :label="label">
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
</view>
|
<view v-if="current === 2" class="headerstyle">
|
<view class="itemstyle">
|
<uni-forms class="customcss" label-width="120">
|
<uni-forms-item label="条码信息">
|
<uni-easyinput type="text" :focus="!infobarcodefocus" v-model="infobarcode"
|
placeholder="请扫描托盘条码或小火车条码" ref='midInput' @input="infoinputChange" />
|
</uni-forms-item>
|
</uni-forms>
|
<uni-list class="footer">
|
<uni-list-item direction="column" v-for="(item,index) in infos" :key="index">
|
<template v-slot:body>
|
<view class="uni-list-box">
|
<view class="uni-content">
|
<view class="uni-title-sub uni-ellipsis-2">物料编号:{{item.matCode}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">物料名称:{{item.matName}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">托盘号:{{item.barcode}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">出库数量:{{item.quantity}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">配送地址:{{item.address}}</view>
|
<view class="uni-title-sub uni-ellipsis-2">当前位置:{{item.currentAddress}}</view>
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
</view>
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
items: ['库存绑定', '配送校验', '配送信息查询'],
|
current: 0,
|
locationNo: "",
|
barcode: '',
|
barcodefocus: false,
|
|
checklocationNo: "",
|
checkbarcode: '',
|
checkbarcodefocus: false,
|
label: "",
|
|
infos: [],
|
infobarcode: '',
|
infobarcodefocus: false,
|
}
|
},
|
onLoad(res) {},
|
methods: {
|
onClickItem(e) {
|
if (this.current !== e.currentIndex) {
|
this.current = e.currentIndex;
|
}
|
},
|
confirm() {
|
if (this.barcode == "") {
|
this.$refs.uToast.show({
|
title: "托盘号不能为空",
|
type: "error"
|
});
|
return;
|
}
|
var postData = {
|
MainData: {
|
"trainCode": this.locationNo,
|
},
|
}
|
this.$u.post('/api/StockOperate/TrainStockBindConfirm', postData).then((res) => {
|
if (res.status) {
|
this.items = [];
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "success"
|
});
|
this.locationNo = "";
|
this.barcode = "";
|
this.barcodefocus = false;
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
});
|
}
|
})
|
},
|
trainStockBind() {
|
if (this.locationNo == "") {
|
this.$refs.uToast.show({
|
title: "货位号不能为空",
|
type: "error"
|
});
|
return;
|
}
|
if (this.barcode == "") {
|
this.$refs.uToast.show({
|
title: "托盘号不能为空",
|
type: "error"
|
});
|
return;
|
}
|
var postData = {
|
MainData: {
|
"trainCode": this.locationNo,
|
"barcode": this.barcode
|
},
|
}
|
this.$u.post('/api/StockOperate/TrainStockBind', postData).then((res) => {
|
if (res.status) {
|
this.items = [];
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "success"
|
});
|
this.locationNo = "";
|
this.barcode = "";
|
this.barcodefocus = false;
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
});
|
}
|
})
|
},
|
barcodeinputChange() {
|
this.barcodefocus = false;
|
this.$nextTick(function(x) {
|
if (this.barcode != '') {
|
this.barcodefocus = true;
|
}
|
})
|
},
|
|
|
locationNoinputChange() {
|
this.$nextTick(function(x) {
|
if (this.checklocationNo == "") {
|
return;
|
}
|
if (this.checkbarcode == "") {
|
this.$refs.uToast.show({
|
title: "托盘号不能为空",
|
type: "error"
|
});
|
return;
|
}
|
var postData = {
|
MainData: {
|
"locationCode": this.checklocationNo,
|
"barcode": this.checkbarcode
|
},
|
}
|
this.$u.post('/api/Carry/PutMatCheck', postData).then((res) => {
|
if (res.status) {
|
this.items = [];
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "success"
|
});
|
this.checklocationNo = "";
|
this.checkbarcode = "";
|
this.checkbarcodefocus = false;
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
});
|
this.checklocationNo = "";
|
this.checkbarcode = "";
|
this.checkbarcodefocus = false;
|
}
|
this.label = res.message;
|
})
|
})
|
},
|
checkbarcodeinputChange() {
|
this.checkbarcodefocus = false;
|
this.$nextTick(function(x) {
|
if (this.checkbarcode != '') {
|
this.checkbarcodefocus = true;
|
}
|
})
|
},
|
|
infoinputChange() {
|
this.$nextTick(function(x) {
|
if (this.infobarcode != '') {
|
var postData = {
|
MainData: {
|
"barcode": this.infobarcode
|
}
|
};
|
this.$u.post('/api/Carry/GetCarryInfo', postData).then(res => {
|
if (res.status) {
|
this.infos = res.data
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
this.infobarcode = "";
|
})
|
this.istrue = true;
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/common/uni-ui.scss';
|
|
.content {
|
display: flex;
|
height: 150px;
|
}
|
|
.content-text {
|
font-size: 14px;
|
color: #666;
|
}
|
|
.itemstyle {
|
margin-top: 20px;
|
margin-left: 5%;
|
}
|
|
.headerstyle {
|
width: 90%;
|
}
|
</style>
|