From 8ba6920a2b7f013360f705997cc94d84608823fd9b37007527a34565a470dbdf Mon Sep 17 00:00:00 2001 From: linuxero Date: Fri, 23 May 2025 14:11:06 +0200 Subject: [PATCH] Scroll and wage fix - Employee --- Gui/Employees/AddEmployee.qml | 149 +++++++++++++------------ Gui/Employees/EmployeePersonalData.qml | 4 + Gui/Employees/EmployeesTable.qml | 2 +- 3 files changed, 84 insertions(+), 71 deletions(-) diff --git a/Gui/Employees/AddEmployee.qml b/Gui/Employees/AddEmployee.qml index 071d970..1a22ac2 100644 --- a/Gui/Employees/AddEmployee.qml +++ b/Gui/Employees/AddEmployee.qml @@ -2,8 +2,12 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import Js -ColumnLayout { - id: colPar + +ScrollView +{ + id: scroll + width: parent.width + height: parent.height function checkFields() { if (!personalData.checkPersonalField()) @@ -20,81 +24,86 @@ ColumnLayout { } } - Layout.fillHeight: true - Layout.fillWidth: true - anchors.fill: parent - implicitWidth: parent.width + ColumnLayout { + id: colPar - Component.onCompleted: { - employee_model.addedNewEmployee.connect(onAddNewEmployee); - } - - Label { - id: headline - - Layout.alignment: Qt.AlignHCenter | Qt.AlignTop - font.pixelSize: 35 - text: qsTr("Mitarbeiter / Bewerber hinzufügen") - } - RowLayout { - Layout.fillWidth: true - spacing: Dimensions.l - - Frame { - Layout.alignment: Qt.AlignTop - Layout.fillWidth: true - Layout.horizontalStretchFactor: 1 - - EmployeePersonalData { - id: personalData - - implicitWidth: parent.width - } - } - Frame { - Layout.alignment: Qt.AlignTop - Layout.fillWidth: true - Layout.horizontalStretchFactor: 1 - - ColumnLayout { - Layout.alignment: Qt.AlignTop - implicitWidth: parent.width - - EmployeeBankData { - id: bankAccount - - } - EmployeeNationalInsurance { - id: nationalInsurance - } - EmployeeVarious { - id: applicantVarious - - } - } - } - } - Item { + height: Screen.desktopAvailableHeight + width: scroll.width Layout.fillHeight: true - } - RowLayout { - Layout.alignment: Qt.AlignRight Layout.fillWidth: true + implicitWidth: parent.width - Button { - text: qsTr("Abbrechen") - - onClicked: contentStack.pop() + Component.onCompleted: { + employee_model.addedNewEmployee.connect(onAddNewEmployee); } - Button { - id: saveBtn - enabled: false - text: qsTr("Speichern") + Label { + id: headline - onClicked: { - const new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious); - employee_model.addEmployee(new_applicant); + Layout.alignment: Qt.AlignHCenter | Qt.AlignTop + font.pixelSize: 35 + text: qsTr("Mitarbeiter hinzufügen") + } + RowLayout { + Layout.fillWidth: true + spacing: Dimensions.l + + Frame { + Layout.alignment: Qt.AlignTop + Layout.fillWidth: true + Layout.horizontalStretchFactor: 1 + + EmployeePersonalData { + id: personalData + + implicitWidth: parent.width + } + } + Frame { + Layout.alignment: Qt.AlignTop + Layout.fillWidth: true + Layout.horizontalStretchFactor: 1 + + ColumnLayout { + Layout.alignment: Qt.AlignTop + implicitWidth: parent.width + + EmployeeBankData { + id: bankAccount + + } + EmployeeNationalInsurance { + id: nationalInsurance + } + EmployeeVarious { + id: applicantVarious + + } + } + } + } + Item { + Layout.fillHeight: true + } + RowLayout { + Layout.alignment: Qt.AlignRight + Layout.fillWidth: true + + Button { + text: qsTr("Abbrechen") + + onClicked: contentStack.pop() + } + Button { + id: saveBtn + + enabled: false + text: qsTr("Speichern") + + onClicked: { + const new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious); + employee_model.addEmployee(new_applicant); + } } } } diff --git a/Gui/Employees/EmployeePersonalData.qml b/Gui/Employees/EmployeePersonalData.qml index 298a73e..a3aecba 100644 --- a/Gui/Employees/EmployeePersonalData.qml +++ b/Gui/Employees/EmployeePersonalData.qml @@ -292,6 +292,10 @@ GridLayout { Layout.fillWidth: true placeholderTextColor: "red" + validator: RegularExpressionValidator { + regularExpression: /([0-9]{1,3})/ + } + onTextChanged: checkFields() } Label { diff --git a/Gui/Employees/EmployeesTable.qml b/Gui/Employees/EmployeesTable.qml index e696483..a77d510 100644 --- a/Gui/Employees/EmployeesTable.qml +++ b/Gui/Employees/EmployeesTable.qml @@ -27,7 +27,7 @@ ColumnLayout { ListElement { name: "Mitarbeiter" selected: false - text: qsTr("Kunde") + text: qsTr("Mitarbeiter") } ListElement { name: "Erledigt"