whycq
2024-11-19 fe8fb74ce94e7bee23ed47b7175236248ac93b98
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
138
139
140
141
142
143
144
145
146
147
<template>
    <view>
        <!-- 搜索框 -->
        <view class="search-bar">
            <uni-search-bar v-model="condition" placeholder=" 扫码 / 输入订单号" bgColor="#EEEEEE" @input="search" />
        </view>
        <view>
            <view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item)">
                <view class="tag">
                    <view style="display: flex;">
                        <view class="wms-tag" :style="baColor" >商品</view>
                    </view>
                </view>
                <view class="tag-item">商品编号: {{item.matnr}}</view>
                <view class="tag-item">商品名称: {{item.maktx  ? item.maktx : '--'}}</view>
                <view class="tag-item">商品规格: {{item.specs  ? item.specs : '--'}}</view>
                <view class="tag-item">数量: {{item.anfme  ? item.anfme : '--'}}</view>
            </view>
        </view>
        <uni-load-more v-show="matList.length != 0" :status="status" :icon-size="16" :content-text="contentText" />
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                tagList: [],
                matList: [],
                condition: '',
                reload: false,
                curr:1,
                tag: '分类',
                baColor: "background-color: #0081ff;",
                desc: '商品编号:',
                baseUrl: '',
                token: '',
                status: 'more',
                contentText: {
                    contentdown: '上拉加载更多',
                    contentrefresh: '加载中',
                    contentnomore: '没有更多'
                },
                // 当前tagId
                tagIdNow: 1
            }
        },
        onReachBottom() {
            this.status = 'more';
            if (this.tagList == null) {
                this.showMat(this.tagIdNow);
            }
        },
        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
            })
        },
        onShow() {
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
        },
        methods: {
            search() {
                let that = this
                that.tagList = []
                that.matList = []
                uni.request({
                    url: that.baseUrl + '/orderDetl/forOrderNo/mergePakin/v1',
                    data: {
                        orderNo: that.condition
                    },
                    method:"GET",
                    header: {
                        'token':uni.getStorageSync('token'),
                    },
                    success(result) {
                        var res = result.data
                        if (res.code === 200 ) {
                            let tmp = res.data;
                            tmp.forEach((item) => {
                                item.maxNum = item.anfme;
                            })
                            that.matList = tmp;
                        } else if (res.code == 403) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                        }
                    }
                });
            },
            findBySelect(item) {
                this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: item});
                uni.navigateBack({
                    
                })
                
            }
        }
    }
</script>
 
<style>
    @import url('../../static/css/wms.css/wms.css');
    .tag-list {
        width: 94%;
        min-height: 160rpx;
        margin: 10px auto;
        background-color: #FFF;
        border-radius: 5px;
        box-shadow: 0 5upx 20upx rgba(0, 0, 0, 0.2);
    }
    .tag {
        display: flex;
        flex-direction: column;
        min-height: 80rpx;
        border-bottom: 1px solid #e2e2e2;
    }
    .wms-tag {
        min-width: 60rpx;
        margin-left: 50rpx;
        margin-top: 30rpx;
        color: #FFF;
        font-size: 14px;
        padding: 4rpx 12rpx;
    }
    .tag-item {
        width: 100%;
        min-height: 60rpx;
        line-height: 2;
        padding-left: 50rpx;
        color: #606266;
        font-size: 14px;
    }
</style>