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