versione 0.3.16:

- Aggiunto bottone "Scambio Ospitalità" (nuova tabella)
This commit is contained in:
Paolo Arena
2022-05-06 19:51:33 +02:00
parent 171b99c34d
commit 200ac47035
25 changed files with 322 additions and 68 deletions

View File

@@ -27,7 +27,7 @@ $grayshadow: #555;
}
.barwidth{
.barwidth {
width: 250px !important;
}
@@ -56,10 +56,23 @@ $grayshadow: #555;
}
.my-card-gallery-view {
width: 100px;
height: 100px;
padding: 0.25rem 0.25rem;
margin: auto;
}
.accom_type{
font-size: 1rem;
font-weight: bold;
margin-right: 4px;
padding-top: 10px;
}
.accom_location{
font-size: 1rem;
padding-top: 10px;
margin-right: 4px;
font-style: italic;
}

View File

@@ -8,6 +8,8 @@ import { tools } from '@store/Modules/tools'
import { shared_consts } from '@src/common/shared_vuejs'
import { useGlobalStore } from '@store/globalStore'
import { costanti } from '@costanti'
import { CMySelect } from '../CMySelect'
import { CTitleBanner } from '../CTitleBanner'
export default defineComponent({
name: 'CAccomodation',
@@ -27,12 +29,12 @@ export default defineComponent({
},
title: String,
mylist: {
type: Object as PropType<IAccomodation[] | string | undefined | null>,
type: [Array, String, undefined, null] as PropType<IAccomodation[] | string | undefined | null>,
required: true,
},
},
emits: ['showandsave'],
components: { },
components: { CMySelect, CTitleBanner },
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
@@ -41,7 +43,7 @@ export default defineComponent({
const displayGall = ref(false)
const listobj = ref(<IImgGallery[]>[])
const listobj = ref(<IAccomodation[]>[])
const maximizedToggle = ref(true)
@@ -66,21 +68,16 @@ export default defineComponent({
})
function created() {
// console.log('created cgallery')
console.log('created CAccomodation', props.mylist)
if (isValid(props.mylist)) {
// @ts-ignore
let myarr: any = props.mylist
listobj.value = []
if (Array.isArray(myarr)) {
myarr.forEach((pic: any) => {
if (pic.imagefile) {
listobj.value.push(pic)
}
})
listobj.value = myarr
}
} else {
listobj.value = [
]
listobj.value = []
}
}
@@ -100,7 +97,7 @@ export default defineComponent({
function getlist() {
if (listobj.value)
// return listobj.value.slice().sort((a: any, b: any) => a.order! - b.order!)
return listobj.value
return listobj.value.filter((rec) => rec.num > 0)
else
return null
}
@@ -144,7 +141,7 @@ export default defineComponent({
}
function save() {
console.log('CGallery save', listobj.value)
console.log('CAccomodation save', listobj.value)
if (listobj.value.length > 0) {
emit('showandsave', listobj.value)
} else {
@@ -156,6 +153,17 @@ export default defineComponent({
return ''
}
function add_newbed() {
const rec: IAccomodation = {
type: 2,
location: 2,
num: 1,
}
listobj.value.push(rec)
save()
}
onMounted(created)
return {
@@ -174,6 +182,7 @@ export default defineComponent({
isListImgValid,
costanti,
shared_consts,
add_newbed,
}
}
})

View File

@@ -1,25 +1,65 @@
<template>
<!--<div class="q-pa-md items-start " style="display: inline-flex; width: 800px;"> -->
1) Accom:
<div v-for="(myaccom, index) in getlist()" :key="index">
myaccom: {{ myaccom}}
<div class="bordo_stondato_blu">
<CTitleBanner class="column" title="Tipi di ospitalità"></CTitleBanner>
<CMySelect
:label="$t('hosps.accomodation.type')" v-model:value="myaccom.type"
optval="value"
optlab="label"
:options="shared_consts.TypeAccom" :useinput="false">
</CMySelect>
<div class="">
<q-btn
v-if="isInModif"
rounded label="Aggiungi Letti" color="positive" @click="add_newbed()">
</q-btn>
<CMySelect
:label="$t('hosps.accomodation.location')" v-model:value="myaccom.location"
optval="value"
optlab="label"
:options="shared_consts.LocationAccom" :useinput="false">
</CMySelect>
<div v-for="(myaccom, index) in getlist()" :key="index">
<div v-if="isInModif" class="row justify-center bordo_stondato_small">
<div>
<CMySelect
v-if="myaccom.num"
:label="$t('hosps.accomodation.num')"
v-model:value="myaccom.num"
optval="value"
optlab="label"
:sola_lettura="!isInModif"
:options="shared_consts.People" :useinput="false"
>
</CMySelect>
</div>
<div>
<CMySelect
v-if="myaccom.type"
:label="$t('hosps.accomodation.type')"
v-model:value="myaccom.type"
optval="value"
optlab="label"
:sola_lettura="!isInModif"
:options="shared_consts.TypeAccom" :useinput="false">
</CMySelect>
</div>
<div>
<CMySelect
v-if="myaccom.location"
:label="$t('hosps.accomodation.location')"
v-model:value="myaccom.location"
optval="value"
optlab="label"
:sola_lettura="!isInModif"
:options="shared_consts.LocationAccom" :useinput="false">
</CMySelect>
<q-btn v-if="isInModif && myaccom.num > 0" flat round color="red" icon="fas fa-trash-alt" @click="deleteRec(myaccom)"></q-btn>
</div>
</div>
<div v-else class="row justify-start q-px-xs q-ma-xs">
<div class="accom_num">{{ myaccom.num }}</div>
<div class="accom_type">
{{ shared_consts.getLabelByValueAndArr(myaccom.type, shared_consts.TypeAccom) }}
</div>
<div>
<div class="accom_location"> ({{shared_consts.getLabelByValueAndArr(myaccom.location, shared_consts.LocationAccom) }})</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" src="./CAccomodation.ts">
@@ -28,3 +68,4 @@
<style lang="scss" scoped>
@import './CAccomodation.scss';
</style>