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
<template>
    <view class="wrap">
        <view class="search">
            <u-search v-model="query.transportsNo" @custom="search" @search="search" placeholder="货盘运输任务标识号"></u-search>
        </view>
        <scroll-view class="scroll-list" scroll-y="true" @scrolltolower="loadMore">
            <u-cell-group class="list" :border="false">
                <u-card :title="item.transportsNo" :sub-title="item.transportsNo" v-for="(item, index) in list" :key="item.id"
                    :index="item.id" @click="cardClick(item.id)" >
                    <view slot="head">
                        <view class="row-list">
                            <span class="span-lable">【任务标识号】{{item.transportsNo}}</span>
                        </view>
                    </view>
                    <view slot="body">
                        <view class="row-list">
                            <u-row justify="space-between">
                                <u-col span="4">
                                    <span class="span-lable">物料需求: </span>
                                </u-col>
                                <u-col span="4">
                                    <u-button type="primary" size="mini" style="height: 80rpx;line-height: 80rpx;width: 100rpx;" @click="requirePartClick(item.id)">查看</u-button>
                                </u-col>
                            </u-row>
                        </view>
                        <view class="row-list">
                            <u-row justify="space-between">
                                <u-col span="4">
                                    <span class="span-lable">移库明细: </span>
                                </u-col>
                                <u-col span="4">
                                    <u-button type="primary" size="mini" style="height: 80rpx;line-height: 80rpx;width: 100rpx;" @click="moveDetailClick(item.id)">查看</u-button>
                                </u-col>
                            </u-row>
                        </view>
                        
                        <view class="row-list">
                            <u-row justify="space-between">
                                <u-col span="4">
                                    <span class="span-lable">创建时间: </span>
                                </u-col>
                                <u-col span="7">
                                    <view><span class="span-lable">{{item.createTime}}</span></view>
                                </u-col>
                            </u-row>
                        </view>
                    </view>
                    
                </u-card>
            </u-cell-group>
            <view class="loadmore" @click="loadMore">
                <u-loadmore :status="loadStatus"></u-loadmore>
            </view>
        </scroll-view>
        
    </view>
</template>
<script>
    export default {
        data() {
            return {
                keywords: '',
                query: {
                    current: 1,
                    size: 20
                },
                list: [],
                count: 0,
                loadStatus: 'loadmore'
            };
        },
        onLoad() {
            this.loadList();
        },
        onShow() {
            /*if (uni.getStorageSync('refreshList') === true) {
                uni.removeStorageSync('refreshList');
                this.search('');
            }*/
        },
        methods: {
            moveDetailClick(id){
                uni.navigateTo({
                    url: '/pages/product/pick/moveDetailRecordList?id='+id
                })
            },
            requirePartClick(id) {
                uni.navigateTo({
                    url: '/pages/product/pick/requirePartRecordList?id='+id
                })
            },
            cardClick(id) {
                console.log('adasdad')
                uni.navigateTo({
                    url: '/pages/product/pick/materialTransfer?id=' + id
                })
            },
            loadMore() {
                this.loadStatus = "loading";
                setTimeout(() => {
                    this.query.current += 1;
                    this.loadList();
                }, 100);
            },
            loadList() {
                this.$u.api.palletTransports.page(this.query).then(res => {
                    if (!res.data.records || res.data.records.length == 0) {
                        this.loadStatus = "nomore";
                        return;
                    }
                    this.list = this.list.concat(res.data.records);
                    //this.total = res.data.total;
                    this.query.current = res.data.current;
                    this.query.size = res.data.size;
                    this.loadStatus = "loadmore";
                });
            },
            search(value) {
                this.list = [];
                this.query.current = 1;
                this.query.transportsNo = value;
                this.loadList();
            }
        }
    };
</script>