merge main

This commit is contained in:
2025-02-27 09:39:40 +01:00
6 changed files with 39 additions and 29 deletions

View File

@@ -145,8 +145,21 @@ ColumnLayout
}
}
}
Component.onCompleted:
{
employee_model.addedNewEmployee.connect(onAddNewEmployee)
}
// }
// } // ScrollView
function onAddNewEmployee(added)
{
if (added)
console.log('addedsuccesfully')
else
console.log('failedtoadd')
appLoader.source = 'EmployeeTable.qml'
}
function checkFields()
{

View File

@@ -11,19 +11,6 @@ GridLayout
Layout.fillHeight: true
rowSpacing: 9
Label
{
text: qsTr("Firma")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
ComboBox
{
property string name: "business"
id: business
editable: true
Layout.fillWidth: true
Layout.columnSpan: 3
}
//// New grid row
@@ -158,7 +145,7 @@ GridLayout
id: mezzanin
Layout.fillWidth: true
editable: false
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
model: [qsTr("Ja"), qsTr("Nein")]
}
Label
@@ -173,7 +160,7 @@ GridLayout
id: lift
Layout.fillWidth: true
editable: false
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
model: [qsTr("Ja"), qsTr("Nein")]
}
//New grid row
@@ -188,6 +175,8 @@ GridLayout
id: objectno
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
placeholderText: qsTr("0 oder leer um eine Nummer automatisch zu generieren")
placeholderTextColor: "pink"
}
@@ -230,10 +219,12 @@ GridLayout
function checkObjectField()
{
return (street.text.trim() && houseno.text.trim() &&
return street.text.trim() && houseno.text.trim() &&
(postcode.editText.trim() || postcode.currentText.trim()) &&
(city.editText.trim() || city.currentText.trim()) &&
cleaningproducts.text.trim())
cleaningproducts.text.trim()
}
}

View File

@@ -71,19 +71,20 @@ ColumnLayout
enabled: false
onClicked:
{
new_object = JsLib.parseForm(newObject)
new_object['lift'] = new_object['lift'] === 'Ja' ? 1 : 0
new_object['mezzanin'] = new_object['mezzanin'] === 'Ja' ? 1 : 0
if (!checkAddContact.checked)
{
var list = []
new_object = JsLib.parseForm(newObject)
object_model.addObject(new_object, list)
object_model.addObject(new_object, list, false)
}
else
{
new_object = JsLib.parseForm(newObject)
var new_objecto = addObjectLayout.getForm()
object_model.addObject(new_object, new_objecto)
object_model.addObject(new_object, new_objecto, true)
}
}
}