add new table feature for responsible person and assignment close #2
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m23s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m49s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m34s
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m23s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m49s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m37s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m34s
This commit is contained in:
@@ -67,12 +67,14 @@
|
||||
filled
|
||||
v-model="localMember.group"
|
||||
></q-input>
|
||||
<q-input
|
||||
<q-select
|
||||
class="q-ml-md col-5"
|
||||
:label="$t('responsible')"
|
||||
filled
|
||||
:options="props.responsibles"
|
||||
:option-label="(opt) => opt.firstName + ' ' + opt.lastName"
|
||||
v-model="localMember.responsiblePerson"
|
||||
></q-input>
|
||||
></q-select>
|
||||
<q-input
|
||||
v-if="!newMember"
|
||||
class="q-ml-md col-11"
|
||||
@@ -97,9 +99,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import DialogFrame from 'src/vueLib/dialog/DialogFrame.vue';
|
||||
import { ref } from 'vue';
|
||||
import { type PropType, ref } from 'vue';
|
||||
import { appApi } from 'src/boot/axios';
|
||||
import type { Member } from 'src/vueLib/models/member';
|
||||
import type { Member, Members } from 'src/vueLib/models/member';
|
||||
import { useNotify } from 'src/vueLib/general/useNotify';
|
||||
import { i18n } from 'src/boot/lang';
|
||||
|
||||
@@ -111,20 +113,15 @@ const localMember = ref<Member>({
|
||||
id: 0,
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
birthday: '',
|
||||
age: '',
|
||||
address: '',
|
||||
town: '',
|
||||
zip: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
group: '',
|
||||
responsiblePerson: '',
|
||||
firstVisit: '',
|
||||
lastVisit: '',
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update-member']);
|
||||
const props = defineProps({
|
||||
responsibles: {
|
||||
type: Object as PropType<Members>,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update']);
|
||||
|
||||
function open(member: Member | null) {
|
||||
if (member === undefined) {
|
||||
@@ -139,17 +136,6 @@ function open(member: Member | null) {
|
||||
id: 0,
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
birthday: '',
|
||||
age: '',
|
||||
address: '',
|
||||
town: '',
|
||||
zip: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
group: '',
|
||||
responsiblePerson: '',
|
||||
firstVisit: '',
|
||||
lastVisit: '',
|
||||
};
|
||||
newMember.value = true;
|
||||
}
|
||||
@@ -165,14 +151,16 @@ async function save() {
|
||||
}
|
||||
|
||||
let query = 'members/edit';
|
||||
let payload = JSON.stringify([localMember.value]);
|
||||
if (newMember.value) {
|
||||
query = 'members/add';
|
||||
payload = JSON.stringify(localMember.value);
|
||||
}
|
||||
|
||||
await appApi
|
||||
.post(query, JSON.stringify([localMember.value]))
|
||||
.post(query, payload)
|
||||
.then(() => {
|
||||
emit('update-member');
|
||||
emit('update');
|
||||
NotifyResponse(i18n.global.t('memberUpdated'));
|
||||
dialog.value.close();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user