added BusinessDAO

This commit is contained in:
2024-12-04 16:56:20 +01:00
parent 6e91637792
commit 50720596c6
11 changed files with 303 additions and 34668 deletions

View File

@@ -3,6 +3,8 @@ import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Fusion
import "../js/qmldict.js" as JsLib
ColumnLayout
{
Layout.fillWidth: true
@@ -17,6 +19,7 @@ ColumnLayout
}
CheckBox
{
id: checkAddContact
text: qsTr("Ansprechpartner hinzufügen")
Layout.alignment: Qt.AlignRight
checked: false
@@ -30,6 +33,7 @@ ColumnLayout
spacing: 45
GridLayout
{
id: businessGrid
columns: 2
Layout.fillWidth: true
Layout.fillHeight: true
@@ -37,6 +41,7 @@ ColumnLayout
Label
{
id: lblFirmenName
text: qsTr("Firmenname")
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
}
@@ -46,6 +51,10 @@ ColumnLayout
id: firmenName
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
onTextChanged: isEmptyField()
placeholderText: "Pflichtfeld"
placeholderTextColor: "red"
}
Label
@@ -58,6 +67,9 @@ ColumnLayout
{
id: street
Layout.fillWidth: true
onTextChanged: isEmptyField()
placeholderText: "Pflichtfeld"
placeholderTextColor: "red"
}
Label
{
@@ -67,8 +79,14 @@ ColumnLayout
ComboBox
{
id: postcode
Layout.fillWidth: true
editable: true
onCurrentTextChanged: isEmptyField()
onEditTextChanged: isEmptyField()
model: ["test", "test2", "test3"]
}
Label
@@ -78,8 +96,11 @@ ColumnLayout
}
TextField
{
id: location
id: city
Layout.fillWidth: true
onTextChanged: isEmptyField(city)
placeholderText: "Pflichtfeld"
placeholderTextColor: "red"
}
Label
@@ -137,10 +158,22 @@ ColumnLayout
Layout.fillWidth: true
}
Label
{
text: qsTr("Typ")
Layout.alignment: Qt.AlignRight
}
ComboBox
{
Layout.fillWidth: true
editable: true
}
Label
{
text: qsTr("Info")
Layout.alignment: Qt.AlignRight | Qt.AlignTop
}
ScrollView
{
Layout.fillWidth: true
@@ -213,6 +246,7 @@ ColumnLayout
id: jobdescription
Layout.fillWidth: true
editable: true
}
Label
{
@@ -256,6 +290,7 @@ ColumnLayout
id: rank
Layout.fillWidth: true
editable: true
}
Label
{
@@ -267,6 +302,7 @@ ColumnLayout
id: invoice
Layout.fillWidth: true
editable: true
objectName: "combo"
}
Label
{
@@ -278,6 +314,7 @@ ColumnLayout
id: due
Layout.fillWidth: true
editable: true
}
}
}
@@ -293,7 +330,13 @@ ColumnLayout
}
Button
{
id: saveBtn
text: qsTr("Speichern")
enabled: false
onClicked:
{
JsLib.addBusiness(businessGrid)
}
}
}
@@ -302,4 +345,20 @@ ColumnLayout
id: spacer3
Layout.fillHeight: true
}
function isEmptyField()
{
if (!firmenName.text.trim() || !street.text.trim() || !city.text.trim())
{
saveBtn.enabled = false
}
else
{
if (!postcode.editText.trim() || !postcode.currentText)
saveBtn.enabled = false
else
saveBtn.enabled = true
}
}
}

View File

@@ -6,7 +6,6 @@ import QtQuick.Controls.Fusion
Item {
anchors.fill: parent
//color: "lightslategrey"
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort"]
id: test
@@ -19,10 +18,8 @@ Item {
Button
{
id: addBusinessBtn
//icon.source: "../images/addbusiness.svg"
icon.source: "qrc:/images/addbusiness.svg"
icon.color: "olive"
//width: icon.width
anchors.right: parent.right
flat: true
onClicked: appLoader.source = "AddCustomer.qml"
@@ -34,7 +31,6 @@ Item {
id: tableColumn
anchors
{
top: searchBar.bottom
bottom: parent.bottom
left: parent.left
@@ -43,10 +39,6 @@ Item {
RowLayout
{
// Layout.fillHeight: true
// Layout.fillWidth: true
RadioButton
{
@@ -107,7 +99,6 @@ Item {
{
//property var customWidths: [0.2, 0.5, 0.3, 05, 0.2, 0.2]
property real newWidth: 0
id: testTable
Layout.fillHeight: true
Layout.fillWidth: true
@@ -146,8 +137,6 @@ Item {
repeat: false
onTriggered:
{
//testTable.columnWidths[2] = 150
//console.log("Timing..")
testTable.forceLayout();
}
}
@@ -159,11 +148,7 @@ Item {
required property bool selected
required property bool current
implicitWidth: testTable.width / testTable.columns
//Layout.fillWidth: true
implicitHeight: 25
//border.color: "yellow"
//border.width: 1
//color: selected? "lightblue": palette.base
color: selected
? addBusinessBtn.palette.highlight //palette.highlight
: (testTable.alternatingRows && row % 2 !== 0
@@ -183,19 +168,13 @@ Item {
MouseArea
{
id: mouseArea
property bool hovered: false
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked:
{
bm.onRowClicked(row)
}
onEntered:
{
@@ -211,7 +190,6 @@ Item {
}
}
Item
{
Layout.fillHeight: true

View File

@@ -114,7 +114,7 @@ Item
{
if (firstStart.currentItem.name === "database")
{
pyqcrm_conf = Qmldict.func(submitBtn.grids)
pyqcrm_conf = Qmldict.firstConf(submitBtn.grids)
if (pyqcrm_conf)
{
config.setConfig(pyqcrm_conf)
@@ -123,7 +123,7 @@ Item
}
else
{
pyqcrm_conf = Qmldict.func(submitBtn.grids)
pyqcrm_conf = Qmldict.firstConf(submitBtn.grids)
if (pyqcrm_conf)
{
admin = config.addAdminUser(pyqcrm_conf)