feat: update dialog state
This commit is contained in:
parent
ba90a6534e
commit
314ffa8582
1 changed files with 4 additions and 0 deletions
|
|
@ -85,6 +85,9 @@ export const useCustomerForm = defineStore('form-customer', () => {
|
|||
if (state.value.dialogType === 'create') {
|
||||
state.value.editCustomerId = '';
|
||||
}
|
||||
if (state.value.dialogType === 'edit') {
|
||||
state.value.dialogType = 'info';
|
||||
}
|
||||
|
||||
currentFormData.value = structuredClone(resetFormData);
|
||||
}
|
||||
|
|
@ -99,6 +102,7 @@ export const useCustomerForm = defineStore('form-customer', () => {
|
|||
|
||||
if (!data) return;
|
||||
|
||||
state.value.dialogType = 'edit';
|
||||
state.value.editCustomerId = id;
|
||||
state.value.editCustomerCode = data.code;
|
||||
state.value.customerImageUrl = `${apiBaseUrl}/customer/${id}/image`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue