skyouc
2025-03-10 8eaee61fbbdea1eaa294b0f1a7d9f2a10da9ade9
rsf-admin/src/page/warehouseAreas/WarehouseAreasCreate.jsx
@@ -17,7 +17,7 @@
    useNotify,
    Form,
    useCreateController,
} from 'react-admin';
} from "react-admin";
import {
    Dialog,
    DialogActions,
@@ -26,7 +26,7 @@
    Stack,
    Grid,
    Box,
} from '@mui/material';
} from "@mui/material";
import DialogCloseButton from "../components/DialogCloseButton";
import StatusSelectInput from "../components/StatusSelectInput";
import MemoInput from "../components/MemoInput";
@@ -45,11 +45,14 @@
    const handleSuccess = async (data) => {
        setOpen(false);
        notify('common.response.success');
    notify("common.response.success");
    };
    const handleError = async (error) => {
        notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } });
    notify(error.message || "common.response.fail", {
      type: "error",
      messageArgs: { _: error.message },
    });
    };
    return (
@@ -70,15 +73,19 @@
                    maxWidth="md"   // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
                >
                    <Form>
                        <DialogTitle id="form-dialog-title" sx={{
                            position: 'sticky',
            <DialogTitle
              id="form-dialog-title"
              sx={{
                position: "sticky",
                            top: 0,
                            backgroundColor: 'background.paper',
                            zIndex: 1000
                backgroundColor: "background.paper",
                zIndex: 1000,
                        }}
                        >
                            {translate('create.title')}
                            <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}>
              {translate("create.title")}
              <Box
                sx={{ position: "absolute", top: 8, right: 8, zIndex: 1001 }}
              >
                                <DialogCloseButton onClose={handleClose} />
                            </Box>
                        </DialogTitle>
@@ -88,7 +95,7 @@
                                    <TextInput
                                        label="table.field.warehouseAreas.uuid"
                                        source="uuid"
                                        parse={v => v}
                    parse={(v) => v}
                                        validate={[required()]}
                                        autoFocus
                                    />
@@ -98,7 +105,7 @@
                                        label="table.field.warehouseAreas.name"
                                        source="name"
                                        validate={[required()]}
                                        parse={v => v}
                    parse={(v) => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
@@ -106,14 +113,11 @@
                                        label="table.field.warehouseAreas.code"
                                        source="code"
                                        validate={[required()]}
                                        parse={v => v}
                    parse={(v) => v}
                                    />
                                </Grid>
                                <Grid item xs={6} display="flex" gap={1}>
                                    <ReferenceInput
                                        source="shipperId"
                                        reference="shipper"
                                    >
                  <ReferenceInput source="shipperId" reference="shipper">
                                        <AutocompleteInput
                                            label="table.field.warehouseAreas.shipperId"
                                            optionText="name"
@@ -134,8 +138,8 @@
                                        source="flagMinus"
                                        validate={[required()]}
                                        choices={[
                                            { id: 0, name: '否' },
                                            { id:  1, name: '是' },
                      { id: 0, name: "否" },
                      { id: 1, name: "是" },
                                        ]}
                                    />
                                </Grid>
@@ -145,8 +149,8 @@
                                        source="flagLabelMange"
                                        validate={[required()]}
                                        choices={[
                                            { id: 0, name: ' 否' },
                                            { id:  1, name: ' 是' },
                      { id: 0, name: " 否" },
                      { id: 1, name: " 是" },
                                        ]}
                                    />
                                </Grid>
@@ -156,8 +160,8 @@
                                        source="flagMix"
                                        validate={[required()]}
                                        choices={[
                                            { id: 0, name: '否' },
                                            { id:  1, name: '是' },
                      { id: 0, name: "否" },
                      { id: 1, name: "是" },
                                        ]}
                                    />
                                </Grid>
@@ -166,14 +170,21 @@
                                    <StatusSelectInput />
                                </Grid>
                                <Grid item xs={12} display="flex" gap={1}>
                                    <Stack direction="column" spacing={1} width={'100%'}>
                  <Stack direction="column" spacing={1} width={"100%"}>
                                        <MemoInput />
                                    </Stack>
                                </Grid>
                            </Grid>
                        </DialogContent>
                        <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
                            <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }}  >
            <DialogActions
              sx={{
                position: "sticky",
                bottom: 0,
                backgroundColor: "background.paper",
                zIndex: 1000,
              }}
            >
              <Toolbar sx={{ width: "100%", justifyContent: "space-between" }}>
                                <SaveButton />
                            </Toolbar>
                        </DialogActions>
@@ -181,7 +192,7 @@
                </Dialog>
            </CreateBase>
        </>
    )
}
  );
};
export default WarehouseAreasCreate;