#
whycq
2024-12-12 c299f99d637eb8f30b7571979bf710c3bcd74ee8
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
<template>
    <view>
        <scroll-view scroll-y>
            <!-- 托盘码窗口 -->
            <view class="square-2">
                <view class="square-title">
                    <view class="title-sign"><view class="sign"></view></view>
                    <view class="title-text"><text>托盘条码</text></view>
                </view>
                <view class="square-content">
                    <view class="content-input">
                        <input v-model="barcode" type="text" placeholder="扫码 / 输入" 
                        :focus="barcodeFocus" placeholder-style="line-height:  85rpx;">
                        <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
                    </view>
                </view>
            </view>
        </scroll-view>
        <!-- 底部按钮 -->
        <view class="footer flex justify-around">
            <label class="label-btn" style="width: 150rpx;">
                <button class="cu-btn" @click="resst()">重置</button>
            </label>
            <label class="label-btn">
                <button class="cu-btn bg-blue " @click="startPaking()">入库</button>
            </label>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                commonUrl: null,
                barcode: null,
                barcodeFocus: true,
                matList:[],
                sites: [2,4,5,7,9,11,13,15],
                siteId: '',
            }
        },
        mounted(){
            const UIP = uni.getStorageSync('UIP');
            this.baseIP = UIP;
            const UPORT = uni.getStorageSync('UPORT');
            this.basePORT = UPORT
            const PROJ = uni.getStorageSync('UPROJ');
            this.baseUrl = PROJ
            this.getUrl()
        },
        methods: {
            // 获取url
            getUrl() {
                this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
            },
            startPaking() {
                uni.showLoading({})
                let that = this 
                uni.request({
                    url: that.commonUrl + "/open/asrs/wrk/pickback",
                    data: {barcode:that.barcode},
                    method: 'GET',
                    header: {
                        'token':uni.getStorageSync('token')
                    },
                    success(result) {
                        console.log(result);
                        var res = result.data 
                        if (res.code === 200) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            uni.hideLoading()
                        } else if (res.code == 403) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
</style>