From 2d1e224dfab6d4416c903ac2c4bb897948b10ade Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 22 Jun 2022 16:06:44 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=90=A5=E9=94=80?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 6 + src/pages/order/order-market-report/index.jsx | 484 ++++++++++++++++++ .../order/order-market-report/index.less | 16 + 3 files changed, 506 insertions(+) create mode 100644 src/pages/order/order-market-report/index.jsx create mode 100644 src/pages/order/order-market-report/index.less diff --git a/config/routes.js b/config/routes.js index 4fec1eb..c8d1589 100644 --- a/config/routes.js +++ b/config/routes.js @@ -586,6 +586,12 @@ export default [ component: './order/exOrder', access: 'k31', }, + { + name: '营销报表', + path: '/order/order-market-report', + component: './order/order-market-report', + access: 'k31', + }, ], }, { diff --git a/src/pages/order/order-market-report/index.jsx b/src/pages/order/order-market-report/index.jsx new file mode 100644 index 0000000..debb786 --- /dev/null +++ b/src/pages/order/order-market-report/index.jsx @@ -0,0 +1,484 @@ +import React from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Table, Card, DatePicker } from 'antd'; +import styles from './index.less'; + +const { RangePicker } = DatePicker; +const columns = [ + { + title: '时间', + dataIndex: 'date', + key: 'date', + width: 170, + align: 'center', + fixed: 'left' + }, + { + title: '店铺', + dataIndex: 'storeName', + key: 'storeName', + width: 170, + align: 'center', + fixed: 'left', + filters: [ + { + text: '四川黑菠萝科技', + value: '四川黑菠萝科技', + }, + { + text: '四川白菠萝科技', + value: '四川白菠萝科技', + } + ], + onFilter: (value, record) => record.storeName.indexOf(value) === 0, + }, + { + title: '营收', + dataIndex: 'revenue', + key: 'revenue', + children: [ + { + title: '营业额', + dataIndex: 'turnover', + key: 'turnover', + children: [ + { + title: '流水', + dataIndex: 'flowingWater', + key: 'flowingWater', + width: 100, + align: 'center', + }, + { + title: '实收', + dataIndex: 'netReceipts', + key: 'netReceipts', + width: 100, + align: 'center', + }, + ] + }, + { + title: '优惠明细', + dataIndex: 'discountDetails', + key: 'discountDetails', + children: [ + { + title: '会员价', + dataIndex: 'membershipPrice', + key: 'membershipPrice', + width: 100, + align: 'center', + }, + { + title: '优惠券', + dataIndex: 'coupon', + key: 'coupon', + width: 100, + align: 'center', + }, + { + title: '活动', + dataIndex: 'activity', + key: 'activity', + width: 100, + align: 'center', + } + ] + }, + ] + }, + { + title: '分类营收', + dataIndex: 'classifiedRevenue', + key: 'classifiedRevenue', + children: [ + { + title: '外卖营业额', + dataIndex: 'takeOutTurnover', + key: 'takeOutTurnover', + children: [ + { + title: '外卖营收', + dataIndex: 'takeOutRevenue', + key: 'takeOutRevenue', + width: 100, + align: 'center', + }, + { + title: '美团外卖', + dataIndex: 'meituanTakeout', + key: 'meituanTakeout', + width: 100, + align: 'center', + }, + { + title: '饿了么外卖', + dataIndex: 'hungryTakeOut', + key: 'hungryTakeOut', + width: 100, + align: 'center', + }, + ] + }, + { + title: '食堂营收', + dataIndex: 'canteenRevenue', + key: 'canteenRevenue', + children: [ + { + title: '堂食流水', + dataIndex: 'freshWaterInTheHall', + key: 'freshWaterInTheHall', + width: 100, + align: 'center', + }, + { + title: '堂食实收', + dataIndex: 'paidInFood', + key: 'paidInFood', + width: 100, + align: 'center', + } + ] + }, + { + title: '第三方平台营收', + dataIndex: 'thirdPartyPlatformRevenue', + key: 'thirdPartyPlatformRevenue', + children: [ + { + title: '大众点评', + dataIndex: 'publicComments', + key: 'publicComments', + width: 100, + align: 'center', + }, + { + title: '口碑', + dataIndex: 'wordOfMouth', + key: 'wordOfMouth', + width: 100, + align: 'center', + }, + { + title: '抖音', + dataIndex: 'tiktok', + key: 'tiktok', + width: 100, + align: 'center', + } + ] + }, + ] + }, + { + title: '堂食单价', + dataIndex: 'unitPriceCanteenFood', + key: 'unitPriceCanteenFood', + children: [ + { + title: '客单价', + dataIndex: 'customerUnitPrice', + key: 'customerUnitPrice', + children: [ + { + title: '流水单价', + dataIndex: 'unitPriceOfWater', + key: 'unitPriceOfWater', + width: 100, + align: 'center', + }, + { + title: '实收单价', + dataIndex: 'paidInUnitPrice', + key: 'paidInUnitPrice', + width: 100, + align: 'center', + } + ] + }, + { + title: '单单价', + dataIndex: 'singleUnitPrice', + key: 'singleUnitPrice', + children: [ + { + title: '流水单价', + dataIndex: 'singleUnitPriceOfWater', + key: 'singleUnitPriceOfWater', + width: 100, + align: 'center', + }, + { + title: '实收单价', + dataIndex: 'singlePaidInUnitPrice', + key: 'singlePaidInUnitPrice', + width: 100, + align: 'center', + } + ] + }, + ] + }, + { + title: '交易笔数', + dataIndex: 'numberOfTransactions', + key: 'numberOfTransactions', + children: [ + { + title: '现金', + dataIndex: 'numCash', + key: 'numCash', + width: 100, + align: 'center', + }, + { + title: '微信支付', + dataIndex: 'numWechatPayment', + key: 'numWechatPayment', + width: 100, + align: 'center', + }, + { + title: '大众点评', + dataIndex: 'numPublicComments', + key: 'numPublicComments', + width: 100, + align: 'center', + }, + { + title: '口碑', + dataIndex: 'numWordOfMouth', + key: 'numWordOfMouth', + width: 100, + align: 'center', + }, + { + title: '抖音', + dataIndex: 'numTiktok', + key: 'numTiktok', + width: 100, + align: 'center', + }, + { + title: '美团外卖', + dataIndex: 'numMeituanTakeout', + key: 'numMeituanTakeout', + width: 100, + align: 'center', + }, + { + title: '饿了么外卖', + dataIndex: 'numHungryTakeOut', + key: 'numHungryTakeOut', + width: 100, + align: 'center', + }, + ] + }, + { + title: '收入构成', + dataIndex: 'revenueComposition', + key: 'revenueComposition', + children: [ + { + title: '收入来源', + dataIndex: 'sourceOfIncome', + key: 'sourceOfIncome', + children: [ + { + title: '会员', + dataIndex: 'incomeMember', + key: 'incomeMember', + width: 100, + align: 'center', + }, + { + title: '非会员', + dataIndex: 'incomeNonMember', + key: 'incomeNonMember', + width: 100, + align: 'center', + }, + { + title: '外卖', + dataIndex: 'incomeTakeOut', + key: 'incomeTakeOut', + width: 100, + align: 'center', + }, + { + title: '团购', + dataIndex: 'incomeGroupPurchase', + key: 'incomeGroupPurchase', + width: 100, + align: 'center', + }, + ] + }, + { + title: '收入结构', + dataIndex: 'revenueStructure', + key: 'revenueStructure', + children: [ + { + title: '微信支付', + dataIndex: 'incomeWechatPay', + key: 'incomeWechatPay', + width: 100, + align: 'center', + }, + { + title: '现金支付', + dataIndex: 'incomeCashPay', + key: 'incomeCashPay', + width: 100, + align: 'center', + }, + { + title: '大众点评', + dataIndex: 'incomePublicComments', + key: 'incomePublicComments', + width: 100, + align: 'center', + }, + { + title: '口碑', + dataIndex: 'incomeWordOfMouth', + key: 'incomeWordOfMouth', + width: 100, + align: 'center', + }, + { + title: '抖音', + dataIndex: 'incomeTiktok', + key: 'incomeTiktok', + width: 100, + align: 'center', + }, + { + title: '美团外卖', + dataIndex: 'incomeMeituan', + key: 'incomeMeituan', + width: 100, + align: 'center', + }, + { + title: '饿了么外卖', + dataIndex: 'incomeHungry', + key: 'incomeHungry', + width: 100, + align: 'center', + }, + ] + }, + ] + } +] + +/** + * 营销报表 + * @returns + */ +export default function Index() { + + const data = [ + { + date: '2022-6-22 14:01:53', + storeName: '四川黑菠萝科技', + flowingWater: 10010, + netReceipts: 8848, + membershipPrice: 6000, + coupon: 2848, + activity: 998, + takeOutRevenue: 10086, + meituanTakeout: 5500, + hungryTakeOut: 5600, + freshWaterInTheHall: 10010, + paidInFood: 10010, + publicComments: 8000, + wordOfMouth: 1000, + tiktok: 2000, + unitPriceOfWater: 68, + paidInUnitPrice: 70, + singleUnitPriceOfWater: 99, + singlePaidInUnitPrice: 88, + numCash: 10, + numWechatPayment: 100, + numPublicComments: 99, + numWordOfMouth: 88, + numTiktok: 77, + numMeituanTakeout: 66, + numHungryTakeOut: 55, + incomeMember: 50, + incomeNonMember: 50, + incomeTakeOut: 70, + incomeGroupPurchase: 90, + incomeWechatPay: 10, + incomeCashPay: 30, + incomePublicComments: 20, + incomeWordOfMouth: 50, + incomeTiktok: 30, + incomeMeituan: 80, + incomeHungry: 100 + }, + { + date: '2022-6-22 15:58:43', + storeName: '四川白菠萝科技', + flowingWater: 10010, + netReceipts: 8848, + membershipPrice: 6000, + coupon: 2848, + activity: 998, + takeOutRevenue: 10086, + meituanTakeout: 5500, + hungryTakeOut: 5600, + freshWaterInTheHall: 10010, + paidInFood: 10010, + publicComments: 8000, + wordOfMouth: 1000, + tiktok: 2000, + unitPriceOfWater: 68, + paidInUnitPrice: 70, + singleUnitPriceOfWater: 99, + singlePaidInUnitPrice: 88, + numCash: 10, + numWechatPayment: 100, + numPublicComments: 99, + numWordOfMouth: 88, + numTiktok: 77, + numMeituanTakeout: 66, + numHungryTakeOut: 55, + incomeMember: 50, + incomeNonMember: 50, + incomeTakeOut: 70, + incomeGroupPurchase: 90, + incomeWechatPay: 10, + incomeCashPay: 30, + incomePublicComments: 20, + incomeWordOfMouth: 50, + incomeTiktok: 30, + incomeMeituan: 80, + incomeHungry: 100 + } + ]; + + return ( + + +
+ +
+ + +
+
+
+ + +
+
+
+ ) +} diff --git a/src/pages/order/order-market-report/index.less b/src/pages/order/order-market-report/index.less new file mode 100644 index 0000000..74d0c92 --- /dev/null +++ b/src/pages/order/order-market-report/index.less @@ -0,0 +1,16 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-card { +} \ No newline at end of file From 81caaa06c43453e57755b1edc5358601b57b276c Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 22 Jun 2022 16:25:51 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E3=80=81=E8=90=A5=E6=94=B6=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E4=BA=A7=E5=93=81=E6=8A=A5=E8=A1=A8=E3=80=81=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 24 ++++++++++++++++ .../order/order-member-statement/index.jsx | 28 +++++++++++++++++++ .../order/order-member-statement/index.less | 16 +++++++++++ .../order/order-product-report/index.jsx | 28 +++++++++++++++++++ .../order/order-product-report/index.less | 16 +++++++++++ src/pages/order/order-report/index.jsx | 28 +++++++++++++++++++ src/pages/order/order-report/index.less | 16 +++++++++++ .../order/order-revenue-statement/index.jsx | 28 +++++++++++++++++++ .../order/order-revenue-statement/index.less | 16 +++++++++++ 9 files changed, 200 insertions(+) create mode 100644 src/pages/order/order-member-statement/index.jsx create mode 100644 src/pages/order/order-member-statement/index.less create mode 100644 src/pages/order/order-product-report/index.jsx create mode 100644 src/pages/order/order-product-report/index.less create mode 100644 src/pages/order/order-report/index.jsx create mode 100644 src/pages/order/order-report/index.less create mode 100644 src/pages/order/order-revenue-statement/index.jsx create mode 100644 src/pages/order/order-revenue-statement/index.less diff --git a/config/routes.js b/config/routes.js index c8d1589..a05b309 100644 --- a/config/routes.js +++ b/config/routes.js @@ -592,6 +592,30 @@ export default [ component: './order/order-market-report', access: 'k31', }, + { + name: '订单报表', + path: '/order/order-report', + component: './order/order-report', + access: 'k31', + }, + { + name: '营收报表', + path: '/order/order-revenue-statement', + component: './order/order-revenue-statement', + access: 'k31', + }, + { + name: '产品报表', + path: '/order/order-product-report', + component: './order/order-product-report', + access: 'k31', + }, + { + name: '会员报表', + path: '/order/order-member-statement', + component: './order/order-member-statement', + access: 'k31', + }, ], }, { diff --git a/src/pages/order/order-member-statement/index.jsx b/src/pages/order/order-member-statement/index.jsx new file mode 100644 index 0000000..8c62138 --- /dev/null +++ b/src/pages/order/order-member-statement/index.jsx @@ -0,0 +1,28 @@ +import React from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +/** + * 会员报表 + * @returns + */ +export default function Index() { + + return ( + + +
+ +
+ + +
+
+
+ + 会员报表 + +
+ ) +} diff --git a/src/pages/order/order-member-statement/index.less b/src/pages/order/order-member-statement/index.less new file mode 100644 index 0000000..74d0c92 --- /dev/null +++ b/src/pages/order/order-member-statement/index.less @@ -0,0 +1,16 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-card { +} \ No newline at end of file diff --git a/src/pages/order/order-product-report/index.jsx b/src/pages/order/order-product-report/index.jsx new file mode 100644 index 0000000..253aa3b --- /dev/null +++ b/src/pages/order/order-product-report/index.jsx @@ -0,0 +1,28 @@ +import React from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +/** + * 产品报表 + * @returns + */ +export default function Index() { + + return ( + + +
+ +
+ + +
+
+
+ + 产品报表 + +
+ ) +} diff --git a/src/pages/order/order-product-report/index.less b/src/pages/order/order-product-report/index.less new file mode 100644 index 0000000..74d0c92 --- /dev/null +++ b/src/pages/order/order-product-report/index.less @@ -0,0 +1,16 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-card { +} \ No newline at end of file diff --git a/src/pages/order/order-report/index.jsx b/src/pages/order/order-report/index.jsx new file mode 100644 index 0000000..dcd0de6 --- /dev/null +++ b/src/pages/order/order-report/index.jsx @@ -0,0 +1,28 @@ +import React from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +/** + * 订单报表 + * @returns + */ +export default function Index() { + + return ( + + +
+ +
+ + +
+
+
+ + 订单报表 + +
+ ) +} diff --git a/src/pages/order/order-report/index.less b/src/pages/order/order-report/index.less new file mode 100644 index 0000000..74d0c92 --- /dev/null +++ b/src/pages/order/order-report/index.less @@ -0,0 +1,16 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-card { +} \ No newline at end of file diff --git a/src/pages/order/order-revenue-statement/index.jsx b/src/pages/order/order-revenue-statement/index.jsx new file mode 100644 index 0000000..c2e0ebd --- /dev/null +++ b/src/pages/order/order-revenue-statement/index.jsx @@ -0,0 +1,28 @@ +import React from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +/** + * 营收报表 + * @returns + */ +export default function Index() { + + return ( + + +
+ +
+ + +
+
+
+ + 营收报表 + +
+ ) +} diff --git a/src/pages/order/order-revenue-statement/index.less b/src/pages/order/order-revenue-statement/index.less new file mode 100644 index 0000000..74d0c92 --- /dev/null +++ b/src/pages/order/order-revenue-statement/index.less @@ -0,0 +1,16 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-card { +} \ No newline at end of file From 4fbc9f2a989c50bcb2ff0d1588285cc8c66eced9 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 22 Jun 2022 17:21:44 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E8=90=A5=E9=94=80=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=88=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-market-report/index.jsx | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/pages/order/order-market-report/index.jsx b/src/pages/order/order-market-report/index.jsx index debb786..259adbe 100644 --- a/src/pages/order/order-market-report/index.jsx +++ b/src/pages/order/order-market-report/index.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; import { Button, Table, Card, DatePicker } from 'antd'; import styles from './index.less'; @@ -383,7 +383,7 @@ const columns = [ */ export default function Index() { - const data = [ + const [data, setData] = useState([ { date: '2022-6-22 14:01:53', storeName: '四川黑菠萝科技', @@ -462,7 +462,37 @@ export default function Index() { incomeMeituan: 80, incomeHungry: 100 } - ]; + ]) + + useEffect(() => { + calcTotal(); + }, []); + + const calcTotal = () => { + const originData = JSON.parse(JSON.stringify(data)); + const totalData = {} + data.forEach(dataObj => { + Object.keys(dataObj).forEach(key => { + if (key === 'date') { + totalData.date = '合计'; + } else if (key == 'storeName') { + totalData.storeName = ''; + } else if (typeof dataObj[key] === 'number') { + if (totalData[key] && typeof totalData[key] === 'number') { + totalData[key] += dataObj[key]; + } else { + totalData[key] = 0; + totalData[key] += dataObj[key]; + } + } else { + totalData[key] = '暂无统计' + } + }); + }); + originData.push(totalData); + console.log('originData', originData); + setData(originData); + } return ( From 47ceaf75959fd3543cd5c2ba7c21adbf16434fab Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Thu, 23 Jun 2022 14:49:44 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 6 + src/pages/order/order-report-detail/index.jsx | 213 ++++++++++++++++ .../order/order-report-detail/index.less | 231 ++++++++++++++++++ 3 files changed, 450 insertions(+) create mode 100644 src/pages/order/order-report-detail/index.jsx create mode 100644 src/pages/order/order-report-detail/index.less diff --git a/config/routes.js b/config/routes.js index a05b309..2df949c 100644 --- a/config/routes.js +++ b/config/routes.js @@ -598,6 +598,12 @@ export default [ component: './order/order-report', access: 'k31', }, + { + name: '订单报表详情', + path: '/order/order-report-detail', + component: './order/order-report-detail', + access: 'k31', + }, { name: '营收报表', path: '/order/order-revenue-statement', diff --git a/src/pages/order/order-report-detail/index.jsx b/src/pages/order/order-report-detail/index.jsx new file mode 100644 index 0000000..aefa3a0 --- /dev/null +++ b/src/pages/order/order-report-detail/index.jsx @@ -0,0 +1,213 @@ +import React, { useState } from 'react'; +import { Button, Card, Image, Timeline } from 'antd'; +import styles from './index.less'; +import { ExclamationCircleOutlined } from '@ant-design/icons'; +/** + * 订单详情 + * @returns + */ +export default function Index() { + + const [orderInfo, setOrderInfo] = useState({ + id: '1008611', + sortId: '99', //取餐号 + orderDetail: [ //订单商品列表 + { + id: 'cda34f2c-7965-46ef-8517-0bc6fae87a71', + goodName: '牛肉面', + goodImg: 'https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee//goods/132969698918875531.jpg', + order_Status: 3, + originalMoney: 0.03 + }, + { + id: 'cda34f2c-7965-46ef-8517-0bc6fae87a72', + goodName: '姜鸭面', + goodImg: 'https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee//goods/132969698918875531.jpg', + order_Status: 3, + originalMoney: 0.03 + }, + ], + discountMoney: 0.02, //优惠金额 + orderRealMoney: 0.01, //支付金额 + orderNumber: '202205201022415338172', + createdAt: '2022-05-20 02:22:41', + orderSourceFrom: 0, //桌号 + payMode: 0 //支付方式 + }); + + const [memberInfo, setMemberInfo] = useState({ + id: '4fb28567-8294-4dfc-b2ca-485dc1310837', + nickName: 'Emperor_', + phone: '18200000000', + headImgUrl: 'https://thirdwx.qlogo.cn/mmopen/vi_32/Tnw5gbRSiaekqqHYERFT4x8o8GSkkBINuStbvml530FYjyeO2EKSYouKCAZLHBX3PDLLYInn130vwda6Y3gK0yA/132', + createAt: '2022-05-18 11:20:44', + address: '四川省 成都市 高新区 环球中心9-11B' + }); + + const [saleAfterInfo, setSaleAfterInfo] = useState([ + { + id: "acc670f8-317f-4c2d-94f5-f7af12c80ebd", + createdAt: "2022-05-18 07:52:09", + stutasStr: "待处理" + }, + { + id: "acc670f8-317f-4c2d-94f5-f7af12c80eb1", + createdAt: "2022-05-18 09:52:09", + stutasStr: "已退款" + }, + ]); + + return ( +
+ {/* 用户基本信息 */} +
+
+
+ #{orderInfo.sortId} +
+
+ 立即制作 +
+
+ 2022-6-23 10:36:42 前制作完成 +
+
+
+
+ 用户头像 +
+
+
+ {memberInfo.nickName} +
+
+ #门店新客 + #门店会员 +
+
+
+
+ + 为保证服务体验,您在拨打或接听隐私号电话时,可能被录音 +
+
+ + 顾客电话 + + + {memberInfo.phone} + +
+
+ + 顾客地址 + + + {memberInfo.address} + +
+
+
+ 备餐状态 +
+
+ 制作中 +
+
+
+ {/* 订单数据 */} +
+
+ 订单信息 +
+
+
订单编号
+
{orderInfo.orderNumber}
+
+
+
支付方式
+
{orderInfo.payMode === 0 ? '微信支付' : '其他支付'}
+
+
+
下单时间
+
{orderInfo.createdAt}
+
+
+
就餐人数
+
商家按餐量提供
+
+
+
桌台号码
+
{orderInfo.orderSourceFrom}
+
+
+ {/* 商品信息 */} +
+
+ 商品信息 +
+
+ { + orderInfo.orderDetail.map(item => { + return ( +
+
+ 商品图片 +
+
+ {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.discountMoney}
+
+
+
支付金额
+
¥{orderInfo.orderRealMoney}
+
+
+
+ {/* 售后信息 */} +
+
+ 售后信息 +
+ + { + 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 new file mode 100644 index 0000000..98d768c --- /dev/null +++ b/src/pages/order/order-report-detail/index.less @@ -0,0 +1,231 @@ +.order-detail-container { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.order-head-card, .goods-card { + padding: 20px; + background-color: #FFF; + width: 50%; + box-sizing: border-box; +} + +.order-head { + display: flex; + align-items: center; + position: relative; + height: 50px; + margin-bottom: 10px; +} + +.order-head::before { + position: absolute; + content: ''; + 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); +} + +.order-number { + display: flex; + align-items: center; + justify-content: center; + position: absolute; + width: 90px; + height: 50px; + left: -20px; + top: 0; + background-color: rgb(88, 91, 110); + color: #FFF; + font-size: 35px; +} + +.order-cook-state { + font-size: 30px; + margin-left: 130px; + margin-right: 20px; +} + +.order-cook-date { + font-size: 20px; + color: rgb(246 , 152, 38); +} + +// 用户信息 +.member-info { + display: flex; +} +.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; + justify-content: center; +} + +.member-info-head { + font-size: 30px; + margin-right: 10px; +} + +.member-info-label { + font-size: 20px; + color: #999; +} + +.member-info-label span { + margin-right: 10px; +} + +.member-info-privacy { + margin: 10px 0; + font-size: 16px; + color: rgb(88, 91, 110); +} + +.member-info-privacy span { + margin-left: 10px; +} + +.member-info-prefix { + font-size: 20px; + color: rgb(88, 91, 110); + margin-right: 10px; +} + +.member-info-suffix { + font-size: 20px; + color: #222; +} + +// 备餐状态 +.prepare-meals { + margin-top: 20px; + font-size: 20px; + color: #222; +} + +.prepare-meals-title { + font-weight: 700; +} + +// 商品信息 +.goods-card { + // margin-top: 20px; +} + +.goods-title { + font-size: 30px; + font-weight: 700; + margin-bottom: 10px; +} + +.goods-item { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + font-size: 20px; + 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; +} + +.goods-calc-title { + font-size: 20px; + font-weight: 700; +} + +.goods-calc-item { + display: flex; + align-items: center; + justify-content: space-between; + font-size: 20px; +} + +.goods-calc-pay .goods-calc-sufix { + color: #F84352; +} + +// 订单信息 +.order-base-card { + width: 49%; + background-color: #FFF; + padding: 20px; + box-sizing: border-box; +} + +.sale-after-card { + margin-top: 20px; + width: 49%; + background-color: #FFF; + padding: 20px; + box-sizing: border-box; +} + +.sale-after-line { + font-size: 18px; +} \ No newline at end of file From 3e28b8da2ee6cc7379c67d0f6e743b91c92a93f6 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Thu, 23 Jun 2022 15:50:04 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AA=92=E4=BD=93?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/order-report-detail/index.less | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/src/pages/order/order-report-detail/index.less b/src/pages/order/order-report-detail/index.less index 98d768c..f6a5d24 100644 --- a/src/pages/order/order-report-detail/index.less +++ b/src/pages/order/order-report-detail/index.less @@ -4,13 +4,6 @@ flex-wrap: wrap; } -.order-head-card, .goods-card { - padding: 20px; - background-color: #FFF; - width: 50%; - box-sizing: border-box; -} - .order-head { display: flex; align-items: center; @@ -53,13 +46,14 @@ .order-cook-date { font-size: 20px; - color: rgb(246 , 152, 38); + color: rgb(246, 152, 38); } // 用户信息 .member-info { display: flex; } + .member-info-img { width: 100px; height: 100px; @@ -177,12 +171,13 @@ color: #800080; } -.product-show-3 { +.product-show-3 { border-color: #4169E1; color: #4169E1; } -.product-show-99999, .product-show-99998{ +.product-show-99999, +.product-show-99998 { border-color: #FFA500; color: #FFA500; } @@ -211,21 +206,32 @@ } // 订单信息 -.order-base-card { - width: 49%; - background-color: #FFF; - padding: 20px; - box-sizing: border-box; -} - -.sale-after-card { - margin-top: 20px; - width: 49%; - background-color: #FFF; - padding: 20px; - box-sizing: border-box; -} - .sale-after-line { font-size: 18px; +} + +@media screen and (min-width: 1200px) { + .order-head-card, + .goods-card, + .order-base-card, + .sale-after-card { + padding: 20px; + background-color: #FFF; + width: 49.5%; + box-sizing: border-box; + margin-bottom: 10px; + } +} + +@media screen and (max-width: 1200px) { + .order-head-card, + .goods-card, + .order-base-card, + .sale-after-card { + padding: 20px; + background-color: #FFF; + width: 100%; + box-sizing: border-box; + margin-bottom: 10px; + } } \ No newline at end of file From 1ccf734c0567bdd00a91f30fee9cf7f1c215427d Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Fri, 24 Jun 2022 14:50:34 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E8=B0=83=E7=94=A8=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E3=80=81=E8=AE=A2=E5=8D=95=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 2 +- src/pages/order/order-report-detail/index.jsx | 325 +++++++++--------- .../order/order-report-detail/index.less | 96 ++---- .../order/order-report-detail/service.js | 9 + src/pages/order/order-report/index.jsx | 105 +++++- src/pages/order/order-report/index.less | 6 +- src/pages/order/order-report/service.js | 10 + 7 files changed, 302 insertions(+), 251 deletions(-) create mode 100644 src/pages/order/order-report-detail/service.js create mode 100644 src/pages/order/order-report/service.js diff --git a/config/routes.js b/config/routes.js index 2df949c..cc29f64 100644 --- a/config/routes.js +++ b/config/routes.js @@ -600,7 +600,7 @@ export default [ }, { name: '订单报表详情', - path: '/order/order-report-detail', + path: '/order/order-report/order-report-detail', component: './order/order-report-detail', access: 'k31', }, diff --git a/src/pages/order/order-report-detail/index.jsx b/src/pages/order/order-report-detail/index.jsx index aefa3a0..1761009 100644 --- a/src/pages/order/order-report-detail/index.jsx +++ b/src/pages/order/order-report-detail/index.jsx @@ -1,7 +1,13 @@ -import React, { useState } from 'react'; -import { Button, Card, Image, Timeline } from 'antd'; +import React, { useState, useEffect } from 'react'; +import { Button, Card, Image, Timeline, message } from 'antd'; import styles from './index.less'; import { ExclamationCircleOutlined } from '@ant-design/icons'; +import { history } from 'umi'; +import orderReportAPI from "./service"; +import { PageContainer } from '@ant-design/pro-layout'; + +const orderNumber = history.location.query.orderNumber; + /** * 订单详情 * @returns @@ -9,46 +15,15 @@ import { ExclamationCircleOutlined } from '@ant-design/icons'; export default function Index() { const [orderInfo, setOrderInfo] = useState({ - id: '1008611', - sortId: '99', //取餐号 - orderDetail: [ //订单商品列表 - { - id: 'cda34f2c-7965-46ef-8517-0bc6fae87a71', - goodName: '牛肉面', - goodImg: 'https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee//goods/132969698918875531.jpg', - order_Status: 3, - originalMoney: 0.03 - }, - { - id: 'cda34f2c-7965-46ef-8517-0bc6fae87a72', - goodName: '姜鸭面', - goodImg: 'https://hbl-1305371387.cos.ap-chengdu.myqcloud.com/Franchisee//goods/132969698918875531.jpg', - order_Status: 3, - originalMoney: 0.03 - }, - ], - discountMoney: 0.02, //优惠金额 - orderRealMoney: 0.01, //支付金额 - orderNumber: '202205201022415338172', - createdAt: '2022-05-20 02:22:41', - orderSourceFrom: 0, //桌号 - payMode: 0 //支付方式 - }); - - const [memberInfo, setMemberInfo] = useState({ - id: '4fb28567-8294-4dfc-b2ca-485dc1310837', - nickName: 'Emperor_', - phone: '18200000000', - headImgUrl: 'https://thirdwx.qlogo.cn/mmopen/vi_32/Tnw5gbRSiaekqqHYERFT4x8o8GSkkBINuStbvml530FYjyeO2EKSYouKCAZLHBX3PDLLYInn130vwda6Y3gK0yA/132', - createAt: '2022-05-18 11:20:44', - address: '四川省 成都市 高新区 环球中心9-11B' + memberInfo: {}, + goodsInfo: [] }); const [saleAfterInfo, setSaleAfterInfo] = useState([ { id: "acc670f8-317f-4c2d-94f5-f7af12c80ebd", createdAt: "2022-05-18 07:52:09", - stutasStr: "待处理" + stutasStr: "申请退款" }, { id: "acc670f8-317f-4c2d-94f5-f7af12c80eb1", @@ -57,157 +32,169 @@ export default function Index() { }, ]); + const onQueryOrderDetail = async () => { + if (orderNumber) { + const response = await orderReportAPI.getOrderReporByNumber(orderNumber); + if (response.statusCode === 200) { + setOrderInfo(response.data); + } else { + message.error(response.errors || '订单详情获取失败'); + } + } + } + + useEffect(() => { + onQueryOrderDetail(); + }, []); + return ( -
- {/* 用户基本信息 */} -
-
-
- #{orderInfo.sortId} -
-
- 立即制作 -
-
- 2022-6-23 10:36:42 前制作完成 -
-
-
-
- 用户头像 + +
+ {/* 用户基本信息 */} +
+
+
+ #0 +
+
+ 订单时间 +
+
+ {orderInfo.createdAt} +
-
-
- {memberInfo.nickName} +
+
+
-
- #门店新客 - #门店会员 +
+
+ {orderInfo.memberInfo.memberName || '系统用户'} +
+
+ #门店新客 + #门店会员 +
-
-
- - 为保证服务体验,您在拨打或接听隐私号电话时,可能被录音 -
-
- - 顾客电话 - - - {memberInfo.phone} - -
-
- - 顾客地址 - - - {memberInfo.address} - -
-
+
+ + 为保证服务体验,您在拨打或接听隐私号电话时,可能被录音 +
+
+ + 顾客电话 + + + {orderInfo.memberInfo.phone || '暂无电话'} + +
+ {/*
备餐状态
制作中
+
*/}
-
- {/* 订单数据 */} -
-
- 订单信息 -
-
-
订单编号
-
{orderInfo.orderNumber}
-
-
-
支付方式
-
{orderInfo.payMode === 0 ? '微信支付' : '其他支付'}
-
-
-
下单时间
-
{orderInfo.createdAt}
-
-
-
就餐人数
-
商家按餐量提供
-
-
-
桌台号码
-
{orderInfo.orderSourceFrom}
-
-
- {/* 商品信息 */} -
-
- 商品信息 + {/* 订单数据 */} +
+
+ 订单信息 +
+
+
订单编号
+
{orderInfo.orderNumber}
+
+
+
支付方式
+
微信支付
+
+
+
下单时间
+
{orderInfo.createdAt}
+
+
+
就餐人数
+
商家按餐量提供
+
+
+
桌台号码
+
0
+
-
- { - orderInfo.orderDetail.map(item => { - return ( -
-
- 商品图片 -
-
- {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, + }); + } +}; From 7396a32fba2184e47eb429b931325e5f1c20c9b2 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Sat, 25 Jun 2022 16:32:07 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E8=90=A5=E9=94=80=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AF=BC=E5=87=BAExcel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-market-report/index.jsx | 239 +++++++++--------- .../order/order-market-report/index.less | 6 +- .../order/order-market-report/service.js | 10 + 3 files changed, 133 insertions(+), 122 deletions(-) create mode 100644 src/pages/order/order-market-report/service.js diff --git a/src/pages/order/order-market-report/index.jsx b/src/pages/order/order-market-report/index.jsx index 259adbe..36c3116 100644 --- a/src/pages/order/order-market-report/index.jsx +++ b/src/pages/order/order-market-report/index.jsx @@ -1,7 +1,12 @@ import React, { useEffect, useState } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Table, Card, DatePicker } from 'antd'; +import { DownloadOutlined } from '@ant-design/icons'; +import { Button, Table, Card, DatePicker, message, Pagination } from 'antd'; import styles from './index.less'; +import moment from 'moment'; +import marketAPI from "./service"; + +import ExportJsonExcel from "js-export-excel" const { RangePicker } = DatePicker; const columns = [ @@ -15,8 +20,8 @@ const columns = [ }, { title: '店铺', - dataIndex: 'storeName', - key: 'storeName', + dataIndex: 'shopName', + key: 'shopName', width: 170, align: 'center', fixed: 'left', @@ -30,7 +35,7 @@ const columns = [ value: '四川白菠萝科技', } ], - onFilter: (value, record) => record.storeName.indexOf(value) === 0, + onFilter: (value, record) => record.shopName.indexOf(value) === 0, }, { title: '营收', @@ -44,15 +49,15 @@ const columns = [ children: [ { title: '流水', - dataIndex: 'flowingWater', - key: 'flowingWater', + dataIndex: 'revenueFlow', + key: 'revenueFlow', width: 100, align: 'center', }, { title: '实收', - dataIndex: 'netReceipts', - key: 'netReceipts', + dataIndex: 'paidAmount', + key: 'paidAmount', width: 100, align: 'center', }, @@ -65,22 +70,22 @@ const columns = [ children: [ { title: '会员价', - dataIndex: 'membershipPrice', - key: 'membershipPrice', + dataIndex: 'discountMember', + key: 'discountMember', width: 100, align: 'center', }, { title: '优惠券', - dataIndex: 'coupon', - key: 'coupon', + dataIndex: 'discountCoupon', + key: 'discountCoupon', width: 100, align: 'center', }, { title: '活动', - dataIndex: 'activity', - key: 'activity', + dataIndex: 'discountActivity', + key: 'discountActivity', width: 100, align: 'center', } @@ -184,15 +189,15 @@ const columns = [ children: [ { title: '流水单价', - dataIndex: 'unitPriceOfWater', - key: 'unitPriceOfWater', + dataIndex: 'customerRevenueFlow', + key: 'customerRevenueFlow', width: 100, align: 'center', }, { title: '实收单价', - dataIndex: 'paidInUnitPrice', - key: 'paidInUnitPrice', + dataIndex: 'customerPaidAmount', + key: 'customerPaidAmount', width: 100, align: 'center', } @@ -205,15 +210,15 @@ const columns = [ children: [ { title: '流水单价', - dataIndex: 'singleUnitPriceOfWater', - key: 'singleUnitPriceOfWater', + dataIndex: 'orderRevenueFlow', + key: 'orderRevenueFlow', width: 100, align: 'center', }, { title: '实收单价', - dataIndex: 'singlePaidInUnitPrice', - key: 'singlePaidInUnitPrice', + dataIndex: 'orderPaidAmount', + key: 'orderPaidAmount', width: 100, align: 'center', } @@ -228,15 +233,15 @@ const columns = [ children: [ { title: '现金', - dataIndex: 'numCash', - key: 'numCash', + dataIndex: 'sourceCashCount', + key: 'sourceCashCount', width: 100, align: 'center', }, { title: '微信支付', - dataIndex: 'numWechatPayment', - key: 'numWechatPayment', + dataIndex: 'sourceWeChatCount', + key: 'sourceWeChatCount', width: 100, align: 'center', }, @@ -289,15 +294,15 @@ const columns = [ children: [ { title: '会员', - dataIndex: 'incomeMember', - key: 'incomeMember', + dataIndex: 'memberIncomeMoney', + key: 'memberIncomeMoney', width: 100, align: 'center', }, { title: '非会员', - dataIndex: 'incomeNonMember', - key: 'incomeNonMember', + dataIndex: 'nonMemberIncomeMoney', + key: 'nonMemberIncomeMoney', width: 100, align: 'center', }, @@ -324,15 +329,15 @@ const columns = [ children: [ { title: '微信支付', - dataIndex: 'incomeWechatPay', - key: 'incomeWechatPay', + dataIndex: 'sourceWeChatMoney', + key: 'sourceWeChatMoney', width: 100, align: 'center', }, { title: '现金支付', - dataIndex: 'incomeCashPay', - key: 'incomeCashPay', + dataIndex: 'sourceCashMoney', + key: 'sourceCashMoney', width: 100, align: 'center', }, @@ -383,91 +388,25 @@ const columns = [ */ export default function Index() { - const [data, setData] = useState([ - { - date: '2022-6-22 14:01:53', - storeName: '四川黑菠萝科技', - flowingWater: 10010, - netReceipts: 8848, - membershipPrice: 6000, - coupon: 2848, - activity: 998, - takeOutRevenue: 10086, - meituanTakeout: 5500, - hungryTakeOut: 5600, - freshWaterInTheHall: 10010, - paidInFood: 10010, - publicComments: 8000, - wordOfMouth: 1000, - tiktok: 2000, - unitPriceOfWater: 68, - paidInUnitPrice: 70, - singleUnitPriceOfWater: 99, - singlePaidInUnitPrice: 88, - numCash: 10, - numWechatPayment: 100, - numPublicComments: 99, - numWordOfMouth: 88, - numTiktok: 77, - numMeituanTakeout: 66, - numHungryTakeOut: 55, - incomeMember: 50, - incomeNonMember: 50, - incomeTakeOut: 70, - incomeGroupPurchase: 90, - incomeWechatPay: 10, - incomeCashPay: 30, - incomePublicComments: 20, - incomeWordOfMouth: 50, - incomeTiktok: 30, - incomeMeituan: 80, - incomeHungry: 100 - }, - { - date: '2022-6-22 15:58:43', - storeName: '四川白菠萝科技', - flowingWater: 10010, - netReceipts: 8848, - membershipPrice: 6000, - coupon: 2848, - activity: 998, - takeOutRevenue: 10086, - meituanTakeout: 5500, - hungryTakeOut: 5600, - freshWaterInTheHall: 10010, - paidInFood: 10010, - publicComments: 8000, - wordOfMouth: 1000, - tiktok: 2000, - unitPriceOfWater: 68, - paidInUnitPrice: 70, - singleUnitPriceOfWater: 99, - singlePaidInUnitPrice: 88, - numCash: 10, - numWechatPayment: 100, - numPublicComments: 99, - numWordOfMouth: 88, - numTiktok: 77, - numMeituanTakeout: 66, - numHungryTakeOut: 55, - incomeMember: 50, - incomeNonMember: 50, - incomeTakeOut: 70, - incomeGroupPurchase: 90, - incomeWechatPay: 10, - incomeCashPay: 30, - incomePublicComments: 20, - incomeWordOfMouth: 50, - incomeTiktok: 30, - incomeMeituan: 80, - incomeHungry: 100 - } - ]) + const [data, setData] = 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(() => { - calcTotal(); - }, []); + queryMarketReport(); + }, [current, pageSize, timeRange]); + // useEffect(() => { + // calcTotal(); + // }, [data]); + + //计算总计 const calcTotal = () => { const originData = JSON.parse(JSON.stringify(data)); const totalData = {} @@ -475,8 +414,8 @@ export default function Index() { Object.keys(dataObj).forEach(key => { if (key === 'date') { totalData.date = '合计'; - } else if (key == 'storeName') { - totalData.storeName = ''; + } else if (key == 'shopName') { + totalData.shopName = ''; } else if (typeof dataObj[key] === 'number') { if (totalData[key] && typeof totalData[key] === 'number') { totalData[key] += dataObj[key]; @@ -490,24 +429,82 @@ export default function Index() { }); }); originData.push(totalData); - console.log('originData', originData); setData(originData); } + const queryMarketReport = async () => { + const jsonData = { + current: current, + pageSize: pageSize + } + const response = await marketAPI.getMarketReportList(jsonData); + if (response.statusCode === 200) { + setData(response.data.data); + setTotal(response.data.total); + } else { + message.error(response.errors || '获取营销报表失败'); + } + } + + //页码变化 + const onPageChange = (current, pageSize) => { + setCurrent(current); + setPageSize(pageSize); + } + + //下载Excel + const onDownloadExcel = () => { + let option = {}; //option代表的就是excel文件 + const date = new Date(); + const excelName = "营销报表-" + date.toLocaleString().replaceAll('\/', '-'); + option.fileName = excelName; //excel文件名称 + const sheetHeader = []; + Object.keys(data[0]).forEach(item => { + sheetHeader.push(item); + }); + console.log('sheetHeader', sheetHeader); + option.datas = [ + { + sheetData: data, //excel文件中的数据源 + sheetName: excelName, //excel文件中sheet页名称 + sheetFilter: sheetHeader, //excel文件中需显示的列数据 + sheetHeader: ['ID', '时间', '店铺名称', '店铺ID', '营收流水', + '实际营收', '会员价', '优惠券', '活动折扣', '营收流水', + '营收流水', '客单价-流水单价', '客单价-实收单价', '单单价-总流水', '单单价-总实收', + '现金-交易笔数', '现金收入', '微信-交易笔数', '微信收入', '会员收入', '非会员收入' + ] //excel文件中每列的表头名称 + } + ] + let toExcel = new ExportJsonExcel(option); //生成excel文件 + toExcel.saveExcel(); + } + 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-market-report/index.less b/src/pages/order/order-market-report/index.less index 74d0c92..9487917 100644 --- a/src/pages/order/order-market-report/index.less +++ b/src/pages/order/order-market-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-market-report/service.js b/src/pages/order/order-market-report/service.js new file mode 100644 index 0000000..e5a3880 --- /dev/null +++ b/src/pages/order/order-market-report/service.js @@ -0,0 +1,10 @@ +import { request } from 'umi'; + +export default { + getMarketReportList(data) { + return request(`/kitchen/api/report-statistics/marketing-report`, { + method: 'Post', + data: data, + }); + } +}; From 656841e57b7d056329fdf82cea94b899533d4007 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Mon, 27 Jun 2022 18:06:29 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E3=80=81=E5=94=AE=E5=90=8E=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E3=80=81=E6=8A=98=E6=89=A3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-report-detail/index.jsx | 98 ++++++++++++------- .../order/order-report-detail/index.less | 22 ++++- src/pages/order/order-report/index.jsx | 77 ++++++++++++--- src/pages/order/order-report/index.less | 16 +++ 4 files changed, 165 insertions(+), 48 deletions(-) diff --git a/src/pages/order/order-report-detail/index.jsx b/src/pages/order/order-report-detail/index.jsx index 1761009..14e19c3 100644 --- a/src/pages/order/order-report-detail/index.jsx +++ b/src/pages/order/order-report-detail/index.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; -import { Button, Card, Image, Timeline, message } from 'antd'; +import { Button, Card, Image, Timeline, message, Tag } from 'antd'; import styles from './index.less'; -import { ExclamationCircleOutlined } from '@ant-design/icons'; +import { ExclamationCircleOutlined, UserOutlined, RedEnvelopeOutlined, WhatsAppOutlined } from '@ant-design/icons'; import { history } from 'umi'; import orderReportAPI from "./service"; import { PageContainer } from '@ant-design/pro-layout'; @@ -15,34 +15,46 @@ const orderNumber = history.location.query.orderNumber; export default function Index() { const [orderInfo, setOrderInfo] = useState({ - memberInfo: {}, - goodsInfo: [] + memberInfo: {}, //用户信息 + goodsInfo: [], //商品信息 + informationRefundInfo: [], //售后信息 + discountInfo: [] //优惠信息 }); - const [saleAfterInfo, setSaleAfterInfo] = useState([ - { - id: "acc670f8-317f-4c2d-94f5-f7af12c80ebd", - createdAt: "2022-05-18 07:52:09", - stutasStr: "申请退款" - }, - { - id: "acc670f8-317f-4c2d-94f5-f7af12c80eb1", - createdAt: "2022-05-18 09:52:09", - stutasStr: "已退款" - }, - ]); + const [orderStatus, setOrderStatus] = useState(true); const onQueryOrderDetail = async () => { if (orderNumber) { const response = await orderReportAPI.getOrderReporByNumber(orderNumber); if (response.statusCode === 200) { setOrderInfo(response.data); + orderIsNormal(response.data); } else { message.error(response.errors || '订单详情获取失败'); } } } + const orderIsNormal = (order) => { + let isNormal = true; + if (!(order.payMoneyEx === '正常' && + order.payOrderTimeEx === '正常' && + order.payOrderEx === '正常') + ) { + isNormal = false; + } + if (!(order.refundMoneyEx === '正常' || order.refundMoneyEx === '' || order.refundMoneyEx === null)) { + isNormal = false; + } + if (!(order.refundOrderTimeEx === '正常' || order.refundOrderTimeEx === '' || order.refundOrderTimeEx === null)) { + isNormal = false; + } + if (!(order.refundOrderEx === '正常' || order.refundOrderEx === '' || order.refundOrderEx === null)) { + isNormal = false; + } + setOrderStatus(isNormal); + } + useEffect(() => { onQueryOrderDetail(); }, []); @@ -54,10 +66,12 @@ export default function Index() {
- #0 + #{orderInfo.sortId}
- 订单时间 + { + orderStatus ?
正常订单
:
异常订单
+ }
{orderInfo.createdAt} @@ -94,14 +108,25 @@ export default function Index() { {orderInfo.memberInfo.phone || '暂无电话'}
- {/*
-
- 备餐状态 -
-
- 制作中 +
+
+ 优惠信息 +
+
+ { + orderInfo.discountInfo?.map(discountItem => { + return ( +
+ {discountItem.type === 1 ? } color="#f50">{discountItem.name}:{discountItem.value} : null} + {discountItem.type === 2 ? } color="#87d068">{discountItem.name}:{discountItem.value} : null} + {discountItem.type === 3 ? } color="#108ee9">{discountItem.name}:{discountItem.value} : null} +
+ ) + }) + } + +
-
*/}
{/* 订单数据 */}
@@ -181,15 +206,20 @@ export default function Index() {
{ - saleAfterInfo.map(item => { - return ( - -
- {item.createdAt} {item.stutasStr} -
-
- ) - }) + orderInfo.informationRefundInfo.length > 0 ? + orderInfo.informationRefundInfo.map(item => { + return ( + +
+ {item.createdAt} {item.refundDesc} +
+
+ ) + }) + : + + 暂无售后信息 + }
diff --git a/src/pages/order/order-report-detail/index.less b/src/pages/order/order-report-detail/index.less index 474bef4..6768071 100644 --- a/src/pages/order/order-report-detail/index.less +++ b/src/pages/order/order-report-detail/index.less @@ -17,7 +17,8 @@ content: ''; width: 0; height: 0; - top: 0; + top: 50%; + transform: translateY(-50%); left: 50px; border-top: 20px solid transparent; border-bottom: 20px solid transparent; @@ -32,12 +33,27 @@ width: 70px; height: 40px; left: -20px; - top: 0; + top: 50%; + transform: translateY(-50%); background-color: rgb(88, 91, 110); color: #FFF; font-size: 26px; } +.order-status-true { + font-size: 14px; + padding: 5px 20px; + background-color: #2db7f5; + color: #FFF; +} + +.order-status-false { + font-size: 14px; + padding: 5px 20px; + background-color: #F84352; + color: #FFF; +} + .order-cook-state { font-size: 22px; margin-left: 100px; @@ -110,6 +126,8 @@ font-weight: 700; } + + // 商品信息 .goods-card { // margin-top: 20px; diff --git a/src/pages/order/order-report/index.jsx b/src/pages/order/order-report/index.jsx index d8cf635..b6c4d07 100644 --- a/src/pages/order/order-report/index.jsx +++ b/src/pages/order/order-report/index.jsx @@ -1,13 +1,19 @@ import React, { useState, useEffect } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Card, DatePicker, Table, message, Pagination, Space } from 'antd'; +import { Button, Card, DatePicker, Table, message, Pagination, Space, Tag, Spin } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import orderReportAPI from "./service"; import moment from 'moment'; import { history } from "umi"; +import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons'; const columns = [ + { + title: '交易单号', + dataIndex: 'transactionId', + key: 'transactionId', + }, { title: '店铺名称', dataIndex: 'shopName', @@ -33,24 +39,67 @@ const columns = [ dataIndex: 'createdAt', key: 'createdAt', }, + { + title: '订单状态', + key: 'orderStatus', + render: (record) => { + let isNormal = true; + if (!(record.payMoneyEx === '正常' && + record.payOrderTimeEx === '正常' && + record.payOrderEx === '正常') + ) { + isNormal = false; + } + if (!(record.refundMoneyEx === '正常' || record.refundMoneyEx === '' || record.refundMoneyEx === null)) { + isNormal = false; + } + if (!(record.refundOrderTimeEx === '正常' || record.refundOrderTimeEx === '' || record.refundOrderTimeEx === null)) { + isNormal = false; + } + if (!(record.refundOrderEx === '正常' || record.refundOrderEx === '' || record.refundOrderEx === null)) { + isNormal = false; + } + return ( + <> + { + isNormal ? } color="success"> + 正常 + + : + } color="error"> + 异常 + + } + + ) + } + }, { title: '操作', key: 'action', render: (_, record) => ( - - { - history.push({ - pathname: '/order/order-report/order-report-detail', - query: { - orderNumber: record.orderNumber - } - }); - }}>详情 - + + { + history.push({ + pathname: '/order/order-report/order-report-detail', + query: { + orderNumber: record.orderNumber + } + }); + }}>详情 + ), - }, + }, ]; +const LoadingCard = () => { + return ( +
+ +
+ ) +} + /** * 订单报表 * @returns @@ -62,6 +111,7 @@ export default function Index() { const [current, setCurrent] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); + const [showLoading, setShowLoading] = useState(false); const [timeRange, setTimeRange] = useState([ moment(moment(new Date(Date.now() - 24 * 60 * 60 * 1000 * 7)).format('YYYY-MM-DD 00:00:00')), @@ -80,7 +130,9 @@ export default function Index() { current, pageSize } + setShowLoading(true); const response = await orderReportAPI.getOrderReportList(jsonData); + setShowLoading(false); if (response.statusCode === 200) { setOrderReportList(response.data.data); setTotal(response.data.total) @@ -97,6 +149,7 @@ export default function Index() { return ( + {showLoading ? : null}
{ diff --git a/src/pages/order/order-report/index.less b/src/pages/order/order-report/index.less index 9487917..c33fc6a 100644 --- a/src/pages/order/order-report/index.less +++ b/src/pages/order/order-report/index.less @@ -17,4 +17,20 @@ justify-content: flex-end; align-items: center; height: 50px; +} + +// 加载中 +.loading-card { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.5); } \ No newline at end of file From 5b3413ebfad6a5ffb470e1de0e38949d295b4ccd Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Tue, 28 Jun 2022 18:14:11 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=90=A5=E9=94=80=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=84=E7=BB=87=E6=9C=BA=E6=9E=84=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E3=80=81=E5=AF=BC=E5=87=BA=E6=89=80=E6=9C=89=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-market-report/index.jsx | 152 +++++++++++++----- .../order/order-market-report/index.less | 21 +++ .../order/order-market-report/service.js | 16 ++ 3 files changed, 152 insertions(+), 37 deletions(-) diff --git a/src/pages/order/order-market-report/index.jsx b/src/pages/order/order-market-report/index.jsx index 36c3116..deca9b1 100644 --- a/src/pages/order/order-market-report/index.jsx +++ b/src/pages/order/order-market-report/index.jsx @@ -1,13 +1,13 @@ import React, { useEffect, useState } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; import { DownloadOutlined } from '@ant-design/icons'; -import { Button, Table, Card, DatePicker, message, Pagination } from 'antd'; +import { Button, Table, Card, DatePicker, message, Pagination, Spin, TreeSelect } from 'antd'; import styles from './index.less'; import moment from 'moment'; import marketAPI from "./service"; - import ExportJsonExcel from "js-export-excel" +const { TreeNode } = TreeSelect; const { RangePicker } = DatePicker; const columns = [ { @@ -382,6 +382,14 @@ const columns = [ } ] +const LoadingCard = () => { + return ( +
+ +
+ ) +} + /** * 营销报表 * @returns @@ -392,19 +400,21 @@ export default function Index() { const [current, setCurrent] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); - + const [orgTree, setOrgTree] = useState([]); + const [showLoading, setShowLoading] = useState(false); 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')), ]); //日期选择器 + const [currentOrg, setCurrentOrg] = useState(''); useEffect(() => { queryMarketReport(); }, [current, pageSize, timeRange]); - // useEffect(() => { - // calcTotal(); - // }, [data]); + useEffect(() => { + onGetOrgTree(); + }, []); //计算总计 const calcTotal = () => { @@ -434,10 +444,15 @@ export default function Index() { const queryMarketReport = async () => { const jsonData = { + startTime: timeRange[0], + endTime: timeRange[1], current: current, pageSize: pageSize } + currentOrg.key && (jsonData.shopId = currentOrg.key); + setShowLoading(true); const response = await marketAPI.getMarketReportList(jsonData); + setShowLoading(false); if (response.statusCode === 200) { setData(response.data.data); setTotal(response.data.total); @@ -453,49 +468,112 @@ export default function Index() { } //下载Excel - const onDownloadExcel = () => { - let option = {}; //option代表的就是excel文件 - const date = new Date(); - const excelName = "营销报表-" + date.toLocaleString().replaceAll('\/', '-'); - option.fileName = excelName; //excel文件名称 - const sheetHeader = []; - Object.keys(data[0]).forEach(item => { - sheetHeader.push(item); - }); - console.log('sheetHeader', sheetHeader); - option.datas = [ - { - sheetData: data, //excel文件中的数据源 - sheetName: excelName, //excel文件中sheet页名称 - sheetFilter: sheetHeader, //excel文件中需显示的列数据 - sheetHeader: ['ID', '时间', '店铺名称', '店铺ID', '营收流水', - '实际营收', '会员价', '优惠券', '活动折扣', '营收流水', - '营收流水', '客单价-流水单价', '客单价-实收单价', '单单价-总流水', '单单价-总实收', - '现金-交易笔数', '现金收入', '微信-交易笔数', '微信收入', '会员收入', '非会员收入' - ] //excel文件中每列的表头名称 + const onDownloadExcel = async () => { + const jsonData = { + startTime: timeRange[0], + endTime: timeRange[1], + } + currentOrg.key && (jsonData.shopId = currentOrg.key); + setShowLoading(true); + const response = await marketAPI.marketingReportExport(jsonData); + setShowLoading(false); + if (response.statusCode === 200) { + let option = {}; //option代表的就是excel文件 + const date = new Date(); + const excelName = "营销报表-" + date.toLocaleString().replaceAll('\/', '-'); + option.fileName = excelName; //excel文件名称 + const sheetHeader = []; + Object.keys(response.data[0]).forEach(item => { + sheetHeader.push(item); + }); + console.log('sheetHeader', sheetHeader); + option.datas = [ + { + sheetData: response.data, //excel文件中的数据源 + sheetName: excelName, //excel文件中sheet页名称 + sheetFilter: sheetHeader, //excel文件中需显示的列数据 + sheetHeader: ['ID', '时间', '店铺名称', '店铺ID', '营收流水', + '实际营收', '会员折扣', '优惠券折扣', '活动折扣','客单价-流水单价', '客单价-实收单价', + '单单价-总流水', '单单价-总实收', + '现金-交易笔数', '现金收入', '微信-交易笔数', '微信收入', '会员收入', '非会员收入' + ] //excel文件中每列的表头名称 + } + ] + let toExcel = new ExportJsonExcel(option); //生成excel文件 + toExcel.saveExcel(); + } else { + message.error(response.errors || '导出失败'); + } + } + + //获取组织树 + const onGetOrgTree = async () => { + setShowLoading(true); + const response = await marketAPI.getOrgTree(); + setShowLoading(false); + if (response.statusCode === 200) { + const originTree = response.data; + onSetOrgTreeStatus(originTree); + setOrgTree(originTree); + } else { + message.error(response.errors || '获取组织树出错'); + } + } + + //设置组织树不可选择状态 + const onSetOrgTreeStatus = (originTree) => { + originTree.forEach(treeItem => { + if (treeItem.children && treeItem.children.length > 0) { + onSetOrgTreeStatus(treeItem.children); + } else { + if (treeItem.type === 2 || treeItem.type === 3) { + treeItem.disabled = false; + } else { + treeItem.disabled = true; + } } - ] - let toExcel = new ExportJsonExcel(option); //生成excel文件 - toExcel.saveExcel(); + }); } return ( + {showLoading ? : null}
- { - 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); - }} /> +
+ { + 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); + }} /> + { + if (node.type === 2 || node === 3) { + setCurrentOrg(node); + } + }} + placeholder="请选择组织架构" + treeDefaultExpandAll + /> +
+
- +
diff --git a/src/pages/order/order-market-report/index.less b/src/pages/order/order-market-report/index.less index 9487917..ed50ea4 100644 --- a/src/pages/order/order-market-report/index.less +++ b/src/pages/order/order-market-report/index.less @@ -17,4 +17,25 @@ justify-content: flex-end; align-items: center; height: 50px; +} + +.data-search-left { + display: flex; + align-items: center; +} + +// 加载中 +.loading-card { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.5); } \ No newline at end of file diff --git a/src/pages/order/order-market-report/service.js b/src/pages/order/order-market-report/service.js index e5a3880..7820383 100644 --- a/src/pages/order/order-market-report/service.js +++ b/src/pages/order/order-market-report/service.js @@ -1,10 +1,26 @@ import { request } from 'umi'; export default { + //获取分页数据 getMarketReportList(data) { return request(`/kitchen/api/report-statistics/marketing-report`, { method: 'Post', data: data, }); + }, + + //获取组织架构 + getOrgTree() { + return request(`/kitchen/api/report-statistics/org-tree`, { + method: 'GET', + }); + }, + + //下载报表 + marketingReportExport(data) { + return request(`/kitchen/api/report-statistics/marketing-report-export`, { + method: 'Post', + data: data, + }); } }; From ff7f6d8bca5ca068df670435f4bb5ca94f949053 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 29 Jun 2022 10:09:12 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-market-report/index.jsx | 2 + src/pages/order/order-report/index.jsx | 122 ++++++++++++++++-- src/pages/order/order-report/service.js | 15 +++ 3 files changed, 130 insertions(+), 9 deletions(-) diff --git a/src/pages/order/order-market-report/index.jsx b/src/pages/order/order-market-report/index.jsx index deca9b1..b9403b5 100644 --- a/src/pages/order/order-market-report/index.jsx +++ b/src/pages/order/order-market-report/index.jsx @@ -561,6 +561,8 @@ export default function Index() { onSelect={(value, node) => { if (node.type === 2 || node === 3) { setCurrentOrg(node); + } else { + setCurrentOrg(""); } }} placeholder="请选择组织架构" diff --git a/src/pages/order/order-report/index.jsx b/src/pages/order/order-report/index.jsx index b6c4d07..bdf566c 100644 --- a/src/pages/order/order-report/index.jsx +++ b/src/pages/order/order-report/index.jsx @@ -1,12 +1,13 @@ import React, { useState, useEffect } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Card, DatePicker, Table, message, Pagination, Space, Tag, Spin } from 'antd'; +import { Button, Card, DatePicker, Table, message, Pagination, Space, Tag, Spin, TreeSelect } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import orderReportAPI from "./service"; import moment from 'moment'; import { history } from "umi"; -import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons'; +import { CheckCircleOutlined, CloseCircleOutlined, DownloadOutlined } from '@ant-design/icons'; +import ExportJsonExcel from "js-export-excel" const columns = [ { @@ -112,6 +113,9 @@ export default function Index() { const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); const [showLoading, setShowLoading] = useState(false); + const [currentOrg, setCurrentOrg] = useState(''); + const [orgTree, setOrgTree] = useState([]); + const [timeRange, setTimeRange] = useState([ moment(moment(new Date(Date.now() - 24 * 60 * 60 * 1000 * 7)).format('YYYY-MM-DD 00:00:00')), @@ -123,13 +127,20 @@ export default function Index() { }, [current, pageSize]); + useEffect(() => { + onGetOrgTree(); + }, []); + //获取订单列表 const onQueryOrderReportList = async () => { const jsonData = { + startTime: timeRange[0], + endTime: timeRange[1], current, pageSize } + currentOrg.key && (jsonData.shopId = currentOrg.key); setShowLoading(true); const response = await orderReportAPI.getOrderReportList(jsonData); setShowLoading(false); @@ -147,19 +158,112 @@ export default function Index() { setPageSize(pageSize); } + //获取组织树 + const onGetOrgTree = async () => { + setShowLoading(true); + const response = await orderReportAPI.getOrgTree(); + setShowLoading(false); + if (response.statusCode === 200) { + const originTree = response.data; + onSetOrgTreeStatus(originTree); + setOrgTree(originTree); + } else { + message.error(response.errors || '获取组织树出错'); + } + } + + //设置组织树不可选择状态 + const onSetOrgTreeStatus = (originTree) => { + originTree.forEach(treeItem => { + if (treeItem.children && treeItem.children.length > 0) { + onSetOrgTreeStatus(treeItem.children); + } else { + if (treeItem.type === 2 || treeItem.type === 3) { + treeItem.disabled = false; + } else { + treeItem.disabled = true; + } + } + }); + } + + //下载Excel + const onDownloadExcel = async () => { + const jsonData = { + startTime: timeRange[0], + endTime: timeRange[1], + } + currentOrg.key && (jsonData.shopId = currentOrg.key); + setShowLoading(true); + const response = await orderReportAPI.orderReportExport(jsonData); + setShowLoading(false); + if (response.statusCode === 200) { + let option = {}; //option代表的就是excel文件 + const date = new Date(); + const excelName = "订单报表-" + date.toLocaleString().replaceAll('\/', '-'); + option.fileName = excelName; //excel文件名称 + const sheetHeader = []; + Object.keys(response.data[0]).forEach(item => { + sheetHeader.push(item); + }); + option.datas = [ + { + sheetData: response.data, //excel文件中的数据源 + sheetName: excelName, //excel文件中sheet页名称 + sheetFilter: sheetHeader, //excel文件中需显示的列数据 + sheetHeader: ['ID', '取餐号', '用户Id', '优惠合集', '订单号(本系统)', + '交易号', '店铺ID', '店铺名字', '商品总价','优惠金额', '实付金额', + '创建时间', '支付金额异常', + '订单支付时间异常', '订单异常', '售后金额异常', '售后时间异常', '售后订单异常' + ] //excel文件中每列的表头名称 + } + ] + let toExcel = new ExportJsonExcel(option); //生成excel文件 + toExcel.saveExcel(); + } else { + message.error(response.errors || '导出失败'); + } + } + return ( {showLoading ? : null}
- { - 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); - }} /> +
+ { + 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); + }} /> + { + console.log('node>>>', node); + if (node.type === 2 || node === 3) { + setCurrentOrg(node); + } else { + setCurrentOrg(""); + } + }} + placeholder="请选择组织架构" + treeDefaultExpandAll + /> +
+
diff --git a/src/pages/order/order-report/service.js b/src/pages/order/order-report/service.js index 11107ef..777cde2 100644 --- a/src/pages/order/order-report/service.js +++ b/src/pages/order/order-report/service.js @@ -6,5 +6,20 @@ export default { method: 'Post', data: data, }); + }, + + //获取组织架构 + getOrgTree() { + return request(`/kitchen/api/report-statistics/org-tree`, { + method: 'GET', + }); + }, + + //下载报表 + orderReportExport(data) { + return request(`/kitchen/api/report-statistics/order-report-export`, { + method: 'Post', + data: data, + }); } }; From da4edd44f94dccece3225f427dff28c74346efd4 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 29 Jun 2022 10:35:39 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=AF=A6=E7=BB=86?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-report-detail/index.jsx | 43 +++++++++++++------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/pages/order/order-report-detail/index.jsx b/src/pages/order/order-report-detail/index.jsx index 14e19c3..e3df461 100644 --- a/src/pages/order/order-report-detail/index.jsx +++ b/src/pages/order/order-report-detail/index.jsx @@ -21,7 +21,9 @@ export default function Index() { discountInfo: [] //优惠信息 }); - const [orderStatus, setOrderStatus] = useState(true); + const [orderStatus, setOrderStatus] = useState({ + isTrue: true + }); const onQueryOrderDetail = async () => { if (orderNumber) { @@ -36,22 +38,35 @@ export default function Index() { } const orderIsNormal = (order) => { - let isNormal = true; - if (!(order.payMoneyEx === '正常' && - order.payOrderTimeEx === '正常' && - order.payOrderEx === '正常') - ) { - isNormal = false; + let isNormal = { + isTrue: true, + msg: '正常订单' + }; + if (!(order.payMoneyEx === '正常')) { + isNormal.isTrue = false; + isNormal.msg = '订单支付金额异常'; + } + else if (!(order.payOrderTimeEx === '正常')) { + isNormal.isTrue = false; + isNormal.msg = '订单支付时间异常'; + } + else if (!(order.payOrderEx === '正常')) { + isNormal.isTrue = false; + isNormal.msg = '订单支付异常'; } - if (!(order.refundMoneyEx === '正常' || order.refundMoneyEx === '' || order.refundMoneyEx === null)) { - isNormal = false; + else if (!(order.refundMoneyEx === '正常' || order.refundMoneyEx === '' || order.refundMoneyEx === null)) { + isNormal.isTrue = false; + isNormal.msg = '订单退款金额异常'; } - if (!(order.refundOrderTimeEx === '正常' || order.refundOrderTimeEx === '' || order.refundOrderTimeEx === null)) { - isNormal = false; + else if (!(order.refundOrderTimeEx === '正常' || order.refundOrderTimeEx === '' || order.refundOrderTimeEx === null)) { + isNormal.isTrue = false; + isNormal.msg = '订单退款时间异常'; } - if (!(order.refundOrderEx === '正常' || order.refundOrderEx === '' || order.refundOrderEx === null)) { - isNormal = false; + else if (!(order.refundOrderEx === '正常' || order.refundOrderEx === '' || order.refundOrderEx === null)) { + isNormal.isTrue = false; + isNormal.msg = '订单退款异常'; } + console.log('isNormal', isNormal); setOrderStatus(isNormal); } @@ -70,7 +85,7 @@ export default function Index() {
{ - orderStatus ?
正常订单
:
异常订单
+ orderStatus.isTrue ?
正常订单
:
{orderStatus.msg}
}
From 0e0d286e9a1be93a9059fa8b894f5b736c228bff Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 29 Jun 2022 16:32:28 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E3=80=81=E9=94=80=E5=94=AE=E6=AF=9B=E5=88=A9?= =?UTF-8?q?=E3=80=81=E9=97=A8=E5=BA=97=E9=94=80=E5=94=AE=E6=AF=9B=E5=88=A9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.js | 18 ++ src/pages/order/cost-of-sales/index.jsx | 162 ++++++++++++++++++ src/pages/order/cost-of-sales/index.less | 36 ++++ src/pages/order/cost-of-sales/service.js | 10 ++ .../order/gross-profit-store-sales/index.jsx | 110 ++++++++++++ .../order/gross-profit-store-sales/index.less | 36 ++++ .../order/gross-profit-store-sales/service.js | 10 ++ src/pages/order/sales-gross-profit/index.jsx | 141 +++++++++++++++ src/pages/order/sales-gross-profit/index.less | 36 ++++ src/pages/order/sales-gross-profit/service.js | 10 ++ 10 files changed, 569 insertions(+) create mode 100644 src/pages/order/cost-of-sales/index.jsx create mode 100644 src/pages/order/cost-of-sales/index.less create mode 100644 src/pages/order/cost-of-sales/service.js create mode 100644 src/pages/order/gross-profit-store-sales/index.jsx create mode 100644 src/pages/order/gross-profit-store-sales/index.less create mode 100644 src/pages/order/gross-profit-store-sales/service.js create mode 100644 src/pages/order/sales-gross-profit/index.jsx create mode 100644 src/pages/order/sales-gross-profit/index.less create mode 100644 src/pages/order/sales-gross-profit/service.js diff --git a/config/routes.js b/config/routes.js index cc29f64..a5c011c 100644 --- a/config/routes.js +++ b/config/routes.js @@ -622,6 +622,24 @@ export default [ component: './order/order-member-statement', access: 'k31', }, + { + name: '销售成本分析', + path: '/order/cost-of-sales', + component: './order/cost-of-sales', + access: 'k31', + }, + { + name: '销售毛利分析', + path: '/order/sales-gross-profit', + component: './order/sales-gross-profit', + access: 'k31', + }, + { + name: '门店销售毛利分析', + path: '/order/gross-profit-store-sales', + component: './order/gross-profit-store-sales', + access: 'k31', + }, ], }, { diff --git a/src/pages/order/cost-of-sales/index.jsx b/src/pages/order/cost-of-sales/index.jsx new file mode 100644 index 0000000..4cc723d --- /dev/null +++ b/src/pages/order/cost-of-sales/index.jsx @@ -0,0 +1,162 @@ +import React, { useState, useEffect } from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +import costSalesAPI from "./service"; +import moment from 'moment'; + +const columns = [ + { + title: '门店名称', + dataIndex: 'storeName', + key: 'storeName', + }, + { + title: '商品名称', + dataIndex: 'goodsName', + key: 'storeName', + }, + { + title: '销售收入', + dataIndex: 'salesRevenue', + key: 'salesRevenue', + }, + { + title: '销售成本', + dataIndex: 'costOfSale', + key: 'costOfSale', + }, + { + title: '销售数量', + dataIndex: 'salesVolumes', + key: 'salesVolumes', + }, + { + title: '成本率', + dataIndex: 'costRate', + key: 'costRate', + } +]; + +const LoadingCard = () => { + return ( +
+ +
+ ) +} + +const children = []; + +for (let i = 10; i < 36; i++) { + children.push(); +} + +/** + * 销售成本分析 + * @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 [showLoading, setShowLoading] = useState(false); + 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')), + ]); //日期选择器 + + //页码变化 + const onPageChange = (current, pageSize) => { + setCurrent(current); + setPageSize(pageSize); + } + + //查询 + const onQueryOrderReportList = () => { + + } + + //选择门店 + const handleStoreChange = () => { + + } + + return ( + + {showLoading ? : null} + +
+
+ + + + { + 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/cost-of-sales/index.less b/src/pages/order/cost-of-sales/index.less new file mode 100644 index 0000000..c33fc6a --- /dev/null +++ b/src/pages/order/cost-of-sales/index.less @@ -0,0 +1,36 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-page { + display: flex; + justify-content: flex-end; + align-items: center; + height: 50px; +} + +// 加载中 +.loading-card { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.5); +} \ No newline at end of file diff --git a/src/pages/order/cost-of-sales/service.js b/src/pages/order/cost-of-sales/service.js new file mode 100644 index 0000000..11107ef --- /dev/null +++ b/src/pages/order/cost-of-sales/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, + }); + } +}; diff --git a/src/pages/order/gross-profit-store-sales/index.jsx b/src/pages/order/gross-profit-store-sales/index.jsx new file mode 100644 index 0000000..6cd88e8 --- /dev/null +++ b/src/pages/order/gross-profit-store-sales/index.jsx @@ -0,0 +1,110 @@ +import React, { useState, useEffect } from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +import costSalesAPI from "./service"; +import moment from 'moment'; + +const columns = [ + { + title: '门店名称', + dataIndex: 'storeName', + key: 'storeName', + }, + { + title: '毛利率', + dataIndex: 'grossProfitMargin', + key: 'salesRevenue', + } +]; + +const LoadingCard = () => { + return ( +
+ +
+ ) +} + +const children = []; + +for (let i = 10; i < 36; i++) { + children.push(); +} + +/** + * 门店销售毛利分析 + * @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 [showLoading, setShowLoading] = useState(false); + 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')), + ]); //日期选择器 + + //页码变化 + const onPageChange = (current, pageSize) => { + setCurrent(current); + setPageSize(pageSize); + } + + //查询 + const onQueryOrderReportList = () => { + + } + + //选择门店 + const handleStoreChange = () => { + + } + + return ( + + {showLoading ? : null} + +
+
+ + { + 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/gross-profit-store-sales/index.less b/src/pages/order/gross-profit-store-sales/index.less new file mode 100644 index 0000000..c33fc6a --- /dev/null +++ b/src/pages/order/gross-profit-store-sales/index.less @@ -0,0 +1,36 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-page { + display: flex; + justify-content: flex-end; + align-items: center; + height: 50px; +} + +// 加载中 +.loading-card { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.5); +} \ No newline at end of file diff --git a/src/pages/order/gross-profit-store-sales/service.js b/src/pages/order/gross-profit-store-sales/service.js new file mode 100644 index 0000000..11107ef --- /dev/null +++ b/src/pages/order/gross-profit-store-sales/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, + }); + } +}; diff --git a/src/pages/order/sales-gross-profit/index.jsx b/src/pages/order/sales-gross-profit/index.jsx new file mode 100644 index 0000000..7d1c768 --- /dev/null +++ b/src/pages/order/sales-gross-profit/index.jsx @@ -0,0 +1,141 @@ +import React, { useState, useEffect } from 'react'; +import { PageContainer } from '@ant-design/pro-layout'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select } from 'antd'; +import styles from './index.less'; +const { RangePicker } = DatePicker; +import costSalesAPI from "./service"; +import moment from 'moment'; + +const columns = [ + { + title: '门店名称', + dataIndex: 'storeName', + key: 'storeName', + }, + { + title: '商品名称', + dataIndex: 'goodsName', + key: 'storeName', + }, + { + title: '毛利率', + dataIndex: 'grossProfitMargin', + key: 'salesRevenue', + } +]; + +const LoadingCard = () => { + return ( +
+ +
+ ) +} + +const children = []; + +for (let i = 10; i < 36; i++) { + children.push(); +} + +/** + * 销售毛利分析 + * @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 [showLoading, setShowLoading] = useState(false); + 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')), + ]); //日期选择器 + + //页码变化 + const onPageChange = (current, pageSize) => { + setCurrent(current); + setPageSize(pageSize); + } + + //查询 + const onQueryOrderReportList = () => { + + } + + //选择门店 + const handleStoreChange = () => { + + } + + return ( + + {showLoading ? : null} + +
+
+ + + + { + 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/sales-gross-profit/index.less b/src/pages/order/sales-gross-profit/index.less new file mode 100644 index 0000000..c33fc6a --- /dev/null +++ b/src/pages/order/sales-gross-profit/index.less @@ -0,0 +1,36 @@ +.data-search-card { + margin-bottom: 20px; +} + +.data-search-box { + display: flex; + align-items: center; + justify-content: space-between; +} + +.search-btn-item { + margin-left: 20px; +} + +.table-page { + display: flex; + justify-content: flex-end; + align-items: center; + height: 50px; +} + +// 加载中 +.loading-card { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + height: 100vh; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 999; + background-color: rgba(0, 0, 0, 0.5); +} \ No newline at end of file diff --git a/src/pages/order/sales-gross-profit/service.js b/src/pages/order/sales-gross-profit/service.js new file mode 100644 index 0000000..11107ef --- /dev/null +++ b/src/pages/order/sales-gross-profit/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, + }); + } +}; From a91cf6af2c4f80d316740a9a77eb135b2d500b26 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Wed, 29 Jun 2022 17:00:00 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/order-report/index.jsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/pages/order/order-report/index.jsx b/src/pages/order/order-report/index.jsx index bdf566c..d58951b 100644 --- a/src/pages/order/order-report/index.jsx +++ b/src/pages/order/order-report/index.jsx @@ -73,7 +73,26 @@ const columns = [ } ) - } + }, + }, + { + title: '售后信息', + key: 'orderStatus', + render: (record) => { + return ( + <> + { + record.isRefund ? + 有 + + : + + 无 + + } + + ) + }, }, { title: '操作', @@ -212,7 +231,7 @@ export default function Index() { sheetName: excelName, //excel文件中sheet页名称 sheetFilter: sheetHeader, //excel文件中需显示的列数据 sheetHeader: ['ID', '取餐号', '用户Id', '优惠合集', '订单号(本系统)', - '交易号', '店铺ID', '店铺名字', '商品总价','优惠金额', '实付金额', + '交易号', '店铺ID', '店铺名字', '商品总价', '优惠金额', '实付金额', '创建时间', '支付金额异常', '订单支付时间异常', '订单异常', '售后金额异常', '售后时间异常', '售后订单异常' ] //excel文件中每列的表头名称 From 66ea28cdd51e93b1c5338383ea66f719e519449e Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Thu, 30 Jun 2022 16:09:24 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E6=88=90=E6=9C=AC=E5=88=86=E6=9E=90?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/cost-of-sales/index.jsx | 141 ++++++++++++++---- src/pages/order/cost-of-sales/service.js | 34 ++++- .../order/gross-profit-store-sales/index.jsx | 83 ++++++++--- .../order/gross-profit-store-sales/service.js | 15 +- src/pages/order/sales-gross-profit/index.jsx | 140 +++++++++++++---- src/pages/order/sales-gross-profit/service.js | 33 +++- 6 files changed, 363 insertions(+), 83 deletions(-) diff --git a/src/pages/order/cost-of-sales/index.jsx b/src/pages/order/cost-of-sales/index.jsx index 4cc723d..f815970 100644 --- a/src/pages/order/cost-of-sales/index.jsx +++ b/src/pages/order/cost-of-sales/index.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Card, DatePicker, Table, Pagination, Spin, Select } from 'antd'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select, message } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import costSalesAPI from "./service"; @@ -9,28 +9,28 @@ import moment from 'moment'; const columns = [ { title: '门店名称', - dataIndex: 'storeName', - key: 'storeName', + dataIndex: 'storeId', + key: 'storeId', }, { title: '商品名称', - dataIndex: 'goodsName', - key: 'storeName', + dataIndex: 'goodsId', + key: 'goodsId', }, { title: '销售收入', - dataIndex: 'salesRevenue', - key: 'salesRevenue', + dataIndex: 'salesPrice', + key: 'salesPrice', }, { title: '销售成本', - dataIndex: 'costOfSale', - key: 'costOfSale', + dataIndex: 'costPrice', + key: 'costPrice', }, { title: '销售数量', - dataIndex: 'salesVolumes', - key: 'salesVolumes', + dataIndex: 'salesNum', + key: 'salesNum', }, { title: '成本率', @@ -47,12 +47,6 @@ const LoadingCard = () => { ) } -const children = []; - -for (let i = 10; i < 36; i++) { - children.push(); -} - /** * 销售成本分析 * @returns @@ -60,7 +54,7 @@ for (let i = 10; i < 36; i++) { export default function Index() { //订单报表列表 - const [orderReportList, setOrderReportList] = useState([]); + const [costSalesData, setCostSalesData] = useState([]); const [current, setCurrent] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); @@ -69,6 +63,15 @@ export default function Index() { 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')), ]); //日期选择器 + //门店 + const [storeIdArray, setStoreIdArray] = useState([]); + const [storeSelect, setStoreSelect] = useState([]); + //商品 + const [goodsIdArray, setGoodsIdArray] = useState([]); + const [goodsIdSelect, setGoodsIdSelect] = useState([]); + //商品类型 + const [goodsTypeArray, setGoodsTypeArray] = useState([]); + const [goodsTypeSelect, setGoodsTypeSelect] = useState([]); //页码变化 const onPageChange = (current, pageSize) => { @@ -77,15 +80,77 @@ export default function Index() { } //查询 - const onQueryOrderReportList = () => { + const onQueryReportSalescost = async () => { + const jsonData = { + "storeId": storeIdArray, + "goodsId": goodsIdArray, + "goodsTypeId": goodsTypeArray, + "begintime": timeRange[0], + "endtime": timeRange[1], + current, + pageSize + } + setShowLoading(true); + const response = await costSalesAPI.getReportSalescost({}); + setShowLoading(false); + if (response.statusCode === 200) { + setCostSalesData(response.data.data); + } else { + message.error(response.errors || '获取销售成本失败'); + } + } + /** + * 查询店铺列表 + */ + const onQueryStoreList = async () => { + setShowLoading(true); + const response = await costSalesAPI.gettree({}); + setShowLoading(false); + if (response.statusCode === 200) { + const storeList = []; + response.data.forEach(item => { + if (item.type === 2 || item.type === 3) { + storeList.push(item) + } + }) + setStoreSelect(storeList); + } else { + message.error('查询店铺列表失败'); + } } - //选择门店 - const handleStoreChange = () => { + //查询商品列表 + const onQueryGoodsList = async () => { + setShowLoading(true); + const response = await costSalesAPI.goodsList({}); + setShowLoading(false); + if (response.statusCode === 200) { + setGoodsIdSelect(response.data); + } else { + message.error('查询商品列表失败'); + } + } + //查询商品分类类型列表 + const onQueryGoodsType = async () => { + setShowLoading(true); + const response = await costSalesAPI.goodsTypeList({}); + setShowLoading(false); + if (response.statusCode === 200) { + setGoodsTypeSelect(response.data); + } else { + message.error('查询商品分类列表失败'); + } } + useEffect(() => { + onQueryReportSalescost(); + onQueryStoreList(); + onQueryGoodsList(); + onQueryGoodsType(); + }, []); + return ( {showLoading ? : null} @@ -98,14 +163,20 @@ export default function Index() { size="middle" allowClear placeholder="请选择门店" - onChange={handleStoreChange} + onChange={(values) => setStoreIdArray(values)} filterOption={(input, option) => option.children.toLowerCase().includes(input.toLowerCase())} style={{ width: '300px', marginRight: '50px' }} > - {children} + { + storeSelect.map( (item) => { + return ( + + ) + }) + } { let tempDate = [ @@ -147,12 +230,12 @@ export default function Index() {
- +
-
+
diff --git a/src/pages/order/cost-of-sales/service.js b/src/pages/order/cost-of-sales/service.js index 11107ef..bb2fdb4 100644 --- a/src/pages/order/cost-of-sales/service.js +++ b/src/pages/order/cost-of-sales/service.js @@ -1,10 +1,40 @@ import { request } from 'umi'; export default { - getOrderReportList(data) { - return request(`/kitchen/api/report-statistics/order-report`, { + getReportSalescost(data) { + return request(`/kitchen/api/report/salescost`, { method: 'Post', data: data, }); + }, + /** + * 查询商品信息 + */ + goodsList(data) { + return request(`/kitchen/api/goodes/list`, { + method: 'Post', + data: data, + }); + }, + /** + * 查询商品类型 + */ + goodsTypeList(data) { + return request(`/kitchen/api/goodstype/list`, { + method: 'Post', + data: data, + }); + }, + + /** + * 查询门店列表 + */ + gettree(params) { + return request('​/kitchen/api​/sysOrg​/tree', { + data: { + ...params, + }, + }); } + }; diff --git a/src/pages/order/gross-profit-store-sales/index.jsx b/src/pages/order/gross-profit-store-sales/index.jsx index 6cd88e8..5d5b1f7 100644 --- a/src/pages/order/gross-profit-store-sales/index.jsx +++ b/src/pages/order/gross-profit-store-sales/index.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Card, DatePicker, Table, Pagination, Spin, Select } from 'antd'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select, message } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import costSalesAPI from "./service"; @@ -9,13 +9,13 @@ import moment from 'moment'; const columns = [ { title: '门店名称', - dataIndex: 'storeName', - key: 'storeName', + dataIndex: 'storeId', + key: 'storeId', }, { title: '毛利率', - dataIndex: 'grossProfitMargin', - key: 'salesRevenue', + dataIndex: 'marginRatio', + key: 'marginRatio', } ]; @@ -27,12 +27,6 @@ const LoadingCard = () => { ) } -const children = []; - -for (let i = 10; i < 36; i++) { - children.push(); -} - /** * 门店销售毛利分析 * @returns @@ -40,7 +34,7 @@ for (let i = 10; i < 36; i++) { export default function Index() { //订单报表列表 - const [orderReportList, setOrderReportList] = useState([]); + const [costSalesData, setCostSalesData] = useState([]); const [current, setCurrent] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); @@ -49,6 +43,9 @@ export default function Index() { 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')), ]); //日期选择器 + //门店 + const [storeIdArray, setStoreIdArray] = useState([]); + const [storeSelect, setStoreSelect] = useState([]); //页码变化 const onPageChange = (current, pageSize) => { @@ -57,33 +54,75 @@ export default function Index() { } //查询 - const onQueryOrderReportList = () => { - + const onQueryReportSalescost = async () => { + const jsonData = { + "storeId": storeIdArray, + "begintime": timeRange[0], + "endtime": timeRange[1], + current, + pageSize + } + setShowLoading(true); + const response = await costSalesAPI.getReportOrgsalesmargin({}); + setShowLoading(false); + if (response.statusCode === 200) { + setCostSalesData(response.data.data); + } else { + message.error(response.errors || '获取销售成本失败'); + } } - //选择门店 - const handleStoreChange = () => { - + /** + * 查询店铺列表 + */ + const onQueryStoreList = async () => { + setShowLoading(true); + const response = await costSalesAPI.gettree({}); + setShowLoading(false); + if (response.statusCode === 200) { + const storeList = []; + response.data.forEach(item => { + if (item.type === 2 || item.type === 3) { + storeList.push(item) + } + }) + setStoreSelect(storeList); + } else { + message.error('查询店铺列表失败'); + } } + useEffect(() => { + onQueryReportSalescost(); + onQueryStoreList(); + }, []); + return ( {showLoading ? : null}
- { let tempDate = [ @@ -95,12 +134,12 @@ export default function Index() {
- +
-
+
diff --git a/src/pages/order/gross-profit-store-sales/service.js b/src/pages/order/gross-profit-store-sales/service.js index 11107ef..d25abba 100644 --- a/src/pages/order/gross-profit-store-sales/service.js +++ b/src/pages/order/gross-profit-store-sales/service.js @@ -1,10 +1,21 @@ import { request } from 'umi'; export default { - getOrderReportList(data) { - return request(`/kitchen/api/report-statistics/order-report`, { + getReportOrgsalesmargin(data) { + return request(`/kitchen/api/report/orgsalesmargin`, { method: 'Post', data: data, }); + }, + + /** + * 查询门店列表 + */ + gettree(params) { + return request('​/kitchen/api​/sysOrg​/tree', { + data: { + ...params, + }, + }); } }; diff --git a/src/pages/order/sales-gross-profit/index.jsx b/src/pages/order/sales-gross-profit/index.jsx index 7d1c768..6ef8a2a 100644 --- a/src/pages/order/sales-gross-profit/index.jsx +++ b/src/pages/order/sales-gross-profit/index.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from 'react'; import { PageContainer } from '@ant-design/pro-layout'; -import { Button, Card, DatePicker, Table, Pagination, Spin, Select } from 'antd'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select, message } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import costSalesAPI from "./service"; @@ -9,18 +9,18 @@ import moment from 'moment'; const columns = [ { title: '门店名称', - dataIndex: 'storeName', - key: 'storeName', + dataIndex: 'storeId', + key: 'storeId', }, { title: '商品名称', - dataIndex: 'goodsName', - key: 'storeName', + dataIndex: 'goodsId', + key: 'goodsId', }, { title: '毛利率', - dataIndex: 'grossProfitMargin', - key: 'salesRevenue', + dataIndex: 'marginRatio', + key: 'marginRatio', } ]; @@ -32,12 +32,6 @@ const LoadingCard = () => { ) } -const children = []; - -for (let i = 10; i < 36; i++) { - children.push(); -} - /** * 销售毛利分析 * @returns @@ -45,7 +39,7 @@ for (let i = 10; i < 36; i++) { export default function Index() { //订单报表列表 - const [orderReportList, setOrderReportList] = useState([]); + const [costSalesData, setCostSalesData] = useState([]); const [current, setCurrent] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); @@ -54,6 +48,15 @@ export default function Index() { 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')), ]); //日期选择器 + //门店 + const [storeIdArray, setStoreIdArray] = useState([]); + const [storeSelect, setStoreSelect] = useState([]); + //商品 + const [goodsIdArray, setGoodsIdArray] = useState([]); + const [goodsIdSelect, setGoodsIdSelect] = useState([]); + //商品类型 + const [goodsTypeArray, setGoodsTypeArray] = useState([]); + const [goodsTypeSelect, setGoodsTypeSelect] = useState([]); //页码变化 const onPageChange = (current, pageSize) => { @@ -62,59 +65,144 @@ export default function Index() { } //查询 - const onQueryOrderReportList = () => { + const onQueryReportSalescost = async () => { + const jsonData = { + "storeId": storeIdArray, + "goodsId": goodsIdArray, + "goodsTypeId": goodsTypeArray, + "begintime": timeRange[0], + "endtime": timeRange[1], + current, + pageSize + } + setShowLoading(true); + const response = await costSalesAPI.getReportSalesmargin({}); + setShowLoading(false); + if (response.statusCode === 200) { + setCostSalesData(response.data.data); + } else { + message.error(response.errors || '获取销售成本失败'); + } + } + /** + * 查询店铺列表 + */ + const onQueryStoreList = async () => { + setShowLoading(true); + const response = await costSalesAPI.gettree({}); + setShowLoading(false); + if (response.statusCode === 200) { + const storeList = []; + response.data.forEach(item => { + if (item.type === 2 || item.type === 3) { + storeList.push(item) + } + }) + setStoreSelect(storeList); + } else { + message.error('查询店铺列表失败'); + } } - //选择门店 - const handleStoreChange = () => { + //查询商品列表 + const onQueryGoodsList = async () => { + setShowLoading(true); + const response = await costSalesAPI.goodsList({}); + setShowLoading(false); + if (response.statusCode === 200) { + setGoodsIdSelect(response.data); + } else { + message.error('查询商品列表失败'); + } + } + //查询商品分类类型列表 + const onQueryGoodsType = async () => { + setShowLoading(true); + const response = await costSalesAPI.goodsTypeList({}); + setShowLoading(false); + if (response.statusCode === 200) { + setGoodsTypeSelect(response.data); + } else { + message.error('查询商品分类列表失败'); + } } + useEffect(() => { + onQueryReportSalescost(); + onQueryStoreList(); + onQueryGoodsList(); + onQueryGoodsType(); + }, []); return ( {showLoading ? : null}
- { let tempDate = [ @@ -126,12 +214,12 @@ export default function Index() {
- +
-
+
diff --git a/src/pages/order/sales-gross-profit/service.js b/src/pages/order/sales-gross-profit/service.js index 11107ef..7537b2e 100644 --- a/src/pages/order/sales-gross-profit/service.js +++ b/src/pages/order/sales-gross-profit/service.js @@ -1,10 +1,39 @@ import { request } from 'umi'; export default { - getOrderReportList(data) { - return request(`/kitchen/api/report-statistics/order-report`, { + getReportSalesmargin(data) { + return request(`/kitchen/api/report/salesmargin`, { method: 'Post', data: data, }); + }, + /** + * 查询商品信息 + */ + goodsList(data) { + return request(`/kitchen/api/goodes/list`, { + method: 'Post', + data: data, + }); + }, + /** + * 查询商品类型 + */ + goodsTypeList(data) { + return request(`/kitchen/api/goodstype/list`, { + method: 'Post', + data: data, + }); + }, + + /** + * 查询门店列表 + */ + gettree(params) { + return request('​/kitchen/api​/sysOrg​/tree', { + data: { + ...params, + }, + }); } };