<template>
|
<view>
|
<view class="status_bar">
|
<!-- 这里是状态栏 -->
|
</view>
|
<uni-nav-bar left-icon="left" background-color="#f8f8f8" title="关联库位" @clickLeft="back" :fixed="true"
|
:border="false" rightWidth="160rpx" leftWidth="160rpx"
|
>
|
<block slot="right">
|
<view class="city">
|
<view>
|
<text class="uni-nav-bar-text">{{store}}</text>
|
</view>
|
</view>
|
</block>
|
</uni-nav-bar>
|
<!-- 搜索框 -->
|
<!-- <view class="search-bar">
|
<uni-search-bar v-model="searchVal" placeholder=" 输入库位号" bgColor="#EEEEEE" @input="search" />
|
</view> -->
|
<view style="margin: 0;background-color: aliceblue;text-align: center;height: 30px;">
|
当前订单号: {{order.orderNo}}
|
</view>
|
<view class="card" v-for="item in menuList" @click="chose(item)">
|
{{item}}
|
</view>
|
</view>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
baseUrl: '',
|
token: '',
|
storeId: 0,
|
store: '',
|
orderNo: '',
|
searchVal: '',
|
orderId: 0,
|
menuList: [],
|
order: {orderNo: '--'},
|
orNo: ''
|
}
|
},
|
onShow() {
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
this.storeId = uni.getStorageSync('store')
|
if (this.storeId == 1) {
|
this.store = '宁波仓'
|
}
|
if (this.storeId == 2) {
|
this.store = '新昌仓'
|
}
|
let that = this
|
const eventChannel = that.getOpenerEventChannel();
|
eventChannel.on('order', function(data) {
|
// console.log(data)
|
that.orderId = data.orderNo.id
|
that.order = data.orderNo
|
that.getOrderNoList(that.orderId)
|
})
|
},
|
methods: {
|
back() {
|
uni.navigateBack({})
|
},
|
getOrderNoList(orderId) {
|
let that = this
|
uni.request({
|
url: that.baseUrl + '/mobile/pda/OutLocNo',
|
data: {orderId:orderId},
|
header: {
|
'token': uni.getStorageSync('token'),
|
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
},
|
method: 'POST',
|
success(res) {
|
res = res.data
|
that.menuList = res.data
|
}
|
})
|
},
|
search() {
|
let baseList = [...this.menuList]
|
this.menuList = this.fuzzySearch(baseList,this.searchVal)
|
},
|
|
fuzzySearch(array, query) {
|
const regex = new RegExp(query, 'i'); // 'i' 表示不区分大小写
|
return array.filter(num => regex.test(num.toString()));
|
},
|
chose(item) {
|
let that = this
|
uni.navigateTo({
|
url: "./outMats",
|
success: function(res) {
|
// 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的
|
res.eventChannel.emit('order', {
|
locNo: item,
|
orderId: that.orderId,
|
orderNo: that.order
|
})
|
},
|
events: {
|
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 另外一个页面传过来的
|
matList: function(data) {
|
// that.matnr = data.data
|
that.getOrderNoList(that.orderId)
|
},
|
},
|
});
|
}
|
}
|
}
|
</script>
|
|
<style>
|
@import url('../../static/css/wms.css/wms.css');
|
.card {
|
margin: 20rpx;
|
padding: 30rpx;
|
background-color: #157ec1;
|
border-radius: 20rpx;
|
color: #FFF;
|
}
|
</style>
|