refactor: add employee

This commit is contained in:
Thanaphon Frappet 2024-10-04 17:57:33 +07:00
parent aa3ca879d0
commit b737d16aaa
2 changed files with 44 additions and 5 deletions

View file

@ -14,7 +14,6 @@ const DEFAULT_DATA: QuotationPayload = {
urgent: false,
customerBranchId: '',
worker: [],
workerCount: 0,
payBillDate: new Date(),
paySplit: [],
paySplitCount: 0,
@ -98,7 +97,7 @@ export const useQuotationForm = defineStore('form-quotation', () => {
currentFormState.value.mode = 'info';
}
function injectNewEmployee(data: EmployeeWorker) {
function injectNewEmployee(data: EmployeeWorker, callback?: () => void) {
currentFormData.value.worker.push({
alienReferencNumber: data.alienReferencNumber,
documentExpireDate: data.documentExpireDate,
@ -113,6 +112,8 @@ export const useQuotationForm = defineStore('form-quotation', () => {
gender: data.gender,
dateOfBirth: data.dateOfBirth,
});
callback?.();
}
function dialogDelete(callback: () => void) {