diff --git a/src/modals/zaken/ZaakForm.vue b/src/modals/zaken/ZaakForm.vue
index 9b732db..ff73091 100644
--- a/src/modals/zaken/ZaakForm.vue
+++ b/src/modals/zaken/ZaakForm.vue
@@ -108,6 +108,13 @@ export default {
NcSelect,
NcTextArea,
},
+ props: {
+ dashboardWidget: {
+ type: Boolean,
+ default: false,
+ required: false,
+ },
+ },
data() {
return {
zaak: {
@@ -164,6 +171,7 @@ export default {
methods: {
closeModal() {
navigationStore.setModal(null)
+ this?.dashboardWidget && this.$emit('close')
this.success = null
this.loading = false
this.zaak = {
@@ -228,6 +236,8 @@ export default {
.then(({ response }) => {
this.success = response.ok
setTimeout(this.closeModal, 2500)
+
+ this?.dashboardWidget && this.$emit('save-success')
})
.catch((err) => {
console.error(err)
@@ -239,3 +249,10 @@ export default {
},
}
+
+
diff --git a/src/views/widgets/ZakenWidget.vue b/src/views/widgets/ZakenWidget.vue
index 7588bff..89e64ba 100644
--- a/src/views/widgets/ZakenWidget.vue
+++ b/src/views/widgets/ZakenWidget.vue
@@ -1,5 +1,5 @@
@@ -18,12 +18,17 @@ import { zaakStore } from '../../store/store.js'
-
+
Zaak aanmaken
+
+
@@ -34,9 +39,10 @@ import { getTheme } from '../../services/getTheme.js'
import Plus from 'vue-material-design-icons/Plus.vue'
import Folder from 'vue-material-design-icons/Folder.vue'
+import ZaakForm from '../../modals/zaken/ZaakForm.vue'
+
export default {
name: 'ZakenWidget',
-
components: {
NcDashboardWidget,
NcEmptyContent,
@@ -44,24 +50,21 @@ export default {
Plus,
Folder,
},
-
data() {
return {
loading: false,
+ isModalOpen: false,
zaakItems: [],
}
},
-
computed: {
items() {
return this.zaakItems
},
},
-
mounted() {
this.fetchZaakItems()
},
-
methods: {
fetchZaakItems() {
this.loading = true
@@ -77,6 +80,15 @@ export default {
this.loading = false
})
},
+ openModal() {
+ this.isModalOpen = true
+ zaakStore.setZaakItem(null)
+ navigationStore.setModal('zaakForm')
+ },
+ closeModal() {
+ this.isModalOpen = false
+ navigationStore.setModal(null)
+ },
getItemIcon() {
const theme = getTheme()
return theme === 'light' ? '/apps-extra/zaakafhandelapp/img/briefcase-account-outline-dark.svg' : '/apps-extra/zaakafhandelapp/img/briefcase-account-outline.svg'
@@ -88,9 +100,9 @@ export default {
window.open('/apps/opencatalogi/catalogi', '_self')
},
},
-
}
+
-