<template>
|
<view>
|
<view class="header">
|
<uni-forms label-width="120">
|
<uni-forms-item label="托盘条码">
|
<uni-easyinput type="text" @input="inputChange()" v-model="value" 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>
|
</view>
|
<uni-list class="footer">
|
<uni-list-item direction="column" v-if="value2">
|
<label>{{value2}}</label>
|
</uni-list-item>
|
<uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode">
|
<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.matQuantity}}</view>
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
|
<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" style="font-size: 1.1em;">物料编码:{{item.matCode}}
|
</view>
|
<view class="uni-title-sub uni-ellipsis-2" style="font-size: 1.1em;">物料名称:{{item.matName}}
|
</view>
|
<view class="uni-title-sub uni-ellipsis-2" style="font-size: 1.1em;">数量:{{item.matQty}}
|
</view>
|
</view>
|
</view>
|
</template>
|
</uni-list-item>
|
</uni-list>
|
|
<u-toast ref="uToast" />
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
value: "",
|
matInfo: [],
|
value2: "",
|
matTotal:[]
|
}
|
},
|
onLoad(res) {
|
//this.hideboard();
|
},
|
methods: {
|
submit() {
|
if (this.value.length == 0) {
|
this.$refs.uToast.show({
|
title: "请扫码",
|
type: "error"
|
})
|
return;
|
}
|
var param;
|
var matInfo = this.value.split('|');
|
if (matInfo.length == 7) {
|
param = {
|
MainData: {
|
"innerCode": this.value
|
}
|
}
|
} else {
|
param = {
|
MainData: {
|
"barcode": this.value
|
}
|
}
|
}
|
this.$u.post('/api/StockOperate/ReleaseAllBox', param).then(resdt => {
|
if (resdt.status) {
|
uni.$showMsg('解盘成功!')
|
this.value = "";
|
this.matInfo = [];
|
} else {
|
this.$refs.uToast.show({
|
title: resdt.message,
|
type: "error"
|
})
|
}
|
}).catch(err => {
|
this.$refs.uToast.show({
|
title: err.message,
|
type: "error"
|
})
|
})
|
},
|
inputChange(e) {
|
this.$nextTick(() => {
|
if (this.value.length == 0) {
|
return;
|
}
|
var matInfo = this.value.split('|');
|
this.matInfo = [];
|
if (matInfo.length == 7) {
|
this.$u.post('/api/StockOperate/GetStockInfoByInnerCode', {
|
MainData: {
|
"innerCode": this.value
|
}
|
}).then(res => {
|
if (res.status) {
|
this.matInfo = res.data.stockInfo;
|
this.matTotal = res.data.stockTotal;
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
})
|
} else {
|
this.$u.post('/api/StockOperate/GetStockInfoByBarcode', {
|
MainData: {
|
"barcode": this.value
|
}
|
}).then(res => {
|
if (res.status) {
|
this.matInfo = res.data.stockInfo;
|
this.matTotal = res.data.stockTotal;
|
// console.log(res.data);
|
// console.log(this.matTotal);
|
} else {
|
this.$refs.uToast.show({
|
title: res.message,
|
type: "error"
|
})
|
}
|
})
|
}
|
})
|
},
|
}
|
}
|
</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;
|
}
|
|
.customcss {
|
display: flex;
|
position: fixed;
|
width: 100%;
|
top: 10px;
|
text-align: center;
|
z-index: 999;
|
left: 30px;
|
height: 20%;
|
}
|
|
.footer {
|
// padding-top: 30%;
|
}
|
|
.header {
|
width: 100%;
|
height: 150px;
|
background-color: #ffffff;
|
padding: 20rpx 40rpx;
|
}
|
</style>
|