diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/AddEntity.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/AddEntity.vue new file mode 100644 index 000000000..af35ec8e1 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/AddEntity.vue @@ -0,0 +1,52 @@ + + + Add {{ entityType }} + + Select type: + + Person + Thirdparty + + + + + + + + + + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/EntityDetails/PersonDetails.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/EntityDetails/PersonDetails.vue new file mode 100644 index 000000000..4b08501b3 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/EntityDetails/PersonDetails.vue @@ -0,0 +1,25 @@ + + + {{ person.name }} + Email: {{ person.email }} + Phone: {{ person.phone }} + + Household + + {{ member.name }} + + + + + + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/SearchEntity.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/SearchEntity.vue new file mode 100644 index 000000000..3c00ad42c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/_components/SearchEntity.vue @@ -0,0 +1,64 @@ + + + Search {{ entityType }}: + + + + + {{ result.name }} + + + + + + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/index.js new file mode 100644 index 000000000..dc0179da5 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/index.js @@ -0,0 +1,7 @@ +import { createApp } from 'vue'; +import store from './store/entities'; +import AddEntity from './components/AddEntity.vue'; + +const app = createApp(AddEntity); +app.use(store); +app.mount('#add-entity-app'); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/store/entities.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/store/entities.js new file mode 100644 index 000000000..16c1e04f1 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AddEntities/store/entities.js @@ -0,0 +1,37 @@ +export default { + namespaced: true, + state: { + selectedEntity: null, + persons: [], + thirdparties: [], + accompanyingPeriodWorks: [] + }, + mutations: { + SET_SELECTED_ENTITY(state, entity) { + state.selectedEntity = entity; + }, + SET_PERSONS(state, persons) { + state.persons = persons; + }, + SET_THIRDPARTIES(state, thirdparties) { + state.thirdparties = thirdparties; + }, + SET_ACCOMPANYING_PERIOD_WORKS(state, works) { + state.accompanyingPeriodWorks = works; + } + }, + actions: { + async fetchPersons({ commit }, query) { + const response = await api.get(`/persons?search=${query}`); + commit('SET_PERSONS', response.data); + }, + async fetchThirdparties({ commit }, query) { + const response = await api.get(`/thirdparties?search=${query}`); + commit('SET_THIRDPARTIES', response.data); + }, + async fetchAccompanyingPeriodWorks({ commit }, personId) { + const response = await api.get(`/persons/${personId}/accompanying-period-works`); + commit('SET_ACCOMPANYING_PERIOD_WORKS', response.data); + } + } +};
Email: {{ person.email }}
Phone: {{ person.phone }}