diff --git a/Gui/AddApplicant.qml b/Gui/AddApplicant.qml index 3f950a8..8a912e8 100644 --- a/Gui/AddApplicant.qml +++ b/Gui/AddApplicant.qml @@ -1,6 +1,7 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts +import "../js/qmldict.js" as JsLib // ScrollView // { @@ -133,21 +134,22 @@ import QtQuick.Layouts id: saveBtn text: qsTr("Speichern") enabled: false - // onClicked: - // { - // if (!checkAddContact.checked) - // { - // new_business = JsLib.addBusiness(customerView) - // business_model.addBusiness(new_business, 0) - // appLoader.source = "EmployeeTable.qml" - // } - // else - // { - // new_business = JsLib.addBusiness(customerView) - // var new_contact = JsLib.addBusiness(addContactLayout) - // contact_model.addContact(new_contact) - // } - // } + onClicked: + { + if (radio.children[0].checked) + { + var new_applicant = JsLib.addApplicant(personalData) + // business_model.addApplicant(new_business, 0) + // appLoader.source = "EmployeeTable.qml" + console.log(JSON.stringify (new_applicant)) + } + // else + // { + // new_applicant = JsLib.addApplicant(customerView) + // var new_contact = JsLib.addApplicant(addContactLayout) + // contact_model.addContact(new_contact) + // } + } } } Item diff --git a/Gui/AddObjectEmployee.qml b/Gui/AddObjectEmployee.qml index 9b9abfa..be6761b 100644 --- a/Gui/AddObjectEmployee.qml +++ b/Gui/AddObjectEmployee.qml @@ -12,7 +12,7 @@ ApplicationWindow anchors.margins: 10 Label { - text: qsTr("Neuer Mitarbeiter") + text: qsTr("Mitarbeiter zuweisen") Layout.alignment: Qt.AlignHCenter font.pixelSize: 35 } @@ -84,6 +84,11 @@ ApplicationWindow id: output Layout.fillWidth: true } + Item + { + Layout.fillHeight: true + Layout.columnSpan: 2 + } } RowLayout { diff --git a/Gui/ApplicantPersonalData.qml b/Gui/ApplicantPersonalData.qml index cafdccc..da0c25f 100644 --- a/Gui/ApplicantPersonalData.qml +++ b/Gui/ApplicantPersonalData.qml @@ -14,12 +14,25 @@ GridLayout } ComboBox { + property string name: "title" id: title Layout.fillWidth: true editable: false - model: [qsTr("Herr"), qsTr("Frau")] - onCurrentTextChanged: briefAnrede.text = title.currentText === "Herr"? "Sehr geehrter " + - title.currentText: "Sehr geehrte " + title.currentText + 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 { @@ -28,6 +41,7 @@ GridLayout } TextField { + property string name: "firstname" id: firstname Layout.fillWidth: true placeholderText: "Pflichtfeld" @@ -42,6 +56,7 @@ GridLayout } TextField { + property string name: "lastname" id: lastname Layout.fillWidth: true placeholderText: "Pflichtfeld" @@ -56,6 +71,7 @@ GridLayout } TextField { + property string name: "street" id: street Layout.fillWidth: true placeholderTextColor: "red" @@ -68,8 +84,10 @@ GridLayout } RowLayout { + property string name: "Oschkar" ComboBox { + property string name: "postcode" id: postcode Layout.fillWidth: true editable: true @@ -97,6 +115,7 @@ GridLayout } ComboBox { + property string name: "city" id: city Layout.fillWidth: true editable: true @@ -117,6 +136,7 @@ GridLayout } TextField { + property string name: "phone" id: phonenumber Layout.fillWidth: true placeholderTextColor: "red" @@ -128,6 +148,7 @@ GridLayout } TextField { + property string name: "mobile" id: cellphone Layout.fillWidth: true placeholderTextColor: "red" @@ -139,6 +160,7 @@ GridLayout } TextField { + property string name: "email" id: email Layout.fillWidth: true placeholderTextColor: "red" @@ -151,6 +173,7 @@ GridLayout } ComboBox { + property string name: "maritalstatus" id: maritalstatus Layout.fillWidth: true editable: false @@ -165,6 +188,7 @@ GridLayout } TextField { + property string name: "jobdesc" id: jobdescription Layout.fillWidth: true visible: radio.children[1].checked @@ -178,6 +202,7 @@ GridLayout } TextField { + property string name: "workstart" id: workstart Layout.fillWidth: true visible: radio.children[1].checked @@ -191,6 +216,7 @@ GridLayout } TextField { + property string name: "workend" id: workend Layout.fillWidth: true visible: radio.children[1].checked @@ -204,6 +230,7 @@ GridLayout } TextField { + property string name: "timework" id: timetowork Layout.fillWidth: true visible: radio.children[1].checked @@ -216,6 +243,7 @@ GridLayout } TextField { + property string name: "formofaddress" id: briefAnrede Layout.fillWidth: true placeholderTextColor: "red" diff --git a/Gui/ObjectAddOnEmployee.qml b/Gui/ObjectAddOnEmployee.qml index 990dd7f..4f54bda 100644 --- a/Gui/ObjectAddOnEmployee.qml +++ b/Gui/ObjectAddOnEmployee.qml @@ -31,8 +31,8 @@ GridLayout text: qsTr("Mitarbeiter") width: 175 font.bold: true - horizontalAlignment: Text.AlignHCenter - color: "yellow" + horizontalAlignment: Text.AlignLeft + color: "black" } } } @@ -58,11 +58,10 @@ GridLayout { width: 200 height: 15 - padding: 7 + //padding: 7 Text { text: model.namens - color: "yellow" } } @@ -118,10 +117,6 @@ GridLayout employeeModel.append({namens: new_employee["assignee"]}); - console.log(employeeModel.get(num_employees).namens) - - console.log(new_employee["assignee"]) - console.log(JSON.stringify(new_employee)) } } diff --git a/js/qmldict.js b/js/qmldict.js index 7a5c8a7..9c303b6 100644 --- a/js/qmldict.js +++ b/js/qmldict.js @@ -76,6 +76,37 @@ function addObject(form) } return object_form } +function addApplicant(form) +{ + let applicant_form = {}; + for (var i = 0; i < form.children.length; i++) + { + if (form.children[i].name === "Oschkar") + { + if(form.children[i].children[0].editText) + { + applicant_form[form.children[i].children[0].name] = form.children[i].children[0].editText + } + else + { + applicant_form[form.children[i].children[0].name] = form.children[i].children[0].currentText + } + if(form.children[i].children[2].editText) + { + applicant_form[form.children[i].children[2].name] = form.children[i].children[2].editText + } + else + { + applicant_form[form.children[i].children[2].name] = form.children[i].children[2].currentText + } + } + else if (form.children[i].toString().startsWith("TextField")) + { + applicant_form[form.children[i].name] = form.children[i].text.trim() + } + } + return applicant_form +}