skyouc
1 天以前 e6b2d108f49e2dc1d3c825704cb19e5557607420
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<template>
    <view>
        <view class="item">
            <view class="code-decs">物料码:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" >
            <view class="item-right">
                <text style="text-align: right;color: #409EFF;" @click="findMat()">查询</text>
                <uni-icons type="right" color="#c1c1c1"></uni-icons>
            </view>
        </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: '',
                matnr: null,
                matFocus: false,
            }
        },
        onLoad(option) {
            this.barcode = option.barcode
        },
 
        onShow() {
            this.getMats(this.barcode, null)
        },
        
        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()
                        },
                    },
                });
            },
            
            findMat() {
                console.log("--------->");
                this.getMats(this.barcode, this.matnr)
            },
            
            /**
             * 获取当前订单下所有物料明细
             * @param {Object} barcode
             */
            getMats(barcode, matnr) {
                console.log(matnr);
                let that = this
                uni.request({
                    // url: that.baseUrl + '/mat/auth',
                    url: uni.getStorageSync('baseUrl') + '/pda/mat/auth',
                    method:'POST',
                    data: JSON.stringify({
                        barcode: barcode,
                        matnr: matnr
                    }),
                    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: 92%;
        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>
<style>
    @import url('../../static/css/wms.css/wms.css');
    
    .uni-section {
        margin-top: 0rpx;
 
        .uni-section__content-title {
            font-size: 16px !important;
        }
    }
 
    .list {
        border-radius: unset;
        margin: auto;
        margin-top: 20rpx;
        padding: 10rpx;
    }
    
    .list-view {
        width: 100%;
        position: relative;
    }
 
    .list:first-child {
        margin-top: 320rpx;
    }
    .code {
        width: 100%;
        position: fixed;
        min-height: 200rpx;
        background-color: #FFF;
        z-index: 10;
    }
 
    .item {
        display: flex;
        align-items: center;
        height: 100rpx;
        margin-left: 20rpx;
        border-bottom: 1px solid #DCDFE6;
    }
 
    .item input {
        height: 50rpx;
        line-height: 50rpx;
        /* font-family: PingFang SC; uniapp 默认字体不居中 */
        font-size: 36upx;
        font-family: PingFang SC;
        width: 55vw;
 
    }
 
    .code-decs {
        width: 20vw;
        font-size: 18px;
        color: #303133;
    }
 
    .item-right {
        margin-left: auto;
        margin-right: 20rpx;
    }
 
    .mat-list-title {
        height: 80rpx;
        line-height: 80rpx;
        width: 100%;
        background-color: white;
        position: relative;
        font-weight: 500;
        z-index: 9;
    }
</style>