#
whycq
2024-04-11 35a6571ff25e5da94784d228d6bb73df768013d7
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
<template>
    <view>
        <view class="list list-font-color" :class="orderDetl.color" v-for="(orderDetl,index) in dataList" :key="index">
            <view class="list-left" style="display: flex;flex-direction: column;">
                <!-- 上 -->
                <view>
                    <view class="detl-threeCode">{{orderDetl.threeCode}}</view>
                    <view class="detl-locNo">{{orderDetl.locNo}}</view>
                </view>
                <!-- 中 -->
                <view style="display: flex;">
                    <view style="flex: 1;">
                        <view>主单号:{{orderDetl.orderNo}}</view>
                        <view>编号:{{orderDetl.matnr}}</view>
                        <view>名称:{{orderDetl.maktx}}</view>
                        <view>库存数量:{{orderDetl.anfme}}</view>
                    </view>
                    <view class="out-btn">
                        <view>出库</view>
                    </view>
                </view>
                <!-- 下 -->
            </view>
            <!-- <view class="list-right" @click="goToLocDetl(orderDetl)">
                <uni-icons type="right" size="25"  color="#fff"></uni-icons>
            </view> -->
        </view>
        <!-- 垫高 -->
        <view style="height: 340rpx;text-align: center;color: #b9b9b9;">
            - 已经到底了 -
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                baseUrl: '',
                token: '',
                dataList: [],
                count: 0,
                index: 0,
                barcode: '',
                agvDevp: '',
            }
        },
        onShow() {
            let _this = this
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
            // const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('item', function(data) {
                console.log(data.item);
                _this.getLocDetl(data.item.orderNo,data.item.threeCode,data.item.matnr)
            })
        },
        methods: {
            getLocDetl(orderNo,threeCode,matnr) {
                let _this = this
                uni.request({
                    url: `${_this.baseUrl}/agvMobile/query/locDetl/v1`,
                    header: { 'token': uni.getStorageSync('token') },
                    data: {
                        orderNo: orderNo,
                        threeCode: threeCode ,
                        matnr: matnr
                    },
                    method: 'POST',
                    success(res) {
                        res = res.data
                        console.log(res);
                        if (res.code === 200) {
                            for (let k of res.data) {
                                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'
                                }
                            }
                            _this.dataList = res.data
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
    @import url('../../../static/css/common/order.css');
    .list-font-color {
        color: #fff;
        /* background-color: #33bb44; */
    }
    .order-sts-start {
        background-color: #3eb689;
    }
    .order-sts-working {
        background-color: #ff9d46;
    }
    .order-sts-end {
        background-color: #ff7356;
    }
    .detl-threeCode {
        font-size: 28px;
        font-weight: bold;
    }
    .detl-locNo {
        font-size: 20px;
        font-weight: bold;
    }
    .out-btn {
        background-color: #3e82ff;
        height: 120rpx;
        width: 120rpx;
        line-height: 120rpx;
        text-align: center;
        border-radius: 50%;
        margin-left: 20rpx;
        margin-right: 20rpx;
    }
</style>