#
whycq
2024-04-15 e31f97952d112272fcb779fbd4763e40b349c675
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
<template>
    <view>
        <view>当前库位号:{{locNo}}</view>
        <view>当前货架码:{{barcode}}</view>
        
        <view>
            <view>实际库存</view>
            <view>库位号{{containerDetl.locNo}}</view>
            <view>货架码{{containerDetl.barcode}}</view>
            <view>库存品类{{containerDetl.count}}</view>
        </view>
        <view v-if="locDetlShow">
            <view>数据库存</view>
            <view>库位号{{locDetl.locNo}}</view>
            <view>货架码{{locDetl.barcode}}</view>
            <view>库存品类{{locDetl.count}}</view>
        </view>
        
        <!-- 底部操作按钮 -->
        <view class="buttom">
            <button size="mini" type="primary" @click="agvStart('warn')">纠正库位</button>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                baseUrl: '',
                token: '',
                locNo: '',
                barcode: '',
                containerDetl: {
                    locNo: '',
                    barcode: '',
                    count: ''
                },
                locDetl: {
                    locNo: '',
                    barcode: '',
                    count: ''
                },
                dataList: [],
                locDetlShow: false
            }
        },
        onShow() {
            let _this = this
            this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
            // const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('item', function(data) {
                console.log(data);
                _this.locNo = data.item.locNo
                _this.getLocDetl(data.item.locNo,data.item.barcode)
            })
        },
        methods: {
            getLocDetl(locNo,barcode) {
                let _this = this 
                let param = {locNo:locNo,containerCode: barcode}
                uni.request({
                    url: `${_this.baseUrl}/agvMobile/check/detl/v1`,
                    data: param,
                    method: 'POST',
                    success(res) {
                        res = res.data
                        console.log(res);
                        if (res.code === 200) {
                            _this.dataList = res.data.containerCode
                            if (res.data.containerCode[0].locNo) {
                                _this.containerDetl.locNo = res.data.containerCode[0].locNo
                                _this.containerDetl.barcode = res.data.containerCode[0].suppCode
                                _this.containerDetl.count = res.data.containerCode.length
                            }
                            if (res.data.locNo.length > 0) {
                                _this.locDetlShow = true
                            }
                            
                            
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
    @import url('../../../static/css/common/order.css');
</style>