refactor: wait putAttachment
This commit is contained in:
parent
57a32bdd04
commit
53c015ae6c
1 changed files with 9 additions and 2 deletions
|
|
@ -2684,25 +2684,32 @@ const emptyCreateDialog = ref(false);
|
|||
}
|
||||
|
||||
customerFormData.customerBranch[idx].file?.forEach(
|
||||
(v) => {
|
||||
async (v) => {
|
||||
if (!v.file) return;
|
||||
|
||||
const ext = v.file.name.split('.').at(-1);
|
||||
let filename = v.group + '-' + new Date().getTime();
|
||||
if (ext) filename += `.${ext}`;
|
||||
|
||||
customerStore.putAttachment({
|
||||
const res = await customerStore.putAttachment({
|
||||
branchId:
|
||||
customerFormData.customerBranch?.[idx].id || '',
|
||||
file: v.file,
|
||||
filename,
|
||||
});
|
||||
|
||||
if (res) {
|
||||
await customerFormStore.assignFormData(
|
||||
customerFormState.editCustomerId,
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await customerFormStore.assignFormData(
|
||||
customerFormState.editCustomerId,
|
||||
);
|
||||
|
||||
customerFormStore.resetForm();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue