|
@@ -19,6 +19,7 @@ export default () => { |
|
|
const [tabIndex, setTabIndex] = useState(1); |
|
|
const [tabIndex, setTabIndex] = useState(1); |
|
|
const [currentPage, setCurrentPage] = useState(1); |
|
|
const [currentPage, setCurrentPage] = useState(1); |
|
|
const [pageSize, setPageSize] = useState(10); |
|
|
const [pageSize, setPageSize] = useState(10); |
|
|
|
|
|
const [total, setTotal] = useState(0); |
|
|
const [ReservationGoods, setReservationGoods] = useState([]); |
|
|
const [ReservationGoods, setReservationGoods] = useState([]); |
|
|
const [ReservationOrg, setReservationOrg] = useState([]); |
|
|
const [ReservationOrg, setReservationOrg] = useState([]); |
|
|
const [ReservationUser, setReservationUser] = useState([]); |
|
|
const [ReservationUser, setReservationUser] = useState([]); |
|
@@ -289,6 +290,7 @@ export default () => { |
|
|
setIsLoading(false); |
|
|
setIsLoading(false); |
|
|
if (response.succeeded) { |
|
|
if (response.succeeded) { |
|
|
let sortArr = response.data.data.sort((a, b) => b.value - a.value); |
|
|
let sortArr = response.data.data.sort((a, b) => b.value - a.value); |
|
|
|
|
|
setTotal(response.data.total); |
|
|
setReservationGoodsDetailed(sortArr); |
|
|
setReservationGoodsDetailed(sortArr); |
|
|
} else { |
|
|
} else { |
|
|
console.log('Message:', response.msg || '获取预定人员失败'); |
|
|
console.log('Message:', response.msg || '获取预定人员失败'); |
|
@@ -389,7 +391,7 @@ export default () => { |
|
|
}, []); |
|
|
}, []); |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
initData(); |
|
|
initData(); |
|
|
}, [tabIndex]); |
|
|
|
|
|
|
|
|
}, [tabIndex, currentPage]); |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<PageContainer> |
|
|
<PageContainer> |
|
@@ -455,7 +457,7 @@ export default () => { |
|
|
</Row> |
|
|
</Row> |
|
|
</Card> |
|
|
</Card> |
|
|
<Card> |
|
|
<Card> |
|
|
<Tabs tabPosition='left' value={tabIndex} onChange={setTabIndex}> |
|
|
|
|
|
|
|
|
<Tabs tabPosition='left' value={tabIndex} onChange={value => {setTabIndex(value); setTotal(0); setCurrentPage(1)}}> |
|
|
<TabPane tab="预定菜品汇总" key={1}> |
|
|
<TabPane tab="预定菜品汇总" key={1}> |
|
|
{ |
|
|
{ |
|
|
tabIndex == 1 && <> |
|
|
tabIndex == 1 && <> |
|
@@ -470,7 +472,7 @@ export default () => { |
|
|
<Table |
|
|
<Table |
|
|
columns={ReservationGoodsColums} |
|
|
columns={ReservationGoodsColums} |
|
|
dataSource={ReservationGoods} |
|
|
dataSource={ReservationGoods} |
|
|
pagination={{ current: currentPage, pageSize: pageSize, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> |
|
|
|
|
|
|
|
|
pagination={{ current: currentPage, pageSize: pageSize,total , onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> |
|
|
</> |
|
|
</> |
|
|
} |
|
|
} |
|
|
</TabPane> |
|
|
</TabPane> |
|
@@ -488,7 +490,7 @@ export default () => { |
|
|
<Table |
|
|
<Table |
|
|
columns={ReservationOrgColums} |
|
|
columns={ReservationOrgColums} |
|
|
dataSource={ReservationOrg} |
|
|
dataSource={ReservationOrg} |
|
|
pagination={{ current: currentPage, pageSize: pageSize, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> |
|
|
|
|
|
|
|
|
pagination={{ current: currentPage, pageSize: pageSize, total, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} /> |
|
|
</> |
|
|
</> |
|
|
} |
|
|
} |
|
|
</TabPane> |
|
|
</TabPane> |
|
@@ -524,7 +526,7 @@ export default () => { |
|
|
<Table |
|
|
<Table |
|
|
columns={ReservationGoodsDetailedColums} |
|
|
columns={ReservationGoodsDetailedColums} |
|
|
dataSource={ReservationGoodsDetailed} |
|
|
dataSource={ReservationGoodsDetailed} |
|
|
pagination={{ current: currentPage, pageSize: pageSize, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} |
|
|
|
|
|
|
|
|
pagination={{ current: currentPage, pageSize: pageSize, total, onChange: setCurrentPage, onShowSizeChange: (current, size) => setPageSize(size) }} |
|
|
/> |
|
|
/> |
|
|
</> |
|
|
</> |
|
|
} |
|
|
} |
|
|