<template>
|
<view>
|
<view class="code">
|
<view class="item">
|
<view class="code-decs">库位号:</view>
|
<input type="text" placeholder=" 扫码 / 输入" v-model="locno" :focus="barcodeFocus"
|
@input="barcodeInput()">
|
</view>
|
<view class="item">
|
<view class="code-decs">托盘码:</view>
|
<input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="matFocus" @input="fetchGoods">
|
<view class="item-right">
|
<button></button>
|
</view>
|
</view>
|
<uni-section title="商品列表" type="line" class="mat-list-title"></uni-section>
|
</view>
|
<view class="list-view">
|
<scroll-view style="overflow: hidden;overflow-y: scroll;height: auto;">
|
<view class="list" v-for="(item,i) in dataList" :key="i">
|
<view class="list-left">
|
<view class="list-left-item">
|
<view class="desc">No:</view>
|
<view class="left-item">{{i + 1}}</view>
|
</view>
|
<view class="list-left-item">
|
<view class="desc">订单号:</view>
|
<view class="left-item">
|
<uni-tag :text="item.orderNo" type="primary"></uni-tag>
|
</view>
|
</view>
|
<view class="list-left-item">
|
<view class="desc">料号:</view>
|
<view class="left-item">
|
<uni-tag :text="item.matnr" type="primary"></uni-tag>
|
</view>
|
</view>
|
<view class="list-left-item">
|
<view class="desc">批号:</view>
|
<view class="left-item">
|
<uni-tag :text="item.batch" type="warning"></uni-tag>
|
</view>
|
</view>
|
<view class="list-left-item">
|
<view class="desc">数量:</view>
|
<view class="left-item">{{item.anfme}}</view>
|
</view>
|
</view>
|
</view>
|
</scroll-view>
|
</view>
|
<!-- 底部操作按钮 -->
|
<view class="buttom">
|
<button size="middle" type="primary" @click="combConfirm('warn')">上架</button>
|
</view>
|
<!-- 确认上架 -->
|
<view>
|
<uni-popup ref="combConfirm" type="dialog">
|
<uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确认" :title="title" :content="content"
|
@confirm="comb" @close="combClose"></uni-popup-dialog>
|
</uni-popup>
|
</view>
|
<view>
|
<!-- 提示信息弹窗 -->
|
<uni-popup ref="message" type="message">
|
<uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message>
|
</uni-popup>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data () {
|
return {
|
baseUrl: '',
|
token: '',
|
order: '',
|
locno: '',
|
barcode: '',
|
barcodeFocus: '',
|
dataList: [],
|
count: 0,
|
rowNum: '',
|
matnr: '',
|
matnr1: '',
|
batch: '',
|
weight: '',
|
msgType1: 'success',
|
msgType: 'success',
|
messageText: '',
|
title: '',
|
content: '',
|
barcodeFocus: true,
|
matFocus: false,
|
matData: '',
|
removeNum: 0
|
}
|
},
|
onShow() {
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
},
|
methods: {
|
fetchGoods() {
|
let that = this
|
setTimeout(() => {
|
that.getMatnrBybarcode()
|
}, 800)
|
},
|
|
/**
|
* 根据拖盘码拉取已组拖数据
|
*/
|
getMatnrBybarcode() {
|
if (this.barcode.length < 1) {
|
return
|
}
|
// if (this.barcode.length != 8) {
|
// this.messageToggle('error', '拖盘码为8位随机数字!!')
|
// return
|
// }
|
let that = this
|
uni.request({
|
url: that.baseUrl + '/pda/barcode/matnr/' + that.barcode,
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(response) {
|
let result = response.data;
|
if (result.code === 200) {
|
that.dataList = result.data
|
}
|
}
|
})
|
},
|
|
combConfirm(type) {
|
if (this.locno.trim() == undefined || this.locno.trim() == '') {
|
this.messageToggle('error', '上架库位不能为空!!')
|
return
|
}
|
if (this.barcode.trim() == undefined || this.barcode.trim() == '') {
|
this.messageToggle('error', '拖盘码不能为空!!')
|
return
|
}
|
this.dialogToggle(type, '确认', '是否上架组拖物料')
|
},
|
|
comb() {
|
uni.vibrateShort();
|
let that = this;
|
this.$toast.loading('上架中...')
|
uni.request({
|
url: that.baseUrl + '/pda/matnr/in/barcode',
|
data: JSON.stringify({
|
loc: that.locno.trim(),
|
barcode: that.barcode.trim()
|
}),
|
method: 'POST',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(result) {
|
that.$toast.hideLoading()
|
var res = result.data
|
if (res.code === 200) {
|
that.messageToggle('success', '上架成功!!')
|
} else if (res.code == 403) {
|
that.messageText = res.msg
|
that.messageToggle('error')
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../login/login'
|
});
|
}, 1000);
|
} else {
|
that.messageText = res.msg
|
that.messageToggle('error')
|
}
|
|
},
|
fail() {
|
that.$toast.hideLoading()
|
},
|
complete() {
|
that.resst()
|
}
|
});
|
},
|
|
combClose() {
|
this.$refs.combConfirm.close()
|
},
|
|
resst() {
|
this.dataList = []
|
this.barcode = ''
|
this.locno = ''
|
},
|
|
//dialog弹框信息
|
dialogToggle(type,title, msg) {
|
this.msgType = type
|
this.title = title
|
this.content = msg
|
this.$refs.combConfirm.open()
|
},
|
|
//消息弹框
|
messageToggle(type, msg) {
|
this.msgType1 = type
|
if (msg != undefined || msg != null) {
|
this.messageText = msg
|
}
|
this.$refs.message.open()
|
},
|
}
|
}
|
</script>
|
|
<style>
|
@import url('../../static/css/wms.css/wms.css');
|
|
.uni-section {
|
margin-top: 0rpx;
|
|
.uni-section__content-title {
|
font-size: 16px !important;
|
}
|
}
|
|
.buttom uni-button {
|
width: 60%;
|
}
|
|
.list-view {
|
width: 100%;
|
position: relative;
|
}
|
|
.list {
|
display: flex;
|
min-height: 80rpx;
|
background-color: #FFF;
|
margin: 20rpx;
|
border-radius: 20rpx;
|
box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.2);
|
}
|
.list:first-child {
|
margin-top: 300rpx;
|
}
|
.list:last-child {
|
margin-bottom: 120rpx;
|
}
|
.code {
|
width: 100%;
|
position: fixed;
|
background: white;
|
min-height: 200rpx;
|
background-color: #FFF;
|
z-index: 10;
|
}
|
.item {
|
display: flex;
|
align-items: center;
|
height: 100rpx;
|
margin-left: 20rpx;
|
border-bottom: 1px solid #DCDFE6;
|
}
|
|
.item input {
|
height: 50rpx;
|
line-height: 50rpx;
|
/* font-family: PingFang SC; uniapp 默认字体不居中 */
|
font-size: 36upx;
|
font-family: PingFang SC;
|
width: 55vw;
|
|
}
|
|
.code-decs {
|
width: 20vw;
|
font-size: 18px;
|
color: #303133;
|
}
|
|
.item-right {
|
margin-left: auto;
|
margin-right: 20rpx;
|
}
|
|
.mat-list-title {
|
height: 80rpx;
|
position: fixed;
|
line-height: 80rpx;
|
font-size: 24px;
|
width: 100%;
|
background: white;
|
font-weight: 500;
|
}
|
</style>
|