skyouc
2025-01-11 b89f495ce0b028fc51456b9658a05572484a0f0a
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
<template>
    <view>
        <view class="view-bg">
            <uni-section title="播种位" type="line" />
            <uni-data-select v-model="value" :localdata="range" @change="change" style="padding: 20rpx; height: 100rpx;background-color: white;">
            </uni-data-select>
        </view>
        <view class="view-bg">
            <uni-section title="订单" type="line" />
            <input maxlength="10" placeholder="PDA扫描站点标签" v-model="orderNo"/>
        </view>
        <view class="view-bg">
            <uni-section title="容器" type="line" />
            <input maxlength="10" placeholder="PDA扫描托盘/料箱标签" v-model="barcode"/>
        </view>
        
        <view class="button-sp-buttom">
            <button class="btn-span" type="primary" @click="bindOrder">绑定</button>
            <button class="btn-span" type="default">解绑</button>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                value: 0,
                range: [],
                orderNo: '',
                barcode: ''
            }
        },
        
        onLoad () {
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
            this.getSeedLocs()
        },
        
        methods: {
            getSeedLocs() {
                let that = this
                uni.request({
                    url: this.baseUrl +  '/pda/pick/seed/locs',
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(res) {
                        let result = res.data;
                        if (result.code === 200) {
                            if (result.data != undefined && result.data.length > 0) {
                                let array = result.data
                                console.log(array)
                                that.range = array.map((item, index) => {
                                    return {text: item.siteNo, value: item.id}
                                })
                                console.log(that.range)    
                            }
                        }
                    }
                })
            },
            
            change(e) {
                console.log("e:", e);
            },
            //绑定订单至播种墙
            bindOrder() {
                let that = this
                uni.request({
                    url: that.baseUrl +  "/pda/pick/seed/bind",
                    data: {barcode: that.barcode, orderNo: that.orderNo, siteNo: '', type: 'bind'},
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(res) {
                        let result = res.data;
                        if (result.code === 200) {
                            
                        }
                    }
                })
            },
            //解绑 
            unbindOrder() {
                let that = this
                uni.request({
                    url: that.baseUrl +  "/pda/pick/seed/bind",
                    data: {barcode: that.barcode, orderNo: that.orderNo, siteNo: '', type: 'unbind'},
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(res) {
                        let result = res.data;
                        if (result.code === 200) {
                            
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
    @import url('../../static/css/wms.css/wms.css');
 
    .view-bg {
        background-color: white;
        
        input {
            padding: 30rpx;;
        }
        
        .uni-section__content-title {
            font-size: 16px;
        }
        
        .uni-section__head {
            .line {
                background-color: #007aff;
            }
        }
    }
    
    .button-sp-buttom {
        margin-top: 90rpx;
        padding: 40rpx;
        
        .btn-span {
            margin: 30rpx 20rpx;
        }
    }
</style>