|  |  |  | 
|---|
|  |  |  | import PurchasePanel from "./PurchasePanel"; | 
|---|
|  |  |  | import EmptyData from "../../components/EmptyData"; | 
|---|
|  |  |  | import MyCreateButton from "../../components/MyCreateButton"; | 
|---|
|  |  |  | import BillStatusField from '../../components/BillStatusField'; | 
|---|
|  |  |  | import MyExportButton from '../../components/MyExportButton'; | 
|---|
|  |  |  | import PageDrawer from "../../components/PageDrawer"; | 
|---|
|  |  |  | import MyField from "../../components/MyField"; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
|---|
|  |  |  | import * as Common from '@/utils/common'; | 
|---|
|  |  |  | import ImportButton from "../../components/ImportButton"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|---|
|  |  |  | '& .css-1vooibu-MuiSvgIcon-root': { | 
|---|
|  |  |  | 
|---|
|  |  |  | '& .opt': { | 
|---|
|  |  |  | width: 200 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .MuiTableCell-root': { | 
|---|
|  |  |  | whiteSpace: 'nowrap', | 
|---|
|  |  |  | overflow: 'visible', | 
|---|
|  |  |  | textOverflow: 'unset' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const PurchaseList = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const navigate = useNavigate(); | 
|---|
|  |  |  | const assign = (record) => { | 
|---|
|  |  |  | navigate(`/purchaseItem?poId=${record.id}`); | 
|---|
|  |  |  | 
|---|
|  |  |  | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | title={"menu.purchase"} | 
|---|
|  |  |  | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} | 
|---|
|  |  |  | empty={false} | 
|---|
|  |  |  | filters={filters} | 
|---|
|  |  |  | sort={{ field: "create_time", order: "desc" }} | 
|---|
|  |  |  | actions={( | 
|---|
|  |  |  | <TopToolbar> | 
|---|
|  |  |  | <FilterButton /> | 
|---|
|  |  |  | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> | 
|---|
|  |  |  | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} | 
|---|
|  |  |  | <SelectColumnsButton preferenceKey='purchase' /> | 
|---|
|  |  |  | <ImportButton value={'purchaseItem'} /> | 
|---|
|  |  |  | <MyExportButton /> | 
|---|
|  |  |  | </TopToolbar> | 
|---|
|  |  |  | )} | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='purchase' | 
|---|
|  |  |  | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | rowClick={'edit'} | 
|---|
|  |  |  | bulkActionButtons={() => <BulkDeleteButton mutationMode="pessimistic"/>} | 
|---|
|  |  |  | rowClick={false} | 
|---|
|  |  |  | expand={false} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo', 'preArr', 'channel','startTime','workQty', 'endTime']} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy','channel', 'platCode', 'memo', 'channel','startTime','workQty', 'endTime','createBy$']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | <TextField source="code" label="table.field.purchase.code" /> | 
|---|
|  |  |  | <TextField source="type$" label="table.field.purchase.type" /> | 
|---|
|  |  |  | <TextField source="wkType$" label="table.field.purchase.wkType" /> | 
|---|
|  |  |  | <TextField source="source" label="table.field.purchase.source" /> | 
|---|
|  |  |  | <DateField source="preArr" label="table.field.purchase.preArr" showTime /> | 
|---|
|  |  |  | <NumberField source="anfme" label="table.field.purchase.anfme" /> | 
|---|
|  |  |  | <NumberField source="qty" label="table.field.purchase.qty" /> | 
|---|
|  |  |  | <NumberField source="workQty" label="table.field.purchase.workQty" /> | 
|---|
|  |  |  | {/* <NumberField source="workQty" label="table.field.purchase.workQty" /> */} | 
|---|
|  |  |  | <TextField source="channel" label="table.field.purchase.channel" /> | 
|---|
|  |  |  | <TextField source="platCode" label="table.field.purchase.platCode" /> | 
|---|
|  |  |  | <DateField source="preArr" label="table.field.purchase.preArr" showTime /> | 
|---|
|  |  |  | <DateField source="startTime" label="table.field.purchase.startTime" showTime /> | 
|---|
|  |  |  | <DateField source="endTime" label="table.field.purchase.endTime" showTime /> | 
|---|
|  |  |  | <TextField source="project" label="table.field.purchase.project" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy"  /> | 
|---|
|  |  |  | <DateField source="createTime" label="common.field.createTime" showTime /> | 
|---|
|  |  |  | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> | 
|---|
|  |  |  | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.asnOrder.exceStatus" /> | 
|---|
|  |  |  | {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} | 
|---|
|  |  |  | <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|---|
|  |  |  | <WrapperField cellClassName="opt" label="common.field.opt"> | 
|---|
|  |  |  | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> | 
|---|
|  |  |  | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
|---|
|  |  |  | <EditButton label="toolbar.detail" sx={{ padding: '1px', fontSize: '.75rem' }} /> | 
|---|
|  |  |  | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode="pessimistic"/> | 
|---|
|  |  |  | </WrapperField> | 
|---|
|  |  |  | </StyledDatagrid> | 
|---|
|  |  |  | </List> | 
|---|