- {item.goodName}
-
- ¥{item.originalMoney}
-
- x1份
-
- {item.order_Status === 0 ? '等待制作' : ''}
- {item.order_Status === 1 ? '制作中' : ''}
- {item.order_Status === 2 ? '等待取餐' : ''}
- {item.order_Status === 3 ? '取餐完成' : ''}
- {item.order_Status === 99998 ? '正常订单' : ''}
- {item.order_Status === 99999 ? '异常订单' : ''}
+ {/* 商品信息 */}
+
+
+ 商品信息
+
+
+ {
+ orderInfo.goodsInfo.map(item => {
+ return (
+
+
+
+
+
+ {item.goodsName || '暂无名称'}
+
+
+ ¥{item.memberPrice}
+
+
+ x{item.count}份
+
-
- )
- })
- }
-
- {/* 小计 */}
-
-
小计
-
-
优惠金额
-
¥{orderInfo.discountMoney}
+ )
+ })
+ }
-
-
支付金额
-
¥{orderInfo.orderRealMoney}
+ {/* 小计 */}
+
+
小计
+
+
优惠金额
+
¥{orderInfo.discountMoney}
+
+
+
支付金额
+
¥{orderInfo.orderRealMoney}
+
-
- {/* 售后信息 */}
-
-
- 售后信息
+ {/* 售后信息 */}
+
+
+ 售后信息
+
+
+ {
+ saleAfterInfo.map(item => {
+ return (
+
+
+ {item.createdAt} {item.stutasStr}
+
+
+ )
+ })
+ }
+
-
- {
- saleAfterInfo.map(item => {
- return (
-
-
- {item.createdAt} {item.stutasStr}
-
-
- )
- })
- }
-
-
+
+
)
}
diff --git a/src/pages/order/order-report-detail/index.less b/src/pages/order/order-report-detail/index.less
index f6a5d24..474bef4 100644
--- a/src/pages/order/order-report-detail/index.less
+++ b/src/pages/order/order-report-detail/index.less
@@ -18,10 +18,10 @@
width: 0;
height: 0;
top: 0;
- left: 70px;
- border-top: 25px solid transparent;
- border-bottom: 25px solid transparent;
- border-left: 25px solid rgb(88, 91, 110);
+ left: 50px;
+ border-top: 20px solid transparent;
+ border-bottom: 20px solid transparent;
+ border-left: 20px solid rgb(88, 91, 110);
}
.order-number {
@@ -29,23 +29,23 @@
align-items: center;
justify-content: center;
position: absolute;
- width: 90px;
- height: 50px;
+ width: 70px;
+ height: 40px;
left: -20px;
top: 0;
background-color: rgb(88, 91, 110);
color: #FFF;
- font-size: 35px;
+ font-size: 26px;
}
.order-cook-state {
- font-size: 30px;
- margin-left: 130px;
+ font-size: 22px;
+ margin-left: 100px;
margin-right: 20px;
}
.order-cook-date {
- font-size: 20px;
+ font-size: 16px;
color: rgb(246, 152, 38);
}
@@ -55,18 +55,9 @@
}
.member-info-img {
- width: 100px;
- height: 100px;
margin-right: 20px;
}
-.member-info-img img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- border-radius: 50%;
-}
-
.member-info-row {
display: flex;
flex-direction: column;
@@ -74,12 +65,12 @@
}
.member-info-head {
- font-size: 30px;
+ font-size: 22px;
margin-right: 10px;
}
.member-info-label {
- font-size: 20px;
+ font-size: 16px;
color: #999;
}
@@ -98,20 +89,20 @@
}
.member-info-prefix {
- font-size: 20px;
+ font-size: 16px;
color: rgb(88, 91, 110);
margin-right: 10px;
}
.member-info-suffix {
- font-size: 20px;
+ font-size: 16px;
color: #222;
}
// 备餐状态
.prepare-meals {
margin-top: 20px;
- font-size: 20px;
+ font-size: 16px;
color: #222;
}
@@ -125,7 +116,7 @@
}
.goods-title {
- font-size: 30px;
+ font-size: 22px;
font-weight: 700;
margin-bottom: 10px;
}
@@ -135,62 +126,19 @@
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
- font-size: 20px;
+ font-size: 16px;
color: #222;
}
-.goods-item-img {
- width: 80px;
- height: 80px;
-}
-
-.goods-item-img img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- border-radius: 10px;
-}
-
-.product-show-state {
- border: 1px solid;
- padding: 0px 30px;
-}
-
-.product-show-0 {
- border-color: #51A97D;
- color: #51A97D;
-}
-
-.product-show-1 {
- border-color: #F84352;
- color: #F84352;
-}
-
-.product-show-2 {
- border-color: #800080;
- color: #800080;
-}
-
-.product-show-3 {
- border-color: #4169E1;
- color: #4169E1;
-}
-
-.product-show-99999,
-.product-show-99998 {
- border-color: #FFA500;
- color: #FFA500;
-}
-
// 小计
.goods-calc {
padding-top: 10px;
border-top: 1px dashed #dedede;
- font-size: 20px;
+ font-size: 16px;
}
.goods-calc-title {
- font-size: 20px;
+ font-size: 16px;
font-weight: 700;
}
@@ -198,7 +146,7 @@
display: flex;
align-items: center;
justify-content: space-between;
- font-size: 20px;
+ font-size: 16px;
}
.goods-calc-pay .goods-calc-sufix {
@@ -207,7 +155,7 @@
// 订单信息
.sale-after-line {
- font-size: 18px;
+ font-size: 16px;
}
@media screen and (min-width: 1200px) {
@@ -219,7 +167,6 @@
background-color: #FFF;
width: 49.5%;
box-sizing: border-box;
- margin-bottom: 10px;
}
}
@@ -232,6 +179,5 @@
background-color: #FFF;
width: 100%;
box-sizing: border-box;
- margin-bottom: 10px;
}
}
\ No newline at end of file
diff --git a/src/pages/order/order-report-detail/service.js b/src/pages/order/order-report-detail/service.js
new file mode 100644
index 0000000..bc9b448
--- /dev/null
+++ b/src/pages/order/order-report-detail/service.js
@@ -0,0 +1,9 @@
+import { request } from 'umi';
+
+export default {
+ getOrderReporByNumber(orderNumber) {
+ return request(`/kitchen/api/report-statistics/order-info-report/${orderNumber}`, {
+ method: 'GET',
+ });
+ }
+};
diff --git a/src/pages/order/order-report/index.jsx b/src/pages/order/order-report/index.jsx
index dcd0de6..d8cf635 100644
--- a/src/pages/order/order-report/index.jsx
+++ b/src/pages/order/order-report/index.jsx
@@ -1,27 +1,122 @@
-import React from 'react';
+import React, { useState, useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
-import { Button, Card, DatePicker } from 'antd';
+import { Button, Card, DatePicker, Table, message, Pagination, Space } from 'antd';
import styles from './index.less';
const { RangePicker } = DatePicker;
+import orderReportAPI from "./service";
+import moment from 'moment';
+import { history } from "umi";
+
+const columns = [
+ {
+ title: '店铺名称',
+ dataIndex: 'shopName',
+ key: 'shopName',
+ },
+ {
+ title: '原价(¥)',
+ dataIndex: 'orderOriginalMoney',
+ key: 'orderOriginalMoney',
+ },
+ {
+ title: '优惠(¥)',
+ dataIndex: 'discountMoney',
+ key: 'discountMoney',
+ },
+ {
+ title: '实际支付(¥)',
+ dataIndex: 'orderRealMoney',
+ key: 'orderRealMoney',
+ },
+ {
+ title: '创建时间',
+ dataIndex: 'createdAt',
+ key: 'createdAt',
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (_, record) => (
+
+ {
+ history.push({
+ pathname: '/order/order-report/order-report-detail',
+ query: {
+ orderNumber: record.orderNumber
+ }
+ });
+ }}>详情
+
+ ),
+ },
+];
+
/**
* 订单报表
* @returns
*/
export default function Index() {
+ //订单报表列表
+ const [orderReportList, setOrderReportList] = useState([]);
+ const [current, setCurrent] = useState(1);
+ const [pageSize, setPageSize] = useState(10);
+ const [total, setTotal] = useState(0);
+
+ const [timeRange, setTimeRange] = useState([
+ moment(moment(new Date(Date.now() - 24 * 60 * 60 * 1000 * 7)).format('YYYY-MM-DD 00:00:00')),
+ moment(moment(new Date(Date.now())).format('YYYY-MM-DD 23:59:59')),
+ ]); //日期选择器
+
+ useEffect(() => {
+ onQueryOrderReportList();
+ }, [current, pageSize]);
+
+
+
+ //获取订单列表
+ const onQueryOrderReportList = async () => {
+ const jsonData = {
+ current,
+ pageSize
+ }
+ const response = await orderReportAPI.getOrderReportList(jsonData);
+ if (response.statusCode === 200) {
+ setOrderReportList(response.data.data);
+ setTotal(response.data.total)
+ } else {
+ message.error(response.errors || '获取订单报表列表失败');
+ }
+ }
+
+ //页码变化
+ const onPageChange = (current, pageSize) => {
+ setCurrent(current);
+ setPageSize(pageSize);
+ }
+
return (
-
+
{
+ let tempDate = [
+ moment(moment(new Date(dateStrings[0])).format('YYYY-MM-DD 00:00:00')),
+ moment(moment(new Date(dateStrings[1])).format('YYYY-MM-DD 23:59:59')),
+ ]
+ setTimeRange(tempDate);
+ }} />
-
+
- 订单报表
+
+
)
diff --git a/src/pages/order/order-report/index.less b/src/pages/order/order-report/index.less
index 74d0c92..9487917 100644
--- a/src/pages/order/order-report/index.less
+++ b/src/pages/order/order-report/index.less
@@ -12,5 +12,9 @@
margin-left: 20px;
}
-.table-card {
+.table-page {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ height: 50px;
}
\ No newline at end of file
diff --git a/src/pages/order/order-report/service.js b/src/pages/order/order-report/service.js
new file mode 100644
index 0000000..11107ef
--- /dev/null
+++ b/src/pages/order/order-report/service.js
@@ -0,0 +1,10 @@
+import { request } from 'umi';
+
+export default {
+ getOrderReportList(data) {
+ return request(`/kitchen/api/report-statistics/order-report`, {
+ method: 'Post',
+ data: data,
+ });
+ }
+};