<template>
|
<view>
|
<u-sticky offset-top="1" zIndex="999" bgColor="#fff">
|
<view style="background-color: #fff; padding-bottom: 20px;">
|
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
|
</uni-segmented-control>
|
</view>
|
</u-sticky>
|
<view v-if="current === 0" class="headerstyle">
|
<view class="itemstyle">
|
<u-sticky offset-top="90" zIndex="999" bgColor="#fff">
|
<view style="background-color: #fff; ">
|
<uni-search-bar @confirm="zbsearch" v-model="zbsearchValue"></uni-search-bar>
|
<uni-forms ref="formData" label-width="120">
|
<!-- <uni-forms-item label="楼层" style="background-color: #fff;width: 90%;margin-left: 5%;">
|
<uni-data-select v-model="floor" :localdata="floorrange"></uni-data-select>
|
</uni-forms-item> -->
|
<uni-forms-item label="出库地址" style="background-color: #fff;width: 90%;margin-left: 5%;">
|
<uni-easyinput type="text" maxlength="25" :focus="true" v-model="zboutAddress"
|
placeholder="请输入出库地址" ref='midInput' />
|
</uni-forms-item>
|
|
<uni-forms-item></uni-forms-item>
|
</uni-forms>
|
</view>
|
</u-sticky>
|
<uni-list class="body">
|
<uni-list-item direction="column" v-for="(item,index) in zbstockInfo" :key="index">
|
<template v-slot:body>
|
<view class="uni-list-box">
|
<checkbox @click="zbclick(item)"></checkbox>
|
<view class="uni-content">
|
<view class="uni-title-sub uni-ellipsis-2">托盘号:{{item.barcode}}</view>
|
<view class="uni-note">货位编号:{{item.locationNo}}</view>
|
<view class="uni-note">物料编码:{{item.matCode}}</view>
|
<view class="uni-note">物料名称:{{item.matName}}</view>
|
<view class="uni-note">数量:{{item.quantity}}</view>
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
<view style="background-color: #fff; padding: 20rpx,20rpx;" class="footerxy">
|
<u-sticky offset-top="80%" zIndex="999">
|
<button @click="zboutbound" type="primary" size="default">出库确认</button>
|
</u-sticky>
|
</view>
|
</view>
|
</view>
|
<view v-if="current === 1" class="headerstyle">
|
<view class="itemstyle" style="margin: 20px 5%;width: 90%;">
|
<uni-forms label-width="120">
|
<uni-forms-item>
|
<uni-easyinput type="text" @input="inputChange" v-model="locationCode" placeholder="请扫码"
|
ref='midInput' :focus="true" />
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="submit" type="primary" size="default" style="margin-top: 2%;">出库</button>
|
</uni-forms-item>
|
</uni-forms>
|
<uni-list class="footer">
|
<uni-list-item direction="column" v-for="(item,index) in matInfo" :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.matQty}}
|
</view>
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
</view>
|
</view>
|
<view v-if="current === 2" class="headerstyle">
|
<view class="itemstyle">
|
<u-sticky offset-top="90" zIndex="999" bgColor="#fff">
|
<view style="background-color: #fff;">
|
<uni-search-bar @confirm="kbsearch" v-model="kbsearchValue"></uni-search-bar>
|
<uni-forms ref="formData" label-width="120">
|
<uni-forms-item label="出库地址" style="background-color: #fff;width: 90%;margin-left: 5%;">
|
<uni-easyinput type="text" maxlength="25" :focus="true" v-model="kboutAddress"
|
placeholder="请输入出库地址" ref='midInput' />
|
</uni-forms-item>
|
<uni-forms-item></uni-forms-item>
|
</uni-forms>
|
</view>
|
</u-sticky>
|
<uni-list class="body">
|
<uni-list-item direction="column" v-for="(item,index) in kbstockInfo" :key="item.id">
|
<template v-slot:body>
|
<view class="uni-list-box">
|
<checkbox @click="kbclick(item)"></checkbox>
|
<view class="uni-content">
|
<view class="uni-title-sub uni-ellipsis-2">托盘号:{{item.barcode}}</view>
|
<view class="uni-note">货位编号:{{item.locationNo}}</view>
|
<view class="uni-note">物料编码:{{item.matCode}}</view>
|
<view class="uni-note">物料名称:{{item.matName}}</view>
|
<view class="uni-note">数量:{{item.quantity}}</view>
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
<view style="background-color: #fff; padding: 20rpx,20rpx;" class="footerxy">
|
<u-sticky offset-top="80%" zIndex="999">
|
<button @click="kboutbound" type="primary" size="default">出库确认</button>
|
</u-sticky>
|
</view>
|
</view>
|
</view>
|
<view v-if="current === 3" class="headerstyle">
|
<view class="itemstyle">
|
<uni-forms style="margin-top: 30px;margin-left: 5%;width: 90%;" label-width="120">
|
<uni-forms-item label="楼层">
|
<uni-data-select v-model="printFloor" :localdata="printFloorRange"></uni-data-select>
|
</uni-forms-item>
|
<uni-forms-item label="内箱标签">
|
<uni-easyinput type="text" :focus="tagFocus" v-model="tag" placeholder="请扫描内箱标签" ref='midInput'
|
@input="tagInput" />
|
</uni-forms-item>
|
<uni-forms-item :label="tagmatCode"></uni-forms-item>
|
<!-- <uni-forms-item :label="tagmatName"></uni-forms-item> -->
|
<uni-forms-item :label="tagQty"></uni-forms-item>
|
<uni-forms-item label="拆分数量">
|
<uni-easyinput type="number" v-model="number" placeholder="请输入拆分数量" ref='midInput'
|
:focus="numberFocus" />
|
</uni-forms-item>
|
<uni-forms-item>
|
<button @click="printTag" type="primary" size="default" style="margin-top: 2%;">打印标签</button>
|
</uni-forms-item>
|
</uni-forms>
|
</view>
|
</view>
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
import { config } from '../../common/config.js'
|
export default {
|
data() {
|
return {
|
items: ['栈板手动出库', '栈板指定出库', '库宝手动出库', '内箱拆分'],
|
current: 0,
|
zbstockInfo: [],
|
zboutItems: [],
|
zboutAddress: "",
|
zbpageNo: 1,
|
zbsearchValue: "",
|
|
kbstockInfo: [],
|
kboutItems: [],
|
kboutAddress: "",
|
kbpageNo: 1,
|
kbsearchValue: "",
|
|
locationCode: "",
|
matInfo: null,
|
|
tagFocus: true,
|
numberFocus: false,
|
tag: "",
|
number: 0,
|
tagmatCode: "物料编码:",
|
tagmatName: "物料名称:",
|
tagQty: "包装数量:",
|
printFloor: "",
|
printFloorRange: [],
|
}
|
},
|
mounted() {
|
this.printFloorRange = config.printFloorRange;
|
if(config.printFloor){
|
this.printFloor = config.outboundFloor;
|
}
|
},
|
onLoad(res) {
|
this.zbgetData();
|
},
|
onReachBottom() {
|
if (this.current === 0) {
|
this.zbpageNo += 1;
|
this.zbgetData();
|
} else if (this.current === 2) {
|
this.kbpageNo += 1;
|
this.kbgetData();
|
}
|
},
|
methods: {
|
onClickItem(e) {
|
this.focus = false;
|
this.addressFocus = false;
|
if (this.current !== e.currentIndex) {
|
this.current = e.currentIndex;
|
if (this.current === 0) {
|
this.zbgetData();
|
} else if (this.current === 2) {
|
this.kbgetData();
|
}
|
}
|
},
|
|
printTag() {
|
if (this.tag == "") {
|
this.$refs.uToast.show({
|
title: "请扫描内箱标签",
|
type: "error"
|
})
|
return;
|
}
|
if (this.number <= 0) {
|
this.$refs.uToast.show({
|
title: "请扫描内箱标签",
|
type: "error"
|
})
|
return;
|
}
|
var postData = {
|
MainData: {
|
tag: this.tag,
|
number: this.number,
|
floor: this.printFloor
|
}
|
}
|
this.$u.post('/api/StockOperate/PrintTag', postData).then(res => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "打印成功",
|
type: "success"
|
})
|
this.tagmatCode = "物料编码:";
|
this.tagQty = "包装数量:";
|
this.tag = "";
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
})
|
},
|
tagInput() {
|
this.$nextTick(() => {
|
var tagInfos = this.tag.split('|');
|
if (tagInfos.length == 7) {
|
this.tagmatCode = "物料编码:" + tagInfos[1];
|
this.tagQty = "物料数量:" + tagInfos[5];
|
} else {
|
|
}
|
this.numberFocus = true;
|
})
|
},
|
|
submit() {
|
if (this.locationCode.length == 0) {
|
this.$refs.uToast.show({
|
title: "请扫码",
|
type: "error"
|
})
|
return;
|
}
|
var param = {
|
MainData: {
|
"locationCode": this.locationCode
|
}
|
};
|
this.$u.post('/api/StockOperate/ManualOutbound', param).then(res => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "success"
|
})
|
this.locationCode = "";
|
this.matInfo = [];
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
}).catch(err => {
|
this.$refs.uToast.show({
|
title: err.message,
|
type: "error"
|
})
|
})
|
},
|
inputChange(e) {
|
this.$nextTick(() => {
|
if (this.locationCode == "") {
|
this.matInfo = [];
|
return;
|
}
|
// this.matInfo = [];
|
var param = {
|
MainData: {
|
"locationCode": this.locationCode
|
}
|
}
|
this.$u.post('/api/StockOperate/GetStockByLocationCode', param).then(result => {
|
if (result.status) {
|
this.matInfo = result.data;
|
console.log(this.matInfo);
|
} else {
|
this.$refs.uToast.show({
|
title: result.message,
|
type: "error"
|
})
|
}
|
})
|
})
|
},
|
|
zbsearch() {
|
this.$nextTick(() => {
|
this.zbpageNo = 1;
|
this.zbgetData();
|
})
|
},
|
zbgetData() {
|
var postData = {
|
MainData: {
|
system: "ZB",
|
matCode: this.zbsearchValue
|
},
|
Extra: this.zbpageNo
|
}
|
this.$u.post('/api/VV_StockGroup/GetStockInfo', postData).then((res) => {
|
if (res.status) {
|
if (res.data) {
|
if (this.zbpageNo == 1) {
|
this.zbstockInfo = res.data;
|
} else {
|
this.zbstockInfo = this.zbstockInfo.concat(res.data);
|
}
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
});
|
}
|
} else {
|
this.zbstockInfo = [];
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
});
|
}
|
})
|
|
},
|
zboutbound() {
|
if (this.zboutItems.length == 0) {
|
this.$refs.uToast.show({
|
title: "请选择要出库的数据",
|
type: "error"
|
});
|
return;
|
}
|
if (this.zboutItems.length > 1) {
|
this.$refs.uToast.show({
|
title: "请选择一条要出库的数据",
|
type: "error"
|
});
|
return;
|
}
|
if (this.zboutAddress == "") {
|
this.$refs.uToast.show({
|
title: "请输入出库地址",
|
type: "error"
|
});
|
return;
|
}
|
var postData = {
|
MainData: {
|
"id": this.zboutItems[0].id,
|
"endPoint": this.zboutAddress
|
},
|
}
|
|
this.$u.post('/api/Outbound/HandOutbound', postData).then((res) => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "出库成功",
|
type: "success"
|
});
|
this.zboutAddress = "";
|
this.zboutItems = [];
|
this.zbstockInfo = [];
|
this.zbpageNo = 1;
|
this.zbsearch();
|
} else {
|
this.$refs.uToast.show({
|
title: "出库失败" + res.message,
|
type: "error"
|
});
|
}
|
})
|
},
|
zbclick(e) {
|
if (this.zboutItems.find(x => x.barcode == e.barcode)) {
|
this.zboutItems.map((item, index) => {
|
if (item.barcode == e.barcode) {
|
this.zboutItems.splice(index, 1);
|
}
|
})
|
} else {
|
this.zboutItems.push(e);
|
}
|
},
|
|
|
kbsearch() {
|
this.$nextTick(() => {
|
this.kbpageNo = 1;
|
this.kbgetData();
|
})
|
},
|
kbgetData() {
|
var postData = {
|
MainData: {
|
system: "kb",
|
matCode: this.kbsearchValue
|
},
|
Extra: this.kbpageNo
|
}
|
this.$u.post('/api/VV_StockGroup/GetStockInfo', postData).then((res) => {
|
if (res.status) {
|
if (res.data) {
|
if (this.kbpageNo == 1) {
|
this.kbstockInfo = res.data;
|
} else {
|
this.kbstockInfo = this.kbstockInfo.concat(res.data);
|
}
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
});
|
}
|
} else {
|
this.kbstockInfo = [];
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
});
|
}
|
})
|
|
},
|
kboutbound() {
|
if (this.kboutItems.length == 0) {
|
this.$refs.uToast.show({
|
title: "请选择要出库的数据",
|
type: "error"
|
});
|
return;
|
}
|
if (this.kboutItems.length > 1) {
|
this.$refs.uToast.show({
|
title: "请选择一条要出库的数据",
|
type: "error"
|
});
|
return;
|
}
|
if (this.kboutAddress == "") {
|
this.$refs.uToast.show({
|
title: "请输入出库地址",
|
type: "error"
|
});
|
return;
|
}
|
var postData = {
|
MainData: {
|
"id": this.kboutItems[0].id,
|
"endPoint": this.kboutAddress
|
},
|
}
|
|
this.$u.post('/api/Outbound/HandOutbound', postData).then((res) => {
|
if (res.status) {
|
this.$refs.uToast.show({
|
title: "出库成功",
|
type: "success"
|
});
|
this.kboutAddress = "";
|
this.kboutItems = [];
|
this.kbstockInfo = [];
|
this.kbpageNo = 1;
|
this.kbsearch();
|
} else {
|
this.$refs.uToast.show({
|
title: "出库失败" + res.message,
|
type: "error"
|
});
|
}
|
})
|
},
|
kbclick(e) {
|
if (this.kboutItems.find(x => x.barcode == e.barcode)) {
|
this.kboutItems.map((item, index) => {
|
if (item.barcode == e.barcode) {
|
this.kboutItems.splice(index, 1);
|
}
|
})
|
} else {
|
this.kboutItems.push(e);
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/common/uni-ui.scss';
|
|
page {
|
display: flex;
|
flex-direction: column;
|
box-sizing: border-box;
|
background-color: #efeff4;
|
min-height: 100%;
|
height: auto;
|
}
|
|
.tips {
|
color: #67c23a;
|
font-size: 14px;
|
line-height: 40px;
|
text-align: center;
|
background-color: #f0f9eb;
|
height: 0;
|
opacity: 0;
|
transform: translateY(-100%);
|
transition: all 0.3s;
|
}
|
|
.tips-ani {
|
transform: translateY(0);
|
height: 40px;
|
opacity: 1;
|
}
|
|
.content {
|
width: 100%;
|
display: flex;
|
}
|
|
.list-picture {
|
width: 100%;
|
height: 145px;
|
}
|
|
.thumb-image {
|
width: 100%;
|
height: 100%;
|
}
|
|
.ellipsis {
|
display: flex;
|
overflow: hidden;
|
}
|
|
.uni-ellipsis-1 {
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
}
|
|
.uni-ellipsis-2 {
|
overflow: hidden;
|
text-overflow: ellipsis;
|
display: -webkit-box;
|
-webkit-line-clamp: 2;
|
-webkit-box-orient: vertical;
|
}
|
|
.itemstyle {
|
// margin-top: 30px;
|
// margin-left: 5%;
|
}
|
|
.headerstyle {
|
width: 100%;
|
}
|
|
.body {
|
padding-bottom: 80px;
|
background-color: #f1f3f4;
|
}
|
|
.footerxy {
|
width: 100%;
|
height: 140rpx;
|
text-align: center;
|
position: fixed;
|
/*1、【relative】相对定位;2、【absolute】绝对定位;3、【fixed】固定定位;4、【static】默认值;5、【sticky】粘性定位。*/
|
left: 0px;
|
/*定位:离页面左边0px的位置*/
|
bottom: 0px;
|
/*定位:离页面底部0px的位置*/
|
padding-top: 20rpx;
|
}
|
</style>
|