pang.jiabao
2025-04-11 162b3abda98bf6c33d60e0846b54febade343274
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
<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="square-content">
                <view class="content-input">
                    <input type="text" v-model="billNo" placeholder="扫码 / 输入" @input="searchBillNo" placeholder-style="line-height:  85rpx;">
                    <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBillNo"></uni-icons>
                </view>
            </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="暂无数据" 
                        :candidates="sites" v-model="siteId"  @click="staNoSelect()" placeholder="请选择出库站点">
                    </uni-combox>
                </view>
        </view>
        
        <view class="square-1">
            <view class="square-title">
                <view class="title-sign"><view class="sign"></view></view>
                <view class="title-text"><text>商品列表</text></view>
            </view>
            
        </view>
        
        <view class="square-none" v-show="matList.length === 0">
            <view class="v-show">Нет дополнительных данных...</view>
        </view>
        
        <checkbox-group @change="checkbox">
            <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
                <!-- <label class="left-check-box">
                    <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
                </label> -->
                <view class="data-list-left">
                    <view class="matnr"><text style="width: 700rpx;">编码:{{item.matnr}}</text></view>
                    <view><text style="width: 700rpx;">品名:{{item.maktx}}</text></view>
                    <view><text style="width: 700rpx;">批号:{{item.batch}}</text></view>
                    <view>
                        <text style="width: 700rpx;">数量:{{item.anfme}}</text>
                    </view>
                </view>
                <view class="data-list-right">
                    <!-- <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> -->
                    <!-- list中删除键 -->
                    <!-- <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> -->
                </view>
            </view>
        </checkbox-group>
      <!--  <view style="margin-top: 10px;">
            <uni-table ref="table" border stripe emptyText="反选</text>">
                <uni-tr>
                    <uni-th align="center" width="50">出库数量</uni-th>
                    <uni-th align="center" width="70">产品ID</uni-th>
                    <uni-th align="center" width="80">产品代号</uni-th>
                    <uni-th align="center" width="70">产品名称</uni-th>
                </uni-tr>
                <uni-tr v-for="(item, index) in matList" :key="index">
                    <uni-td align="center">{{item.qty}}</uni-td>
                    <uni-td align="center">{{item.matNo}}</uni-td>
                    <uni-td align="center">{{item.size}}</uni-td>
                    <uni-td align="center">{{item.matName}}</uni-td>
                </uni-tr>
            </uni-table>
        </view> -->
        
        <!-- 底部按钮 -->
        <view class="footer flex justify-around">
            <!-- 底部全选 反选按钮 -->
            <!-- <label class="label-btn" style="width: 170rpx;">
                <checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
            </label>
            <label class="label-btn" style="width: 100rpx;">
                <text  @click="reChecked()">反选</text>
            </label> -->
            
            <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="outbound()">启动出库</button>
            </label>
        </view>
        
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                commonUrl:null,
                billNo: '',
                matList: [],
                sites: [],
                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()
            this.staNoSelect();
        },
        methods: {
            // 获取url
            getUrl() {
                this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
            },
            // 清空单号搜索框
            removeBillNo() {
                this.billNo = null
            },
            searchBillNo() {
                let that = this;
                uni.request({
                    url: that.commonUrl + "/orderDetl/list/auth",
                    header: {
                        'content-type':"application/x-www-form-urlencoded",
                        'token':uni.getStorageSync('token')
                        },
                    data: {
                        curr:1,
                        limit:10,
                        // typeCode:1,
                        order_no: that.billNo
                    },
                    method:"POST",
                    success(result) {
                        let res = result.data
                        if (res.code === 200 ) {
                            if (res.data) {
                                that.matList = res.data.records
                                that.staNoSelect()
                            } else {
                                that.matList = []
                            }
                        } 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'})
                        }
                    },
                })
            },
            staNoSelect() {
                let that = this;
                uni.request({
                    url: that.commonUrl + "/available/take/site",
                    header: {'token':uni.getStorageSync('token')},
                    success(result) {
                        console.log(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].desc)
                            }
                        } 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'})
                        }
                    }
                })
            },
            outbound() {
                let that = this
                if (that.matList.length === 0) {
                    uni.showToast({title: "请选择出库口", icon: "none",position: 'top'})
                } else {
                    if (that.siteId == '') {
                        uni.showToast({title: "请选择出库口", icon: "none",position: 'top'})
                        return;
                    }
                };
                var staNo = that.siteId.substring(0,3)
                var locDetls = [];
                that.matList.forEach(function(elem) {
                    locDetls.push({billNo:elem.billNo,seqNo:elem.seqNo, matNo: elem.matNo, count: elem.qty,});
                });
                let param = {
                    outSite: staNo,
                    locDetls: locDetls
                }
                console.log(param)
                // return
                uni.request({
                    url: that.commonUrl + "/mobile/order/out/pakout/auth",
                    header: {
                        'token':uni.getStorageSync('token')},
                    // data: JSON.stringify(param),
                    data: {
                            staNo: staNo,
                            orderNo: that.billNo
                        },
                    method:"POST",
                    success(result) {
                        console.log(result)
                        if (result.data.code === 200) {
                            uni.showToast({title: result.data.msg, icon: "none",position: 'top'})
                            that.resst()
                        } else {
                            uni.showToast({title: result.data.msg, icon: "none",position: 'top'})
                        }
                    }
                })
            },
            resst() {
                this.billNo = '';
                this.matList = [];
                this.siteId = '';
            }
        }
    }
</script>
 
<style>
    .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;
        width: 94%;
        margin: 15rpx auto 15rpx auto;
        border-radius: 20rpx;
    }
    .data-list:first-child {
        margin-top: 20rpx;
    }
    .data-list:last-child {
        margin-bottom: 160rpx;
    }
    /* .data-list-left {
        display: inline-block;
        float: left;
        text-align: center;
        width: 100rpx;
        height: 180rpx;
        line-height: 180rpx;
    } */ 
    .left-check-box {
        display: inline-block;
        /* background-color: #1E9FFF; */
        float: left;
        height: 100%;
        width: 100rpx;
        text-align: center;
        line-height: 170rpx;
    }
    .data-list-left {
        /* background-color: #ffff7f; */
        display: inline-block;
        float: left;
        height: 180rpx;
        width: 500rpx;
        color: #676767;
        text-indent: 20rpx;
    }
    .matnr {
        padding-top: 10rpx;
    }
    .data-list-right {
        /* background-color: #55ffff; */
        display: inline-block;
        float: right;
        width: 100rpx;
        height: 180rpx;
        line-height: 180rpx;
    }
    .data-list-right label {
        display: inline-block;
        float: left;
        width: 100rpx;
        height: 180rpx;
    }
    .revise-box {
        width: 500rpx;
        height: 500rpx;
    }
    .revise-box-top {
        width: 100%;
        height: 100rpx;
        background-color: #fff;
        padding: 10rpx;
    }
    .changeBox {
        width: 100%;
        height: 100rpx;
        line-height: 120rpx;
        text-align: center;
        background-color: #FFF;
        margin-top: 20rpx;
        border-bottom: 1px solid #e3e3e3;
    }
    .text-box {
        width: 100%;
        height: 100rpx;
        line-height: 120rpx;
        text-align: center;
        /* padding-left: 120rpx; */
        background-color: #FFF;
        margin-top: 20rpx;
        border-bottom: 1px solid #e3e3e3;
    }
    .changeBox .num-box {
        display:  inline-block;
        float: left;
    }
    .changeBox button {
        float: left;
    }
    .revise-box-buttom {
        position: absolute;
        width: 100%;
        height: 100rpx;
        line-height: 100rpx;
        background-color: #FFFFFF;
        bottom: 0;
        text-align: center;
    }
</style>