#
zjj
2024-04-15 14baa19873ed843f09ff34f8d8df008dce95dce2
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<template>
    <view >
        <scroll-view>
            <view class="detil-list" v-for="(item,i) in dataList" :key="i">
                <view class="detil-list-checkbox">
                    <label>
                        <checkbox :value="check" :checked="item.checked" @click="set(i)"/>
                    </label>
                </view>
                <view class="detil-list-context">
                    <view class="flex-align-center">
                        <view>单号:</view><view>{{item.orderNo}}</view>
                    </view>
                    <view class="flex-align-center">
                        <view>料号:</view><view>{{item.matnr}}</view>
                    </view>
                    <view class="flex-align-center">
                        <view>名称:</view><view>{{item.maktx}}</view>
                    </view>
                    <view class="flex-align-center">
                        <view>规格:</view><view>{{item.specs}}</view>
                    </view>
                    <view class="flex-align-center">
                        <view>批号:</view><view>{{item.batch}}</view>
                    </view>
                    <view class="flex-align-center">
                        <view>重量:</view><view>{{item.weight}}</view>
                    </view>
                    <view class="flex-align-center">
                        <view>数量:</view><view>{{item.anfme}}</view>
                    </view>
                </view>
            </view>
        </scroll-view>
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" type="primary" @click="back()">提取</button>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                dataList: [],
                check: '',
                baseUrl: '',
                token: '',
                orderNo: ''
            }
        },
        onShow() {
            let that = this
            // #ifdef APP-NVUE
            const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            // #endif
            // #ifndef APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // #endif
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('orderNo', function(data) {
                that.orderNo = data.orderNo
                console.log(data);
            })
            
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
            this.getOrderDetl();
        },
        methods: {
            set(e) {
                var ck = this.dataList[e].checked
                this.dataList[e].checked = ck ? false:true
            },
            back() {
                let that = this
                let k;
                let confirmList = [];
                for(k in that.dataList) {
                    if(that.dataList[k].checked) {
                        confirmList.push(that.dataList[k])
                    }
                }
                this.getOpenerEventChannel().emit('orderList', {data: confirmList});
                uni.navigateBack({
                    
                })
            },
            getOrderDetl() {
                console.log(this.orderNo);
                let that = this
                uni.request({
                    url: that.baseUrl + '/order/list/orderNo',
                    data: {orderNo: that.orderNo} ,
                    method: 'GET',
                    success(res) {
                        res = res.data;
                        if (res.code === 200) {
                            that.dataList = res.data
                            for (var i = 0; i < that.dataList.length; i++) {
                                that.$set(that.dataList[i],'checked',false)
                            }
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
    @import url('../../static/css/wms.css/wms.css');
    .detil-list {
        background-color: #FFF;
        border-radius: 10rpx;
        margin: 10px;
        display: flex;
        align-items: center;
        box-shadow: 0 0 5px 1px #e7e7e7;
    }
    .detil-list-checkbox {
        width: 15%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .detil-list-context {
        height: 100%;
        width: 85%;
    }
    .flex-align-center {
        display: flex;
        align-items: center;
    }
</style>