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

View file

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