refactor: delete quotation

This commit is contained in:
Thanaphon Frappet 2024-10-08 14:05:43 +07:00
parent 30c78ef269
commit 978c338ca4
2 changed files with 9 additions and 2 deletions

View file

@ -198,6 +198,13 @@ async function submitCustomer() {
// customerFormState.value.dialogType = 'info';
}
async function triggerDialogDeleteQuottaion(id: string) {
quotationFormStore.dialogDelete(async () => {
await quotationStore.deleteQuottaion(id);
await fetchQuotationList();
});
}
function triggerCreateCustomerd(opts: { type: 'CORP' | 'PERS' }) {
setDefaultCustomerd();
customerFormState.value.dialogType = 'create';
@ -610,7 +617,7 @@ watch(() => pageState.currentTab, fetchQuotationList);
@edit="quotationFormStore.assignFormData(v.id, 'edit')"
@link="console.log('link')"
@upload="console.log('upload')"
@delete="console.log('delete')"
@delete="triggerDialogDeleteQuottaion(v.id)"
@change-status="console.log('change')"
/>
</div>

View file

@ -181,7 +181,7 @@ export const useQuotationForm = defineStore('form-quotation', () => {
persistent: true,
message: t('dialog.message.confirmDelete'),
action: async () => {
callback;
callback();
},
cancel: () => {},
});