fix
Helius
2021-02-20 45fb4b11ad51bb38306765b11a6747402e382cee
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
<template>
    <!-- 出入库记录 -->
    <view>
        <view class="header">
            <view class="header-time mr-20">
                <picker mode="date" @change="startDateChange">
                    <text :class="startDate?'blue':'gray'">{{startDate?startDate:'请选择开始日期'}}</text>
                </picker>
            </view>
            <text class="iconfont iconjian"></text>
            <view class="header-time ml-20">
                <picker mode="date" @change="endDateChange">
                    <text :class="endDate?'blue':'gray'">{{endDate?endDate:'请选择结束日期'}}</text>
                </picker>
            </view>
        </view>
        <view class="content">
            <view class="content-row" v-for="item in list">
                <view class="content-row-header">
                    <text>{{item.createTime}}</text>
                </view>
                <view class="content-row-con">
                    <view class="font-15 flex align-center justify-between mb-10">
                        <text>{{item.content}}</text>
                        <text :class="item.amount<0?'red':'green'">{{item.amount<0?item.amount:'+'+item.amount}}</text>
                    </view>
                    <text class="gray">订单编号: {{item.orderNo}}</text>
                </view>
            </view>
            <view v-if="list.length">
                <uni-load-more :status="loadStatus" color="#a5abaf"></uni-load-more>
            </view>
        </view>
    </view>
</template>
 
<script>
    import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
    export default{
        components:{
            uniLoadMore
        },
        data(){
            return {
                goodsCode: '',
                startDate: '',
                endDate: '',
                list: [],
                loadStatus: 'more',
                pageNum: 1
            }
        },
        onLoad(options) {
            this.goodsCode = options.goodsCode;
            this.loadList()
        },
        onPullDownRefresh(){
            this.reloadData();
            let timer = setTimeout(function () {
                uni.stopPullDownRefresh();
                clearTimeout(timer);
                timer = null;
            }, 800);
        },
        onReachBottom(){
            this.loadList()
        },
        methods:{
            reloadData(){
                this.list = [];
                this.pageNum = 1;
                this.loadStatus = 'more';
                this.loadList();
            },
            startDateChange(e){
                this.startDate = e.detail.value;
                this.reloadData()
            },
            endDateChange(e){
                this.endDate = e.detail.value;
                this.reloadData()
            },
            loadList(){
                if(this.loadStatus!=='more'){
                    return;
                }
                this.$httpUtils.request('/api/store/findGoodsInOutInfo', {
                    code: this.goodsCode,
                    pageNum: this.pageNum,
                    pageSize: 10,
                    startTime: this.startDate,
                    endTime: this.endDate
                }, 'POST').then((res) => {
                    if(res.status == 200){
                        let result = res.rows;
                        if(result.length < 10){
                            this.loadStatus = 'noMore';
                        } else {
                            this.pageNum ++ ;
                            this.loadStatus = 'more';
                        }
                        this.list = this.list.concat(result);
                    }
                })
            }
        }
    }
</script>
 
<style>
    page{
        background: #F6F6F8;
        position: relative;
    }
    .header{
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        left: 0;
        right: 0;
        margin-top: -10px;
        background: #FFFFFF;
        padding: 10px 0;
        box-shadow:0 6px 6px rgba(237,234,244,0.5);
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
    }
    .header-time{
        border: 1px solid #EDEAF4;
        border-radius: 4px;
        padding: 5px 0;
        width: 120px;
        text-align: center;
        font-size: 14px;
    }
    .content{
        padding: 44px 10px 10px;
    }
    .content-row{
        margin-top: 10px;
        background: #FFFFFF;
        border: 1px solid #EDEAF4;
        border-radius: 4px;
        padding: 0 10px;
        box-shadow:0 6px 6px rgba(237,234,244,0.5);
    }
    .content-row .content-row-header{
        padding: 10px 0;
        border-bottom: 1px solid #EDEAF4;
        font-size: 13px;
    }
    .content-row-con{
        padding: 10px 0;
        font-size: 13px;
    }
</style>