#
whycq
2022-11-10 b4416d1e1c0c292875820a3a510a1bc3488cb1f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
    <view>
        <view class="list" v-for="(item,index) in matList" :key="index" @click="chose(item.orderNo)">
            <view class="item">
                <view class="title">单据类型:</view>
                <view class="context">{{item.docType$}}</view>
            </view>
            <view class="item">
                <view class="title">单号:</view>
                <view class="context">{{item.orderNo}}</view>
            </view>
            <view class="item">
                <view class="title">订单状态:</view>
                <view class="context">{{item.settle$}}</view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                commonUrl: null,
                matList: [],
                
            }
        },
        onLoad() {
            let that = this
            // const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('commonUrl', function(data) {
                that.commonUrl = data.commonUrl
                that.getList()
            })
        },
        methods: {
            getList() {
                let that = this
                uni.request({
                    url: that.commonUrl + '/manPakOut/notIssued',
                    header: {'token':uni.getStorageSync('token')},
                    method: 'GET',
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.matList = res.data
                        }
                    }
                })
            },
            chose(orderNo) {
                this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: orderNo});
                uni.navigateBack({
                    
                })
            }
        }
    }
</script>
 
<style>
    .list {
        width: 96%;
        min-height: 100rpx;
        background-color: #FFF;
        margin: 15rpx 2% 0 2%;
        border-radius: 15rpx;
    }
    .item {
        display: flex;
        flex-direction: row;
        padding: 4rpx;
        font-size: 16px;
    }
</style>