li-guang
2020-12-31 805546268abc5687dbefdd40cd927da62b096fad
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
<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>
    </view>
</template>
 
<script>
    export default{
        data(){
            return {
                goodsCode: '',
                startDate: '',
                endDate: '',
                list: []
            }
        },
        onLoad(options) {
            this.goodsCode = options.goodsCode;
            this.loadList()
        },
        methods:{
            startDateChange(e){
                this.startDate = e.detail.value;
                this.loadList()
            },
            endDateChange(e){
                this.endDate = e.detail.value;
                this.loadList()
            },
            loadList(){
                this.$httpUtils.request('/api/store/findGoodsInOutInfo', {
                    code: this.goodsCode,
                    pageNum: 1,
                    pageSize: 100,
                    startTime: this.startDate,
                    endTime: this.endDate
                }, 'POST').then((res) => {
                    if(res.status == 200){
                        this.list = res.rows;
                    }
                })
            }
        }
    }
</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>