Add shared Manifest UI for delivery, quote, and order.

Wire quote/order API clients and routes, then unify list/create/edit behind ManifestList/Form tiles so Lieferungen and Auftrag share one stack.
This commit is contained in:
seb
2026-08-06 20:08:56 +02:00
parent 8d50d083f5
commit 4896b1dc36
26 changed files with 1356 additions and 1103 deletions

View File

@@ -0,0 +1,93 @@
import { PureComponent } from 'react';
import Autocomplete from '@mui/material/Autocomplete';
import Stack from '@mui/material/Stack';
import TextField from '@mui/material/TextField';
import SingleLineTextEdit from '../SingleLineTextEdit';
import { PanelTile } from '../panels';
import { partyDisplayName } from './manifestConfig';
class ManifestHeader extends PureComponent {
constructor(props) {
super(props);
this.handlePartyChange = this.handlePartyChange.bind(this);
}
handlePartyChange(_event, option) {
this.props.onPartyChange(option?.id ?? null);
}
render() {
const {
kind,
headerColor,
dateLabel,
partyLabel,
parties,
partiesLoading,
partyId,
date,
number,
saving,
onDateChange,
onNumberChange,
} = this.props;
const selected = parties.find((row) => row.id === partyId) ?? null;
return (
<PanelTile wide={3} minHeight={160} color={headerColor} title="Kopfdaten">
<Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>
<TextField
size="small"
type="date"
label={dateLabel}
value={date}
disabled={saving}
onChange={(e) => onDateChange(e.target.value)}
autoComplete="off"
slotProps={{
inputLabel: { shrink: true },
htmlInput: { spellCheck: false },
}}
sx={{ minWidth: 220 }}
/>
<Autocomplete
size="small"
options={parties}
value={selected}
loading={Boolean(partiesLoading)}
disabled={saving}
getOptionLabel={(option) => partyDisplayName(kind, option)}
isOptionEqualToValue={(option, value) => option.id === value.id}
onChange={this.handlePartyChange}
sx={{ flex: 1, minWidth: 220 }}
renderInput={(params) => (
<TextField
{...params}
label={partyLabel}
slotProps={{
...params.slotProps,
htmlInput: {
...params.slotProps?.htmlInput,
spellCheck: false,
autoComplete: 'off',
},
}}
/>
)}
/>
<SingleLineTextEdit
size="small"
label="Nummer"
value={number}
disabled={saving}
onChange={onNumberChange}
sx={{ minWidth: 180, flex: 1 }}
/>
</Stack>
</PanelTile>
);
}
}
export default ManifestHeader;