checkfield ApplicantNationalInsurance and ApplicantVarious not ready yet
This commit is contained in:
@@ -3,166 +3,140 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import "../js/qmldict.js" as JsLib
|
import "../js/qmldict.js" as JsLib
|
||||||
|
|
||||||
// ScrollView
|
|
||||||
// {
|
|
||||||
// anchors.fill: parent
|
|
||||||
// ScrollBar.vertical: ScrollBar
|
|
||||||
// {
|
|
||||||
// policy: ScrollBar.AlwaysOn
|
|
||||||
// }
|
|
||||||
ColumnLayout
|
|
||||||
{
|
|
||||||
id: colPar
|
|
||||||
anchors.fill: parent
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
||||||
id: headline
|
|
||||||
text: qsTr("Mitarbeiter / Bewerber hinzufügen")
|
|
||||||
font.pixelSize: 35
|
|
||||||
|
|
||||||
}
|
ColumnLayout
|
||||||
ButtonGroup
|
{
|
||||||
|
id: colPar
|
||||||
|
anchors.fill: parent
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||||
|
id: headline
|
||||||
|
text: qsTr("Mitarbeiter / Bewerber hinzufügen")
|
||||||
|
font.pixelSize: 35
|
||||||
|
}
|
||||||
|
ButtonGroup
|
||||||
|
{
|
||||||
|
buttons: radio.children
|
||||||
|
onClicked:
|
||||||
{
|
{
|
||||||
buttons: radio.children
|
checkFields()
|
||||||
|
personalData.requiredField()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row
|
||||||
|
{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
id: radio
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
RadioButton
|
||||||
|
{
|
||||||
|
checked: true
|
||||||
|
text: qsTr("Bewerber")
|
||||||
|
}
|
||||||
|
RadioButton
|
||||||
|
{
|
||||||
|
text: qsTr("Mitarbeiter")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout
|
||||||
|
{
|
||||||
|
Layout.fillWidth: true
|
||||||
|
spacing: 50
|
||||||
|
|
||||||
|
Frame
|
||||||
|
{
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
Layout.fillWidth: true
|
||||||
|
ApplicantPersonalData
|
||||||
|
{
|
||||||
|
id: personalData
|
||||||
|
width: parent.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Frame
|
||||||
|
{
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
Layout.fillWidth: true
|
||||||
|
visible: radio.children[1].checked
|
||||||
|
ColumnLayout
|
||||||
|
{
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
ApplicantBankData
|
||||||
|
{
|
||||||
|
id: bankAccount
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplicantNationalInsurance
|
||||||
|
{
|
||||||
|
id: nationalInsurance
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplicantVarious
|
||||||
|
{
|
||||||
|
id: applicantVarious
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout
|
||||||
|
{
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: qsTr("Abbrechen")
|
||||||
|
onClicked: appLoader.source = "EmployeeTable.qml"
|
||||||
|
}
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
id: saveBtn
|
||||||
|
text: qsTr("Speichern")
|
||||||
|
enabled: false
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
checkFields()
|
var new_applicant
|
||||||
personalData.requiredField()
|
if (radio.children[0].checked)
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Row
|
|
||||||
{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
id: radio
|
|
||||||
Layout.columnSpan: 2
|
|
||||||
RadioButton
|
|
||||||
{
|
|
||||||
checked: true
|
|
||||||
text: qsTr("Bewerber")
|
|
||||||
}
|
|
||||||
RadioButton
|
|
||||||
{
|
|
||||||
text: qsTr("Mitarbeiter")
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RowLayout
|
|
||||||
{
|
|
||||||
Layout.fillWidth: true
|
|
||||||
spacing: 50
|
|
||||||
|
|
||||||
Frame
|
|
||||||
{
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
Layout.fillWidth: true
|
|
||||||
ApplicantPersonalData
|
|
||||||
{
|
{
|
||||||
id: personalData
|
new_applicant = JsLib.parseForm(personalData)
|
||||||
width: parent.width
|
// business_model.addApplicant(new_business, 0)
|
||||||
|
// appLoader.source = "EmployeeTable.qml"
|
||||||
|
console.log(JSON.stringify (new_applicant))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Frame
|
|
||||||
{
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: radio.children[1].checked
|
|
||||||
ColumnLayout
|
|
||||||
{
|
|
||||||
Layout.alignment: Qt.AlignTop
|
|
||||||
width: parent.width
|
|
||||||
// CheckBox
|
|
||||||
// {
|
|
||||||
// id: checkcontactdata
|
|
||||||
// Layout.fillWidth: true
|
|
||||||
// text: qsTr("Kontaktdaten")
|
|
||||||
// checked: false
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ApplicantContactData
|
|
||||||
// {
|
|
||||||
// visible: checkcontactdata.checked
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ApplicantBankData
|
|
||||||
{
|
|
||||||
id: bankAccount
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplicantNationalInsurance
|
|
||||||
{
|
|
||||||
id: nationalInsurance
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplicantVarious
|
|
||||||
{
|
|
||||||
id: applicantVarious
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RowLayout
|
|
||||||
{
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.alignment: Qt.AlignRight
|
|
||||||
Button
|
|
||||||
{
|
|
||||||
text: qsTr("Abbrechen")
|
|
||||||
onClicked: appLoader.source = "EmployeeTable.qml"
|
|
||||||
}
|
|
||||||
Button
|
|
||||||
{
|
|
||||||
|
|
||||||
id: saveBtn
|
|
||||||
text: qsTr("Speichern")
|
|
||||||
enabled: false
|
|
||||||
onClicked:
|
|
||||||
{
|
|
||||||
var new_applicant
|
|
||||||
if (radio.children[0].checked)
|
|
||||||
{
|
|
||||||
new_applicant = JsLib.parseForm(personalData)
|
|
||||||
// business_model.addApplicant(new_business, 0)
|
|
||||||
// appLoader.source = "EmployeeTable.qml"
|
|
||||||
console.log(JSON.stringify (new_applicant))
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// console.log(personalData, bankAccount, nationalInsurance, applicantVarious)
|
|
||||||
new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious)
|
|
||||||
// var new_contact = JsLib.addApplicant(addContactLayout)
|
|
||||||
// contact_model.addContact(new_contact)
|
|
||||||
console.log(JSON.stringify (new_applicant))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item
|
|
||||||
{
|
|
||||||
Layout.fillHeight: true
|
|
||||||
}
|
|
||||||
function checkFields()
|
|
||||||
{
|
|
||||||
if(radio.children[1].checked)
|
|
||||||
{
|
|
||||||
if(!personalData.checkPersonalField() || !bankAccount.checkBankField() )
|
|
||||||
saveBtn.enabled = false
|
|
||||||
else
|
else
|
||||||
saveBtn.enabled = true
|
{
|
||||||
|
// console.log(personalData, bankAccount, nationalInsurance, applicantVarious)
|
||||||
|
new_applicant = JsLib.parseForm(personalData, bankAccount, nationalInsurance, applicantVarious)
|
||||||
|
// var new_contact = JsLib.addApplicant(addContactLayout)
|
||||||
|
// contact_model.addContact(new_contact)
|
||||||
|
console.log(JSON.stringify (new_applicant))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!personalData.checkPersonalField())
|
}
|
||||||
|
}
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
function checkFields()
|
||||||
|
{
|
||||||
|
if(radio.children[1].checked)
|
||||||
|
{
|
||||||
|
if(!personalData.checkPersonalField() || !bankAccount.checkBankField() || !nationalInsurance.checkNationalInsuranceField() )
|
||||||
saveBtn.enabled = false
|
saveBtn.enabled = false
|
||||||
else
|
else
|
||||||
saveBtn.enabled = true
|
saveBtn.enabled = true
|
||||||
}
|
}
|
||||||
|
else if (!personalData.checkPersonalField())
|
||||||
|
saveBtn.enabled = false
|
||||||
|
else
|
||||||
|
saveBtn.enabled = true
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -44,13 +45,16 @@ GridLayout
|
|||||||
property string name: "bank"
|
property string name: "bank"
|
||||||
id: bankname
|
id: bankname
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
model: [qsTr("Sparkasse"),qsTr("Volksbank")]
|
model: ["",qsTr("Sparkasse"),qsTr("Volksbank")]
|
||||||
|
editable: true
|
||||||
|
onCurrentTextChanged: checkFields()
|
||||||
|
onEditTextChanged: checkFields()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
function checkBankField()
|
function checkBankField()
|
||||||
{
|
{
|
||||||
// return (iban.text.trim() && bankname.text.trim())
|
return (iban.text.trim() && (bankname.currentText.trim() || bankname.editText.trim()))
|
||||||
return (iban.text.trim())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@@ -48,6 +49,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@@ -62,6 +64,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox
|
CheckBox
|
||||||
@@ -99,6 +102,14 @@ GridLayout
|
|||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
}
|
}
|
||||||
|
function checkNationalInsuranceField()
|
||||||
|
{
|
||||||
|
if (nation.currentText === "Deutschland")
|
||||||
|
{
|
||||||
|
|
||||||
|
return (socialnumber.text.trim() && taxnumber.text.trim() && medicalinsurance.text.trim())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ GridLayout
|
|||||||
id: street
|
id: street
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
onTextChanged: checkFields()
|
||||||
|
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
@@ -90,6 +91,7 @@ GridLayout
|
|||||||
id: houseno
|
id: houseno
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
onTextChanged: checkFields()
|
||||||
|
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
@@ -107,8 +109,8 @@ GridLayout
|
|||||||
id: postcode
|
id: postcode
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: true
|
editable: true
|
||||||
onCurrentTextChanged: checkFields()
|
|
||||||
onEditTextChanged: checkFields()
|
onEditTextChanged: checkFields()
|
||||||
|
onCurrentTextChanged: checkFields()
|
||||||
onActivated: currentValue
|
onActivated: currentValue
|
||||||
model: address_model
|
model: address_model
|
||||||
textRole: "display"
|
textRole: "display"
|
||||||
@@ -118,7 +120,7 @@ GridLayout
|
|||||||
onCurrentIndexChanged: city.currentIndex = postcode.currentIndex
|
onCurrentIndexChanged: city.currentIndex = postcode.currentIndex
|
||||||
validator: RegularExpressionValidator
|
validator: RegularExpressionValidator
|
||||||
{
|
{
|
||||||
regularExpression: /([0-9]{1,5})/
|
regularExpression: /([^$][0-9]{1,4})/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,6 +159,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -170,6 +173,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -183,6 +187,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -214,6 +219,7 @@ GridLayout
|
|||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -229,6 +235,7 @@ GridLayout
|
|||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -244,6 +251,7 @@ GridLayout
|
|||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -259,6 +267,7 @@ GridLayout
|
|||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
@@ -272,6 +281,7 @@ GridLayout
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
Layout.columnSpan: 3
|
Layout.columnSpan: 3
|
||||||
|
onTextChanged: checkFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
@@ -287,8 +297,11 @@ GridLayout
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("Mitarbeiter")
|
return (firstname.text.trim() && lastname.text.trim() && street.text.trim() && houseno.text.trim()
|
||||||
return (firstname.text.trim() && lastname.text.trim())
|
&& (postcode.editText.trim() || postcode.currentText.trim())
|
||||||
|
&& (city.editText.trim() || city.currentText.trim()) && phonenumber.text.trim()
|
||||||
|
&& cellphone.text.trim() && email.text.trim() && jobdescription.text.trim()
|
||||||
|
&& workstart.text.trim() && workend.text.trim() && timetowork.text.trim() && briefAnrede.text.trim())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function requiredField()
|
function requiredField()
|
||||||
@@ -303,5 +316,6 @@ GridLayout
|
|||||||
workend.placeholderText = pf
|
workend.placeholderText = pf
|
||||||
timetowork.placeholderText = pf
|
timetowork.placeholderText = pf
|
||||||
briefAnrede.placeholderText = pf
|
briefAnrede.placeholderText = pf
|
||||||
|
houseno.placeholderText = pf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user