1
huanghongfeng
2025-09-12 a1a0c91857b670152ec7d4afa7bc4140953a5e98
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
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
<template>
    <view>
        <view class="login__info tn-flex tn-flex-direction-column tn-flex-col-center tn-flex-row-center">
            <view
                class="login__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
                <view class="login__info__item__input__content">
                    <input maxlength="500" style="height: 40px;" v-model="barcode" focus="true" placeholder-class="input-placeholder"
                        @input="barcodeInput" placeholder="请扫描托盘条码" />
                </view>
            </view>
 
            <view
                class="login__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
                <view class="login__info__item__input__content" style="width: 100%;">
                    <input maxlength="500" style="height: 40px;" v-model="stationName" placeholder-class="input-placeholder"
                        @click="stationshow=true" placeholder="请选择车型" />
                        
                    <button @tap="onButtonClick2" class="input-button">全部</button>
                    <u-picker v-model="stationshow" mode="selector" :range="selectorStation2" range-key="stationName"
                        @confirm="stationConfirm2"></u-picker>
                </view>
            </view>
            
            
            <view
                class="login__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
                <view class="login__info__item__input__content" style="width: 100%;">
                        <input maxlength="500" style="height: 40px;" v-model="cartnme" placeholder-class="input-placeholder"
                            placeholder="请选择名称" @click="dropdownOpen = true" />
                        
                </view>
            </view>
            
            <view
                class="login__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
                <view class="login__info__item__input__content">
                    <input maxlength="500" style="height: 40px;" v-model="barcodemodel" focus="true" placeholder-class="input-placeholder"
                        placeholder="请选择车号" @tap="selectListmoder()" />
                </view>
            </view>
                
            <view
                class="login__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
                <view class="login__info__item__input__content">
                    <input maxlength="500" style="height: 40px;" v-model="cartnumber" focus="true" placeholder-class="input-placeholder"
                         placeholder="请输入车组号" />
                </view>
            </view>
            
            <view
                class="login__info__item__input tn-flex tn-flex-direction-row tn-flex-nowrap tn-flex-col-center tn-flex-row-left">
                <view class="login__info__item__input__content">
                    <input maxlength="500" style="height: 40px;" v-model="cartcount" focus="true" placeholder-class="input-placeholder"
                         placeholder="请输入数量" />
                </view>
            </view>
            <view class="login__info__item__button tn-cool-bg-color-7--reverse" @tap="submitCheek()"
                hover-class="tn-hover" :hover-stay-time="150">更改库存</view>
        </view>
 
        <u-popup v-model="show" mode="bottom">
            <view class="">
                <u-checkbox-group>
                    <view v-for="(item, index) in list" :key="index" class="picker-item">
                        <u-checkbox @change="checkboxChange" v-model="item.checked" :name="item.name">
                            {{ item.name }}
                        </u-checkbox>
                    </view>
                </u-checkbox-group>
                <u-button @click="checkedAll">{{ labeat }}</u-button>
                <u-button @click="updateBarcodeModel" type="success" style="margin-top: 30px;">确定</u-button>
            </view>
        </u-popup>
        
        <u-popup v-model="dropdownOpen" mode="left">
            <button @tap="onButtonClick" class="input-button" style="margin-top: 30px;">加载全部</button>
            <view style="width: 180px;text-align: center;">
                <scroll-view scroll-y="true" >
                    <view v-for="(item, index) in selectorStation" :key="index" class="tag" @click="toggleSelection(item)"
                        :style="{ backgroundColor: selectedItems.includes(item) ? '#63f004' : '#999999', width: '80%',margin:'20px auto', borderRadius: '10px'   }">
                        {{ item }}
                    </view>
                </scroll-view>
            </view>
        </u-popup>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                labeat: "全选",
                // 输入框的值
                barcodemodel: '',
                cartnumber:'',
                barcode: '',
                stationName: '',
                show: false,
                istrue: true,
                cacheshow: false,
                stationshow: false,
                stashow:false,
                dropdownOpen:false,
                cartnme: '',
                cartcount: '',
                selectorStation: [],
                selectorStation2: [],
                selectedItems: [],
                stationtype:"",
                list: Array.from({
                    length: 17
                }, (_, index) => ({
                    name: (index + 1).toString().padStart(2, '0'), // 小于10的数字前加'0'
                    checked: false,
                    disabled: false
                }))
            }
        },
        mounted() {
            //this.SetCacheList2();
        },
        methods: {
            SetCacheList(stationId) {
                this.stationtype=stationId;
                this.selectorStation=[];
                this.$u.get("/api/Sys_Vehi/GetCacheList?traycode_code=" + stationId+"&barcode="+this.barcode).then(res => {
                    
                    this.selectorStation=res.data;
                });
            },
            toggleSelection(item) {
                const index = this.selectedItems.indexOf(item);
                if (index === -1) {
                    // 如果该项未选择,加入选择列表
                    this.selectedItems.push(item);
                } else {
                    // 如果该项已选择,移除它
                    this.selectedItems.splice(index, 1);
                }
                this.cartnme = this.selectedItems.join(', ');
            },
            SetCacheList2(barcode) {
                this.selectorStation2=[];
                this.$u.get("/api/Sys_Vehi/GetCachedata?traycode_code=" + barcode).then(res => {
                    if (res.data.length > 0) {
                        for (let i = 0; i < res.data.length; i++) {
                            this.selectorStation2.push({
                                stationName: res.data[i].vehiclename,
                                stationId: res.data[i].vehicleid
                            })
                        }
                    }
                });
            },
            onButtonClick() {
                if (this.barcode == '') {
                    this.$t.message.toast('托盘条码不能为空');
                    return
                }
                this.selectorStation=[];
                this.$u.get("/api/Sys_Vehi/GetdataLis?vehiclerpall="+this.stationtype).then(res => {
                    this.selectorStation=res.data;
                });
            },
            onButtonClick2() {
                this.selectorStation2=[];
                this.$u.get("/api/Sys_Vehicle/GetCachedatalst").then(res => {
                    if (res.data.length > 0) {
                        for (let i = 0; i < res.data.length; i++) {
                            this.selectorStation2.push({
                                stationName: res.data[i].vehiclename,
                                stationId: res.data[i].vehicleid
                            })
                        }
                    }
                });
            },
            ///条码
            barcodeInput: function(e) {
                this.barcode = e.detail.value;
                this.SetCacheList2(this.barcode);
            },
            //下料口
            stationConfirm(e) {
                uni.hideKeyboard(); //隐藏软键盘  
                let x = this.selectorStation[e];
                this.cartnme = x.cartnme
            },
            stationConfirm2(e) {
                uni.hideKeyboard(); //隐藏软键盘
                let x = this.selectorStation2[e];
                this.stationName = x.stationName
                this.SetCacheList(x.stationId);
            },
            //入库通知信息校验
            submitCheek() {
                if (this.barcode == '') {
                    this.$t.message.toast('托盘条码不能为空');
                    return
                }
                if (this.stationName == '') {
                    this.$t.message.toast('请选择车型');
                    return
                }
                if (this.cartnme == '') {
                    this.$t.message.toast('请选择名称');
                    return
                }
                if (this.cartcount == '') {
                    this.$t.message.toast('请输入数量');
                    return
                }
                if (this.barcodemodel == '') {
                    this.$t.message.toast('请选择型号');
                    return
                }
                if (this.cartnumber == '') {
                    this.$t.message.toast('请输入车组号');
                    return
                }
                // console.log(ip);
                this.$u.post("api/Task/RequestInboundPDA2", {
                    MainData: {
                        barcode: this.barcode,
                        stationName:this.stationName,
                        cartnme:this.cartnme,
                        cartcount:this.cartcount,
                        barcodemodel:this.barcodemodel,
                        cartnumber:this.cartnumber
                    }
                }).then(res => {
                    if(res.status){
                        this.barcode="";
                        this.stationName="";
                        this.cartnme="";
                        this.cartcount="";
                        this.barcodemodel="";
                        this.cartnumber="";
                    }
                    this.$t.message.toast(res.message);
                }).catch(err => {
 
                })
            },
 
            selectListmoder() {
                this.show = true;
            },
            // 每当复选框的选中状态发生变化时触发
            checkboxChange() {
                this.checkIfAllChecked(); // 检查是否全选
            },
            updateBarcodeModel() {
                const selectedItems = this.list.filter(item => item.checked).map(item => item.name);
                this.barcodemodel = selectedItems.join(", "); // 用逗号隔开
                this.show = false;
            },
            // 检查是否所有复选框都被选中
            checkIfAllChecked() {
                // 检查所有项的 checked 状态,如果都为 true,则全选
                const allChecked = this.list.every(item => item.checked);
 
                // 根据是否全选来更新按钮的文本
                this.labeat = allChecked ? "取消全选" : "全选";
            },
 
            // 点击全选/取消全选按钮时触发
            checkedAll() {
                // 如果已经全选,点击后取消所有选中
                const allChecked = this.labeat === "取消全选";
 
                // 根据状态来设置所有复选框的选中状态
                this.list.forEach(item => {
                    item.checked = !allChecked; // 如果全选,则取消选中;如果取消全选,则选中
                });
 
                // 更新按钮文本
                this.checkIfAllChecked();
            }
        },
        watch: {
            // 监听 list 的变化,以确保在复选框项的 checked 状态变化时更新按钮文本
            list: {
                handler() {
                    this.checkIfAllChecked();
                },
                deep: true
            }
        }
 
    }
</script>
 
<style lang="scss" scoped>
    .isnone {
        display: none;
        width: 100%;
    }
 
    .isnonone {
        width: 100%;
    }
    // @import '@/static/css/templatePage/custom_nav_bar.scss';
    /* 悬浮 */
    .rocket-sussuspension {
        animation: suspension 3s ease-in-out infinite;
    }
 
 
 
.login__info__item__input__content {
  display: flex; /* 使用 flex 布局 */
  flex-direction: row; /* 水平排列 */
  align-items: center; /* 垂直居中对齐 */
}
 
input {
  flex-grow: 1; /* 让输入框占据尽可能多的空间 */
  padding: 10px;
  font-size: 14px;
}
 
.input-button {
  width: 60px; /* 设置按钮的宽度 */
  height: 40px; /* 设置按钮的高度 */
  padding: 0;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px; /* 使按钮文字大小与输入框相匹配 */
  display: flex;
  justify-content: center;
  align-items: center;
  
}
 
.input-button:hover {
  background-color: #0056b3;
}
 
 
 
 
    @keyframes suspension {
 
        0%,
        100% {
            transform: translate(0, 0);
        }
 
        50% {
            transform: translate(-0.8rem, 1rem);
        }
    }
 
    .login {
        position: relative;
        height: 100%;
        z-index: 1;
 
        /* 背景图片 start */
        &__bg {
            z-index: -1;
            position: fixed;
 
            &--top {
                top: 0;
                left: 0;
                right: 0;
                width: 100%;
 
                .bg {
                    width: 750rpx;
                    will-change: transform;
                }
 
                .rocket {
                    margin: 50rpx 28%;
                    width: 400rpx;
                    will-change: transform;
                }
            }
 
            &--bottom {
                bottom: -10rpx;
                left: 0;
                right: 0;
                width: 100%;
                // height: 144px;
                margin-bottom: env(safe-area-inset-bottom);
 
                image {
                    width: 750rpx;
                    will-change: transform;
                }
            }
        }
 
        /* 背景图片 end */
 
        /* 内容 start */
        &__wrapper {
            margin-top: 403rpx;
            width: 100%;
        }
 
        /* 切换 start */
        &__mode {
            position: relative;
            margin: 0 auto;
            width: 476rpx;
            height: 77rpx;
            background-color: #FFFFFF;
            box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
            border-radius: 39rpx;
 
            &__item {
                height: 77rpx;
                width: 100%;
                line-height: 77rpx;
                text-align: center;
                font-size: 31rpx;
                color: #908f8f;
                letter-spacing: 1em;
                text-indent: 1em;
                z-index: 2;
                transition: all 0.4s;
 
                &--active {
                    font-weight: bold;
                    color: #FFFFFF;
                }
            }
 
            &__slider {
                position: absolute;
                height: inherit;
                width: calc(476rpx);
                border-radius: inherit;
                box-shadow: 0rpx 18rpx 72rpx 18rpx rgba(0, 195, 255, 0.1);
                z-index: 1;
                transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            }
        }
 
        /* 切换 end */
        .prop {
            width: 100%;
            height: 300px;
            background-color: #000;
            border: 1px solid #e3e3e3;
            z-index: 999;
            position: fixed;
            bottom: 0;
            border-top-left-radius: 20rpx;
            border-top-right-radius: 20rpx;
        }
 
        .g-picker-con {
            color: #333;
            font-size: 28rpx;
 
            .g-picker-operate {
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 80rpx;
                padding: 0 32rpx;
 
                text {
                    color: #999;
 
                    &:last-child {
                        color: #3c9cff;
                    }
                }
            }
 
            .g-picker-list {
                min-height: 30vh;
                max-height: 60vh;
                overflow-y: scroll;
 
                .g-picker-item {
                    position: relative;
                    width: 100%;
                    height: 80rpx;
 
                    .g-picker-item_label {
                        width: 66%;
                        margin: 0 auto;
                        text-align: center;
                        line-height: 80rpx;
                        white-space: nowrap;
                        text-overflow: ellipsis;
                        overflow: hidden;
                    }
 
                    .g-picker-item--actived {
                        font-weight: 600;
                    }
 
                    .g-picker-item_icon {
                        position: absolute;
                        top: 50%;
                        right: 40rpx;
                        transform: translateY(-50%);
                    }
                }
            }
        }
 
        /* 登录注册信息 start */
        &__info {
            margin: 0 30rpx;
            margin-top: 105rpx;
            padding: 30rpx 51rpx;
            padding-bottom: 0;
            border-radius: 20rpx;
            background-color: #ffff;
            box-shadow: 0rpx 10rpx 50rpx 0rpx rgba(0, 3, 72, 0.1);
 
            &__item {
 
                &__input {
                    margin-top: 59rpx;
                    width: 100%;
                    height: 100rpx;
                    border: 1rpx solid #E6E6E6;
                    border-radius: 39rpx;
 
                    &__left-icon {
                        width: 10%;
                        font-size: 44rpx;
                        margin-left: 20rpx;
                        color: #AAAAAA;
                    }
 
                    &__content {
                        width: 80%;
                        padding-left: 10rpx;
 
                        &--verify-code {
                            width: 56%;
                        }
 
                        input {
                            font-size: 48rpx;
                            // letter-spacing: 0.1em;
                        }
                    }
 
                    &__right-icon {
                        width: 10%;
                        font-size: 44rpx;
                        margin-right: 20rpx;
                        color: #AAAAAA;
                    }
 
                    &__right-verify-code {
                        width: 34%;
                        margin-right: 20rpx;
                    }
                }
 
                &__button {
                    margin-top: 75rpx;
                    margin-bottom: 39rpx;
                    width: 100%;
                    height: 77rpx;
                    text-align: center;
                    font-size: 48rpx;
                    font-weight: bold;
                    line-height: 77rpx;
                    letter-spacing: 1em;
                    text-indent: 1em;
                    border-radius: 39rpx;
                    box-shadow: 1rpx 10rpx 24rpx 0rpx rgba(60, 129, 254, 0.35);
                }
 
                &__tips {
                    margin: 30rpx 0;
                    color: #AAAAAA;
                }
            }
        }
 
        /* 登录注册信息 end */
 
        /* 登录方式切换 start */
        &__way {
            margin: 0 auto;
            margin-top: 110rpx;
 
            &__item {
                &--icon {
                    width: 77rpx;
                    height: 77rpx;
                    font-size: 50rpx;
                    border-radius: 100rpx;
                    margin-bottom: 18rpx;
                    position: relative;
                    z-index: 1;
 
                    &::after {
                        content: " ";
                        position: absolute;
                        z-index: -1;
                        width: 100%;
                        height: 100%;
                        left: 0;
                        bottom: 0;
                        border-radius: inherit;
                        opacity: 1;
                        transform: scale(1, 1);
                        background-size: 100% 100%;
                        background-image: url(https://tnuiimage.tnkjapp.com/cool_bg_image/icon_bg5.png);
                    }
                }
            }
        }
 
        /* 登录方式切换 end */
        /* 内容 end */
 
    }
 
    /deep/.input-placeholder {
        font-size: 24rpx;
        //color: #E6E6E6;
    }
 
    .picker-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: rgba(0, 0, 0, 0.5);
    }
 
    .picker-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
 
    .picker-content {
        width: 90%;
        height: 80%;
        background: #fff;
        border-radius: 10px;
        overflow-y: auto;
        padding: 10px;
    }
 
    .picker-item {
        display: flex;
        align-items: center;
        padding: 10px;
        border-bottom: 1px solid #eee;
    }
</style>