subnav
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
ManifestLines,
|
||||
DELIVERY_LINE_COLUMNS,
|
||||
buildManifestBody,
|
||||
restoreAttachmentsFromApi,
|
||||
dateInputValue,
|
||||
emptyLine,
|
||||
lineFromApi,
|
||||
@@ -160,6 +161,11 @@ class LieferungNeuPage extends PureComponent {
|
||||
if (doc.externalNumber != null) deliveryEditorAutomat.actions.setExternalNumber(String(doc.externalNumber));
|
||||
deliveryEditorAutomat.actions.setLineitems(lines);
|
||||
|
||||
// Restore attachments with thumbnails
|
||||
const apiFiles = doc.files ?? [];
|
||||
const attachments = await restoreAttachmentsFromApi(apiFiles, this.state.attachments);
|
||||
deliveryEditorAutomat.actions.setAttachments(attachments);
|
||||
|
||||
this.setState({
|
||||
status: 'ready',
|
||||
partiesLoading: false,
|
||||
@@ -573,8 +579,10 @@ class LieferungNeuPage extends PureComponent {
|
||||
textEditorAttachment: attachment,
|
||||
});
|
||||
} else if (attachment.file instanceof Blob || attachment.file instanceof File) {
|
||||
const url = URL.createObjectURL(attachment.file);
|
||||
window.open(url, '_blank');
|
||||
if (attachment.file.size > 0) {
|
||||
const url = URL.createObjectURL(attachment.file);
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -614,13 +622,14 @@ class LieferungNeuPage extends PureComponent {
|
||||
const isCreate = docId == null;
|
||||
let body;
|
||||
try {
|
||||
body = buildManifestBody(
|
||||
body = await buildManifestBody(
|
||||
{
|
||||
number: this.state.number ?? '',
|
||||
externalNumber: this.state.externalNumber ?? '',
|
||||
date: this.state.date ?? '',
|
||||
partyId: this.state.partyId,
|
||||
lines: this.state.lines,
|
||||
attachments: this.state.attachments,
|
||||
},
|
||||
{
|
||||
partyField: cfg.partyField,
|
||||
@@ -663,6 +672,11 @@ class LieferungNeuPage extends PureComponent {
|
||||
if (doc.externalNumber != null) deliveryEditorAutomat.actions.setExternalNumber(String(doc.externalNumber));
|
||||
deliveryEditorAutomat.actions.setLineitems(lines);
|
||||
|
||||
// Restore attachments with thumbnails
|
||||
const apiFiles = doc.files ?? [];
|
||||
const attachments = await restoreAttachmentsFromApi(apiFiles, this.state.attachments);
|
||||
deliveryEditorAutomat.actions.setAttachments(attachments);
|
||||
|
||||
enqueueSnackbar(cfg.savedMsg, { variant: 'success' });
|
||||
this.setState({ saving: false });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user