refactor: edit get value
This commit is contained in:
parent
4ff7f50811
commit
0b648d8e45
1 changed files with 22 additions and 16 deletions
|
|
@ -201,15 +201,21 @@ export const useCustomerForm = defineStore('form-customer', () => {
|
||||||
|
|
||||||
payDateEN: v.payDateEN,
|
payDateEN: v.payDateEN,
|
||||||
statusSave: true,
|
statusSave: true,
|
||||||
file: await customerStore.listAttachment(v.id).then(async (r) => {
|
file: await customerStore
|
||||||
|
.listAttachment({ parentId: v.id })
|
||||||
|
.then(async (r) => {
|
||||||
if (r) {
|
if (r) {
|
||||||
return await Promise.all(
|
return await Promise.all(
|
||||||
r.map(async (item) => {
|
r.map(async (item) => {
|
||||||
const fragment = item.split('-');
|
const fragment = item.split('-');
|
||||||
const group = fragment.length === 1 ? 'other' : fragment.at(0);
|
const group =
|
||||||
|
fragment.length === 1 ? 'other' : fragment.at(0);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: await customerStore.getAttachment(v.id, item),
|
url: await customerStore.getAttachment({
|
||||||
|
parentId: v.id,
|
||||||
|
name: item,
|
||||||
|
}),
|
||||||
name: item,
|
name: item,
|
||||||
group: group,
|
group: group,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue