Objekt Formular bearbeitet

This commit is contained in:
2025-02-25 15:58:58 +01:00
parent fdaae34678
commit cc25f85771
3 changed files with 33 additions and 23 deletions

View File

@@ -123,7 +123,7 @@ GridLayout
SpinBox SpinBox
{ {
property string name: "partitions" property string name: "units"
id: partitions id: partitions
Layout.fillWidth: true Layout.fillWidth: true
from: 1 from: 1
@@ -179,7 +179,18 @@ GridLayout
} }
//New grid row //New grid row
Label
{
text: qsTr("Objekt-Nr.")
Layout.alignment: Qt.AlignRight
}
TextField
{
property string name: "objectno"
id: objectno
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
}
Label Label
@@ -197,20 +208,7 @@ GridLayout
} }
//// New grid row //// New grid row
Label
{
text: qsTr("Kontaktdaten")
Layout.alignment: Qt.AlignRight | Qt.AlignTop
}
ComboBox
{
property string name: "contact"
id: contact
Layout.fillWidth: true
editable: false
model: [qsTr("Beirat"), qsTr("Hausmeister")]
}
Label Label
{ {
@@ -220,8 +218,8 @@ GridLayout
TextField TextField
{ {
property string name: "cleansing" property string name: "cleaningproducts"
id: cleansing id: cleaningproducts
Layout.fillWidth: true Layout.fillWidth: true
placeholderText: "Pflichtfeld" placeholderText: "Pflichtfeld"
placeholderTextColor: "red" placeholderTextColor: "red"

View File

@@ -7,6 +7,21 @@ GridLayout
property var contacts: null property var contacts: null
columns: 2 columns: 2
Label
{
text: qsTr("Kontaktdaten")
Layout.alignment: Qt.AlignRight | Qt.AlignTop
}
ComboBox
{
property string name: "contacttype"
id: contacttype
Layout.fillWidth: true
editable: false
model: [qsTr("Beirat"), qsTr("Hausmeister")]
}
Label Label
{ {
text: qsTr("Anrede") text: qsTr("Anrede")
@@ -114,6 +129,7 @@ GridLayout
if (Object.keys(contacts).length === 0) if (Object.keys(contacts).length === 0)
{ {
enabled = false enabled = false
console.log(contacts)
} }
checkFields() checkFields()
} }
@@ -124,7 +140,7 @@ GridLayout
{ {
id: addContact id: addContact
text: qsTr("Hinzufügen") text: qsTr("Hinzufügen")
enabled: firstname.text.trim() && lastname.text.trim() && (phonenumber.text.trim() || mobile.text.trim()) && posizion.text.trim() enabled: firstname.text.trim() && lastname.text.trim() && (phonenumber.text.trim() || mobile.text.trim()) && posizion.text.trim() && (contacts === null || Object.keys(contacts).length < 3)
onClicked: onClicked:
{ {
var num_contacts = 0 var num_contacts = 0
@@ -150,11 +166,6 @@ GridLayout
mobile.text = "" mobile.text = ""
posizion.text = "" posizion.text = ""
if (Object.keys(contacts).length >= 3)
{
enabled = false
}
removeContact.enabled = true removeContact.enabled = true
checkFields() checkFields()
} }

View File

@@ -21,6 +21,7 @@ class EmployeeModel(QAbstractTableModel):
self.__employee_dao.newEmployeeAdded.connect(self.__refreshView) self.__employee_dao.newEmployeeAdded.connect(self.__refreshView)
self.__conf = ConfigLoader().getConfig() self.__conf = ConfigLoader().getConfig()
self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY'] self.__key = self.__conf['pyqcrm']['ENCRYPTION_KEY']
print(self.__key)
self.__getData() self.__getData()
@Slot(dict, bool) @Slot(dict, bool)