Browse Source

收银历史

cr 4 years ago
parent
commit
53bfb35b17

+ 12 - 0
src/pages.json

@@ -279,6 +279,18 @@
279 279
             "style": {
280 280
                 "navigationBarTitleText": "结算"
281 281
             }
282
+        },
283
+        {
284
+            "path": "pages/manage/cashier/list",
285
+            "style": {
286
+                "navigationBarTitleText": "历史单据"
287
+            }
288
+        },
289
+        {
290
+            "path": "pages/manage/cashier/detail",
291
+            "style": {
292
+                "navigationBarTitleText": "单据详情"
293
+            }
282 294
         }
283 295
     ]
284 296
 }

+ 166 - 0
src/pages/manage/cashier/detail.vue

@@ -0,0 +1,166 @@
1
+<template>
2
+    <div class="page">
3
+        <div class="head">
4
+            <!-- <section class="item">
5
+                <my-image class="img" src=""></my-image>
6
+                0002
7
+            </section>
8
+            <section class="item">
9
+                <my-image class="img" src=""></my-image>
10
+                非会员
11
+            </section> -->
12
+            <section class="item">
13
+                <my-image class="img" src=""></my-image>
14
+                {{ data.payRemark }}
15
+            </section>
16
+        </div>
17
+        <div class="goods">
18
+            <div class="good-head">
19
+                <div>
20
+                    {{ data.payTime }} 销售{{
21
+                        data.orderItems ? data.orderItems.length : 0
22
+                    }}件
23
+                </div>
24
+                <!-- <div>{{ data.tradeNo }}</div> -->
25
+            </div>
26
+            <ul class="good-list">
27
+                <li class="item" v-for="item of data.orderItems" :key="item.id">
28
+                    <div class="name">{{ item.productName }}</div>
29
+                    <div class="num">{{ item.count }}</div>
30
+                </li>
31
+            </ul>
32
+        </div>
33
+        <div class="other-info">
34
+            <section class="item">
35
+                <div>商品数量</div>
36
+                <div>{{ data.orderItems ? data.orderItems.length : 0 }}</div>
37
+            </section>
38
+            <section class="item">
39
+                <div>商品总额</div>
40
+                <div>¥{{ data.amount |  minuteToRmb2}}</div>
41
+            </section>
42
+            <!-- <section class="item">
43
+                <div>折扣</div>
44
+                <div>¥{{ (data.amount/100)*(data.discount/100) }}</div>
45
+            </section> -->
46
+            <section class="item color">
47
+                <div>应付</div>
48
+                <div>¥{{ data.payAmount | minuteToRmb2}}</div>
49
+            </section>
50
+        </div>
51
+
52
+        <div class="tool">
53
+
54
+        </div>
55
+    </div>
56
+</template>
57
+
58
+<script>
59
+import MyImage from "../../../components/image/index";
60
+
61
+export default {
62
+    name: "",
63
+    components: { MyImage },
64
+    filters: {},
65
+    // 数据
66
+    data() {
67
+        return {
68
+            pageIndex: 1,
69
+            pageSize: 20,
70
+            data: {},
71
+        };
72
+    },
73
+
74
+    onLoad(opts) {
75
+        console.log(opts);
76
+        this.getData(opts.orderNo);
77
+    },
78
+    async onShow() {},
79
+    // 函数
80
+    methods: {
81
+        getData(orderNo) {
82
+            this.api
83
+                .get("/Order/GetSettleDetail", {
84
+                    orderNo: orderNo,
85
+                })
86
+                .then((res) => {
87
+                    this.data = res.data;
88
+                });
89
+        },
90
+    },
91
+
92
+    // 数据计算
93
+    computed: {
94
+        user() {
95
+            return this.$store.state.user.user;
96
+        },
97
+    },
98
+
99
+    // 数据监听
100
+    watch: {},
101
+};
102
+</script>
103
+
104
+<style lang="scss" scoped>
105
+.head {
106
+    background-color: #fff;
107
+    .item {
108
+        min-height: px(110);
109
+        display: flex;
110
+        align-items: center;
111
+        padding: 0 px(35);
112
+        border-bottom: 1px solid #f1f1f1;
113
+        font-size: px(40);
114
+    }
115
+    .img {
116
+        width: px(45);
117
+        height: px(45);
118
+        flex-shrink: 0;
119
+        margin-right: px(30);
120
+        /deep/ img {
121
+            width: px(45);
122
+            height: px(45);
123
+        }
124
+    }
125
+}
126
+.goods{
127
+    margin-top: px(30);
128
+    .good-head {
129
+        display: flex;
130
+        align-items: center;
131
+        justify-content: space-between;
132
+        height: px(90);
133
+        padding: 0 px(35);
134
+        font-size: px(38);
135
+        color: #666;
136
+        border-bottom: 1px solid #efefef;
137
+        background-color: #faf7f2;
138
+    }
139
+    .good-list {
140
+        background-color: #fff;
141
+        .item {
142
+            border-bottom: 1px solid #f1f1f1;
143
+            padding: px(20) px(35);
144
+
145
+            min-height: px(160);
146
+            display: flex;
147
+            justify-content: space-between;
148
+            align-items: center;
149
+        }
150
+    }
151
+}
152
+.other-info {
153
+    margin-top: px(30);
154
+    background-color: #fff;
155
+    padding: px(35);
156
+    .item {
157
+        display: flex;
158
+        justify-content: space-between;
159
+        align-items: center;
160
+        padding: px(15) 0;
161
+    }
162
+}
163
+.color {
164
+    color: #0c89c9;
165
+}
166
+</style>

+ 128 - 0
src/pages/manage/cashier/list.vue

@@ -0,0 +1,128 @@
1
+<template>
2
+    <div class="page">
3
+        <ul class="list">
4
+            <li class="item" v-for="item of dataList" :key="item.id" @click="goDetail(item)">
5
+                <div class="main">
6
+                    <div class="trade-no">{{ item.tradeNo }}</div>
7
+                    <div class="info">
8
+                        共{{
9
+                            item.orderItems ? item.orderItems.length : 0
10
+                        }}件商品
11
+                        <span class="price">{{
12
+                            item.payAmount | minuteToRmb2
13
+                        }}元</span>
14
+                    </div>
15
+                    <div class="time">
16
+                        {{ item.payTime }}
17
+                    </div>
18
+                </div>
19
+                <div class="arrow">
20
+                    <my-image
21
+                        class="img"
22
+                        src="/static/common/arrows_left.png"
23
+                    ></my-image>
24
+                </div>
25
+            </li>
26
+        </ul>
27
+    </div>
28
+</template>
29
+
30
+<script>
31
+import MyImage from "../../../components/image/index";
32
+
33
+export default {
34
+    name: "",
35
+    components: { MyImage },
36
+    filters: {},
37
+    // 数据
38
+    data() {
39
+        return {
40
+            pageIndex: 1,
41
+            pageSize: 20,
42
+            dataList: [],
43
+        };
44
+    },
45
+
46
+    onLoad() {
47
+        this.getList();
48
+    },
49
+    async onShow() {},
50
+    // 函数
51
+    methods: {
52
+        getList() {
53
+            this.api
54
+                .get("/Order/GetSettleList", {
55
+                    pageIndex: this.pageIndex,
56
+                    pageSize: this.pageSize,
57
+                })
58
+                .then((res) => {
59
+                    let data = res.data;
60
+                    this.dataList = res.data.data;
61
+                });
62
+        },
63
+
64
+        goDetail(item){
65
+            this.router.push({
66
+                path:'/pages/manage/cashier/detail',
67
+                query:{
68
+                    orderNo:item.tradeNo
69
+                }
70
+            })
71
+        },
72
+    },
73
+
74
+    // 数据计算
75
+    computed: {
76
+        user() {
77
+            return this.$store.state.user.user;
78
+        },
79
+    },
80
+
81
+    // 数据监听
82
+    watch: {},
83
+};
84
+</script>
85
+
86
+<style lang="scss" scoped>
87
+.list {
88
+    .item {
89
+        padding: px(30) px(35);
90
+        font-size: px(40);
91
+        display: flex;
92
+        justify-content: space-between;
93
+        align-items: center;
94
+        & ~ .item {
95
+            border-top: 1px solid #efefef;
96
+        }
97
+    }
98
+    .trade-no {
99
+        color: #333;
100
+        font-size: px(44);
101
+    }
102
+    .info {
103
+        margin-top: px(15);
104
+        color: #999;
105
+    }
106
+    .price {
107
+        margin-left: px(10);
108
+        color: #0099cb;
109
+    }
110
+    .time {
111
+        font-size: px(36);
112
+        margin-top: px(10);
113
+        color: #999;
114
+    }
115
+    .arrow {
116
+        .img {
117
+            display: block;
118
+            width: px(40);
119
+            height: px(40);
120
+            transform: rotate(180deg);
121
+            /deep/ img {
122
+                width: px(40);
123
+                height: px(40);
124
+            }
125
+        }
126
+    }
127
+}
128
+</style>

+ 8 - 1
src/pages/manage/index.vue

@@ -45,10 +45,17 @@
45 45
                 <li class="item" @click="jump('/pages/manage/cashier/index')">
46 46
                     <my-image
47 47
                         class="img"
48
-                        src="/static/icon/user.png"
48
+                        src="/static/icon/cashier.png"
49 49
                     ></my-image>
50 50
                     <span class="text">收银</span>
51 51
                 </li>
52
+                <li class="item" @click="jump('/pages/manage/cashier/list')">
53
+                    <my-image
54
+                        class="img"
55
+                        src="/static/icon/cashier-list.png"
56
+                    ></my-image>
57
+                    <span class="text">历史单据</span>
58
+                </li>
52 59
               
53 60
             </ul>
54 61
         </div>

BIN
src/static/icon/cashier-list.png