Scroll and wage fix - Employee

This commit is contained in:
2025-05-23 14:11:06 +02:00
parent e49622136c
commit 8ba6920a2b
3 changed files with 84 additions and 71 deletions

View File

@@ -2,8 +2,12 @@ import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import Js import Js
ColumnLayout {
id: colPar ScrollView
{
id: scroll
width: parent.width
height: parent.height
function checkFields() { function checkFields() {
if (!personalData.checkPersonalField()) if (!personalData.checkPersonalField())
@@ -20,81 +24,86 @@ ColumnLayout {
} }
} }
Layout.fillHeight: true ColumnLayout {
Layout.fillWidth: true id: colPar
anchors.fill: parent
implicitWidth: parent.width
Component.onCompleted: { height: Screen.desktopAvailableHeight
employee_model.addedNewEmployee.connect(onAddNewEmployee); width: scroll.width
}
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 {
Layout.fillHeight: true Layout.fillHeight: true
}
RowLayout {
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true Layout.fillWidth: true
implicitWidth: parent.width
Button { Component.onCompleted: {
text: qsTr("Abbrechen") employee_model.addedNewEmployee.connect(onAddNewEmployee);
onClicked: contentStack.pop()
} }
Button {
id: saveBtn
enabled: false Label {
text: qsTr("Speichern") id: headline
onClicked: { Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
const new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious); font.pixelSize: 35
employee_model.addEmployee(new_applicant); 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);
}
} }
} }
} }

View File

@@ -292,6 +292,10 @@ GridLayout {
Layout.fillWidth: true Layout.fillWidth: true
placeholderTextColor: "red" placeholderTextColor: "red"
validator: RegularExpressionValidator {
regularExpression: /([0-9]{1,3})/
}
onTextChanged: checkFields() onTextChanged: checkFields()
} }
Label { Label {

View File

@@ -27,7 +27,7 @@ ColumnLayout {
ListElement { ListElement {
name: "Mitarbeiter" name: "Mitarbeiter"
selected: false selected: false
text: qsTr("Kunde") text: qsTr("Mitarbeiter")
} }
ListElement { ListElement {
name: "Erledigt" name: "Erledigt"