skyouc
2024-12-23 3bc055f2ee9e813db0f08c5aefc4799be943f77f
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<template>
    <view>
        <scroll-view>
            <view class="tag-list" v-for="(item,i) in matData" :key="i" @click="showTag(item)">
    <!--             <view class="tag">
                    <view style="display: flex;">
                        <view class="wms-tag" :style="baColor" >分类</view>
                    </view>
                </view> -->
                <view class="tag-item">名称:{{item.maktx}}</view>
                <view class="tag-item">编码:{{item.matnr}}</view>
                <view class="tag-item">型号:{{item.model}}</view>
                <view class="tag-item">规格:{{item.specs}}</view>
                <view style="display: flex;">
                    <view class="tag-item">数量:{{item.anfme}}</view>
                    <view class="tag-item" style="display: flex;">
                        <view >
                            已完成:
                        </view>
                        <view style="color: green;">
                            {{item.qty}}
                        </view>
                    </view>
                    <view class="tag-item" style="display: flex;">
                        <view>
                            执行中:
                        </view>
                        <view style="color: red;">
                            {{item.workQty}}
                        </view>
                    </view>
                    <view class="tag-item" style="display: flex;">
                        <view>
                            可组拖:
                        </view>
                        <view style="color: blue;">
                            {{item.mergeNum}}
                        </view>
                        </view>
                </view>
            </view>
        </scroll-view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                matData: [],
                barcode: '',
            }
        },
        onLoad(option) {
            this.barcode = option.barcode
        },
 
        onShow() {
            
            this.getMats(this.barcode)
        },
        
        methods: {
            showTag(pars) {
                uni.navigateTo({
                    url: "../mat/matSelected",
                    // 通过eventChannel向被打开页面传送数据
                    success: function(res) {
                        res.eventChannel.emit('mat', {
                            data: pars
                        })
                    },
                    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                    events: {
                        matList: function(data) {
                            // that.checkMat(data.data)
                            // that.focuss()
                        },
                    },
                });
            },
            
            /**
             * 获取当前订单下所有物料明细
             * @param {Object} barcode
             */
            getMats(barcode) {
                let that = this
                uni.request({
                    // url: that.baseUrl + '/mat/auth',
                    url: uni.getStorageSync('baseUrl') + '/pda/mat/auth',
                    method:'POST',
                    data: JSON.stringify({
                        barcode: barcode,
                    }),
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(result) {
                        result = result.data
                        if (result.code === 200 && result.data) {
                            that.matData = result.data
                            that.matData['batch'] = ''
                            
                        } else if (result.code == 403) {
                            uni.showToast({
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
                        }
                
                    }
                });
            }
        }
    }
</script>
<style>
    @import url('../../static/css/wms.css/wms.css');
    .tag-list {
        width: 94%;
        min-height: 160rpx;
        margin: 15rpx;
        padding: 15rpx;
        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: 20rpx auto; */
        color: #606266;
        font-size: 14px;
    }
</style>