<template>
|
<view>
|
<view class="code">
|
<view class="item">
|
<view class="code-decs">订单号:</view>
|
<input type="text" placeholder=" 扫码 / 输入" v-model="orderNo" :focus="barcodeFocus"
|
@input="barcodeInput()">
|
</view>
|
<uni-section title="商品列表" type="line" class="mat-list-title"></uni-section>
|
<uni-row :gutter="10" v-if="range.length > 0">
|
<checkbox-group @change="checkboAll">
|
<uni-col :span="3" style="padding: 10px;">
|
<checkbox value="全选" checked></checkbox>
|
</uni-col>
|
<uni-col :span="20">
|
|
</uni-col>
|
</checkbox-group>
|
</uni-row>
|
</view>
|
<view class="list-view">
|
<scroll-view style="overflow: hidden;overflow-y: scroll;height: auto;">
|
<checkbox-group @change="checkboxChange">
|
<label :class="item.workQty == item.anfme ? 'order__list' : 'order-list-cell'" v-for="(item, index) in range" :key="index">
|
<view class="order__list__right">
|
<checkbox :value="item.id" :checked="item.checked" style="transform:scale(0.7)" />
|
</view>
|
<view class="order__list__left">
|
<view>No:{{index + 1}}</view>
|
<view>订单号:{{item.orderNo}}</view>
|
<view>波次号:{{item.waveNo}}</view>
|
<view>料号:{{item.matnr}}</view>
|
<view>批号:{{item.batch}}</view>
|
<view>订单数量:{{item.anfme}}</view>
|
<view>实发数量:{{item.workQty}}</view>
|
</view>
|
</label>
|
</checkbox-group>
|
</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="shippingConfirm" @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 {
|
barcodeFocus: '',
|
orderNo: '',
|
msgType1: 'success',
|
msgType: 'success',
|
messageText: '',
|
title: '',
|
content: '',
|
shipping: [],
|
barcode: '',
|
matFocus: '',
|
value: '0',
|
range: []
|
}
|
},
|
onShow() {
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
},
|
|
methods: {
|
barcodeInput() {
|
let that = this
|
setTimeout(() => {
|
that.getOrderDetl()
|
}, 700)
|
},
|
/**
|
* 获取发货订单明细信息
|
*/
|
getOrderDetl() {
|
if (this.orderNo.trim() == undefined || this.orderNo.trim() == null || this.orderNo == '') {
|
this.messageToggle('error', '订单编码不能为空!!')
|
return
|
}
|
|
let that = this
|
this.$toast.loading('加载中...')
|
uni.request({
|
url: that.baseUrl + '/pda/shipping/order/detl',
|
data: JSON.stringify({
|
orderNo: this.orderNo.trim(),
|
}),
|
method: 'POST',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(result) {
|
var res = result.data
|
if (res.code === 200) {
|
that.messageToggle('success', '数据拉取成功!!')
|
that.range = res.data.map(item => {
|
return {...item, checked: true}
|
})
|
} else {
|
that.messageText = res.msg
|
that.messageToggle('error')
|
}
|
},
|
complete() {
|
that.$toast.hideLoading()
|
}
|
});
|
},
|
|
/**
|
* 输入框重置
|
*/
|
resst() {
|
this.orderNo = ''
|
this.shipping = []
|
},
|
/**
|
* checkbox选中事件
|
* @param {Object} e
|
*/
|
checkboxChange: function (e) {
|
var items = this.range, values = e.detail.value;
|
for (var i = 0, lenI = items.length; i < lenI; ++i) {
|
const item = items[i]
|
if(values.indexOf(item.id) >= 0){
|
this.$set(item,'checked',true)
|
}else {
|
this.$set(item,'checked',false)
|
}
|
}
|
},
|
/**
|
* checkbox全选事件
|
* @param {Object} e
|
*/
|
checkboAll(e) {
|
let detl = e.detail.value
|
if (detl.length < 1) {
|
this.range.map(item => {
|
return item.checked = false
|
})
|
} else {
|
this.range.map(item => {
|
return item.checked = true
|
})
|
}
|
},
|
|
//确认发货
|
shippinged() {
|
if (this.orderNo == undefined || this.orderNo == null || this.orderNo.trim() == '') {
|
this.messageToggle('error', '订单编码不能为空!!')
|
return
|
}
|
|
let that = this
|
this.$toast.loading('加载中...')
|
uni.request({
|
url: that.baseUrl + '/pda/shipping/confirm',
|
data: JSON.stringify(that.shipping),
|
method: 'POST',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(result) {
|
var res = result.data
|
if (res.code === 200) {
|
that.messageToggle('success', '发货成功!!')
|
that.range = res.data.map(item => {
|
return {...item, checked: true}
|
})
|
} else {
|
that.messageText = res.msg
|
that.messageToggle('error')
|
}
|
},
|
complete() {
|
that.resst()
|
that.$toast.hideLoading()
|
}
|
});
|
},
|
|
combConfirm() {
|
this.dialogToggle('dialog', '确认', '是否确认发货?')
|
},
|
|
shippingConfirm(type) {
|
if (this.range == null) {
|
this.messageToggle('error', '发货单数据为空!!');
|
return
|
}
|
/**过滤未选中订单明细*/
|
this.shipping = this.range.filter(item => {
|
return item.checked == true
|
})
|
|
if (this.shipping != null && this.shipping.length > 0) {
|
this.shippinged()
|
}
|
},
|
|
//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%;
|
}
|
.code {
|
width: 100%;
|
top: 76rpx;
|
position: sticky;
|
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;
|
|
.code-decs {
|
width: 20vw;
|
font-size: 18px;
|
color: #303133;
|
}
|
}
|
|
.item input {
|
height: 50rpx;
|
line-height: 50rpx;
|
/* font-family: PingFang SC; uniapp 默认字体不居中 */
|
font-size: 36upx;
|
font-family: PingFang SC;
|
width: 55vw;
|
|
}
|
|
.mat-list-title {
|
height: 80rpx;
|
line-height: 80rpx;
|
font-size: 24px;
|
width: 100%;
|
background: white;
|
font-weight: 500;
|
}
|
|
}
|
|
.list-view {
|
padding-bottom: 92rpx;
|
}
|
|
.item-right {
|
margin-left: auto;
|
margin-right: 20rpx;
|
}
|
|
.order__list {
|
margin: 20rpx;
|
font-size: 14px;
|
background-color: #fff;
|
border-radius: 20rpx;
|
border: 1px solid #eeeeee;
|
display: flex;
|
position: relative;
|
background-color: #3eb689;
|
color: #FFF;
|
}
|
|
.order-list-cell {
|
margin: 20rpx;
|
font-size: 14px;
|
border-radius: 20rpx;
|
border: 1px solid #eeeeee;
|
display: flex;
|
position: relative;
|
background-color: #FD4D11;
|
color: #FFF;
|
}
|
|
|
.order__list__left {
|
flex: 1;
|
padding: 20rpx;
|
position: relative;
|
}
|
.order__list__right {
|
width: 70rpx;
|
border-right: 1rpx solid #eeeeee;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
|
</style>
|