ke_junjie
2025-06-04 4bf0783db564f0d446c74d7b42242aff879b894c
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
<template>
    <view>
        <!-- <u-navbar back-text="" title="非计划出库"></u-navbar> -->
        <view class="search">
            <u-search placeholder="搜索任务单号" v-model="keyword" @search="list" @clear='list' input-align="center"
                bg-color="#fff" shape="square" :show-action="false"></u-search>
        </view>
        <u-dropdown>
            <u-dropdown-item v-model="value1" title="出库类型" :options="options1" @change="changeType"></u-dropdown-item>
            <u-dropdown-item v-model="value2" title="任务状态" :options="options2" @change="changeState"></u-dropdown-item>
        </u-dropdown>
        <view class="con">
            <u-card v-for="(item,index) in out" :key="index" class="card" @click="details(item,$event)">
                <view slot="head" class="title">
                    <text class="col777">出库任务单号:</text>
                    <text class="ml5">{{item.outOrderCode}}</text>
                    <view class="add ml5">
                        <text>{{item.orderStatus}}</text>
                    </view>
                </view>
                <view class="" slot="body" style="display: flex;justify-content: space-around;" class="body">
                    <view class="" style="width: 50%;">
                        <view>
                            <text class="col777">零件名称:</text>
                            <text class="ml5">{{item.itemDes}}</text>
                        </view>
                        <view>
                            <text class="col777">目的地:</text>
                            <text class="ml5">{{item.productionLineName}}</text>
                        </view>
                        <view>
                            <text class="col777">出库数量:</text>
                            <text class="ml5">{{item.checkOutNum}}</text>
                        </view>
                        <view>
                            <text class="col777">创建时间:</text>
                            <text class="ml5">{{$moment(item.updateTime).format('YYYY-MM-DD hh:mm:ss')}}</text>
                        </view>
                    </view>
                    <view class="" style="width: 50%;">
                        <view>
                            <text class="col777">零件编号:</text>
                            <text class="ml5">{{item.itemName}}</text>
                        </view>
                        <view>
                            <text class="col777">出库类型:</text>
                            <text class="ml5">{{item.orderType}}</text>
                        </view>
                        <!-- <view>
                                <text class="col777">叉车司机:</text>
                                <text class="ml5">{{item.inType}}</text>
                            </view> -->
                        <view>
                            <text class="col777">出库口:</text>
                            <text class="ml5">{{item.tranLine}}</text>
                        </view>
                    </view>
                </view>
            </u-card>
            <u-loadmore :status="status" />
        </view>
        <view class="fix">
            <button class="btn" @click="add">新建出库</button>
        </view>
        <u-back-top :scroll-top="scrollTop"></u-back-top>
    </view>
</template>
 
<script>
    import {
        out
    } from '../../../api/putOut.js'
    export default {
        data() {
            return {
                status: 'loadmore',
                page: 1,
                onePageNum: 10,
                keyword: '', // 任务单号
                out: [], //出库列表
                value1: 1,
                value2: 2,
                orderType: '',
                orderStatus: '',
                scrollTop: 0,
                options1: [{
                        label: '全部',
                        value: 1
                    }, {
                        label: '焊装出库',
                        value: 2
                    },
                    {
                        label: '空器具出库',
                        value: 3
                    },
                    {
                        label: '调件出库',
                        value: 4
                    },
                    {
                        label: '返修出库',
                        value: 5
                    },
                    {
                        label: '分拣区',
                        value: 6
                    }
                ],
                options2: [{
                        label: '全部',
                        value: 1,
                    }, {
                        label: '执行中',
                        value: 2,
                    },
                    {
                        label: '完成',
                        value: 3,
                    },
                    {
                        label: '新建',
                        value: 4,
                    }
                ],
                listnum: [{
                    num: 67,
                    ship: '4号口'
                }, {
                    num: 51,
                    ship: '2号口'
                }, {
                    num: 64,
                    ship: '3号口'
                }, {
                    num: 34,
                    ship: '5号口'
                }, {
                    num: 12,
                    ship: '8号口'
                }, {
                    num: 19,
                    ship: '7号口'
                }, {
                    num: 30,
                    ship: '6号口'
                }, {
                    num: 997,
                    ship: '冲压出口'
                }, {
                    num: 999,
                    ship: '焊装出口'
                }]
            }
        },
        //上拉加载
        onReachBottom() {
            let _self = this
            this.status = 'loading'
            // uni.showNavigationBarLoading()
            setTimeout(function() {
                _self.page++;
                // _self.status = 'more'
                _self.list();
                // uni.hideNavigationBarLoading()
            }, 2000);
 
        },
 
        mounted() {
            this.list()
        },
        onBackPress(options) {
            // 这里可以自定义返回逻辑,比如下面跳转其他页面
            if (options.from == 'navigateBack') {
                uni.switchTab({
                    url: '../../Home/index'
                });
            }
            if (options.from == 'backbutton') {
                uni.switchTab({
                    url: '../../Home/index'
                });
            }
            // return true 表示禁止默认返回
            return true
        },
        //下拉刷新
        onPullDownRefresh() {
            this.orderType = ''
            this.orderStatus = ''
            this.keyword = ''
            this.value1 = 1
            this.value2 = 1
            this.list()
            setTimeout(function() {
                uni.stopPullDownRefresh()
            }, 1000)
        },
        onPageScroll(e) {
            this.scrollTop = e.scrollTop;
        },
        methods: {
            // 出库计划
            list() {
                let _self = this
                let params = {
                    orderType: _self.orderType,
                    page: _self.page,
                    onePageNum: _self.onePageNum,
                    orderStatus: _self.orderStatus,
                    outOrderCode: _self.keyword,
                    isErp: 0,
                }
                out(params).then((res) => {
                    if (res.code == 0) {
                        if (_self.page != 1) {
                            if (res.data.result == '') {
                                _self.status = 'more'
                                return
                            }
                            _self.out = _self.out.concat(res.data)
                        } else {
                            _self.out = res.data
 
                        }
                        this.$forceUpdate()
                        _self.out.forEach(item => {
                            this.listnum.forEach(i => {
                                if (item.tranLine == i.num) {
                                    item.tranLine = i.ship
                                }
                            })
                        })
                    }
                })
            },
            //出货计划详情
            details(val, event) {
                uni.navigateTo({
                    url: `./details?code=${val.outOrderCode}`
                });
            },
            //新建非计划出库
            add() {
                uni.navigateTo({
                    url: './add_manual'
                });
            },
            changeType(val) {
                this.options1.forEach(i => {
                    if (val == 1) {
                        this.orderType = ''
                    } else if (val == i.value) {
                        this.orderType = i.label
                    }
                })
                this.list()
            },
            changeState(val) {
                if (val == 1) {
                    this.orderStatus = ""
                } else if (val == 2) {
                    this.orderStatus = "执行中"
                } else if (val == 3) {
                    this.orderStatus = "完成"
                } else if (val == 4) {
                    this.orderStatus = "新建"
                }
                this.list()
            }
        },
    }
</script>
 
<style lang="scss" scoped>
    .search {
        background-color: #f2f2f2;
        padding: 6px 8px;
    }
 
    .col777 {
        color: #777;
    }
 
    .ml5 {
        margin-left: 5px;
    }
 
    .fix {
        position: fixed;
        bottom: 0;
        width: 100%;
        height: 45px;
 
        .btn {
            background-color: #1aac19;
            color: #fff;
            margin: 0 10px;
        }
    }
 
    .con {
        margin-bottom: 45px;
    }
 
    .card {
        .title {
            display: flex;
            align-items: center;
            font-size: 1rem;
 
            .add {
                background-color: #cbfe8f;
                width: 3.8rem;
                border-radius: 5px;
                font-size: 0.8rem;
                padding: 0.3rem 0.4rem;
                text-align: center;
            }
        }
 
        .body {
            font-size: 0.9rem;
            color: #000;
            line-height: 2rem;
        }
    }
</style>