| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { useNavigate, useLocation } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import QrCodeIcon from "@mui/icons-material/QrCode"; |
| | | import ImportButton from "../components/ImportButton"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <NumberInput source="asnId" label="table.field.asnOrderItem.asnId" />, |
| | | <TextInput source="asnCode" label="table.field.asnOrderItem.asnCode" />, |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const location = useLocation(); |
| | | const queryParams = new URLSearchParams(location.search); |
| | | const asnId = queryParams.get("asnId"); |
| | | |
| | | const creatCode = () => { }; |
| | | |
| | | return ( |
| | | <> |
| | | {asnId && <CustomerTopToolBar backPrevious={true} />} |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrderItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <Button onClick={creatCode} label={"toolbar.creatcode"}> |
| | | <QrCodeIcon /> |
| | | </Button> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='asnOrderItem' /> |
| | | <ImportButton value={'asnOrder'} parmas={{ asnId: asnId }} /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | |
| | | <AsnOrderItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | row={{ asnId }} |
| | | /> |
| | | <PageDrawer |
| | | title='AsnOrderItem Detail' |
| | |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | </> |
| | | ) |
| | | } |
| | | AsnOrderItemList.Context = React.createContext() |
| | | |
| | | export default AsnOrderItemList; |