diff --git a/src/pages/05_quotation/form.ts b/src/pages/05_quotation/form.ts index fc400301..312fdd9f 100644 --- a/src/pages/05_quotation/form.ts +++ b/src/pages/05_quotation/form.ts @@ -31,6 +31,11 @@ export const useQuotationForm = defineStore('form-quotation', () => { let resetFormData = structuredClone(defaultFormData); const currentFormData = ref(structuredClone(resetFormData)); + const currentFormState = ref<{ + mode: null | 'info' | 'create' | 'edit'; + }>({ + mode: null, + }); function isFormDataDifferent() { const { ...resetData } = resetFormData; @@ -54,9 +59,13 @@ export const useQuotationForm = defineStore('form-quotation', () => { const data = await quotationStore.getQuotation(id); if (!data) return; // NOTE: Error should be handled globally by axios instance + + currentFormState.value.mode = 'edit'; } - function submiQuotationt() {} + function submiQuotationt() { + currentFormState.value.mode = 'info'; + } function injectNewEmployee(data: EmployeeWorker) { currentFormData.value.worker.push({