<template>
|
<view>
|
<view class="card" v-for="item in menuList" @click="chose(item)">
|
<view class="item">订单编号:{{item.orderNo}}</view>
|
<view class="item">物料编码:{{item.matnr}}</view>
|
<view class="item">批  次:{{item.batch}}</view>
|
<view class="item">剩余数量:{{item.enableQty}}</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
baseUrl: '',
|
token: '',
|
menuList: [],
|
orderNo: ''
|
}
|
},
|
onLoad() {
|
|
},
|
onShow() {
|
let that = this
|
that.baseUrl = uni.getStorageSync('baseUrl');
|
that.token = uni.getStorageSync('token');
|
|
const eventChannel = that.getOpenerEventChannel();
|
eventChannel.on('order', function(data) {
|
// console.log(data.item);
|
that.orderNo = data.orderNo
|
that.getOrderNoList(that.orderNo)
|
})
|
|
},
|
methods: {
|
getOrderNoList(orderNo) {
|
let that = this
|
uni.request({
|
url: this.baseUrl + '/orderDetl/forOrderNo/auth',
|
data: {
|
orderNo: that.orderNo
|
},
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(res) {
|
res = res.data
|
that.menuList = res.data
|
}
|
})
|
},
|
chose(item) {
|
let that = this
|
uni.navigateTo({
|
url: "../pakin/WarehouseOut",
|
success: function(res) {
|
// 通过eventChannel向被打开页面传送数据 向另外一个页面传递值的
|
res.eventChannel.emit('item', {
|
item: item
|
})
|
},
|
events: {
|
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 另外一个页面传过来的
|
acceptDataFromOpenedPage: function(data) {
|
// that.matnr = data.data
|
that.input(that.matnr)
|
},
|
},
|
|
|
});
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.card {
|
margin: 20rpx;
|
padding: 30rpx;
|
background-color: #157ec1;
|
border-radius: 20rpx;
|
color: #FFF;
|
}
|
.item {
|
width: 100%;
|
min-height: 60rpx;
|
line-height: 2;
|
padding-left: 30rpx;
|
color: #FFF;
|
font-size: 14px;
|
}
|
</style>
|