spring
4 天以前 435881d494e2be4ba5ce8bfccb02d6ef49e07314
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
<template>
    <view class="wrap">
        <view>
            <view class="search">
                <u-search v-model="query.locationDesc" @custom="search" @search="search" placeholder="库位描述"></u-search>
            </view>
        <scroll-view class="scroll-list" scroll-y="true">
            <u-cell-group class="list" :border="false">
                <view class="content" v-for="(item, index) in locationList" :key="item.id" :index="index" @click="locationCardClick(item)">
                    <view class="row-list location-row">
                        <span class="span-lable">库位号: </span>{{ item.locationNo }}
                    </view>
                    <view class="row-list location-row">
                        <span class="span-lable">仓库: </span>{{ item.warehouseDesc }}
                    </view>
                    <view class="row-list location-row">
                        <span class="span-lable">库位描述: </span>{{ item.locationDesc }}
                    </view>
                    <view class="row-list location-row">
                        <span class="span-lable">库位类型: </span>{{ item.locationTypeDesc }}
                    </view>
                </view>
                <view v-if="locationList.length===0">
                    <view style="text-align: center;">
                        <span>未查询到IFS库位记录</span>
                    </view>
                </view>
            </u-cell-group>
        </scroll-view>
        </view>
        <!--<view style="position: absolute;bottom: 0">
            <view style="height: 50rpx;display: flex;align-items: flex-end;">
                <u-button type="success" text="库位扫码" size="medium"
                    :customStyle="{width:'750rpx',borderRadius:'0rpx'}" @click="scanLocationCodeClick()">库位扫码
                </u-button>
            </view>
        </view>-->
    </view>
</template>
<script>
    export default {
        data() {
            return {
                locationList: [],
                originList: [],
                query:{locationDesc:''}
            };
        },
        onLoad() {
               this.loadList();
        },
        onShow() {
            
        },
        methods: {
            loadList() {
                // 查询库位列表
                this.$u.api.ifsLocation.page(this.query).then(res => {
                    let _code =res.code
                    let _data =res.data
                    if(_code===0){
                              this.locationList = _data.map((item, index) => {
                                return {
                                  id: index + 1,
                                  locationNo: item.LOCATION_NO,
                                  locationDesc: item.LOCATION_DESC,
                                  locationGroupDesc: item.LOCATION_GROUP_DESC,
                                  locationTypeDesc: item.LOCATION_TYPE_DESC,
                                  warehouseDesc: item.WAREHOUSE_DESC
                                }
                              })
                              }else{
                                  this.locationList=[]
                              }
                })
            },
            search(value){
                this.locationList = [];
                this.query.locationDesc = value;
                this.loadList();
            },
            scanLocationCodeClick() {
                uni.scanCode({
                    scanType: ['qrCode'],
                    success: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                    },
                    fail: function() {
                        console.log('扫码失败');
                    }
                });
            },
            locationCardClick(task) {
                this.refreshLastPage(task)
            },
 
            //刷新上一个页面
            refreshLastPage(task) {
                // 告知 A.vue 更新数据
                // 获取页面栈
                let pages = getCurrentPages()
 
                // 获取上一页栈
                let prevPage = pages[pages.length - 2]
 
                // 触发上一页 upData 函数(并携带参数)
                prevPage.$vm.setMaterialLocation(task)
 
                // 返回上一页
                uni.navigateBack({
                    delta: 1
                })
            },
        }
    };
</script>
<style lang="scss">
    .list .content {
        font-size: 12px;
        background-color: #efefef;
        box-sizing: border-box;
        border-radius: 14rpx;
        margin: 8px;
        padding: 5px 10px;
        box-shadow: none;
    }
    .location-row{
        display: flex;
        justify-content:space-between;
    }
</style>