skyouc
4 天以前 d734647a726a0fc1e693619ad6b1b112f2ff0997
rsf-admin/src/page/statistics/inStockNum/InStockNumList.jsx
@@ -37,8 +37,6 @@
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
import { display, width } from "@mui/system";
import { color } from "framer-motion";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -47,10 +45,19 @@
    '& .RaDatagrid-row': {
        cursor: 'auto'
    },
    '& .column-deadTime': {
        width: 140,
    '& .column-dayTime': {
        width: 120,
        textAlign: 'center',
        color: 'red',
    },
    '& .column-taskType$': {
        width: 130,
    },
    '& .column-matnrCode': {
        width: 150,
        textAlign: 'center',
    },
    '& .RaDatagrid-headerCell': {
@@ -58,103 +65,72 @@
    },
    '& .column-maktx': {
        width: 150
    },
    '& .opt': {
        width: 200
        width: 350
    },
}));
const filters = [
    <SearchInput source="condition" alwaysOn />,
    <DateInput label='common.time.after' source="timeStart" />,
    <DateInput label='common.time.before' source="timeEnd" />,
    <NumberInput source="locId" label="table.field.locItem.locId" />,
    <NumberInput source="orderId" label="table.field.locItem.orderId" />,
    <TextInput source="type$" label="table.field.locItem.type" />,
    <NumberInput source="orderItemId" label="table.field.locItem.orderItemId" />,
    <NumberInput source="wkType$" label="table.field.locItem.wkType" />,
    <NumberInput source="matnrId" label="table.field.locItem.matnrId" />,
    <TextInput source="maktx" label="table.field.locItem.maktx" />,
    <TextInput source="matnrCode" label="table.field.locItem.matnrCode" />,
    <TextInput source="trackCode" label="table.field.locItem.trackCode" />,
    <TextInput source="unit" label="table.field.locItem.unit" />,
    <NumberInput source="anfme" label="table.field.locItem.anfme" />,
    <TextInput source="batch" label="table.field.locItem.batch" />,
    <TextInput source="splrBatch" label="table.field.locItem.splrBatch" />,
    <TextInput source="spec" label="table.field.locItem.spec" />,
    <TextInput source="model" label="table.field.locItem.model" />,
    <TextInput source="fieldsIndex" label="table.field.locItem.fieldsIndex" />,
    <TextInput label="common.field.memo" source="memo" />,
    <SelectInput
        label="common.field.status"
        source="status"
        choices={[
            { id: '1', name: 'common.enums.statusTrue' },
            { id: '0', name: 'common.enums.statusFalse' },
        ]}
        resettable
    />,
]
const InStockNumList = () => {
    const translate = useTranslate();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    const dict = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_task_type' && dict.group == 3)) || [];
    const filters = [
        <SearchInput source="condition" alwaysOn />,
        <DateInput label='common.time.before' source="dayTime" alwaysOn />,
        // <AutocompleteInput optionText="label"
        //     choices={dict}
        //     optionValue="value"
        //     label="table.field.stockStatistic.taskType"
        //     filter
        //     source="taskType"
        //     alwaysOn />,
        <TextInput source="maktx" label="table.field.locItem.maktx" />,
        <TextInput source="matnrCode" label="table.field.locItem.matnrCode" alwaysOn/>,
        <TextInput source="batch" label="table.field.locItem.batch" />,
    ]
    return (
        <Box display="flex">
            <List
                resource="locItem"
                resource="inStatistic"
                sx={{
                    flexGrow: 1,
                    transition: (theme) =>
                        theme.transitions.create(['all'], {
                            duration: theme.transitions.duration.enteringScreen,
                        }),
                    marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
                }}
                title={"menu.locItem"}
                title={false}
                empty={false}
                filter={{taskType: 1, taskStatus: 100}}
                filters={filters}
                sort={{ field: "create_time", order: "asc" }}
                sort={{ field: "day_time", order: "desc" }}
                actions={(
                    <TopToolbar>
                        <FilterButton />
                        <SelectColumnsButton preferenceKey='locItem' />
                        <SelectColumnsButton preferenceKey='stockStatistic' />
                    </TopToolbar>
                )}
                perPage={DEFAULT_PAGE_SIZE}
            >
                <StyledDatagrid
                    preferenceKey='locDeadReport'
                    preferenceKey='stockStatistics'
                    bulkActionButtons={false}
                    rowClick={(id, resource, record) => false}
                    expand={false}
                    expandSingle={true}
                    omit={['id', 'locId', 'orderId', 'orderItemId', 'matnrId', 'trackCode', 'fieldsIndex', 'splrBatch', 'memo']}
                >
                    <NumberField source="id" />
                    <TextField source="locCode" label="table.field.locItem.locCode" />
                    <NumberField source="deadTime" label="table.field.locItem.deadTime" />
                    <NumberField source="locId" label="table.field.locItem.locId" />
                    <NumberField source="matnrId" label="table.field.locItem.matnrId" />
                    <NumberField source="id" key="id-key"/>
                    {/* <TextField source="taskType$" label="table.field.stockStatistic.taskType" /> */}
                    <TextField source="dayTime" label="table.field.stockStatistic.dayTime" />
                    <TextField source="matnrCode" label="table.field.locItem.matnrCode" />
                    <TextField source="maktx" label="table.field.locItem.maktx" />
                    <NumberField source="anfme" label="table.field.locItem.anfme" />
                    <TextField source="batch" label="table.field.locItem.batch" />
                    <TextField source="trackCode" label="table.field.locItem.trackCode" />
                    <TextField source="unit" label="table.field.locItem.unit" />
                    <TextField source="splrBatch" label="table.field.locItem.splrBatch" />
                    <TextField source="spec" label="table.field.locItem.spec" />
                    <TextField source="model" label="table.field.locItem.model" />
                    <TextField source="fieldsIndex" label="table.field.locItem.fieldsIndex" />
                    <TextField source="updateBy$" label="common.field.updateBy" />
                    <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} />
                    <TextField source="memo" label="common.field.memo" sortable={false} />
                </StyledDatagrid>
            </List>
        </Box>