schangxiang@126.com
2025-09-17 c0e20b1b0f1298cdc0af0037d60e74d51e364501
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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
<template>
    <view class="overflow">
        <cu-custom bgColor="bg-white" :isBack="true">
            <block slot="backText">
            </block>
            <block slot="content">A1/A2分拣(PO)</block>
        </cu-custom>
        <view class="flex justify-end align-center padding_right30rpx padding_top12rpx">
            <text class="fontSize12rpx"> 操作人:{{operator}} </text>
        </view>
        <view v-if="!renameFocus" class="text-bold width fontSize32rpx"
            style="padding: 10rpx 10rpx;background-color: #d6d6d6;border-bottom: 1px solid #bcbcbc;">
            <view class="flex justify-between align-center">
                <text class="width23 padding10">容器编号</text>
                <text>{{warehouse.containerCode}}</text>
            </view>
        </view>
        <modal-code ref="resmodal" :rescode='rescode' :resmessage='resmessage' />
        <u-select v-model="containerVisible" :list="containerList" @confirm="containerConfirm"></u-select>
        <view class="" v-if="renameFocus">
            <u-form labelPosition="top" :model="warehouse" ref="warehouseRef">
                <u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
                    <u-col span="12">
                        <u-form-item label="容器编号:" prop="containerCode" required
                            style="font-size: 32rpx;font-weight: bold;padding: 0;">
                            <input v-model="warehouse.containerCode"
                            @focus="containerFocus"
                            style="font-weight: bolder;margin-left: 15rpx;"
                            class="width padding_left25rpx"
                            placeholder="请录入或扫码">
                            </input>
                            <!-- <u-icon name="close-circle-fill" color="#848484" v-if="warehouse.containerCode && focu"
                                @click="warehouse.containerCode=''"></u-icon> -->
                        </u-form-item>
                    </u-col>
                    <!-- <u-col span="2">
                        <u-icon class="iconfont icon-saoma fontSize60rpx" @click="containerScane"></u-icon>
                    </u-col> -->
                </u-row>
                <u-row class="border_bottom margin_top10rpx padding10" style="background-color: #fff;">
                    <u-col span="12">
                        <u-form-item label="物料编号:" 
                            style="font-size: 32rpx;font-weight: bold;padding: 0 0 10rpx;">
                            <input v-model="materialCode" @focus="materialCode = ''" placeholder="请录入或扫码"
                                @blur="getMaterialDetails" class="width padding_left25rpx"
                                style="font-weight: bolder;margin-left: 30rpx;">
                            </input>
                        </u-form-item>
                    </u-col>
                    <!-- <u-col span="2">
                        <u-icon class="iconfont icon-saoma fontSize60rpx"></u-icon>
                    </u-col> -->
                </u-row>
            </u-form>
            <view style="margin-bottom: 180rpx;margin-top: 10rpx;">
                <view v-for="(item, eindex) in singlist" :key="eindex" style="width: 100vw;display: flex;margin: 15rpx auto;">
                    <u-swipe-action :show="item.show" :index="eindex" @click="longpress" @open="open" :options="options" style="width: 100vw;">
                        <view class="title-wrap fontSize32rpx background_fff" :class="item.showItem ? 'bg_item' : ''" style="width: 100vw;">
                            <u-row>
                                <u-col span="1">
                                    <view class="flex justify-center align-center"
                                        style="background-color: #f18202;color: #fff;border-radius: 50%;width: 40rpx;height: 40rpx;">
                                        {{eindex+1}}
                                    </view>
                                </u-col>
                                <u-col span="10">
                                    <view class="color_f18202">
                                        {{item.wareMaterialCode}} ({{item.batchNo}})
                                    </view>
                                </u-col>
                            </u-row>
                            <u-row>
                                <u-col span="12">
                                    <view class="" style="padding: 10rpx 0 10rpx 45rpx;color: #808080;">
                                        分拣需求数:{{item.quantity}}
                                    </view>
                                </u-col>
                            </u-row>
                            <u-row>
                                <u-col span="6">
                                    <view class="" style="padding: 10rpx 0 10rpx 45rpx;color: #808080;">
                                        已分拣数:{{item.sortingQuantity}}
                                    </view>
                                </u-col>
 
                                <u-col span="6" class="flex">
                                    <view class="" style="color: #808080;">
                                        实际分拣数:
                                    </view>
                                    <input
                                        class="border_bottom_f18202 text-left color_f18202 fontSize32rpx"
                                        style="background-color: #f2f2f2;height: 70rpx;width: 115rpx;" v-model="item.uncollectedQuantity"
                                        type="number"  @blur="changeNum(item)" placeholder=""
                                    />
                                </u-col>
                            </u-row>
                        </view>
                    </u-swipe-action>
                </view>
                
            </view>
            <u-popup v-model="detailshow" border-radius="14" @close="detailshow=false" mode="bottom">
                <view class="pop ">
                    <h2 class="text_align_center padding_bottom18 padding15">物料信息</h2>
                    <scroll-view scroll-y="true" style="height: 50vh;margin-bottom: 140rpx;">
                        <view class="line flex justify-between">
                            <text class="text-gray">DO单号</text>
                            <text>{{materlist.deliveryNo}}</text>
                        </view>
                        <view class="line flex justify-between">
                            <text class="text-gray">物料编号</text>
                            <text>{{materlist.wareMaterialCode}}</text>
                        </view>
                        <!-- <view class="line flex justify-between">
                            <text class="text-gray">物料名称</text>
                            <text>{{materlist.materialTypeName}}</text>
                        </view> -->
                        <view class="line flex justify-between">
                            <text class="text-gray">物料名称</text>
                            <text>{{materlist.wareMaterialName }}</text>
                        </view>
                        <view class="line flex justify-between">
                            <text class="text-gray">批次</text>
                            <text>{{materlist.batchNo}}</text>
                        </view>
                        <view class="line flex justify-between">
                            <text class="text-gray">已分拣数</text>
                            <text>{{materlist.sortingQuantity}}</text>
                        </view>
                    </scroll-view>
                </view>
                <button-modal :subShow='true' garmenTitle='打印' @submit='init'  />
            </u-popup>
            <button-modal :empTytowerShow='true' cleaningTitle="回库" garmenTitle='下一步' @submit='next' @reset='rest' />
        </view>
        <view class="" v-else>
            <scroll-view scroll-y="true" style="height: 800rpx;">
                <view v-for="(item,eindex) in arr" :key="eindex" style="background-color: #fff;" class="fontSize32rpx">
                    <u-row style='padding: 25rpx 15rpx 0; '>
                        <u-col span="12" class="flex">
                            <view class="flex justify-center align-center "
                                style="background-color: #f18202;color: #fff;border-radius: 50vh;width: 40rpx;height: 40rpx;">
                                {{eindex+1}}
                            </view>
                            <view class="padding_left10rpx color_f18202">
                                {{item.wareMaterialCode}}
                            </view>
                        </u-col>
                        
                    </u-row>
                    <u-row style='padding: 25rpx 15rpx 0;'>
                        <u-col span="6" class="flex" style="text-align: right;">
                            需求分拣:{{item.quantity}}
                        </u-col>
                        <u-col span="6" class="">
                            已分拣数:{{item.sortingQuantity}}
                        </u-col>
                    </u-row>
                    <u-row style='padding: 25rpx 15rpx 0;'>
                        <u-col span="6" class="color_f18202" >
                            实际分拣:{{item.uncollectedQuantity}}
                        </u-col>
                        <u-col span="6" class="flex">
                            <view class="padding_left45rpx">
                                剩余:{{ Number( item.quantity  - item.sortingQuantity - item.uncollectedQuantity).toFixed(3) }}
                            </view>
                        </u-col>
                    </u-row>
                </view>
                <!-- </view> -->
            </scroll-view>
            <button-modal :empTytowerShow='true' cleaningTitle="上一步" garmenTitle='分拣完成' @submit='submit' @reset='back' />
        </view>
    </view>
    </view>
</template>
 
<script>
    import ButtonModal from '../../components/buttonModal.vue'
    import {getContainDetail} from '../../api/putIn/artificial.js'
    import ModalCode from '../../components/ModalCode.vue'
    import {getOutWarehousePO,addWarehouseDetailsPO, getwmsOrderMovementDetails} from '../../api/sort.js'
    import {getDate} from '../../utils/dateTime.js'
    import {getAttrValue} from '../../utils/tool.js'
    import BluePrint from '@/pages/print/bluePrint.js'
    export default {
        data() {
            return {
                containerVisible: false,
                containerList: [],
                renameFocus: true,
                detailshow: false,
                rescode: 0,
                resmessage: "",
                modalshow: false,
                action: this.$myHOST + '/sysFileInfo/uploadImages',
                singlist: [
                    // {
                    //     "id": 394312061149253,
                    //     "quantity": 19.11,
                    //     "wareMaterialCode": "18VS020A711-011111",
                    //     "wareContainerCode": "A3080201",
                    //     "wareMaterialName": "SPACER, X LMG\nSPACER, X LMG BLOCK",
                    //     "batchNo": "22222222222",
                    //     "materialTypeName": "",
                    //     "deliveryNo": "qqq",
                    //     "sortingQuantity":2.23
                    // }
                ], //物料详情
                arr: [],
                materlist: {}, //物料详情数据
                warehouse: {
                    containerCode: '',
                },
                activeIndex: 100,
                detailable: false,
                materialCode: '', //物料编号
                warehouseRules: {
                    containerCode: [{
                        required: true,
                        message: '容器编号不能为空',
                        trigger: 'blur'
                    }]
                },
                options: [{
                    text: '详情',
                    style: {
                        backgroundColor: '#fc9f35'
                    }
                }],
                operator: '',
                Datetime: getDate(),
            };
        },
        components: {
            ButtonModal,
            ModalCode
        },
        onReady() {
            this.$refs.warehouseRef.setRules(this.warehouseRules)
        },
        mounted() {
            this.operator = JSON.parse(uni.getStorageSync('userInfo')).name
            // this.getOrderNo()
        },
        computed: {
            containerCode() {
                return this.warehouse.containerCode
            }
        },
        watch: {
            containerCode(val) {
                if(!val) {
                    this.detailable = false;
                }
            }
        },
        methods: {
            //打印
            init() {
                const arr = ['warematerialCode','batchNo','uncollectedQuantity'];
                const arrzw = ['物料编号','批次','实际分拣数']
                let isAllow = ''
                Object.keys(this.materlist).forEach(item => {
                    if(arr.includes(item)) {
                        if(!this.materlist[item]) {
                            isAllow =  arr.indexOf(item)
                            // this.rescode = 400
                            // this.resmessage = `${item}为空,不能继续打印`
                            // this.$refs.resmodal.show = true
                            return 
                        }
                    }
                })
                if(isAllow!=''){
                    this.detailshow = false
                    this.rescode = 400
                    this.resmessage = `${arrzw[isAllow]}为空,不能继续打印`
                    this.$refs.resmodal.show = true
                    return
                }
                if(this.materlist.uncollectedQuantity > (this.materlist.quantity - this.materlist.sortingQuantity)){
                    this.detailshow = false
                    this.rescode = 400
                    this.resmessage = `数量不符合规范,不能继续打印`
                    this.$refs.resmodal.show = true
                    return
                }
                //物料名称是否换行
                let name = this.materlist.wareMaterialName
                let name_1 = name.length > 38 ? name.substr(0, 38) : name
                let name_2 = name.length > 38 ? name.substr(38) : ''
                //供应商是否换行
                let desc = this.materlist.supplier || ''
                let desc_1 = desc.length > 38 ? desc.substr(0, 38) : desc
                let desc_2 = desc.length > 38 ? desc.substr(38) : ''
                let ptintContext = [
                    {type:'text',x:0,y:0,text:'',size:2,rotate:0,bold:0,underline:false,reverse:false},
                    {type:'text',x:0,y:0,text:'',size:2,rotate:0,bold:0,underline:false,reverse:false},
                    {type:'text',x:0,y:0,text:'',size:2,rotate:0,bold:0,underline:false,reverse:false},
                    /* 以上空数据,为防止丢包时打印不正常 */
                    {type:'line',x1:3,y1:3,x2:570,y2: 3,width:2}, //上边线
                    {type:'line',x1:3,y1:3,x2:3,y2: 460,width:2},//左边线
                    {type:'line',x1:3,y1:458,x2:570,y2: 458,width:2}, //最下边线
                    {type:'line',x1:560,y1:3,x2:560,y2:420,width:2},  //右边线  
                    {type:'text',x:10,y:15,text:`Part:${this.materlist.wareMaterialCode}`,size:3,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:3,y1:50,x2:565,y2:50,width:2},
                    {type:'text',x:10,y:60,text:`Descript:${name_1}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'text',x:10,y:95,text:`${name_2}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:3,y1:130,x2:565,y2:130,width:2},
                    {type:'text',x:10,y:140,text:`Vendor:${desc_1}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'text',x:10,y:175,text:`${desc_2}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:3,y1:210,x2:565,y2:210,width:2},
                    {type:'text',x:10,y:225,text:`DO:${this.materlist.deliveryNo}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:3,y1:260,x2:350,y2:260,width:2},
                    {type:'text',x:10,y:280,text:`Qty:${this.materlist.uncollectedQuantity} ${this.materlist.unit == null ? '' : this.materlist.unit}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:3,y1:315,x2:350,y2:315,width:2},
                    {type:'line',x1:3,y1:360,x2:350,y2:360,width:2},
                    {type:'text',x:10,y:375,text:`Print Date:${this.getCurrentDate().date}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:3,y1:410,x2:350,y2:410,width:2},
                    {type:'text',x:10,y:425,text:`Print Time:${this.getCurrentDate().time}`,size:2,rotate:0,bold:1,underline:false,reverse:false},
                    {type:'line',x1:350,y1:210,x2:350,y2:460,width:2},
                    {type:'qr',x:380,y:230,text:`PARTS NUMBER: ${this.materlist.wareMaterialCode},MATERIAL NAME: ${this.materlist.wareMaterialName},LOT NO: ${this.materlist.batchNo},QUANTITY: ${this.materlist.uncollectedQuantity}`,width:4,level:1},
                    {type:'text',x:405,y:420,text:``,size:2,rotate:0,bold:1,underline:false,reverse:false},
                ]
                console.log( ptintContext)
                BluePrint.print(this.$store,ptintContext).then(()=>{
                    let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
                    let curRoute = routes[routes.length - 1].route //获取当前页面路由
                    console.log(curRoute)
                    if (curRoute == 'pages/print/bluetoothConnection') {// 连接蓝牙失败 跳页面
                        return
                    }
                    uni.showToast({
                        title:'打印成功',
                        duration:2000
                    })
                    this.addForm.code = this.materlist.wareMaterialCode;
                    this.addForm.name = this.materlist.wareMaterialName;
                    this.addForm.batchNo = this.materlist.batchNo;
                    this.addForm.specificationModel = this.materlist.specificationModel;
                    //这里不再记录打印记录,因为有了斑马打印 【Editby shaocx,2023-05-22】
                    /*
                    addPrintRecord(this.addForm).then(res => {
                        console.log(res);
                    })
                    //*/
                }).catch((err)=>{
                    uni.showToast({
                        title:'打印失败',
                        duration: 2000
                    })
                })
            },
            //获取print date print time
            getCurrentDate() {
                let date = new Date();
                let year = date.getFullYear(); //年
                let month = date.getMonth() + 1; //月
                month = month >= 10 ? month : '0' + month;
                let day = date.getDate(); //日
                day = day >= 10 ? day : '0' + day;
                let hour = date.getHours() //时
                hour = hour >= 10 ? hour : '0' + hour;
                let min = date.getMinutes(); //分
                min = min >= 10 ? min : '0' + min;
                let second = date.getSeconds(); //秒
                second = second >= 10 ? second : '0' + second;
                return {
                    date: `${day}.${month}.${year}`,
                    time: `${hour}:${min}:${second}`,
                    formate:`${year}/${month}/${day}`
                }
            },
            //容器选择
            containerConfirm(context){
                this.warehouse.containerCode = context[0].value
                this.getOutWarehouse()
            },
            //容器聚焦事件
            containerFocus() {
                this.getContainerList()
            },
            //获取当前区域的需要分拣的容器列表
            getContainerList() {
                // //debugger
                let param = {
                    'locationType':'2'
                }
                getwmsOrderMovementDetails(param).then(res => {
                    this.containerList = res.data.reduce((curr,item) => {
                        curr.push({
                            label: item,
                            value: item
                        })
                        return curr;
                    },[])
                    this.containerVisible = true;
                })
            },
            //查询物料
            getOutWarehouse() {
                this.$refs.warehouseRef.validate(valid => {
                    if (valid) {
                        setTimeout(() => {
                            this.focu = false
                            if (this.warehouse.containerCode !== '') {
                                let params = {
                                    WareContainerCode: this.warehouse.containerCode
                                }
                                getOutWarehousePO(params).then((res) => {
                                    if (res.code == 200) {
                                        if(res.data.length == 0) {
                                            this.resmessage = '当前容器无可出物料'
                                            this.rescode = 400
                                            this.$refs.resmodal.show = true
                                        }else {
                                                                                
                                            res.data.map(item => {
                                                item.uncollectedQuantity = parseFloat(item.quantity) - parseFloat(item.sortingQuantity)
                                                item.showItem = false
                                                return item 
                                            })
                                            this.singlist = res.data
                                        }
                                        
                                    } else {
                                        this.resmessage = res.message
                                        this.rescode = res.code
                                        this.$refs.resmodal.show = true
                                    }
                                })
                            }
                        }, 200)
                    }
                })
            },
            //判断此物料编号是否存在
            getMaterialDetails() {
                this.materialCode = getAttrValue(this.materialCode,'PARTSNUMBER')
                if (this.materialCode !== '') {
                    //获取当前物料 + 批次的所有数据
                    const arr = this.singlist.reduce((curr,item,index) => {
                        if(item.wareMaterialCode == this.materialCode) {
                            curr.push(index)
                        }
                        return curr;
                    },[])
                    
                    if(arr.length > 0) {
                        arr.forEach(item => {
                            this.singlist[item].showItem = true;
                            this.singlist.unshift(...this.singlist.splice(item, 1))
                        })
                    }else {
                        uni.showModal({
                            title: '提示',
                            content: '当前分拣单中不需分拣此物料',
                            showCancel: false
                        })
                    }
                }
            },
            //详情
            longpress(index, eindex) {
                this.materlist = this.singlist[index]
                this.activeIndex = index;
                this.detailshow = true
            },
            // 如果打开一个的时候,不需要关闭其他,则无需实现本方法
            open(index) {
                // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
                // 原本为'false',再次设置为'false'会无效
                this.singlist[index].show = true;
                this.singlist.map((val, idx) => {
                    if (index != idx) this.singlist[idx].show = false;
                })
            },
 
            //改变组盘数量
            changeNum(val) {
                if (parseFloat(val.uncollectedQuantity) < 0 || val.uncollectedQuantity =='') {
                    uni.showModal({
                        title: '提示',
                        content: '分拣数量不能小于0',
                        showCancel: false
                    })
                }
                // val.uncollectedQuantity  = Number(val.uncollectedQuantity.toString().match(/^\d+(?:\.\d{0,2})?/)) // 保留两位小数
                let num1 =  Number( Number(val.quantity) - Number(val.sortingQuantity)).toFixed(3) //必须保留3位小数 -否则会造成剩余物料是小数的时候,无法收货
                if (parseFloat(val.uncollectedQuantity) > Number(num1)) {
                    uni.showModal({
                        title: '提示',
                        content: '分拣数量不能大于需求数和已分拣之差',
                        showCancel: false
                    })
                }
 
            },
            //确认
            next() {
                this.$refs.warehouseRef.validate(valid => {
                    if (valid) {
                        if(this.singlist.length == 0) {
                            this.rescode = 400
                            this.resmessage = `次容器下没有可分拣的物料`
                            this.$refs.resmodal.show = true
                            return
                        }else {
                            // let count = this.singlist.findIndex(item => item.uncollectedQuantity == '' || parseFloat(item.uncollectedQuantity) <= 0 || parseFloat(item.uncollectedQuantity) > (parseFloat(item.quantity) - parseFloat(item.sortingQuantity) ) )
                            
                            // if(count > -1) {
                            //     uni.showToast({
                            //         title: `${this.singlist[count].wareMaterialCode}分拣数量不合要求`,
                            //         icon:'none'
                            //     })
                            //     return
                            // }
                            this.arr = this.singlist;
                            this.renameFocus = false;
                        }
                        
                    }else {
                        this.rescode = 400
                        this.resmessage = `表单验证失败,请检查参数是否符合要求`
                        this.$refs.resmodal.show = true
                        return
                    }
                });
            },
            submit() {
                let sortingLists = this.arr.reduce((curr,item) => {
                    curr.push({
                        wareMaterialCode: item.wareMaterialCode,
                        wareMaterialName: item.wareMaterialName,
                        quality: item.uncollectedQuantity,
                        betchNo: item.batchNo,
                        id:item.id
                    })
                    return curr
                },[])
                let params = {
                    createdTime: this.Datetime,
                    updatedTime: this.Datetime,
                    createdUserId: JSON.parse(uni.getStorageSync('userInfo')).id,
                    createdUserName: JSON.parse(uni.getStorageSync('userInfo')).name,
                    updatedUserId: JSON.parse(uni.getStorageSync('userInfo')).id,
                    updatedUserName: JSON.parse(uni.getStorageSync('userInfo')).name,
                    wareContainerCode: this.warehouse.containerCode,
                    gridNumber: 1,
                    useNumber: 0,
                    sortingLists
                }
 
                uni.showModal({
                    title: '提示',
                    content: '确定是否分拣?',
                    showCancel: true,
                    cancelColor: '#333333',
                    success: (res => {
                        if (res.confirm) {
                            addWarehouseDetailsPO(params).then((res) => {
                                this.rescode = res.code
                                this.resmessage = res.message
                                this.$refs.resmodal.show = true
                                if (res.code == 200) {
                                    this.renameFocus = true
                                    this.resetData();
                                }
                            })
                        } else if (res.cancel) {
                            
                        }
                    })
                });
 
                
            },
            //数据重置
            resetData() {
                this.warehouse.gridNumber = 1;
                this.warehouse.useNumber = 0;
                this.warehouse.exitNumber = 0;
                this.materialCode = '';
                this.arr = [];
                this.singlist = [];
                
            },
            //回库
            rest() {
                uni.navigateTo({
                    url:`/pages/sort/return?containerCode=${this.warehouse.containerCode}`
                })
                
            },
            //上一步
            back(){
                // uni.navigateTo({
                //     url:`/pages/sort/return?containerCode=${this.warehouse.containerCode}`
                // })
                this.renameFocus=true 
            }
        }
    }
</script>
 
<style lang="scss" scoped>
   .bg_item {
       background: #FFEBCD !important;
   }
</style>