- aggiunto anche nei beni, servizi e ospitalità la possibilità di aggiungerli come "Gruppo"

This commit is contained in:
Surya Paolo
2025-01-14 18:34:58 +01:00
parent 37970c5c91
commit 08a089881c
23 changed files with 484 additions and 94 deletions

View File

View File

@@ -0,0 +1,77 @@
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { useGlobalStore } from '@store/globalStore'
import { fieldsTable } from '@store/Modules/fieldsTable'
import { tools } from '@store/Modules/tools'
import { costanti } from '@costanti'
import { CMyFieldDb } from '@/components/CMyFieldDb'
import { CMyFieldRec } from '@/components/CMyFieldRec'
import { IColGridTable, IOperators, ISpecialField, IUserFields } from 'model'
import MixinBase from '@/mixins/mixin-base'
import { useCalendarStore } from '@src/store/CalendarStore'
export default defineComponent({
name: 'CUserNote',
emits: ['closenote', 'save'],
props: {
username: String,
userprofile_param: {
type: Object as PropType<IUserFields>,
required: true,
}
},
components: { CMyFieldDb, CMyFieldRec },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const globalStore = useGlobalStore()
const shownote = ref(false)
const userprofile = ref(<IUserFields>{})
function mounted() {
shownote.value = true
userprofile.value = props.userprofile_param
}
function UpdateDbNote() {
const calendarStore = useCalendarStore()
const globalStore = useGlobalStore()
const { t } = useI18n()
const mydatatosave = {
id: userprofile.value._id,
table: 'users',
fieldsvalue: { 'profile.note': userprofile.value.profile.note }
}
globalStore.saveFieldValue(mydatatosave).then((esito) => {
if (esito) {
emit('save', userprofile.value)
tools.showPositiveNotif($q, t('db.recupdated'))
shownote.value = false
} else {
tools.showNegativeNotif($q, t('db.recfailed'))
}
})
}
onMounted(mounted)
return {
tools,
costanti,
fieldsTable,
globalStore,
shownote,
userprofile,
UpdateDbNote,
t,
}
},
})

View File

@@ -0,0 +1,60 @@
<template>
<div v-if="shownote" class="text-center q-ma-sm">
<q-dialog v-model="shownote" maximized>
<q-card>
<q-toolbar class="bg-primary text-white">
<q-toolbar-title> Note per {{ username }}: </q-toolbar-title>
<q-btn
flat
round
color="white"
icon="close"
@click="
$emit('closenote');
shownote = false;
"
></q-btn>
</q-toolbar>
<q-card-section>
Note per {{ username }} da parte del Facilitatore:
<br />
<CMyFieldRec
table="users"
:id="userprofile._id"
:rec="userprofile"
field="profile.note"
class="cursor-pointer"
:canEdit="true"
:canModify="true"
>
</CMyFieldRec>
</q-card-section>
<q-card-actions align="center">
<q-btn
filled
:label="t('dialog.save')"
color="primary"
@click="UpdateDbNote"
></q-btn>
<q-btn
filled
:label="$t('dialog.close')"
icon="close"
@click="
$emit('closenote');
shownote = false;
"
></q-btn>
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script lang="ts" src="./CUserNote.ts">
</script>
<style lang="scss" scoped>
@import './CUserNote.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CUserNote} from './CUserNote.vue'