1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Починка добавления сотрудника5

This commit is contained in:
MoonTestUse1
2024-12-27 02:34:52 +06:00
parent 84e7f7ec06
commit 26243f74da

View File

@@ -2,7 +2,7 @@
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { departments } from '@/utils/constants'; import { departments } from '@/utils/constants';
import type { Employee, EmployeeFormData } from '@/types/employee'; import type { Employee, EmployeeFormData } from '@/types/employee';
import EmployeeForm from './EmployeeForm.vue'; import EmployeeFormModal from './employee/EmployeeFormModal.vue';
const employees = ref<Employee[]>([]); const employees = ref<Employee[]>([]);
const showAddForm = ref(false); const showAddForm = ref(false);
@@ -14,6 +14,7 @@ function getDepartmentLabel(value: string) {
function editEmployee(employee: Employee) { function editEmployee(employee: Employee) {
editingEmployee.value = employee; editingEmployee.value = employee;
showAddForm.value = true;
} }
function closeForm() { function closeForm() {
@@ -120,9 +121,9 @@ onMounted(fetchEmployees);
</table> </table>
</div> </div>
<EmployeeForm <EmployeeFormModal
v-if="showAddForm || editingEmployee" v-if="showAddForm || editingEmployee"
:employee="editingEmployee" :employee="editingEmployee || undefined"
@close="closeForm" @close="closeForm"
@submit="handleSubmit" @submit="handleSubmit"
/> />