#
whycq
2024-03-26 fe65a15581b007a1f86400da8c62f541ef81ccd0
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
<template>
    <view>
        <view class="code">
            <uni-search-bar :focus="searchValueFocus" v-model="searchValue"  @input="searchValueInput()"
                maxlength="500" ancel="cancel" @clear="clear" placeholder="输入 / 扫描 订单号">
            </uni-search-bar>
        </view>
        <view class="list" style="background-color: #3eb689;color: #fff;" v-if="station">
            <view class="list-left">
                <view>站点编号:{{station.stationCode}}</view>
                <view>工位编号:{{station.devNo}}</view>
                <view>工位状态:{{station.locSts$}}</view>
                <view>条形码:{{station.barcode}}</view>
                <!-- <view class="card-id">{{i + 1}}</view> -->
            </view>
            <view class="list-right" @click="getOrderDetl(item)">
                <uni-icons type="right" color="#fff"></uni-icons>
            </view>
        </view>
        <view class="list" style="background-color: #019fe8;color: #fff;" v-if="wrkMast">
            <view class="list-left">
                <view>工作号:{{wrkMast.wrkNo}}</view>
                <view>工作状态:{{wrkMast.wrkSts$}}</view>
                <view>入出库类型:{{wrkMast.ioType$}}</view>
                <view>源库位:{{wrkMast.sourceLocNo}}</view>
                <view>目标库位:{{wrkMast.locNo}}</view>
                <view>料箱码:{{wrkMast.barcode}}</view>
                <!-- <view class="card-id">{{i + 1}}</view> -->
            </view>
            <!-- <view class="list-right" @click="getOrderDetl(item)">
                <uni-icons type="right" color="#fff"></uni-icons>
            </view> -->
        </view>
        
        <view class="list" style="background-color: #fda800;color: #fff;" v-for="wrkMast in wrkDetls">
            <view class="list-left">
                <view>物料号:{{wrkMast.matnr}}</view>
                <view>物料名称:{{wrkMast.maktx}}</view>
                <view>批号:{{wrkMast.batch}}</view>
                <view>规格:{{wrkMast.specs}}</view>
                <view>数量:{{wrkMast.anfme}}</view>
            </view>
        </view>
        
        <view style="height: 100rpx;"></view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                baseUrl: '',
                token: '',
                searchValueFocus: true,
                searchValue: '',
                station: '',
                wrkMast: '',
                wrkDetls: []
                
            }
        },
        onLoad() {
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
        },
        onShow() {
            
        },
        methods: {
            searchValueInput() {
                if (this.searchValue == '') {
                    this.station = ''
                    this.wrkMast = ''
                    this.wrkDetls = []
                } else {
                    this.getBasDevp()
                }
            },
            clear() {
                
            },
            // 获取暂存位
            getBasDevp() {
                let _this = this
                uni.request({
                    url: `${_this.baseUrl}/agv/basDevp/list/auth`,
                    header: {'token': uni.getStorageSync('token')},
                    data: {
                        curr: 1,
                        limit: 1000,
                        dev_no: _this.searchValue
                    },
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            for (let item of res.data.records) {
                                _this.station = item
                                _this.getWrkMast(item.barcode)
                            }
                        }
                    }
                })
            },
            // 获取工作档
            getWrkMast(barcode) {
                let _this = this
                uni.request({
                    url: `${_this.baseUrl}/agv/wrkMast/list/auth`,
                    header: {'token': uni.getStorageSync('token')},
                    data: {
                        curr: 1,
                        limit: 1000,
                        condition: barcode
                    },
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            for (let item of res.data.records) {
                                _this.wrkMast = item
                                _this.getWrkDetl(item.wrkNo)
                            }
                        }
                    }
                })
            },
            getWrkDetl(wrkNo) {
                let _this = this
                uni.request({
                    url: `${_this.baseUrl}/agv/wrkDetl/list/auth`,
                    header: {'token': uni.getStorageSync('token')},
                    data: {
                        curr: 1,
                        limit: 1000,
                        wrk_no: wrkNo
                    },
                    method: 'GET',
                    success(res) {
                        res = res.data
                        if (res.code === 200) {
                            _this.wrkDetls = res.data.records
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
    @import url('../../../static/css/common/order.css');
    .list-anfme {
        color: #0082ff;
        font-weight: bold;
    }
    .list-qty-1 {
        color: #33ba43;
        font-weight: bold;
    }
    .list-qty-2 {
        color: #e2231a;
        font-weight: bold;
    }
</style>