<template>
|
<view>
|
<view class="search-box">
|
<uni-search-bar
|
v-model="searchVal"
|
maxlength="500"
|
ancel="cancel"
|
placeholder="输入 / 扫描 订单号"
|
@confirm="search()"
|
@clear="clear" >
|
</uni-search-bar>
|
<view class="search-box-info">
|
<view></view>
|
<view style="width: 100%;text-align: center;margin: 16rpx 0;">{{searchVal}} 总数量:- {{total}} -</view>
|
<view style="width: 100rpx;margin: 16rpx 0;" @click="filter()">筛选</view>
|
</view>
|
</view>
|
|
<view class="list list-font-color" :class="orderDetl.color" v-for="(orderDetl,index) in dataList" :key="index">
|
<view class="list-left">
|
<view>单据编号:{{orderDetl.orderNo}}</view>
|
<view>销售单号:{{orderDetl.threeCode}}</view>
|
<view>商品编号:{{orderDetl.matnr}}</view>
|
<view>商品名称:{{orderDetl.maktx}}</view>
|
<view>批号:{{orderDetl.batch}}</view>
|
<view>组件号:{{orderDetl.bomCode}}</view>
|
<view>订单数量:{{orderDetl.anfme}}</view>
|
<view>作业数量:{{orderDetl.workQty}}</view>
|
</view>
|
<view class="list-right" @click="checkIsFull(index)">
|
<uni-icons type="folder-add" size="25" color="#fff"></uni-icons>
|
</view>
|
</view>
|
|
<view class="shop-car" @click="orderCar()">
|
<view class="car-left">
|
<uni-icons type="cart-filled" size="35" color="#fff"></uni-icons>
|
</view>
|
<view class="car-right">
|
<text>{{orderCarList.length}}</text>
|
</view>
|
</view>
|
|
<view style="height: 50rpx;"></view>
|
|
|
<!-- 添加物料弹窗 -->
|
<view>
|
<uni-popup ref="addItem" type="dialog">
|
<view class="popup">
|
<!-- 标题 -->
|
<view class="title">入库数量</view>
|
<view class="popup-item">
|
<uni-number-box :value="count" :step='1' :max="9999999" color="#747474" @change="changeValue" />
|
</view>
|
<view class="btn">
|
<view class="btn-left" @click="addClose">取消</view>
|
<view class="btn-right" @click="addConfirm()">添加</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<!-- 选择并板 或 直接入库 -->
|
<view>
|
<uni-popup ref="chose" type="dialog">
|
<view class="popup">
|
<!-- 标题 -->
|
<view class="title">警告</view>
|
<view class="popup-item">
|
<text>当前物料可并板</text>
|
</view>
|
<view class="btn">
|
<view class="btn-left" @click="choseClose">去组托</view>
|
<view class="btn-right" @click="choseConfirm()">去并板</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
|
<!-- 筛选弹窗 -->
|
<view>
|
<uni-popup ref="filter" type="dialog">
|
<view class="filter-popup">
|
<!-- 标题 -->
|
<view class="title">筛选</view>
|
<view class="popup-item" style="background-color: #dfdfdf;">
|
<view class="item-cl">
|
<view>主订单号:</view>
|
<input type="text" v-model="orderNo">
|
</view>
|
</view>
|
<view class="popup-item" style="background-color: #dfdfdf;">
|
<view class="item-cl">
|
<view>商品编号:</view>
|
<input type="text" v-model="matnr">
|
</view>
|
</view>
|
<view class="popup-item" style="background-color: #dfdfdf;">
|
<view class="item-cl">
|
<view>商品名称:</view>
|
<input type="text" v-model="maktx">
|
</view>
|
</view>
|
<view class="popup-item" style="background-color: #dfdfdf;">
|
<view class="item-cl">
|
<view>商品种类:</view>
|
<input type="text" v-model="brand">
|
</view>
|
</view>
|
<view class="btn filter-btn">
|
<view class="btn-left" @click="filterClose">重置</view>
|
<view class="btn-right" @click="filterConfirm()">确认</view>
|
</view>
|
</view>
|
</uni-popup>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
baseUrl: '',
|
token: '',
|
dataList: [],
|
orderCarList: [],
|
searchVal: '',
|
total: '',
|
orderNo: '',
|
matnr: '',
|
maktx: '',
|
brand: '',
|
count: 0,
|
index: '',
|
locMast: '',
|
detls: '',
|
data: {
|
curr: 1,
|
limit: 100,
|
three_code: '',
|
matnr: '',
|
maktx: '',
|
order_no: '',
|
brand: ''
|
},
|
}
|
},
|
onShow() {
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
this.searchVal = uni.getStorageSync('searchVal');
|
this.getDataList(this.searchVal,10)
|
},
|
methods: {
|
search() {
|
this.dataList = []
|
this.data.curr = 1
|
uni.setStorageSync('searchVal', this.searchVal);
|
if (this.searchVal.length == 0) {
|
this.getDataList(this.searchVal,10)
|
}
|
},
|
clear() {
|
|
},
|
getDataList(threeCode,limit) {
|
let _this = this
|
uni.showLoading({})
|
_this.mask = true
|
_this.data.three_code = threeCode
|
_this.data.limit = limit
|
uni.request({
|
url: `${_this.baseUrl}/orderPakin/page/auth`,
|
header: {'token': uni.getStorageSync('token')},
|
data: _this.data,
|
method: 'GET',
|
success(res) {
|
uni.hideLoading({})
|
res = res.data
|
if (res.code === 200) {
|
for (let k of res.data.records) {
|
if (k.anfme > k.qty && k.qty == 0) {
|
k['color'] = 'order-sts-start'
|
} else if (k.anfme > k.qty && k.qty != 0) {
|
k['color'] = 'order-sts-working'
|
} else {
|
k['color'] = 'order-sts-end'
|
}
|
}
|
let list = res.data.records
|
_this.dataList = _this.dataList.concat(list);
|
_this.data.curr = _this.data.curr + 1
|
_this.total = res.data.total
|
_this.mask = false
|
} else if (res.code == 403) {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
|
} else {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
}
|
}
|
})
|
},
|
filter() {
|
this.$refs.filter.open('bottom')
|
},
|
filterConfirm() {
|
},
|
filterClose() {
|
},
|
// 跳转可并板
|
unfullplt(locMasts,detls) {
|
let _this = this
|
uni.navigateTo({
|
url: './unFullpltList',
|
success(res) {
|
res.eventChannel.emit('locMasts', {
|
locMasts: locMasts
|
})
|
res.eventChannel.emit('detls', {
|
detls: detls
|
})
|
},
|
events: {
|
acceptDataFromOpenedPage: function(data) {
|
if (data.data == 1) {
|
setTimeout(()=>{
|
_this.dataList = []
|
_this.getDataList(_this.searchVal,10)
|
},200)
|
}
|
}
|
}
|
})
|
},
|
// 点击前往 待组托列表
|
orderCar() {
|
let _this = this
|
if (_this.orderCarList.length === 0) {
|
uni.showToast({ title: '请添加入库商品!', icon: "none", position: 'top' })
|
return
|
}
|
uni.navigateTo({
|
url: './orderCar',
|
success(res) {
|
res.eventChannel.emit('item', {
|
item: _this.orderCarList
|
})
|
},
|
events: {
|
acceptDataFromOpenedPage: function(data) {
|
if (data.data == 1) {
|
_this.orderCarList = []
|
_this.getDataList(_this.searchVal,10)
|
}
|
}
|
}
|
})
|
},
|
checkIsFull(index) {
|
let _this = this
|
let item = _this.dataList[index]
|
|
uni.request({
|
url: `${_this.baseUrl}/mobile/check/fullplt/auth`,
|
header: {'token': uni.getStorageSync('token')},
|
data: item,
|
method: 'POST',
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
_this.index = index
|
_this.locMast = res.data
|
_this.detls = item
|
_this.$refs.chose.open('center')
|
|
} else if (res.code == 403) {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
|
} else {
|
_this.addItem(index)
|
}
|
}
|
})
|
|
},
|
choseClose() {
|
this.addItem(this.index)
|
this.$refs.chose.close()
|
},
|
choseConfirm() {
|
this.unfullplt(this.locMast,this.detls)
|
this.$refs.chose.close()
|
},
|
// 添加入库商品至 待组托列表
|
addItem(index) {
|
// 判断添加的商品是否和已经添加的重复
|
let dataList = this.dataList
|
for (let k of this.orderCarList) {
|
if (k.orderNo == dataList[index].orderNo
|
&& k.threeCode == dataList[index].threeCode
|
&& k.matnr == dataList[index].matnr
|
&& k.bomCode == dataList[index].bomCode) {
|
uni.showToast({ title: '请勿重复添加商品!', icon: "none", position: 'top' })
|
return
|
}
|
}
|
this.index = index
|
this.$refs.addItem.open()
|
},
|
addClose() {
|
this.$refs.addItem.close()
|
this.count = 0
|
},
|
addConfirm() {
|
if (this.count == 0) {
|
uni.showToast({ title: '为不必要的麻烦,请填写数量!', icon: "none", position: 'top' })
|
return
|
}
|
this.dataList[this.index]['used'] = true
|
this.dataList[this.index]['pakinQty'] = this.count
|
this.orderCarList.push(this.dataList[this.index])
|
this.index = 0
|
this.count = 0
|
this.$refs.addItem.close()
|
},
|
changeValue(value) {
|
this.count = value
|
},
|
}
|
}
|
</script>
|
|
<style>
|
.search-box {
|
background-color: #d9d9d9;
|
z-index: 99;
|
position: sticky;
|
top: 0rpx;
|
left: 0;
|
}
|
.search-box-info {
|
display: flex;
|
justify-content: space-around;
|
}
|
.city-btn {
|
margin-left: 10px;
|
color: #007aff;
|
font-size: 16px;
|
font-weight: bold;
|
}
|
|
.filter-popup {
|
width: 100%;
|
height: 80vh;
|
background-color: #FFF;
|
position: relative;
|
border-radius: 30rpx 30rpx 0rpx 0rpx;
|
}
|
.filter-popup-item {
|
height: 100%;
|
width: 100%;
|
background-color: #c9cdd5;
|
}
|
.filter-popup-item-left {
|
width: 30%;
|
height: 100%;
|
background-color: #DCDFE6;
|
|
}
|
.filter-btn {
|
position: absolute;
|
left: 0;
|
bottom: 0;
|
width: 100%;
|
background-color: #FFF;
|
}
|
.title {
|
height: 100rpx;
|
line-height: 100rpx;
|
width: 100%;
|
color: #606266;
|
text-align: center;
|
font-size: 16px;
|
}
|
|
.popup-item {
|
height: 80rpx;
|
line-height: 80rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.popup-item-left {
|
width: 16vw;
|
padding-right: 20rpx;
|
text-align: right;
|
color: #606266;
|
}
|
.popup-item-right {
|
display: flex;
|
align-items: center;
|
width: 50vw;
|
height: 50rpx;
|
padding: 2px 5px;
|
border: 1px solid #E4E7ED;
|
border-radius: 5rpx;
|
}
|
.popup-item-right input{
|
color: #606266;
|
}
|
.btn {
|
display: flex;
|
height: 90rpx;
|
margin-top: 20rpx;
|
border-top: 1px solid #DCDFE6;
|
justify-content: center;
|
align-items: center;
|
}
|
.btn-left {
|
display: flex;
|
flex: 1;
|
height: 100%;
|
justify-content: center;
|
align-items: center;
|
color: #606266;
|
border-right: 1px solid #DCDFE6;
|
}
|
.btn-right {
|
display: flex;
|
flex: 1;
|
justify-content: center;
|
align-items: center;
|
color: #409EFF;
|
}
|
.item-cl {
|
display: flex;align-items: center;
|
}
|
.item-cl input {
|
border-bottom: 1px solid #b9b9b9;
|
}
|
.list {
|
margin: 20rpx;
|
font-size: 14px;
|
background-color: #fff;
|
border-radius: 20rpx;
|
border: 1px solid #eeeeee;
|
display: flex;
|
position: relative;
|
}
|
.list-left {
|
flex: 1;
|
padding: 20rpx;
|
position: relative;
|
}
|
.list-right {
|
width: 70rpx;
|
border-left: 1px solid #eeeeee;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.list-font-color {
|
/* color: #fff; */
|
background-color: #33bb44;
|
}
|
.shop-car {
|
position: fixed;
|
left: 22rpx;
|
bottom: 150rpx;
|
background-color: #2299ff;
|
width: 260rpx;
|
height: 90rpx;
|
display: flex;
|
align-items: center;
|
box-shadow: 0 0 10px 5px rgba(0, 0, 0, .6);
|
border-radius: 10rpx;
|
color: #fff;
|
font-size: 28px;
|
font-weight: bold;
|
}
|
.car-left {
|
padding: 16rpx;
|
flex: 5;
|
}
|
.car-right {
|
flex: 4;
|
}
|
|
.popup {
|
width: 80vw;
|
min-height: 100rpx;
|
background-color: #FFF;
|
border-radius: 25rpx;
|
position: relative;
|
}
|
.title {
|
height: 100rpx;
|
line-height: 100rpx;
|
width: 100%;
|
color: #606266;
|
text-align: center;
|
font-size: 16px;
|
}
|
.popup-item {
|
height: 80rpx;
|
line-height: 80rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.popup-item-left {
|
width: 16vw;
|
padding-right: 20rpx;
|
text-align: right;
|
color: #606266;
|
}
|
.popup-item-right {
|
display: flex;
|
align-items: center;
|
width: 50vw;
|
height: 50rpx;
|
padding: 2px 5px;
|
border: 1px solid #E4E7ED;
|
border-radius: 5rpx;
|
}
|
.popup-item-right input{
|
color: #606266;
|
}
|
</style>
|