Use common StackView

This commit is contained in:
Yuri Becker
2025-04-03 13:06:37 +02:00
parent f172468ba6
commit 3083406b1b
35 changed files with 131 additions and 277 deletions

View File

@@ -114,7 +114,7 @@ ColumnLayout
Button
{
text: qsTr("Abbrechen")
onClicked: appLoader.source = "Employees/EmployeesView.qml"
onClicked: contentStack.pop()
}
Button
{
@@ -156,7 +156,7 @@ ColumnLayout
console.log('addedsuccesfully')
else
console.log('failedtoadd')
appLoader.source = 'Employees/EmployeesView.qml'
contentStack.pop()
}
function checkFields()

View File

@@ -0,0 +1,51 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
GridLayout
{
id: bankAccount
columns: 2
property alias jobstatus: title
property alias longest: longest
Label
{
id: longest
text: qsTr("Beschäftigungsverhältnis")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
property string name: "jobstatus"
id: title
Layout.fillWidth: true
editable: false
model: [qsTr("Vollzeit"), qsTr("Teilzeit"), qsTr("Minijob"), qsTr("Ausgeschieden")]
}
Label
{
text: qsTr("IBAN")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "iban"
id: iban
Layout.fillWidth: true
}
Label
{
text: qsTr("Bank")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
property string name: "bank"
id: bankname
Layout.fillWidth: true
model: ["",qsTr("Sparkasse"),qsTr("Volksbank")]
editable: true
}
}

View File

@@ -0,0 +1,263 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
GridLayout
{
id: nationalInsurance
columns: 2
Label
{
Layout.preferredWidth: bankAccount.longest.width
text: qsTr("Herkunftsland")
horizontalAlignment: Text.AlignRight
}
ComboBox
{
property string name: "country"
id: nation
Layout.fillWidth: true
editable: true
model: [qsTr("Deutschland"), qsTr("Syrien")]
}
Label
{
text: qsTr("Sozialversicherungs-Nr")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "socialno"
id: socialno
Layout.fillWidth: true
}
Label
{
text: qsTr("Steuer-ID")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "taxno"
id: taxnumber
Layout.fillWidth: true
}
Label
{
text: qsTr("Krankenkasse")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "medicalinsurance"
id: medicalinsurance
Layout.fillWidth: true
}
Label
{
text: qsTr("Knappschaft")
Layout.alignment: Qt.AlignRight
visible: bankAccount.jobstatus.currentText === "Minijob" ? 1:0
}
TextField
{
property string name: "knappschaft"
id: knappschaft
Layout.fillWidth: true
visible: bankAccount.jobstatus.currentText === "Minijob" ? 1:0
}
Label
{
text: qsTr("Ausweistyp")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
property string name: "idtype"
id: idtype
Layout.fillWidth: true
editable: true
model: [qsTr("Personalausweis"), qsTr("Reisepass")]
}
Label
{
text: qsTr("Ausweis Nr.")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "idnumber"
id: idnumber
Layout.fillWidth: true
}
Label
{
text: qsTr("Ausweis gültig bis")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "idexpiry"
id: idexpiry
Layout.fillWidth: true
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = idexpiry.length
var bd = idexpiry.text
if (len === 2 || len === 5) idexpiry.text = bd + "."
}
}
}
Label
{
text: qsTr("Ausstellungsort")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "idauthority"
id: idauthority
Layout.fillWidth: true
}
Label
{
id: test
text: qsTr("Ausgestellt am")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "idissued"
id: idissued
Layout.fillWidth: true
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = idissued.length
var bd = idissued.text
if (len === 2 || len === 5) idissued.text = bd + "."
}
}
}
CheckBox
{
Layout.preferredWidth: bankAccount.longest.width
property string name: "worklicense"
id: worklicense
text: qsTr("Arbeitserlaubnis <font color='red'><b>?</b></font>")
visible: nation.currentText === "Deutschland"? false:true
}
CheckBox
{
property string name: "residencetype"
id: residencetype
text: qsTr("Aufenthaltstitel")
visible: nation.currentText === "Deutschland"? false:true
}
Label
{
text: qsTr("Aufenthaltstitel Nr.")
visible: residencetype.checked
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "residenceno"
id: residenceno
visible: residencetype.checked
Layout.fillWidth: true
}
Label
{
text: qsTr("Ausgestellt von")
visible: residencetype.checked
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "residenceauthority"
id: residenceauthority
visible: residencetype.checked
Layout.fillWidth: true
}
Label
{
text: qsTr("Ausgestellt am")
visible: residencetype.checked
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "residenceissued"
id: residenceissued
visible: residencetype.checked
Layout.fillWidth: true
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = residenceissued.length
var bd = residenceissued.text
if (len === 2 || len === 5) residenceissued.text = bd + "."
}
}
}
Label
{
text: qsTr("Gültig bis")
visible: residencetype.checked
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "residenceexpiry"
id: residenceexpiry
visible: residencetype.checked
Layout.fillWidth: true
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = residenceexpiry.length
var bd = residenceexpiry.text
if (len === 2 || len === 5) residenceexpiry.text = bd + "."
}
}
}
}

View File

@@ -0,0 +1,444 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
GridLayout
{
id: personalData
columns: 4
Label
{
text: qsTr("Anrede")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
property string name: "title"
id: title
Layout.fillWidth: true
editable: false
Layout.columnSpan: 3
model: [qsTr("Keine Angabe"), qsTr("Herr"), qsTr("Frau")]
onCurrentTextChanged:
{
switch (title.currentIndex)
{
case 1:
briefAnrede.text = "Sehr geehrter Herr "
break
case 2:
briefAnrede.text = "Sehr geehrte Frau "
break
default:
briefAnrede.text = "Guten Tag "
}
}
}
Label
{
text: qsTr("Vorname*")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "firstname"
id: firstname
Layout.fillWidth: true
onTextChanged: checkFields()
Layout.columnSpan: 3
}
Label
{
text: qsTr("Nachname*")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "lastname"
id: lastname
Layout.fillWidth: true
onTextChanged: checkFields()
Layout.columnSpan: 3
}
Label
{
text: qsTr("Straße")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "street"
id: street
Layout.fillWidth: true
placeholderTextColor: "red"
onTextChanged: checkFields()
}
Label
{
text: qsTr("Nr.")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "houseno"
id: houseno
Layout.fillWidth: true
placeholderTextColor: "red"
onTextChanged: checkFields()
validator: RegularExpressionValidator
{
regularExpression: /([0-9a-zA-Z\-]{1,6})/
}
}
Label
{
text: qsTr("PLZ")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
property string name: "postcode"
id: postcode
Layout.fillWidth: true
editable: true
onEditTextChanged: checkFields()
onCurrentTextChanged: checkFields()
onActivated: currentValue
model: address_model
textRole: "display"
popup.height: 300
currentIndex: -1
onCurrentIndexChanged: city.currentIndex = postcode.currentIndex
validator: RegularExpressionValidator
{
regularExpression: /([^$][0-9]{1,4})/
}
}
Label
{
text: qsTr("Ort")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
property string name: "city"
id: city
Layout.fillWidth: true
editable: true
onEditTextChanged: checkFields()
onCurrentTextChanged: checkFields()
model: address_model
textRole: "city"
popup.height: 300
currentIndex: -1
}
Label
{
text: qsTr("Geburtsname")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "birthname"
id: birthname
Layout.fillWidth: true
onTextChanged: checkFields()
Layout.columnSpan: 3
visible: radio.children[1].checked
}
Label
{
text: qsTr("Geburtsdatum*")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "birthday"
id: birthday
Layout.fillWidth: true
onTextChanged: checkFields()
Layout.columnSpan: 3
visible: radio.children[1].checked
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = birthday.length
var bd = birthday.text
if (len === 2 || len === 5) birthday.text = bd + "."
}
}
}
Label
{
text: qsTr("Geburtsort*")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "placeofbirth"
id: placeofbirth
Layout.fillWidth: true
onTextChanged: checkFields()
Layout.columnSpan: 3
visible: radio.children[1].checked
}
Label
{
text: qsTr("Telefonnummer")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "phone"
id: phonenumber
Layout.fillWidth: true
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
validator: RegularExpressionValidator
{
regularExpression: /([+0-9]{1})([0-9]{1,17})/
}
}
Label
{
text: qsTr("Mobil")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "mobile"
id: cellphone
Layout.fillWidth: true
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
validator: RegularExpressionValidator
{
regularExpression: /([+0-9]{1})([0-9]{1,17})/
}
}
Label
{
text: qsTr("E-Mail")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "email"
id: email
Layout.fillWidth: true
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
placeholderText: qsTr("beispiel@domain.de")
validator: RegularExpressionValidator
{
regularExpression: /([\+!#$%&\*\\/\=?\^_`\.{|}\~\-\_0-9A-Za-z]{1,185})@([0-9A-Za-z\.\-\_]{1,64})\.([a-zA-z]{2,5})/
}
}
Label
{
text: qsTr("Familienstand")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
ComboBox
{
property string name: "maritalstatus"
id: maritalstatus
Layout.fillWidth: true
editable: false
model: [qsTr("ledig"), qsTr("verheiratet"), qsTr("verwitwet"), qsTr("geschieden")]
visible: radio.children[1].checked
Layout.columnSpan: 3
}
Label
{
text: qsTr("Stundenlohn")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "salary"
id: salary
Layout.fillWidth: true
visible: radio.children[1].checked
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
}
Label
{
text: qsTr("Jobbeschreibung")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "jobdesc"
id: jobdescription
Layout.fillWidth: true
visible: radio.children[1].checked
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
}
Label
{
text: qsTr("Vertragsbeginn")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "contractstart"
id: contractstart
Layout.fillWidth: true
visible: radio.children[1].checked
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = contractstart.length
var bd = contractstart.text
if (len === 2 || len === 5) contractstart.text = bd + "."
}
}
}
Label
{
text: qsTr("Vertragsende")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
TextField
{
property string name: "contractend"
id: contractend
Layout.fillWidth: true
visible: radio.children[1].checked
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
validator: RegularExpressionValidator
{
regularExpression: /((^|)(0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]))\.((^|)(0[1-9]{1}|1[0-2]{1}))\.((^|)(196[0-9]{1}|19[7-9]{1}[0-9]{1}|20[0-9]{2}))/
}
Keys.onPressed: (event)=>
{
if (event.key !== Qt.Key_Backspace)
{
var len = contractend.length
var bd = contractend.text
if (len === 2 || len === 5) contractend.text = bd + "."
}
}
}
Label
{
text: qsTr("Arbeitszeiten Tage")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
ComboBox
{
property string name: "workdays"
id: workdays
Layout.fillWidth: true
visible: radio.children[1].checked
model: ["1","2","3","4","5","6","7"]
}
Label
{
text: qsTr("Stunden")
Layout.alignment: Qt.AlignRight
visible: radio.children[1].checked
}
ComboBox
{
property string name: "workhours"
id: workhours
Layout.fillWidth: true
visible: radio.children[1].checked
model: ["1","2","3","4","5","6","7","8"]
}
Label
{
text: qsTr("Briefanrede")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "formofaddress"
id: briefAnrede
Layout.fillWidth: true
placeholderTextColor: "red"
Layout.columnSpan: 3
onTextChanged: checkFields()
}
Item
{
Layout.fillHeight: true
Layout.columnSpan: 4
}
function checkPersonalField()
{
if (radio.children[0].checked)
{
return (firstname.text.trim() && lastname.text.trim())
}
else
{
return (firstname.text.trim() && lastname.text.trim() && street.text.trim() && houseno.text.trim()
&& (postcode.editText.trim() || postcode.currentText.trim())
&& (city.editText.trim() || city.currentText.trim())
&& birthday.text.trim() && phonenumber.text.trim()
&& cellphone.text.trim() && email.text.trim() && jobdescription.text.trim()
&& contractstart.text.trim() && contractend.text.trim() && briefAnrede.text.trim())
}
}
function requiredField()
{
var pf = (radio.children[1].checked)?"Pflichtfeld":""
street.placeholderText = pf
phonenumber.placeholderText = pf
cellphone.placeholderText = pf
email.placeholderText = pf
jobdescription.placeholderText = pf
contractstart.placeholderText = pf
contractend.placeholderText = pf
briefAnrede.placeholderText = pf
houseno.placeholderText = pf
}
}

View File

@@ -0,0 +1,63 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
GridLayout
{
id: applicantVarious
columns: 2
Label
{
Layout.preferredWidth: bankAccount.longest.width
text: qsTr("Grad der Behinderung")
horizontalAlignment: Text.AlignRight
}
TextField
{
property string name: "disability"
id: disability
placeholderText: "0,0"
}
Label
{
text: qsTr("Disponent")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "disponent"
id: disponent
Layout.fillWidth: true
}
Label
{
text: qsTr("Kostenstelle")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "office"
id: office
Layout.fillWidth: true
}
Label
{
text: qsTr("Fremdlohn-Nr.")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "empreference"
id: empreference
Layout.fillWidth: true
}
}

View File

@@ -16,7 +16,7 @@ Item
Button
{
text: qsTr("Mitarbeiter zeigen")
onClicked: employeesStack.pop()
onClicked: contentStack.pop()
}
}

View File

@@ -47,7 +47,7 @@ ColumnLayout {
icon.source: "qrc:/images/PlusCircle.svg"
text: qsTr("Mitarbeiter Hinzufügen")
onClicked: appLoader.source = "Employees/AddApplicant.qml"
onClicked: contentStack.push("AddApplicant.qml")
}
}
HorizontalHeaderView {
@@ -114,7 +114,7 @@ ColumnLayout {
hoverEnabled: true
onDoubleClicked: {
employeesStack.push("EmployeeDetails.qml", {
contentStack.push("EmployeeDetails.qml", {
selectedEmployee: row
});
}

View File

@@ -1,16 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels
Item {
anchors.fill: parent
StackView {
id: employeesStack
anchors.fill: parent
initialItem: "EmployeesTable.qml"
}
}