refactor: add submitPersonal
This commit is contained in:
parent
1164748e1b
commit
2993cf0f02
3 changed files with 116 additions and 5 deletions
|
|
@ -377,10 +377,26 @@ export const useEmployeeForm = defineStore('form-employee', () => {
|
|||
}
|
||||
|
||||
function resetFormDataEmployee(cb?: (...args: any[]) => unknown) {
|
||||
state.value.dialogType = 'create';
|
||||
currentFromDataEmployee.value = structuredClone(resetEmployeeData);
|
||||
cb?.();
|
||||
}
|
||||
|
||||
async function submitPersonal() {
|
||||
if (state.value.dialogType === 'create') {
|
||||
const res = await employeeStore.create({
|
||||
...currentFromDataEmployee.value,
|
||||
customerBranchId: state.value.formDataEmployeeOwner?.id || '',
|
||||
|
||||
employeeWork: [],
|
||||
employeeCheckup: [],
|
||||
employeeOtherInfo: undefined,
|
||||
});
|
||||
}
|
||||
if (state.value.dialogType === 'edit') {
|
||||
}
|
||||
}
|
||||
|
||||
async function assignFormDataEmployee(id: string) {
|
||||
const res = await employeeStore.fetchById(id);
|
||||
|
||||
|
|
@ -457,6 +473,8 @@ export const useEmployeeForm = defineStore('form-employee', () => {
|
|||
currentFromDataEmployee,
|
||||
resetEmployeeData,
|
||||
|
||||
submitPersonal,
|
||||
|
||||
resetFormDataEmployee,
|
||||
assignFormDataEmployee,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue