From 8ebaea7fcf9c3cc452d9ab35eb29ef8c1d1743e9 Mon Sep 17 00:00:00 2001 From: yangwenhua <1289978696@qq.com> Date: Mon, 4 Jul 2022 10:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E3=80=81?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/cost-of-sales/index.jsx | 71 ++++++++++++------ src/pages/order/cost-of-sales/index.less | 26 +++++++ .../order/gross-profit-store-sales/index.jsx | 43 +++++++---- .../order/gross-profit-store-sales/index.less | 27 +++++++ src/pages/order/sales-gross-profit/index.jsx | 73 ++++++++++++------- src/pages/order/sales-gross-profit/index.less | 26 +++++++ 6 files changed, 203 insertions(+), 63 deletions(-) diff --git a/src/pages/order/cost-of-sales/index.jsx b/src/pages/order/cost-of-sales/index.jsx index f815970..f67affb 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, message } from 'antd'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select, message, Col, Row } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import costSalesAPI from "./service"; @@ -144,6 +144,17 @@ export default function Index() { } } + //重置搜索条件 + const onResetSearch = () => { + setGoodsIdArray([]); + setStoreIdArray([]); + setGoodsTypeArray([]); + setTimeRange([ + 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(() => { onQueryReportSalescost(); onQueryStoreList(); @@ -155,9 +166,14 @@ export default function Index() { {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 index c33fc6a..60fde50 100644 --- a/src/pages/order/cost-of-sales/index.less +++ b/src/pages/order/cost-of-sales/index.less @@ -33,4 +33,30 @@ bottom: 0; z-index: 999; background-color: rgba(0, 0, 0, 0.5); +} + +.data-search-item { + display: flex; + align-items: center; + margin-bottom: 10px; +} + +.data-search-input { + width: 100%; +} + +.data-search-prefix { + text-align-last: justify; + width: 60px; + flex-shrink: 0; + margin-right: 5px; +} + +.data-search-sufixx { + flex-grow: 1; +} + +.data-search-btns { + display: flex; + justify-content: flex-end; } \ No newline at end of file diff --git a/src/pages/order/gross-profit-store-sales/index.jsx b/src/pages/order/gross-profit-store-sales/index.jsx index 5d5b1f7..2224369 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, message } from 'antd'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select, message, Col, Row } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import costSalesAPI from "./service"; @@ -75,7 +75,7 @@ export default function Index() { /** * 查询店铺列表 */ - const onQueryStoreList = async () => { + const onQueryStoreList = async () => { setShowLoading(true); const response = await costSalesAPI.gettree({}); setShowLoading(false); @@ -92,6 +92,15 @@ export default function Index() { } } + //重置搜索条件 + const onResetSearch = () => { + setStoreIdArray([]); + setTimeRange([ + 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(() => { onQueryReportSalescost(); onQueryStoreList(); @@ -101,9 +110,14 @@ export default function Index() { {showLoading ? : null} -
-
- setStoreIdArray(values)} filterOption={(input, option) => option.children.toLowerCase().includes(input.toLowerCase())} - style={{ - width: '300px', - marginRight: '50px' - }} > { - storeSelect.map( (item) => { + storeSelect.map((item) => { 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/gross-profit-store-sales/index.less b/src/pages/order/gross-profit-store-sales/index.less index c33fc6a..7deb632 100644 --- a/src/pages/order/gross-profit-store-sales/index.less +++ b/src/pages/order/gross-profit-store-sales/index.less @@ -33,4 +33,31 @@ bottom: 0; z-index: 999; background-color: rgba(0, 0, 0, 0.5); +} + +.data-search-item { + display: flex; + align-items: center; + margin-bottom: 10px; +} + +.data-search-input { + width: 100%; +} + +.data-search-prefix { + text-align-last: justify; + width: 60px; + flex-shrink: 0; + margin-right: 5px; +} + +.data-search-sufixx { + flex-grow: 1; +} + +.data-search-btns { + margin-left: auto; + display: flex; + justify-content: flex-end; } \ No newline at end of file diff --git a/src/pages/order/sales-gross-profit/index.jsx b/src/pages/order/sales-gross-profit/index.jsx index 6ef8a2a..08b6cb1 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, message } from 'antd'; +import { Button, Card, DatePicker, Table, Pagination, Spin, Select, message, Col, Row } from 'antd'; import styles from './index.less'; const { RangePicker } = DatePicker; import costSalesAPI from "./service"; @@ -129,6 +129,17 @@ export default function Index() { } } + //重置搜索条件 + const onResetSearch = () => { + setGoodsIdArray([]); + setStoreIdArray([]); + setGoodsTypeArray([]); + setTimeRange([ + 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(() => { onQueryReportSalescost(); onQueryStoreList(); @@ -139,9 +150,14 @@ export default function Index() { {showLoading ? : null} -
-
- setStoreIdArray(values)} filterOption={(input, option) => option.children.toLowerCase().includes(input.toLowerCase())} - style={{ - width: '300px', - marginRight: '50px' - }} > { - storeSelect.map( (item) => { + storeSelect.map((item) => { 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/sales-gross-profit/index.less b/src/pages/order/sales-gross-profit/index.less index c33fc6a..60fde50 100644 --- a/src/pages/order/sales-gross-profit/index.less +++ b/src/pages/order/sales-gross-profit/index.less @@ -33,4 +33,30 @@ bottom: 0; z-index: 999; background-color: rgba(0, 0, 0, 0.5); +} + +.data-search-item { + display: flex; + align-items: center; + margin-bottom: 10px; +} + +.data-search-input { + width: 100%; +} + +.data-search-prefix { + text-align-last: justify; + width: 60px; + flex-shrink: 0; + margin-right: 5px; +} + +.data-search-sufixx { + flex-grow: 1; +} + +.data-search-btns { + display: flex; + justify-content: flex-end; } \ No newline at end of file