A lot of changes going on
This commit is contained in:
236
Gui/Offers/AddNewOffer.qml
Normal file
236
Gui/Offers/AddNewOffer.qml
Normal file
@@ -0,0 +1,236 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
GridLayout
|
||||
{
|
||||
id: newObject
|
||||
|
||||
columns: 4
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
rowSpacing: 9
|
||||
|
||||
//New Grid
|
||||
Label
|
||||
{
|
||||
text: qsTr("Objekt:")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font: Typography.h2
|
||||
|
||||
|
||||
}
|
||||
Item
|
||||
{
|
||||
Layout.columnSpan: 3
|
||||
}
|
||||
|
||||
//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
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: qsTr("Objekt hinzufügen")
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
}
|
||||
Item
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//// New grid row
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("PLZ")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
property string name: "postcode"
|
||||
id: postcode
|
||||
Layout.fillWidth: true
|
||||
editable: true
|
||||
// onCurrentTextChanged: checkFields()
|
||||
// onEditTextChanged: checkFields()
|
||||
onActivated: currentValue
|
||||
model: address_model
|
||||
textRole: "display"
|
||||
popup.height: 300
|
||||
currentIndex: -1
|
||||
onCurrentIndexChanged:
|
||||
{
|
||||
city.currentIndex = postcode.currentIndex
|
||||
|
||||
}
|
||||
|
||||
validator: RegularExpressionValidator
|
||||
{
|
||||
regularExpression: /([0-9]{1,5})/
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Ort")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
property string name: "city"
|
||||
id: city
|
||||
Layout.fillWidth: true
|
||||
editable: true
|
||||
// onEditTextChanged: checkFields()
|
||||
// onCurrentTextChanged: checkFields()
|
||||
model: address_model
|
||||
textRole: "city"
|
||||
popup.height: 300
|
||||
currentIndex: -1
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Straße")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
property string name: "street"
|
||||
id: street
|
||||
model: object_model
|
||||
textRole: "StreetInPostcode"
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
// onTextChanged: checkFields()
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: qsTr("Nr.*")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
ComboBox
|
||||
{
|
||||
property string name: "houseno"
|
||||
id: houseno
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
// onTextChanged: checkFields()
|
||||
}
|
||||
|
||||
// New grid row
|
||||
|
||||
|
||||
//New Grid
|
||||
Label
|
||||
{
|
||||
text: qsTr("Kunde:")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font: Typography.h2
|
||||
|
||||
|
||||
}
|
||||
Item
|
||||
{
|
||||
Layout.columnSpan: 3
|
||||
}
|
||||
|
||||
//New grid row
|
||||
Label
|
||||
{
|
||||
text: qsTr("Kunden-Nr.")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
property string name: "customerno"
|
||||
id: customerno
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
Button
|
||||
{
|
||||
text: qsTr("Kunde hinzufügen")
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
}
|
||||
Item
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// New grid row
|
||||
Label
|
||||
{
|
||||
text: qsTr("Kunden-Name")
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
|
||||
id: customerName
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
Layout.columnSpan: 2
|
||||
}
|
||||
//New Grid
|
||||
Label
|
||||
{
|
||||
text: qsTr("Leistungen:")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
font: Typography.h2
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
Layout.columnSpan: 3
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
// function checkObjectField()
|
||||
// {
|
||||
|
||||
// return street.text.trim() && houseno.text.trim() &&
|
||||
|
||||
// (postcode.editText.trim() || postcode.currentText.trim()) &&
|
||||
// (city.editText.trim() || city.currentText.trim()) &&
|
||||
// cleaningproducts.text.trim()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
111
Gui/Offers/AddOffer.qml
Normal file
111
Gui/Offers/AddOffer.qml
Normal file
@@ -0,0 +1,111 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Dialogs
|
||||
import Js
|
||||
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
property var new_object: null
|
||||
//property alias checkAddContact: checkAddContact
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 15
|
||||
Label
|
||||
{
|
||||
text: qsTr("Angebot anlegen")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 35
|
||||
}
|
||||
|
||||
|
||||
RowLayout
|
||||
{
|
||||
id: addObject
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 45
|
||||
|
||||
|
||||
AddNewOffer
|
||||
{
|
||||
id: newOffer
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
RowLayout
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Button
|
||||
{
|
||||
text: qsTr("Abbrechen")
|
||||
onClicked: contentStack.pop()
|
||||
}
|
||||
Button
|
||||
{
|
||||
|
||||
id: saveBtn
|
||||
text: qsTr("Speichern")
|
||||
// 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
|
||||
// object_model.addObject(new_object)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: spacer3
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
//object_model.objectAdded.connect(onObjectAdded)
|
||||
//contact_model.objectContactAdded.connect(onObjectContact)
|
||||
}
|
||||
|
||||
|
||||
// Connections
|
||||
// {
|
||||
// target: object_model
|
||||
|
||||
// function onObjectIdReady()
|
||||
// {
|
||||
// var obj_id = arguments[0]
|
||||
// if (checkAddObjectContact.checked && obj_id)
|
||||
// {
|
||||
// var new_objecto = addObjectLayout.getForm()
|
||||
// contact_model.addObjectContact(new_objecto, obj_id)
|
||||
// object_model.viewCriterion("Alle")
|
||||
// }
|
||||
|
||||
// appLoader.source = "ObjectTable.qml"
|
||||
// }
|
||||
// }
|
||||
|
||||
// function checkFields()
|
||||
// {
|
||||
// if(checkAddObjectContact.checked)
|
||||
// {
|
||||
// if(!newObject.checkObjectField() || !addObjectLayout.contactPerson.contacts || !addObjectLayout.contactPerson.contacts.length)
|
||||
// saveBtn.enabled = false
|
||||
// else
|
||||
// saveBtn.enabled = true
|
||||
// }
|
||||
// else if (!newObject.checkObjectField())
|
||||
// saveBtn.enabled = false
|
||||
// else
|
||||
// saveBtn.enabled = true
|
||||
// }
|
||||
}
|
||||
67
Gui/Offers/OffersTable.qml
Normal file
67
Gui/Offers/OffersTable.qml
Normal file
@@ -0,0 +1,67 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
anchors.fill: parent
|
||||
spacing: Dimensions.l
|
||||
function viewOffers(criterion)
|
||||
{
|
||||
//offer_model.viewCriterion(criterion)
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
spacing: Dimensions.l
|
||||
SearchBar
|
||||
{
|
||||
id: searchBar
|
||||
}
|
||||
QuickFilter {
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
name: "Alle"
|
||||
text: qsTr("Alle")
|
||||
selected: true
|
||||
}
|
||||
ListElement
|
||||
{
|
||||
name: "Offen"
|
||||
text: qsTr("Offen")
|
||||
selected: false
|
||||
}
|
||||
ListElement
|
||||
{
|
||||
name: "Abgeschlossen"
|
||||
selected: false
|
||||
text: qsTr("Abgeschlossen")
|
||||
}
|
||||
ListElement {
|
||||
name: "Erledigt"
|
||||
selected: false
|
||||
text: qsTr("Erledigt")
|
||||
}
|
||||
}
|
||||
|
||||
onSelectedChanged: name => {
|
||||
business_model.viewCriterion(name);
|
||||
}
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: addOfferBtn
|
||||
text: qsTr("Angebote Hinzufügen")
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
flat: true
|
||||
onClicked: contentStack.push("AddOffer.qml")
|
||||
}
|
||||
}
|
||||
Item {
|
||||
id: spacer
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
1
Gui/Offers/qmldir
Normal file
1
Gui/Offers/qmldir
Normal file
@@ -0,0 +1 @@
|
||||
module Offers
|
||||
Reference in New Issue
Block a user