merge main
This commit is contained in:
@@ -145,8 +145,21 @@ ColumnLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
employee_model.addedNewEmployee.connect(onAddNewEmployee)
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// } // ScrollView
|
// } // ScrollView
|
||||||
|
function onAddNewEmployee(added)
|
||||||
|
{
|
||||||
|
if (added)
|
||||||
|
console.log('addedsuccesfully')
|
||||||
|
else
|
||||||
|
console.log('failedtoadd')
|
||||||
|
appLoader.source = 'EmployeeTable.qml'
|
||||||
|
}
|
||||||
|
|
||||||
function checkFields()
|
function checkFields()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,19 +11,6 @@ GridLayout
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
rowSpacing: 9
|
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
|
//// New grid row
|
||||||
|
|
||||||
@@ -158,7 +145,7 @@ GridLayout
|
|||||||
id: mezzanin
|
id: mezzanin
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: false
|
editable: false
|
||||||
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
|
model: [qsTr("Ja"), qsTr("Nein")]
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@@ -173,7 +160,7 @@ GridLayout
|
|||||||
id: lift
|
id: lift
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: false
|
editable: false
|
||||||
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
|
model: [qsTr("Ja"), qsTr("Nein")]
|
||||||
}
|
}
|
||||||
|
|
||||||
//New grid row
|
//New grid row
|
||||||
@@ -188,6 +175,8 @@ GridLayout
|
|||||||
id: objectno
|
id: objectno
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
placeholderText: qsTr("0 oder leer um eine Nummer automatisch zu generieren")
|
||||||
|
placeholderTextColor: "pink"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -230,10 +219,12 @@ GridLayout
|
|||||||
|
|
||||||
function checkObjectField()
|
function checkObjectField()
|
||||||
{
|
{
|
||||||
return (street.text.trim() && houseno.text.trim() &&
|
|
||||||
|
return street.text.trim() && houseno.text.trim() &&
|
||||||
|
|
||||||
(postcode.editText.trim() || postcode.currentText.trim()) &&
|
(postcode.editText.trim() || postcode.currentText.trim()) &&
|
||||||
(city.editText.trim() || city.currentText.trim()) &&
|
(city.editText.trim() || city.currentText.trim()) &&
|
||||||
cleaningproducts.text.trim())
|
cleaningproducts.text.trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,19 +71,20 @@ ColumnLayout
|
|||||||
enabled: false
|
enabled: false
|
||||||
onClicked:
|
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)
|
if (!checkAddContact.checked)
|
||||||
{
|
{
|
||||||
var list = []
|
var list = []
|
||||||
new_object = JsLib.parseForm(newObject)
|
object_model.addObject(new_object, list, false)
|
||||||
object_model.addObject(new_object, list)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new_object = JsLib.parseForm(newObject)
|
|
||||||
var new_objecto = addObjectLayout.getForm()
|
var new_objecto = addObjectLayout.getForm()
|
||||||
object_model.addObject(new_object, new_objecto)
|
object_model.addObject(new_object, new_objecto, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from ..PyqcrmFlags import PyqcrmAppliEmpyFlags
|
|||||||
|
|
||||||
|
|
||||||
class EmployeeDAO(QObject):
|
class EmployeeDAO(QObject):
|
||||||
newEmployeeAdded = Signal()
|
newEmployeeAdded = Signal(bool)
|
||||||
|
|
||||||
__cur = None
|
__cur = None
|
||||||
__all_cols = None
|
__all_cols = None
|
||||||
@@ -44,7 +44,8 @@ class EmployeeDAO(QObject):
|
|||||||
if self.__cur:
|
if self.__cur:
|
||||||
self.__cur.callproc("addApplicant", (json.dumps(data), applicant, enc_key,))
|
self.__cur.callproc("addApplicant", (json.dumps(data), applicant, enc_key,))
|
||||||
self.__con.commit()
|
self.__con.commit()
|
||||||
self.newEmployeeAdded.emit()
|
self.newEmployeeAdded.emit(True)
|
||||||
|
|
||||||
except mariadb.Error as e:
|
except mariadb.Error as e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
self.newEmployeeAdded.emit(False)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import re
|
|||||||
|
|
||||||
|
|
||||||
class EmployeeModel(QAbstractTableModel):
|
class EmployeeModel(QAbstractTableModel):
|
||||||
|
addedNewEmployee = Signal(bool)
|
||||||
__data = None
|
__data = None
|
||||||
__employee_dao = None
|
__employee_dao = None
|
||||||
__visible_index = None
|
__visible_index = None
|
||||||
@@ -26,17 +27,20 @@ class EmployeeModel(QAbstractTableModel):
|
|||||||
|
|
||||||
@Slot(dict, bool)
|
@Slot(dict, bool)
|
||||||
def addEmployee(self, new_employee, applicant = True):
|
def addEmployee(self, new_employee, applicant = True):
|
||||||
new_employee['worklicense'] = int(new_employee['worklicense'])
|
if 'worklicense' in new_employee:
|
||||||
new_employee['residencetype'] = int(new_employee['residencetype'])
|
new_employee['worklicense'] = int(new_employee['worklicense'])
|
||||||
|
new_employee['residencetype'] = int(new_employee['residencetype'])
|
||||||
self.__employee_dao.addEmployee(new_employee, self.__key, applicant)
|
self.__employee_dao.addEmployee(new_employee, self.__key, applicant)
|
||||||
|
|
||||||
@Slot(str)
|
@Slot(str)
|
||||||
def viewCriterion(self, criterion, processed = False, fired = False):
|
def viewCriterion(self, criterion, processed = False, fired = False):
|
||||||
self.__getData(criterion, processed, fired)
|
self.__getData(criterion, processed, fired)
|
||||||
|
|
||||||
@Slot()
|
@Slot(bool)
|
||||||
def __refreshView(self):
|
def __refreshView(self, added):
|
||||||
self.__getData()
|
if added:
|
||||||
|
self.__getData()
|
||||||
|
self.addedNewEmployee.emit(added)
|
||||||
|
|
||||||
def __getData(self, criterion = "Alle", processed = False, fired = False, every_state = True):
|
def __getData(self, criterion = "Alle", processed = False, fired = False, every_state = True):
|
||||||
self.beginResetModel()
|
self.beginResetModel()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ObjectModel(QAbstractTableModel):
|
|||||||
#self.__getData()
|
#self.__getData()
|
||||||
|
|
||||||
@Slot(dict, list, bool)
|
@Slot(dict, list, bool)
|
||||||
def addObject(self, new_object, new_objcontact):
|
def addObject(self, new_object, new_objcontact = None, new_contact = False):
|
||||||
print(new_object)
|
print(new_object)
|
||||||
|
|
||||||
print(new_objcontact)
|
print(new_objcontact)
|
||||||
|
|||||||
Reference in New Issue
Block a user