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
<template>
    <view class="">
        <!-- <u-navbar back-text="" title="详情" :custom-back="back"></u-navbar> -->
        <view class="line">
            <text class="col7">出库任务单号:</text>
            <text class="ml10">{{code}}</text>
        </view>
        <view class="line">
            <text class="col7">创建时间:</text>
            <text class="ml10">{{$moment(doTime).format('YYYY-MM-DD hh:mm:ss')}}</text>
        </view>
        <view class="line">
            <text class="col7">出库口:</text>
            <text class="ml10">{{shipping}}</text>
        </view>
        <view class="line2">
            <view class="">
                <text class="col7">零件号:</text>
                <text class="ml10">{{pn}}</text>
            </view>
            <view class="">
                <text class="col7">零件名称:</text>
                <text class="ml10">{{partName}}</text>
            </view>
        </view>
        <view class="line">
            <text class="col7">目的地:</text>
            <text class="ml10">{{bourn}}</text>
        </view>
        <view class="line">
            <text class="col7">出库类型:</text>
            <text class="ml10">{{orderType}}</text>
        </view>
        <view class="line">
            <text class="col7">出库数量:</text>
            <text class="ml10">{{checkOutNum}}</text>
        </view>
        <!-- <view class="line">
            <text class="col7">总需求数量:</text>
            <text class="ml10">{{totalOutNum}}</text>
        </view> -->
        <view class="line">
            <text class="col7">任务状态:</text>
            <text class="ml10">{{orderStatus}}</text>
        </view>
        <view class="line">
            <text class="col7">完成时间:</text>
            <text class="ml10">{{$moment(updateTime).format('YYYY-MM-DD hh:mm:ss')}}</text>
        </view>
        <!-- <view class="line">
            <text class="col7">叉车工人:</text>
            <text class="ml10">{{applianceType}}</text>
        </view> -->
        <view class="fix">
            <button class="btn" @click="putOut">出库</button>
        </view>
    </view>
</template>
 
<script>
    import {
        out,
        add,
        CheckOutOrder
    } from '../../../api/putOut.js'
    import {
        part
    } from '../../../api/putIn.js'
    export default {
        data() {
            return {
                code: '', //任务单号
                shipping: '', //出货口
                pn: '', //零件编号
                partName: '', //零件名称
                bourn: '', //目的地
                checkOutNum: '', //出库数量
                orderType: '', //出库类型
                orderStatus: '', //任务状态 
                updateTime: '', //完成时间
                maxNum: '', //装箱数量
                erpOrderId: '', //ERP号
                doTime: '', //创建时间
                totalOutNum: '',
                id: '',
                list: [{
                    num: 51,
                    ship: '2号口'
                }, {
                    num: 64,
                    ship: '3号口'
                }, {
                    num: 67,
                    ship: '4号口'
                }, {
                    num: 34,
                    ship: '5号口'
                }, {
                    num: 30,
                    ship: '6号口'
                }, {
                    num: 19,
                    ship: '7号口'
                }, {
                    num: 12,
                    ship: '8号口'
                }, {
                    num: 997,
                    ship: '冲压出口'
                }, {
                    num: 999,
                    ship: '焊装出口'
                }]
            }
        },
        mounted() {
            this.out()
        },
        // onBackPress(e) {
        //     // 这里可以自定义返回逻辑,比如下面跳转其他页面
        //     uni.navigateTo({
        //         url: './plan'
        //     });
        //     // return true 表示禁止默认返回
        //     return true
        // },
        onLoad(options) {
            let val = JSON.parse(decodeURIComponent(options.val))
            this.code = val.outOrderCode
            this.dotime = val.doTime
            this.pn = val.ItemName
            this.shipping = val.tranLine
            this.bourn = val.productionLineName
            this.orderStatus = val.orderStatus
            this.partName = val.itemDes
            this.orderType = val.orderType
            this.checkOutNum = val.checkOutNum
            this.updateTime = val.updateTime
            this.totalOutNum = val.totalOutNum
            this.id = val.id
        },
        methods: {
            //fanhu
            back() {
                uni.navigateTo({
                    url: './plan'
                })
            },
            out() {
                let params = {
                    page: '1',
                    onePageNum: 40
                }
                out(params).then((res) => {
                    res.data.forEach(item => {
                        if (this.code === item.outOrderCode) {
                            this.list.forEach(i => {
                                if (item.tranLine == i.num) {
                                    this.shipping = i.ship
                                }
                            })
                            this.pn = item.itemName
                            this.partName = item.itemDes
                            this.bourn = item.productionLineName
                            this.orderType = item.orderType
                            this.checkOutNum = item.checkOutNum
                            this.orderStatus = item.orderStatus
                            this.updateTime = item.updateTime
                            this.erpOrderId = item.erpOrderId
                            this.doTime = item.doTime
                            this.num()
                        }
 
                    })
                })
            },
            num() {
                let params = {
                    page: '1',
                    itemName: this.pn,
                    onePageNum: 999
                }
                part(params).then((res) => {
                    this.maxNum = res.data[0].maxNum
                })
            },
            //出库页面
            putOut() {
                let params = {
                    page: '1',
                    id: this.id,
                }
                CheckOutOrder(params).then((res) => {
                    uni.navigateTo({
                        url: `./plan`
                    });
                })
 
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .line {
        height: 50px;
        border-bottom: 1px solid #eaeaea;
        padding-left: 3rem;
        font-size: 1rem;
        padding-right: 10px;
        display: flex;
        align-items: center;
    }
 
    .line2 {
        border-bottom: 1px solid #eaeaea;
        font-size: 1rem;
        line-height: 1.9rem;
        padding: 10px 10px 10px 3rem;
    }
 
    .fix {
        position: fixed;
        bottom: 10px;
        width: 100%;
        heigh: 45px;
 
        .btn {
            background-color: #1aac19;
            color: #fff;
            margin: 0 8px;
        }
    }
 
    .col7 {
        color: #777;
    }
 
    .ml10 {
        margin-left: 20px;
    }
</style>