| New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material'; |
| | | import { |
| | | List, |
| | | DateField, |
| | | TextField, |
| | | TopToolbar, |
| | | FilterButton, |
| | | NumberField, |
| | | useTranslate, |
| | | WrapperField, |
| | | useRecordContext, |
| | | DatagridConfigurable, |
| | | useRedirect, |
| | | } from 'react-admin'; |
| | | |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting.js'; |
| | | import BillStatusField from '../../components/BillStatusField'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import * as Common from '@/utils/common.js'; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 220 |
| | | }, |
| | | '& .wkType': { |
| | | width: 110 |
| | | }, |
| | | '& .status': { |
| | | width: 90 |
| | | }, |
| | | })); |
| | | |
| | | const TransferOrders = () => { |
| | | const redirct = useRedirect(); |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | | const translate = useTranslate(); |
| | | return ( |
| | | <> |
| | | <Card sx={{ margin: 'auto' }}> |
| | | <List |
| | | resource="transfer/orders" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | }} |
| | | title={false} |
| | | empty={false} |
| | | pagination={false} |
| | | filters={false} |
| | | filter={{ id: record?.id }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={false} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | sx={{ margin: 'auto', width: '100%' }} |
| | | preferenceKey='outStock' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => { |
| | | if (record.type == 'out') { |
| | | redirct("/outStock") |
| | | } else if (record.type == 'in') { |
| | | redirct("/asnOrder") |
| | | } |
| | | }} |
| | | expandSingle={true} |
| | | omit={['id', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.transferOrder.code"/> |
| | | <TextField source="poCode" label="table.field.transferOrder.poCode" /> |
| | | <TextField source="type$" label="table.field.transferOrder.type" /> |
| | | <TextField cellClassName="wkType" source="wkType$" label="table.field.transferOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.transferOrder.anfme" /> |
| | | <NumberField source="workQty" label="table.field.transferOrder.workQty" /> |
| | | <NumberField source="qty" label="table.field.transferOrder.qty" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.outStock.exceStatus" /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default TransferOrders; |