LSH
2022-09-22 d6b5426ec33378fbe991beb7cec089fe7e8b2659
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
<template>
    <view >
        <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="content-combox">
                    <uni-combox  emptyTips="暂无数据" 
                        :candidates="sites" v-model="siteId"  @click="getInBound()" placeholder="请选择入库站点">
                    </uni-combox>
                </view>
        </view>
        <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="content-combox">
                <uni-combox  emptyTips="暂无数据"  v-model="bucketId"  placeholder="请选择桶类型">
                    <option  value="1">油桶</option>
                    <option  value="2">净桶</option>
                </uni-combox>
            </view> -->
        <!--     <v-select class="content-combox" v-model="bucketId" style="color:#716e7d;border-radius: 5px;">
                <option  value="">请选择桶类型</option>
                <option  value="1">油桶</option>
                <option  value="2">净桶</option>
            </v-select> -->
            <v-select v-model="bucketId"
            :options="bucket" 
            :options-label="'label'" 
            :options-value="'value'" ></v-select>
        </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="comb()">启动入库</button>
            </label>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                commonUrl:null,
                matnr:'',
                focus: true,
                matList: [],
                sites: [],
                siteId: '',
                count:0,
                // bucket:['油桶','净桶'],
                bucket:[
                        {
                            label:'油桶',
                            value:1
                        },
                        {
                            label:'净桶',
                            value:2
                        }
                    ],
                bucketId:'',
            }
        },
        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()
            this.getInBound();
        },
        methods: {
            // 获取url
            getUrl() {
                this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
            },
            // 清空input
            remove(e) {
                this[e] = ''
            },
            // 获取可用入库站点
            getInBound() {
                let that = this;
                uni.request({
                    url: that.commonUrl + "/available/put/site",
                    header: {'token':uni.getStorageSync('token')},
                    success(result) {
                        let res = result.data
                        if (res.code === 200 ) {
                            that.sites = [];
                            for (var i = 0; i < res.data.length; i++) {
                                that.sites.push(res.data[i])
                            }
                        } 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'})
                        }
                    }
                })
            },
            // 启动入库
            comb() {
                
                let that = this
                if (that.siteId == '') {
                    uni.showToast({title: "请选择入库口", icon: "none",position: 'top'})
                    return;
                }
                let buchid=0;
                if (that.bucketId == '') {
                    uni.showToast({title: "请选择桶类型", icon: "none",position: 'top'})
                    return;
                }else{
                    if(that.bucketId == '1'){
                        buchid=1;
                    }else if(that.bucketId == '2'){
                        buchid=2;
                    }else{
                        console.log(that.bucketId)
                        uni.showToast({title: "请选择正确桶类型", icon: "none",position: 'top'})
                        return;
                    }
                }
                uni.request({
                    url: that.commonUrl + '/empty/plate/in/start',
                    data: {
                        sourceStaNo: that.siteId,
                        bucket:buchid
                    },
                    method:"GET",
                    header: {
                        'token':uni.getStorageSync('token'),
                    },
                    success(result) {
                        var res = result.data
                        if (result.data.code === 200) {
                            uni.showToast({title: "入库启动成功,目标库位:" + res.data, icon: "none",position: 'top'})
                            that.resst()
                        } else {
                            uni.showToast({title: result.data.msg, icon: "none",position: 'top'})
                        }
                    }
                });
            },
            resst() {
                this.matnr = '';
                this.siteId = '';
                this.matList = [];
                this.bucketId='';
            },
        }
    }
</script>
 
<style>
    .color-block-blue {
        background-color: #1E9FFF;
        display: inline-block;
        float: left;
        margin: 15rpx 15rpx 0 15rpx;
        width: 12rpx;
        height: 40rpx;
        border: 5rpx solid #1E9FFF;
        border-radius: 20rpx;
    }
    .title {
        display: inline-block;
        float: left;
        font-size: 34rpx;
        font-weight: 700;
        height: 50rpx;
        line-height: 50rpx;
        margin-top: 10rpx;
    }
    .pda-btn1 {
        margin-left:260rpx;
        margin-right: auto;
        margin-top: 150rpx;
        width: 200rpx;
        height: 80rpx;
        font-size: 30upx;
        font-weight: bold;
    }
    .combox {
        width: 200px;
        padding: 12px;
    }
    .bg-false {
        background-color: #FFFFFF;
    }
    .bg-true {
        background-color: #ebebeb;
    }
    .data-list {
        border-bottom: 1px solid #d8d8d8;
        height: 180rpx;
        margin: 15rpx;
        border-radius: 20rpx;
    }
    .data-list:first-child {
        margin-top: 20rpx;
    }
    .data-list:last-child {
        margin-bottom: 120rpx;
    }
    .data-list-left {
        display: inline-block;
        float: left;
        margin-left: 6%;
        height: 180rpx;
        color: #676767;
    }
    .matnr {
        padding-top: 10rpx;
    }
    .data-list-right {
        display: inline-block;
        float: right;
        height: 180rpx;
        line-height: 180rpx;
    }
    .data-list-right label {
        display: inline-block;
        float: left;
        width: 80rpx;
        height: 180rpx;
    }
    .revise-box {
        width: 400rpx;
        height: 300rpx;
        border-radius: 25px;
    }
    .revise-box-top {
        width: 400rpx;
        height: 120rpx;
        border-radius: 25px;
    }
    .changeBox {
        width: 400rpx;
        height: 100rpx;
    }
    .num-box {
        margin-left: 100rpx;
    }
    .revise-box-buttom{
        margin-left: 130rpx;
    }
</style>