schangxiang@126.com
2025-09-19 a68302033da081f9ad5e82268a01892c3e129cc1
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<template>
    <!-- 分拣 -->
    <view class="">
        <view class="scan">
            <u-input :focus='focus' @confirm="tray" v-model="value" @input="tray" :border="true" placeholder="请扫托盘" />
            <i class="iconfont icon-saoma" @click="scan"></i>
        </view>
        <view class="title" style="display: flex;">
            <text style="font-size: 1rem;">占用空间:</text>
            <u-number-box v-model="proportion" :max="100" bg-color="#f4f4f4" style="margin-right: 5px;">
            </u-number-box>%
        </view>
        <view class="" v-show="show">
            <view class="title">
                <view class="">
                    <text>跟踪号:</text>
                    <text>{{tracking}}</text>
                </view>
            </view>
            <view class="tab">
                <u-tabs :list="tabs" :is-scroll="false" :current="current" @change="change" active-color="#80adb1"
                    bar-width="0"></u-tabs>
            </view>
            <view class="" style="border: 1px solid #000;margin: 10px 2%;">
            </view>
            <view class="table">
                <table>
                    <tr>
                        <th>物料编号</th>
                        <th v-if="display">分拣数量</th>
                        <th v-else>数量</th>
                        <th>单位</th>
                    </tr>
                    <tr v-for="(item,index) in orderList" :key="index" style="width: 100%;">
                        <td @click="details(item,index)" style="width: 55%;">
                            <view class="">
                                {{item.materialCode}}
                            </view>
                            <view class="">
                                {{item.materialName}}
                            </view>
                        </td>
                        <td v-if="display" style="height: 32px;border-bottom: 1px solid #c6c6c6;width: 5rem;">
                            <u-number-box v-model="item.pickQty" color="#595c5a" :input-width="65" :input-height="49"
                                bg-color="transparent " :max="item.stockQty" :positive-integer="false"
                                style="margin: 0 auto;"></u-number-box>
                        </td>
                        <td v-else style="height: 32px;border-bottom: 1px solid #c6c6c6;width: 5rem;">
                            {{item.stockQty}}
                        </td>
                        <td>{{item.unit}}</td>
                    </tr>
                </table>
            </view>
            <u-modal v-model="showModel" title="物料详情">
                <view class="slot-content">
                    <view class="list">
                        <view class="">
                            <text>销售单号:</text>
                            <u-input disabled v-model="List.saleCode"></u-input>
                        </view>
                        <view class="">
                            <text>跟踪号:</text>
                            <u-input disabled v-model="List.trankingNumber"></u-input>
                        </view>
                        <view class="">
                            <text>物料名称:</text>
                            <u-input disabled v-model="List.materialName"></u-input>
                        </view>
                        <view class="">
                            <text>物料编号:</text>
                            <u-input disabled v-model="List.materialCode"></u-input>
                        </view>
                        <view class="">
                            <text>移动类型:</text>
                            <u-input disabled v-model="List.moveType"></u-input>
                        </view>
                        <view class="SKU">
                            <text>库存单位:</text>
                            <u-input disabled v-model="List.unit"></u-input>
                        </view>
                        <view class="SKU">
                            <text>分拣数量:</text>
                            <u-input disabled v-model="List.pickQty"></u-input>
                        </view>
                        <view class="SKU">
                            <text>库存数量:</text>
                            <u-input disabled v-model="List.stockQty"></u-input>
                        </view>
                    </view>
                </view>
            </u-modal>
            <view class="btn">
                <u-button @click="reset">重置</u-button>
                <u-button type="success" plain @click="confirm">确认分拣</u-button>
            </view>
        </view>
    </view>
 
</template>
<script>
    import {
        sorting,
        confirm
    } from '../../api/sorting.js'
    export default {
        data() {
            return {
                value: '', //托盘号
                tabs: [{ //选项卡
                    name: '待出库明细'
                }, {
                    name: '全部明细'
                }],
                current: 0, //选项卡默认第一项
                sell: '', //销售单号
                tracking: '', //跟踪号
                type: '', //移动类型
                orderList: [
                //     {
                //     materialCode: 22,
                //     materialName: 222,
                //     pickQty: 3,
                //     stockQty: 3,
                //     unit: 'pp'
                // },
                ], //明细列表
                List: [{
                    // saleCode: '',
                    // trankingNumber: 11,
                    // materialName: 'pp',
                    // materialCode: '123',
                    // moveType: 'p',
                    // unit: 0
                }], //物料详情
                show: false,
                showModel: false, //物料详情模态框
                display: true, //待出库数量栏
                checkItem: '', //单选数据
                proportion: 100, //占用空间
                focus:true,//聚焦
                all: false,
                creator:""
            }
        },
        mounted() {
            let creator = uni.getStorageSync('creator') || ''
            if(creator){
                this.creator = JSON.parse(creator) || ''//修改人
            }
        },
        methods: {
            tray() {
                this.proportion=100 //设置占用空间默认值 【EditBy shaocx,2022-08-30】
                this.orderList=[]
                this.all = true
                let params = {
                    plateCode: this.value
                }
                sorting(params).then((res) => {
                    if (res.data.status == 200) {
                        this.show = true
                        if (this.current == 0) {
                            this.orderList = res.data.materials.filter(picker => {
                                return picker.pickQty != 0
                            })
                            this.tracking = this.orderList[0].trankingNumber //跟踪号
                        } else if (this.current == 1) {
                            this.orderList = res.data.materials
                            this.tracking = this.orderList[0].trankingNumber //跟踪号
                        }
                        //赋值显示空间占比 【EditBy shaocx,2022-10-15】
                        this.proportion=res.data.materials[0].positionLength
                    } else {
                        this.$u.toast('此托盘不需要分拣')
                    }
                })
            },
            change(index) {
                this.current = index;
                if (this.current == 0) {
                    this.display = true
                } else {
                    this.display = false
                }
                this.tray()
            },
            details(val, i) {
                this.List = val
                this.showModel = true
            },
            //重置,全不选
            reset() {
                this.tray()
            },
            //确认分拣
            confirm() {
                uni.showModal({
                    title: '提示',
                    content: '是否确认分拣',
                    showCancel: true,
                    cancelColor: '#333333',
                    success: (res => {
                        if (res.confirm) {
                            let params = '' | []
                            if (this.all == true) {
                                let params = this.orderList
                                let plateCode = this.value
                                let percentage = this.proportion
                                let creator = this.creator || '';
                                confirm(params, plateCode, percentage,creator).then((res) => {
                                    if (res.data.status == 200) {
                                        this.show = false
                                        this.orderList = ''
                                        this.value = ''
                                        this.$u.toast(res.data.msg)
                                    } else {
                                        this.show = true
                                        this.$u.toast(res.data.msg)
                                    }
                                })
                            }
 
                        } else if (res.cancel) {}
                    })
                })
            }
        }
    }
</script>
 
<style lang="scss">
     page {
         background-color: white;
     }
    .active {
        background-color: rgba(128, 173, 177, .4);
    }
 
    .scan {
        display: flex;
        padding: 10px 13%;
        position: relative;
 
        /deep/.u-input--border[data-v-fdbb9fe6] {
            border: 1px solid #b5b5b5 !important;
        }
 
        .iconfont {
            position: absolute;
            right: calc(13% + 5px);
            top: 20px;
            color: #b5b5b5;
        }
    }
 
    .table {
        table {
            border-collapse: collapse;
            width: 90%;
            margin: 0 auto;
        }
 
        th {
            background-color: #f5f6f8;
        }
 
        table,
        th,
        td {
            border: 1px solid #c6c6c6;
            text-align: center;
            padding: 5px;
        }
 
    }
 
    .title {
        padding: 5px 13%;
        font-size: 1.2rem;
        line-height: 2rem;
        color: #818181;
    }
 
    .tab {
        border-bottom: 1px solid #b5b5b5;
        margin: 0 5%;
        /deep/.u-tab-item[data-v-0de61367] {
            border: 1px solid #b5b5b5;
            border-bottom: none;
            border-radius: 5px 5px 0 0;
            margin: 10px 0px 0;
        }
    }
 
    .list {
        margin: 10px 5%;
        border-radius: 5px;
        border: 1px solid #b5b5b5;
        font-size: 1rem;
 
        .SKU {
            /deep/.uni-input-input {
                width: 5rem;
            }
        }
 
        >view {
            display: flex;
            align-items: center;
            padding: 0 10%;
            line-height: 1.8rem;
 
            /deep/.uni-input-input {
                background-color: #f5f5f5;
                border-radius: 15px;
                height: 1.7rem;
                width: 98%;
                padding-left: 5px;
                display: flex;
                align-items: center;
            }
        }
 
        .bottom {
            display: flex;
            justify-content: space-around;
 
            >view {
                text-align: center;
 
                /deep/.uni-input-input {
                    width: 3.5rem;
                    text-align: center;
                }
            }
 
            .sort {
                /deep/.uni-input-input {
                    background-color: #f5f5f5;
                    width: 3.5rem;
                    text-align: center;
                }
 
                /deep/.u-input--border[data-v-fdbb9fe6] {
                    height: 1.7rem;
                    display: flex;
                    align-items: center;
                }
            }
        }
    }
 
    .choose {
        display: flex;
        margin: 0 5%;
        font-size: 1rem;
        color: #b5b5b5;
 
        >view {
            margin: 0 10px;
        }
    }
 
    .btn {
        margin: 21px 5%;
        display: flex;
        justify-content: space-between;
 
        .u-btn {
            width: 48%;
            margin: 10px 0px;
        }
    }
</style>