Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into feature/PC108-…
Browse files Browse the repository at this point in the history
…116/zaak-add-taak
  • Loading branch information
remko48 committed Dec 6, 2024
2 parents 4a695ec + b6b7e8b commit dbb06f8
Show file tree
Hide file tree
Showing 18 changed files with 502 additions and 524 deletions.
1 change: 1 addition & 0 deletions src/entities/taak/taak.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const mockTaakData = (): TTaak[] => [
toelichting: 'Deze taak omvat het uitvoeren van een gedetailleerde interne audit van de bedrijfsprocessen om te controleren of alle afdelingen voldoen aan de vastgestelde kwaliteitsnormen. De bevindingen worden gedocumenteerd en er worden aanbevelingen gedaan voor verbeteringen.',
actie: 'Voorbereiden van auditchecklist, uitvoeren van audits, rapporteren van bevindingen, aanbevelen van verbeteringen.',
klant: 'urn:uuid:6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b',
medewerker: 'urn:uuid:6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b',
},
]

Expand Down
4 changes: 3 additions & 1 deletion src/entities/taak/taak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class Taak implements TTaak {
public toelichting: string
public actie: string
public klant: string

public medewerker: string
constructor(source: TTaak) {
this.id = source.id || ''
this.title = source.title || ''
Expand All @@ -26,6 +26,7 @@ export class Taak implements TTaak {
this.toelichting = source.toelichting || ''
this.actie = source.actie || ''
this.klant = source.klant || ''
this.medewerker = source.medewerker || ''
}

public validate(): SafeParseReturnType<TTaak, unknown> {
Expand All @@ -40,6 +41,7 @@ export class Taak implements TTaak {
toelichting: z.string(),
actie: z.string(),
klant: z.string(),
medewerker: z.string(),
})

return schema.safeParse(this)
Expand Down
3 changes: 2 additions & 1 deletion src/entities/taak/taak.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export type TTaak = {
onderwerp: string;
toelichting: string;
actie: string;
klant: string;
klant: string
medewerker: string
}
3 changes: 0 additions & 3 deletions src/modals/Modals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { navigationStore } from '../store/store.js'
<EditBericht />
<ViewBerichtAuditTrail v-if="navigationStore.modal === 'viewBerichtAuditTrail'" />
<EditTaak v-if="navigationStore.modal === 'editTaak'" />
<WidgetTaakForm v-if="navigationStore.modal === 'widgetTaakForm'" />
<ViewTaakAuditTrail v-if="navigationStore.modal === 'viewTaakAuditTrail'" />
<EditRol />
<ViewKlantRegister v-if="navigationStore.modal === 'viewKlantRegister'" />
Expand All @@ -37,7 +36,6 @@ import EditBericht from './berichten/EditBericht.vue'
import ViewBerichtAuditTrail from './berichten/ViewBerichtAuditTrail.vue'
import EditTaak from './taken/EditTaak.vue'
import ViewTaakAuditTrail from './taken/ViewTaakAuditTrail.vue'
import WidgetTaakForm from './taken/WidgetTaakForm.vue'
import EditRol from './rollen/EditRol.vue'
import ViewZaakAuditTrail from './zaken/ViewZaakAuditTrail.vue'
import ViewKlantRegister from './klantRegister/ViewKlantRegister.vue'
Expand All @@ -57,7 +55,6 @@ export default {
EditBericht,
ViewBerichtAuditTrail,
EditTaak,
WidgetTaakForm,
ViewTaakAuditTrail,
EditRol,
ViewZaakAuditTrail,
Expand Down
86 changes: 63 additions & 23 deletions src/modals/contactMomenten/ContactMomentenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,34 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..

<div v-if="!success">
<div class="headerContainer">
<NcNoteCard type="info" class="noteCard">
<template #default>
<div v-if="klant">
{{ getName(klant) }}
</div>
<div v-else>
Geen klant geselecteerd
</div>
<div class="statusAndStartDateContainer">
<div v-if="contactMoment.status">
status: {{ contactMoment.status }}
<div class="personInfoContainer">
<NcNoteCard type="info" class="noteCard">
<template #default>
<div v-if="klant">
{{ `${getSex(klant)} ${getName(klant)}` }}
<div v-if="klant?.type === 'persoon'" class="flexContainer">
<div>
Geboortedatum: {{ getValidISOstring(klant?.geboortedatum) ? new Date(klant?.geboortedatum).toLocaleDateString() : 'N/A' }}
</div>
<div>
Geboorteplaats: {{ klant?.plaats ?? 'N/A' }}
</div>
</div>
<div v-if="klant?.type === 'organisatie'" class="flexContainer">
<div>
KVK: {{ klant?.kvkNummer ?? 'N/A' }}
</div>
<div>
Locatie: {{ klant?.postcode ?? 'N/A' }} {{ klant?.straatnaam ?? 'N/A' }}
</div>
</div>
</div>
<div v-if="contactMoment.startDate">
startDate: {{ new Date(contactMoment.startDate).toLocaleDateString() }}
<div v-else>
Geen klant geselecteerd
</div>
</div>
</template>
</NcNoteCard>
</template>
</NcNoteCard>
</div>
<div v-if="!klant" class="buttonsContainer">
<div>
<NcButton
Expand Down Expand Up @@ -80,10 +90,18 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</NcButton>
</div>
</div>
<div v-if="isView" class="statusContainer">
<div v-if="contactMoment.status">
Status: {{ contactMoment.status }}
</div>
<div v-if="contactMoment.startDate">
Start datum: {{ new Date(contactMoment.startDate).toLocaleDateString() }}
</div>
</div>
</div>

<div v-if="!success" class="form-group">
<NcTextArea v-model="contactMoment.notitie"
<NcTextArea :value.sync="contactMoment.notitie"
label="Notitie"
:disabled="loading"
:loading="fetchLoading"
Expand Down Expand Up @@ -193,11 +211,17 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
<template #icon>
<DotsHorizontal :size="20" />
</template>
<NcActionButton @click="openTaakForm">
<NcActionButton @click="openTaakForm('medewerker')">
<template #icon>
<CalendarMonthOutline :size="20" />
</template>
Taak aanmaken
Medewerker taak aanmaken
</NcActionButton>
<NcActionButton @click="openTaakForm('klant')">
<template #icon>
<CalendarMonthOutline :size="20" />
</template>
Klant taak aanmaken
</NcActionButton>
<NcActionButton :disabled="true" @click="zaakStore.setZaakItem(); navigationStore.setModal('editZaak')">
<template #icon>
Expand All @@ -220,8 +244,10 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</NcButton>
</template>

<TakenForm v-if="taakFormOpen"
<EditTaakForm v-if="taakFormOpen"
:dashboard-widget="true"
:client-type="taakClientType"
:klant-id="klant?.id"
@close-modal="closeTaakForm"
@save-success="closeTaakForm" />
</NcDialog>
Expand All @@ -234,7 +260,7 @@ import { NcButton, NcActions, NcLoadingIcon, NcDialog, NcTextArea, NcNoteCard, N
// Forms
import SearchKlantModal from '../../modals/klanten/SearchKlantModal.vue'
import TakenForm from '../../modals/taken/WidgetTaakForm.vue'
import EditTaak from '../../modals/taken/EditTaak.vue'
// Icons
import Plus from 'vue-material-design-icons/Plus.vue'
Expand All @@ -244,6 +270,7 @@ import ContentSaveOutline from 'vue-material-design-icons/ContentSaveOutline.vue
import DotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'
import Cancel from 'vue-material-design-icons/Cancel.vue'
import Minus from 'vue-material-design-icons/Minus.vue'
import getValidISOstring from '../../services/getValidISOstring.js'
export default {
name: 'ContactMomentenForm',
Expand All @@ -256,6 +283,7 @@ export default {
NcListItem,
NcActionButton,
NcEmptyContent,
EditTaakForm: EditTaak,
// Icons
Plus,
BriefcaseAccountOutline,
Expand Down Expand Up @@ -308,6 +336,7 @@ export default {
selectedProduct: null,
startingType: 'all',
taakFormOpen: false,
taakClientType: 'both',
}
},
mounted() {
Expand Down Expand Up @@ -403,8 +432,9 @@ export default {
this.searchKlantModalOpen = false
},
openTaakForm() {
openTaakForm(clientType = 'both') {
this.taakFormOpen = true
this.taakClientType = clientType
taakStore.setTaakItem(null)
},
Expand Down Expand Up @@ -462,6 +492,12 @@ export default {
}
return 'onbekend'
},
getSex(klant) {
if (klant.type === 'persoon') {
return `(${klant?.geslacht})`
}
return ''
},
// Tabs
setSelectedZaak(zaak) {
Expand Down Expand Up @@ -534,8 +570,12 @@ div[class='modal-container']:has(.ContactMomentenForm) {
gap: var(--zaa-margin-10);
}
.statusAndStartDateContainer {
.flexContainer, .statusContainer {
display: flex;
gap: var(--zaa-margin-10);
}
.statusContainer {
align-items: center;
}
</style>
6 changes: 3 additions & 3 deletions src/modals/klantRegister/ViewKlantRegister.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ import { taakStore, navigationStore, zaakStore, klantStore } from '../../store/s
:selected-klant-from-widget="klant"
@save-success="fetchZaakItems" />

<WidgetTaakForm v-if="taakModalOpen"
<EditTaakForm v-if="taakModalOpen"
:dashboard-widget="true"
:selected-klant-from-widget="klant"
@save-success="fetchTaakItems" />
Expand All @@ -220,7 +220,7 @@ import ChatOutline from 'vue-material-design-icons/ChatOutline.vue'
import AccountOutline from 'vue-material-design-icons/AccountOutline.vue'
import Eye from 'vue-material-design-icons/Eye.vue'
import DotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'
import WidgetTaakForm from '../../modals/taken/WidgetTaakForm.vue'
import EditTaak from '../../modals/taken/EditTaak.vue'
import WidgetZaakForm from '../../modals/zaken/WidgetZaakForm.vue'
export default {
Expand All @@ -240,7 +240,7 @@ export default {
AccountOutline,
Eye,
DotsHorizontal,
WidgetTaakForm,
EditTaakForm: EditTaak,
WidgetZaakForm,
},
props: {
Expand Down
13 changes: 12 additions & 1 deletion src/modals/medewerkers/EditMedewerker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { medewerkerStore, navigationStore } from '../../store/store.js'
<NcTextField :disabled="loading"
label="Email adres"
maxlength="255"
:value.sync="medewerkerItem.emailadres" />
:value.sync="medewerkerItem.email" />
</div>

<template #actions>
Expand Down Expand Up @@ -119,6 +119,17 @@ export default {
return this.medewerkerItems
},
},
mounted() {
if (medewerkerStore.medewerkerItem?.id) {
this.medewerkerItem = {
...medewerkerStore.medewerkerItem,
voornaam: medewerkerStore.medewerkerItem.voornaam || '',
tussenvoegsel: medewerkerStore.medewerkerItem.tussenvoegsel || '',
achternaam: medewerkerStore.medewerkerItem.achternaam || '',
email: medewerkerStore.medewerkerItem.email || '',
}
}
},
updated() {
if (navigationStore.modal === 'editMedewerker' && !this.hasUpdated) {
Expand Down
Loading

0 comments on commit dbb06f8

Please sign in to comment.