| | |
| | | bindmatnr: 'bind matnr', |
| | | bindloc: 'bind loc', |
| | | batchMatnrGropu: 'batchMatnrGropu', |
| | | batchStatus: 'batchStatus', |
| | | batchMix: 'batchFiexed', |
| | | batchWarehouse: 'batchWarehouse', |
| | | }, |
| | | }; |
| | | |
| | |
| | | bindmatnr: '绑定物料', |
| | | bindloc: '绑定库位', |
| | | batchMatnrGropu: '批量物料分组', |
| | | batchStatus: '批量状态', |
| | | batchMix: '批量混放', |
| | | batchWarehouse: '批量仓库', |
| | | }, |
| | | }; |
| | | |
| | |
| | | <AutocompleteInput |
| | | label="table.field.matnr.shipperId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | |
| | | <TextInput |
| | | label="table.field.matnr.platCode" |
| | | source="platCode" |
| | | validate={[required()]} |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | |
| | | <Grid key={item.id} item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label={item.fieldsAlise} |
| | | source={item.fields} |
| | | source={`extendFields.[${item.fields}]`} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | ) |
| | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput source="shipperId" reference="companys" filter={{ type: 'shipper' }}> |
| | | <AutocompleteInput |
| | | validate={[required()]} |
| | | label="table.field.matnr.shipperId" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | |
| | | <Grid key={item.id} item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label={item.fieldsAlise} |
| | | source={item.fields} |
| | | source={`extendFields.[${item.fields}]`} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | ) |
| | |
| | | <TextInput |
| | | label="table.field.matnrGroup.parCode" |
| | | source="parCode" |
| | | value={editRecord?.parCode} |
| | | parse={v => v} |
| | | value={'11'} |
| | | readOnly |
| | | /> |
| | | </Grid> |
| | |
| | | const onSubmit = (data) => { |
| | | const _params = { ...data }; |
| | | if (editRecord) { |
| | | debugger |
| | | if (_params.parentId === editRecord.id) { |
| | | notify('common.response.dataError', { type: 'error' }); |
| | | return; |
| | |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | |
| | | const InitModal = ({ open, setOpen }) => { |
| | | const InitModal = ({ open, setOpen, fieldType }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | |
| | |
| | | const notify = useNotify(); |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | 'status': null |
| | | 'status': null, |
| | | 'wareId': null, |
| | | 'flagMix': null, |
| | | }); |
| | | |
| | | const { selectedIds, onUnselectItems } = useListContext(); |
| | |
| | | |
| | | const reset = () => { |
| | | setFormData({ |
| | | 'status': null |
| | | 'status': null, |
| | | 'wareId': null, |
| | | 'flagMix': null, |
| | | }) |
| | | } |
| | | |
| | |
| | | const handleSubmit = async () => { |
| | | const parmas = { |
| | | id: selectedIds, |
| | | matnr: removeEmptyKeys(formData) |
| | | ...removeEmptyKeys(formData) |
| | | } |
| | | |
| | | const res = await request.post(`/matnr/modify`, parmas); |
| | | const res = await request.post(`/warehouseAreas/modify`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | handleClose() |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="md" fullWidth> |
| | | <Dialog open={open} maxWidth="xs" fullWidth> |
| | | <Form onSubmit={handleSubmit}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('toolbar.batch')}</DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | <StatusSelectInput |
| | | onChange={(e) => handleChange(e.target.value, 'status')} |
| | | defaultValue={''} |
| | | require={false} |
| | | /> |
| | | </Grid> |
| | | {fieldType === 'status' && |
| | | <Grid item xs={6}> |
| | | <StatusSelectInput |
| | | onChange={(e) => handleChange(e.target.value, 'status')} |
| | | defaultValue={''} |
| | | require={false} |
| | | /> |
| | | </Grid> |
| | | } |
| | | {fieldType === 'flagMix' && |
| | | <Grid item xs={6}> |
| | | <SelectInput |
| | | label="table.field.warehouseAreas.flagMix" |
| | | source="flagMix" |
| | | validate={[required()]} |
| | | onChange={(e) => handleChange(e.target.value, 'flagMix')} |
| | | choices={[ |
| | | { id: 0, name: '否' }, |
| | | { id: 1, name: '是' }, |
| | | ]} |
| | | /> |
| | | </Grid> |
| | | } |
| | | {fieldType === 'wareId' && |
| | | <Grid item xs={6}> |
| | | <ReferenceInput |
| | | source="warehouseId" |
| | | reference="warehouse" |
| | | |
| | | > |
| | | <AutocompleteInput |
| | | onChange={(value) => handleChange(value, 'warehouseId')} |
| | | label="table.field.warehouseAreas.wareId" |
| | | optionText="name" |
| | | validate={[required()]} |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | } |
| | | </Grid> |
| | | |
| | | </Box> |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextField source="warehouseId" label="table.field.warehouseAreas.wareId" alwaysOn />, |
| | | <TextField source="warehouseId" label="table.field.warehouseAreas.wareId" />, |
| | | <TextInput source="uuid" label="table.field.warehouseAreas.uuid" />, |
| | | <TextInput source="name" label="table.field.warehouseAreas.name" />, |
| | | <TextInput source="code" label="table.field.warehouseAreas.code" />, |
| | |
| | | preferenceKey='warehouseAreas' |
| | | bulkActionButtons={ |
| | | <> |
| | | <BatchButton /> |
| | | <WareButton /> |
| | | <MixButton /> |
| | | <StatusButton /> |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </> |
| | | } |
| | |
| | | export default WarehouseAreasList; |
| | | |
| | | |
| | | const BatchButton = () => { |
| | | const MixButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchMix"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'flagMix'} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | const WareButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouse"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'wareId'} |
| | | /> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | const StatusButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStatus"}> |
| | | <EditIcon /> |
| | | </Button> |
| | | |
| | | <BatchModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | fieldType={'status'} |
| | | /> |
| | | </> |
| | | |