diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index ed17f8d0..330cd288 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -54,7 +54,8 @@ import { columnsCustomer, columnsEmployee, formMenuIconEmployee, - uploadFileList, + uploadFileListEmployee, + uploadFileListCustomer, } from './constant'; import { useCustomerForm, useEmployeeForm } from './form'; import { storeToRefs } from 'pinia'; @@ -2466,8 +2467,8 @@ const emptyCreateDialog = ref(false); " :show=" async () => { - await fetchListOfOptionBranch(); - customerFormStore.resetForm(customerFormState.dialogType === 'create'); + // await fetchListOfOptionBranch(); + // customerFormStore.resetForm(true); } " :before-close=" @@ -2477,6 +2478,7 @@ const emptyCreateDialog = ref(false); return false; } else { fetchListCustomer(); + customerFormStore.resetForm(true); customerFormState.branchIndex = -1; } return false; @@ -2680,6 +2682,23 @@ const emptyCreateDialog = ref(false); ); } + customerFormData.customerBranch[idx].file?.forEach( + (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({ + branchId: + customerFormData.customerBranch?.[idx].id || '', + file: v.file, + filename, + }); + }, + ); + await customerFormStore.assignFormData( customerFormState.editCustomerId, ); @@ -2694,6 +2713,7 @@ const emptyCreateDialog = ref(false); v-model:customer-branch=" customerFormData.customerBranch[idx] " + :tree-file="customerFormState.treeFile" :customer-type="customerFormData.customerType" :customer-name="`${customerFormData.firstName} ${customerFormData.lastName}`" :action-disabled=" @@ -3080,11 +3100,11 @@ const emptyCreateDialog = ref(false); />