Kontaktadressen: Modell, Liste und Formular für Akquise-Ziele auf Projektebene
Neue Entität "Kontaktadresse" (Akquise-Ziel, FK projektId) analog zu Kontakten: - Client/models/kontaktadresse.ts: Interface, In-Memory-Mock, CRUD- und REST-Stubs - Client/Components/kontaktadresse.ts: Kontaktadressenliste (Treetable, projektgefiltert) und Stammblatt-Formular - index.ts: Routen /kontaktadresseliste und /kontaktadresse (kein Hauptmenü-Eintrag) - projekt.ts: Kontaktadressen-Button in Projektliste (kompakt in einer Zelle) und im Projekt-Formular (nur bei bestehendem Projekt) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
1 parent
68e9de8dc1
commit
3e1791d316
4 files changed
+442
-14
No files matched your search
@@ -60,6 +60,11 @@ export const projektliste: m.ClosureComponent = (vnode) => {
|
||||
e.stopPropagation()
|
||||
m.route.set("/calllogliste", {projektId: projekt.id})
|
||||
}
|
||||
|
||||
const showKontaktadressen = (projekt: iProjekt, e: Event) => {
|
||||
e.stopPropagation()
|
||||
m.route.set("/kontaktadresseliste", {projektId: projekt.id})
|
||||
}
|
||||
|
||||
const addCallLog = (projekt: iProjekt, e: Event) => {
|
||||
e.stopPropagation()
|
||||
@@ -85,18 +90,19 @@ export const projektliste: m.ClosureComponent = (vnode) => {
|
||||
|
||||
const columnmapper: (node: iTreenode) => any[] = (node: iTreenode) => {
|
||||
let projekt: iProjekt = node.nodevalue
|
||||
const isSelected = selectedNode === node
|
||||
const cellStyle = isSelected ? {backgroundColor: '#e6f7ff'} : {}
|
||||
|
||||
|
||||
return [
|
||||
m("div", {style: cellStyle}, m("strong", projekt.kundenName)),
|
||||
m("span", {style: cellStyle}, projekt.projektname),
|
||||
m("span", {style: cellStyle}, projekt.zweck),
|
||||
m("span", {style: cellStyle}, projekt.verantwortlicher),
|
||||
m("span", {style: cellStyle}, projekt.startdatum),
|
||||
m("button.w3-button.w3-small", {style: cellStyle, onclick: (e: Event) => editProjekt(projekt, e)}, m("i.material-icons", "edit")),
|
||||
m("button.w3-button.w3-small", {title: "Gesprächsnotizen anzeigen", style: cellStyle, onclick: (e: Event) => showCallLogs(projekt, e)}, m("i.material-icons", "call_log")),
|
||||
m("button.w3-button.w3-small", {title: "Gesprächsnotiz hinzufügen", style: cellStyle, onclick: (e: Event) => addCallLog(projekt, e)}, m("i.material-icons", "add_call"))
|
||||
m("div", m("strong", projekt.kundenName)),
|
||||
m("span", projekt.projektname),
|
||||
m("span", projekt.zweck),
|
||||
m("span", projekt.verantwortlicher),
|
||||
m("span", projekt.startdatum),
|
||||
m("div", {style: {display: 'flex', gap: '0', 'white-space': 'nowrap'}},
|
||||
m("button.w3-button.w3-small", {style: {padding: '0 2px'}, onclick: (e: Event) => editProjekt(projekt, e)}, m("i.material-icons", "edit")),
|
||||
m("button.w3-button.w3-small", {title: "Kontaktadressen anzeigen", style: {padding: '0 2px'}, onclick: (e: Event) => showKontaktadressen(projekt, e)}, m("i.material-icons", "contact_page")),
|
||||
m("button.w3-button.w3-small", {title: "Gesprächsnotizen anzeigen", style: {padding: '0 2px'}, onclick: (e: Event) => showCallLogs(projekt, e)}, m("i.material-icons", "call_log")),
|
||||
m("button.w3-button.w3-small", {title: "Gesprächsnotiz hinzufügen", style: {padding: '0 2px'}, onclick: (e: Event) => addCallLog(projekt, e)}, m("i.material-icons", "add_call"))
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
@@ -129,12 +135,13 @@ export const projektliste: m.ClosureComponent = (vnode) => {
|
||||
'overflow-y': 'inherit'}},
|
||||
m("h1", "Projektliste"),
|
||||
m("div", {style: {flex: '1', 'overflow-y': 'inherit'}},
|
||||
m(Treetable,
|
||||
m(Treetable,
|
||||
{
|
||||
treenodes: treenodes,
|
||||
columnmapper: columnmapper,
|
||||
filter: filterFunction,
|
||||
onRowMarked: handleRowMarked
|
||||
onRowMarked: handleRowMarked,
|
||||
isSelected: (node: iTreenode) => node === selectedNode
|
||||
} as iTreetable,
|
||||
m(TopbarButton, {onclick: addProjektRoute, tooltip: "Neues Projekt anlegen"} as iTopbarButton,
|
||||
m("i.material-icons", "post_add")
|
||||
@@ -218,7 +225,14 @@ export const Projekt: m.ClosureComponent = (vnode) => {
|
||||
return {value: k.id, label: k.name}
|
||||
})
|
||||
return m("div.w3-container.w3-auto.form-view-container",
|
||||
m("h1", currentProjekt.id === -1 ? "Neues Projekt anlegen" : "Projekt-Stammblatt"),
|
||||
m("div", {style: {display: 'flex', 'align-items': 'center', 'justify-content': 'space-between'}},
|
||||
m("h1", currentProjekt.id === -1 ? "Neues Projekt anlegen" : "Projekt-Stammblatt"),
|
||||
currentProjekt.id !== -1
|
||||
? m("button.w3-button.w3-theme",
|
||||
{onclick: () => m.route.set("/kontaktadresseliste", {projektId: currentProjekt.id})},
|
||||
m("i.material-icons", "contact_page"), " Kontaktadressen")
|
||||
: null
|
||||
),
|
||||
m("div", {style: {flex: '1', 'min-height': '0'}},
|
||||
m(Form, {showButtons: true, onsubmit: submit, oncancel: cancel} as iForm, [
|
||||
m("label", "Kunde",
|
||||
|
||||
Reference in new issue
Block a user