refactor(form-quotation): layout

This commit is contained in:
Methapon Metanipat 2024-10-21 15:06:14 +07:00
parent 3b3979e403
commit bedbcd1a95
4 changed files with 446 additions and 475 deletions

View file

@ -71,10 +71,12 @@ export const useQuotationForm = defineStore('form-quotation', () => {
const currentFormState = ref<{
mode: null | 'info' | 'create' | 'edit';
source?: QuotationFull;
createdAt: string | Date;
createdBy: (locale: string) => string;
}>({
mode: null,
createdBy: (_) => getName() || '',
createdAt: '',
});
function isFormDataDifferent() {
@ -137,6 +139,8 @@ export const useQuotationForm = defineStore('form-quotation', () => {
? data.createdBy.firstNameEN + ' ' + data.createdBy.lastNameEN
: data.createdBy.firstName + ' ' + data.createdBy.lastName;
currentFormState.value.createdAt = data.createdAt;
if (mode === 'assign') return;
currentFormState.value.mode = mode;