283 lines
6.6 KiB
QML
283 lines
6.6 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
|
|
GridLayout
|
|
{
|
|
id: personalData
|
|
columns: 2
|
|
|
|
Label
|
|
{
|
|
text: qsTr("Anrede")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
ComboBox
|
|
{
|
|
property string name: "title"
|
|
id: title
|
|
Layout.fillWidth: true
|
|
editable: false
|
|
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
|
|
placeholderText: "Pflichtfeld"
|
|
placeholderTextColor: "red"
|
|
onTextChanged: checkFields()
|
|
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Nachname")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "lastname"
|
|
id: lastname
|
|
Layout.fillWidth: true
|
|
placeholderText: "Pflichtfeld"
|
|
placeholderTextColor: "red"
|
|
onTextChanged: checkFields()
|
|
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Straße")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "street"
|
|
id: street
|
|
Layout.fillWidth: true
|
|
placeholderTextColor: "red"
|
|
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("PLZ")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
RowLayout
|
|
{
|
|
property string name: "Oschkar"
|
|
ComboBox
|
|
{
|
|
property string name: "postcode"
|
|
id: postcode
|
|
Layout.fillWidth: true
|
|
editable: true
|
|
onCurrentTextChanged: checkFields()
|
|
onEditTextChanged: checkFields()
|
|
onActivated: currentValue
|
|
model: address_model
|
|
textRole: "display"
|
|
popup.height: 300
|
|
popup.y: postcode.y + 5 - (postcode.height * 2)
|
|
currentIndex: -1
|
|
onCurrentIndexChanged: city.currentIndex = postcode.currentIndex
|
|
validator: RegularExpressionValidator
|
|
{
|
|
regularExpression: /([0-9]{1,5})/
|
|
}
|
|
}
|
|
|
|
|
|
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
|
|
popup.y: postcode.y + 5 - (postcode.height * 2)
|
|
currentIndex: -1
|
|
|
|
}
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Telefonnummer")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "phone"
|
|
id: phonenumber
|
|
Layout.fillWidth: true
|
|
placeholderTextColor: "red"
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Mobil")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "mobile"
|
|
id: cellphone
|
|
Layout.fillWidth: true
|
|
placeholderTextColor: "red"
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("E-Mail")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "email"
|
|
id: email
|
|
Layout.fillWidth: true
|
|
placeholderTextColor: "red"
|
|
}
|
|
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
|
|
}
|
|
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"
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Arbeitsbeginn")
|
|
Layout.alignment: Qt.AlignRight
|
|
visible: radio.children[1].checked
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "workstart"
|
|
id: workstart
|
|
Layout.fillWidth: true
|
|
visible: radio.children[1].checked
|
|
placeholderTextColor: "red"
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Bei Befristung Ende")
|
|
Layout.alignment: Qt.AlignRight
|
|
visible: radio.children[1].checked
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "workend"
|
|
id: workend
|
|
Layout.fillWidth: true
|
|
visible: radio.children[1].checked
|
|
placeholderTextColor: "red"
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Arbeitszeiten")
|
|
Layout.alignment: Qt.AlignRight
|
|
visible: radio.children[1].checked
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "timework"
|
|
id: timetowork
|
|
Layout.fillWidth: true
|
|
visible: radio.children[1].checked
|
|
placeholderTextColor: "red"
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Briefanrede")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "formofaddress"
|
|
id: briefAnrede
|
|
Layout.fillWidth: true
|
|
placeholderTextColor: "red"
|
|
}
|
|
|
|
Item
|
|
{
|
|
Layout.fillHeight: true
|
|
Layout.columnSpan: 2
|
|
}
|
|
function checkPersonalField()
|
|
{
|
|
if (radio.children[0].checked)
|
|
{
|
|
return (firstname.text.trim() && lastname.text.trim())
|
|
}
|
|
else
|
|
{
|
|
console.log("Mitarbeiter")
|
|
return (firstname.text.trim() && lastname.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
|
|
workstart.placeholderText = pf
|
|
workend.placeholderText = pf
|
|
timetowork.placeholderText = pf
|
|
briefAnrede.placeholderText = pf
|
|
}
|
|
}
|