Compare commits
2 Commits
00e535bb13
...
338733a0fb
| Author | SHA256 | Date | |
|---|---|---|---|
| 338733a0fb | |||
| d512d1d8b0 |
@@ -1,6 +1,7 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import "../js/qmldict.js" as JsLib
|
||||||
|
|
||||||
// ScrollView
|
// ScrollView
|
||||||
// {
|
// {
|
||||||
@@ -133,21 +134,22 @@ import QtQuick.Layouts
|
|||||||
id: saveBtn
|
id: saveBtn
|
||||||
text: qsTr("Speichern")
|
text: qsTr("Speichern")
|
||||||
enabled: false
|
enabled: false
|
||||||
// onClicked:
|
onClicked:
|
||||||
// {
|
{
|
||||||
// if (!checkAddContact.checked)
|
if (radio.children[0].checked)
|
||||||
// {
|
{
|
||||||
// new_business = JsLib.addBusiness(customerView)
|
var new_applicant = JsLib.addApplicant(personalData)
|
||||||
// business_model.addBusiness(new_business, 0)
|
// business_model.addApplicant(new_business, 0)
|
||||||
// appLoader.source = "EmployeeTable.qml"
|
// appLoader.source = "EmployeeTable.qml"
|
||||||
// }
|
console.log(JSON.stringify (new_applicant))
|
||||||
// else
|
}
|
||||||
// {
|
// else
|
||||||
// new_business = JsLib.addBusiness(customerView)
|
// {
|
||||||
// var new_contact = JsLib.addBusiness(addContactLayout)
|
// new_applicant = JsLib.addApplicant(customerView)
|
||||||
// contact_model.addContact(new_contact)
|
// var new_contact = JsLib.addApplicant(addContactLayout)
|
||||||
// }
|
// contact_model.addContact(new_contact)
|
||||||
// }
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item
|
Item
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ ApplicationWindow
|
|||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: qsTr("Neuer Mitarbeiter")
|
text: qsTr("Mitarbeiter zuweisen")
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
font.pixelSize: 35
|
font.pixelSize: 35
|
||||||
}
|
}
|
||||||
@@ -84,6 +84,11 @@ ApplicationWindow
|
|||||||
id: output
|
id: output
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
Item
|
||||||
|
{
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.columnSpan: 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RowLayout
|
RowLayout
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,13 +14,27 @@ GridLayout
|
|||||||
}
|
}
|
||||||
ComboBox
|
ComboBox
|
||||||
{
|
{
|
||||||
|
property string name: "title"
|
||||||
id: title
|
id: title
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: false
|
editable: false
|
||||||
model: [qsTr("Herr"), qsTr("Frau")]
|
|
||||||
onCurrentTextChanged: briefAnrede.text = title.currentText === "Herr"? "Sehr geehrter " +
|
|
||||||
title.currentText: "Sehr geehrte " + title.currentText
|
|
||||||
Layout.columnSpan: 3
|
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
|
Label
|
||||||
{
|
{
|
||||||
@@ -29,6 +43,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "firstname"
|
||||||
id: firstname
|
id: firstname
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
@@ -43,6 +58,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "lastname"
|
||||||
id: lastname
|
id: lastname
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderText: "Pflichtfeld"
|
placeholderText: "Pflichtfeld"
|
||||||
@@ -57,6 +73,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "street"
|
||||||
id: street
|
id: street
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
@@ -81,8 +98,12 @@ GridLayout
|
|||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ComboBox
|
ComboBox
|
||||||
{
|
{
|
||||||
|
property string name: "postcode"
|
||||||
id: postcode
|
id: postcode
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: true
|
editable: true
|
||||||
@@ -99,7 +120,6 @@ GridLayout
|
|||||||
{
|
{
|
||||||
regularExpression: /([0-9]{1,5})/
|
regularExpression: /([0-9]{1,5})/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,6 +131,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
ComboBox
|
ComboBox
|
||||||
{
|
{
|
||||||
|
property string name: "city"
|
||||||
id: city
|
id: city
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: true
|
editable: true
|
||||||
@@ -131,6 +152,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "phone"
|
||||||
id: phonenumber
|
id: phonenumber
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
@@ -143,6 +165,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "mobile"
|
||||||
id: cellphone
|
id: cellphone
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
@@ -155,6 +178,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "email"
|
||||||
id: email
|
id: email
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
@@ -168,6 +192,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
ComboBox
|
ComboBox
|
||||||
{
|
{
|
||||||
|
property string name: "maritalstatus"
|
||||||
id: maritalstatus
|
id: maritalstatus
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: false
|
editable: false
|
||||||
@@ -183,6 +208,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "jobdesc"
|
||||||
id: jobdescription
|
id: jobdescription
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
@@ -197,6 +223,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "workstart"
|
||||||
id: workstart
|
id: workstart
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
@@ -211,6 +238,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "workend"
|
||||||
id: workend
|
id: workend
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
@@ -225,6 +253,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "timework"
|
||||||
id: timetowork
|
id: timetowork
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: radio.children[1].checked
|
visible: radio.children[1].checked
|
||||||
@@ -238,6 +267,7 @@ GridLayout
|
|||||||
}
|
}
|
||||||
TextField
|
TextField
|
||||||
{
|
{
|
||||||
|
property string name: "formofaddress"
|
||||||
id: briefAnrede
|
id: briefAnrede
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
placeholderTextColor: "red"
|
placeholderTextColor: "red"
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ GridLayout
|
|||||||
text: qsTr("Mitarbeiter")
|
text: qsTr("Mitarbeiter")
|
||||||
width: 175
|
width: 175
|
||||||
font.bold: true
|
font.bold: true
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignLeft
|
||||||
color: "yellow"
|
color: "black"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,11 +58,10 @@ GridLayout
|
|||||||
{
|
{
|
||||||
width: 200
|
width: 200
|
||||||
height: 15
|
height: 15
|
||||||
padding: 7
|
//padding: 7
|
||||||
Text
|
Text
|
||||||
{
|
{
|
||||||
text: model.namens
|
text: model.namens
|
||||||
color: "yellow"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,10 +117,6 @@ GridLayout
|
|||||||
|
|
||||||
employeeModel.append({namens: new_employee["assignee"]});
|
employeeModel.append({namens: new_employee["assignee"]});
|
||||||
|
|
||||||
console.log(employeeModel.get(num_employees).namens)
|
|
||||||
|
|
||||||
console.log(new_employee["assignee"])
|
|
||||||
console.log(JSON.stringify(new_employee))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,37 @@ function addObject(form)
|
|||||||
}
|
}
|
||||||
return object_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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user