Quando si inserisce un evento, su giunge alla fine, si salva, NON SI MEMORIZZANO foto, data e orario!
This commit is contained in:
@@ -68,6 +68,8 @@ export default defineComponent({
|
||||
const showDateTimeScroller = ref(false)
|
||||
const saveit = ref(false)
|
||||
const myvalue = ref('')
|
||||
const mydate = ref(false)
|
||||
const mytime = ref(false)
|
||||
const valueprec = ref('')
|
||||
// const myvalueDate = toRef(props, 'valueDate')
|
||||
|
||||
@@ -88,6 +90,8 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function Closing() {
|
||||
mydate.value = false
|
||||
mytime.value = false
|
||||
// console.log('Closing')
|
||||
if (!saveit.value) {
|
||||
if (myvalue.value !== valueprec.value) {
|
||||
@@ -143,6 +147,16 @@ export default defineComponent({
|
||||
emit('savetoclose', myvalue.value, valueprec.value)
|
||||
}
|
||||
|
||||
function replacevalue() {
|
||||
// console.log('changeval', newval, 'value=', value, 'myvalue=', myvalue)
|
||||
if (valueprec.value) {
|
||||
emit('update:value', valueprec.value)
|
||||
saveit.value = true
|
||||
showDateTimeScroller.value = false
|
||||
emit('savetoclose', valueprec.value, valueprec.value)
|
||||
}
|
||||
}
|
||||
|
||||
function mystyle() {
|
||||
if (props.label !== '')
|
||||
return ''
|
||||
@@ -172,6 +186,10 @@ export default defineComponent({
|
||||
getclass,
|
||||
myvalue,
|
||||
showDateTimeScroller,
|
||||
replacevalue,
|
||||
mydate,
|
||||
mytime,
|
||||
tools,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -27,33 +27,106 @@
|
||||
color="blue-6"
|
||||
:bg-color="bgcolor"
|
||||
debounce="500"
|
||||
:input-class="getclass()">
|
||||
|
||||
:input-class="getclass()"
|
||||
>
|
||||
<template v-slot:control>
|
||||
<div style="">
|
||||
<div class="self-center full-width no-outline" :style="mystyle()" tabindex="0">
|
||||
<div
|
||||
class="self-center full-width no-outline"
|
||||
:style="mystyle()"
|
||||
tabindex="0"
|
||||
>
|
||||
{{ getstrDate(myvalue) }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="canEdit" name="event" class="cursor-pointer">
|
||||
<q-popup-proxy transition-show="flip-up" v-model="showDateTimeScroller" @before-show="Opening" @before-hide="Closing">
|
||||
|
||||
<div class="q-gutter-md row items-start">
|
||||
<q-btn
|
||||
dense
|
||||
color="primary"
|
||||
v-if="canEdit"
|
||||
icon="fas fa-calendar-day"
|
||||
class="cursor-pointer"
|
||||
@click="mydate = !mydate"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
color="primary"
|
||||
v-if="canEdit"
|
||||
icon="fas fa-clock"
|
||||
class="cursor-pointer"
|
||||
@click="mytime = !mytime"
|
||||
>
|
||||
</q-btn>
|
||||
<q-popup-proxy
|
||||
v-if="mydate"
|
||||
transition-show="flip-up"
|
||||
v-model="showDateTimeScroller"
|
||||
@before-show="Opening"
|
||||
@before-hide="Closing"
|
||||
>
|
||||
<q-card class="justify-center">
|
||||
<div class="q-gutter-md justify-center">
|
||||
<q-date
|
||||
v-model="myvalue" mask="YYYY-MM-DD HH:mm" color="purple"
|
||||
v-model="myvalue"
|
||||
mask="YYYY-MM-DD HH:mm"
|
||||
color="purple"
|
||||
@update:model-value="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
/>
|
||||
<q-time
|
||||
v-model="myvalue" mask="YYYY-MM-DD HH:mm" color="purple"
|
||||
@update:model-value="changeval"
|
||||
@close="() => { savetoclose(); }"
|
||||
@close="
|
||||
() => {
|
||||
savetoclose();
|
||||
}
|
||||
"
|
||||
/>
|
||||
<div class="row justify-center">
|
||||
<q-btn
|
||||
:label="$t('dialog.cancel')"
|
||||
@click="replacevalue"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
:label="'Imposta a ' + tools.getstrDateLong(myvalue)"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</q-card>
|
||||
</q-popup-proxy>
|
||||
<q-popup-proxy
|
||||
v-if="mytime"
|
||||
transition-show="flip-up"
|
||||
v-model="showDateTimeScroller"
|
||||
@before-show="Opening"
|
||||
@before-hide="Closing"
|
||||
>
|
||||
<q-card class="justify-center">
|
||||
<div class="q-gutter-md justify-center">
|
||||
<q-time
|
||||
v-model="myvalue"
|
||||
mask="YYYY-MM-DD HH:mm"
|
||||
color="purple"
|
||||
@update:model-value="changeval"
|
||||
@close="
|
||||
() => {
|
||||
savetoclose();
|
||||
}
|
||||
"
|
||||
/>
|
||||
<div class="row justify-center">
|
||||
<q-btn
|
||||
:label="$t('dialog.cancel')"
|
||||
@click="replacevalue"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
:label="'Imposta a ' + tools.getstrTime(myvalue)"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-popup-proxy>
|
||||
</template>
|
||||
</q-field>
|
||||
</div>
|
||||
|
||||
@@ -1447,7 +1447,7 @@ export default defineComponent({
|
||||
// @ts-ignore
|
||||
newRecord.value = props.defaultnewrec
|
||||
} else {
|
||||
newRecord.value = tools.getdefaultnewrec(mytable.value, {groupname: props.groupname})
|
||||
newRecord.value = tools.getdefaultnewrec(mytable.value, { groupname: props.groupname })
|
||||
}
|
||||
if (!newRecord.value) {
|
||||
newRecord.value = {}
|
||||
@@ -1862,9 +1862,11 @@ export default defineComponent({
|
||||
|
||||
const showmsg = true
|
||||
|
||||
let myrec = recModif.value
|
||||
let myrec = null
|
||||
if (newrec) {
|
||||
myrec = newRecord.value
|
||||
myrec = { ...newRecord.value }
|
||||
} else {
|
||||
myrec = { ...recModif.value }
|
||||
}
|
||||
|
||||
// mycolumns.value.forEach((col: IColGridTable) => {
|
||||
@@ -2237,6 +2239,19 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function update_col(col: string, value: string) {
|
||||
console.log('update_col', col, value)
|
||||
|
||||
if (col) {
|
||||
if (newRecordBool.value) {
|
||||
newRecord.value[col] = value
|
||||
} else {
|
||||
recModif.value[col] = value
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*function showNotification() {
|
||||
$router.push('/notifs')
|
||||
} */
|
||||
@@ -2344,6 +2359,7 @@ export default defineComponent({
|
||||
rowsel,
|
||||
showInnerDialog,
|
||||
lengthopt,
|
||||
update_col,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -550,6 +550,7 @@
|
||||
@save="SaveValue"
|
||||
@show="selItem(row, col)"
|
||||
@showandsave="showandsel"
|
||||
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
@@ -1194,6 +1195,7 @@
|
||||
@show="selItem(rowclicksel, mycol)"
|
||||
@showandsave="showandsel"
|
||||
@annulla="annulla"
|
||||
@update_col="update_col"
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
@@ -1214,6 +1216,7 @@
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-bar>
|
||||
<q-card-section class="inset-shadow">
|
||||
newRecord: {{newRecord}}
|
||||
<div
|
||||
:class="$q.screen.lt.sm ? `` : `row` + ` text-blue `"
|
||||
v-for="col in mycolumns"
|
||||
@@ -1252,6 +1255,7 @@
|
||||
@save="SaveValue"
|
||||
@show="selItem(newRecord, col)"
|
||||
@showandsave="showandsel"
|
||||
@update_col="update_col"
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
@@ -1390,6 +1394,7 @@
|
||||
@save="SaveValue"
|
||||
@show="selItem(recModif, col, true)"
|
||||
@showandsave="showandsel"
|
||||
@update_col="update_col"
|
||||
>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
|
||||
@@ -277,6 +277,28 @@
|
||||
}}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-if="myrec.idStatusSkill && myrec.idStatusSkill.length > 0 && JSON.stringify(myrec.idStatusSkill) !== '[1]'">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="green" name="mood" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
<span
|
||||
v-for="(recstatus, index) in myrec.idStatusSkill"
|
||||
:key="index"
|
||||
>
|
||||
<q-chip
|
||||
dense
|
||||
:color="globalStore.getColByStatusSkills(recstatus)"
|
||||
text-color="white"
|
||||
>
|
||||
{{ globalStore.getStatusSkillById(recstatus) }}
|
||||
</q-chip>
|
||||
</span>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item v-if="myrec.dateTimeStart">
|
||||
<q-item-section avatar>
|
||||
|
||||
@@ -33,7 +33,7 @@ import { useRouter } from 'vue-router'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyPopupEdit',
|
||||
emits: ['showandsave', 'update:row', 'show', 'save', 'annulla'],
|
||||
emits: ['showandsave', 'update:row', 'show', 'save', 'annulla', 'update_col'],
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
@@ -337,8 +337,6 @@ export default defineComponent({
|
||||
}
|
||||
if (props.isInModif)
|
||||
OpenEdit()
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getrealval(newval: any) {
|
||||
@@ -369,25 +367,30 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function changevalRec(newval: any) {
|
||||
if (!props.insertMode || (props.insertMode && col.value.fieldtype !== costanti.FieldType.multioption)) {
|
||||
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
|
||||
myvalue.value = tools.removespaces_slash(newval)
|
||||
}
|
||||
// console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name)
|
||||
|
||||
// console.log('row', props.row, 'col', props.mycol, 'newval', newval)
|
||||
// console.log('row[col.value.name]', props.row[col.value.name])
|
||||
if (props.type === costanti.FieldType.image) {
|
||||
// console.log('image', newval)
|
||||
}
|
||||
|
||||
myrow.value[col.value.name] = newval
|
||||
|
||||
// console.log('changevalRec update:row', myrow.value)
|
||||
emit('update:row', myrow.value)
|
||||
if (props.isInModif)
|
||||
OpenEdit()
|
||||
// console.log('changevalRec', newval)
|
||||
// if (!props.insertMode || (props.insertMode && col.value.fieldtype !== costanti.FieldType.multioption)) {
|
||||
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
|
||||
myvalue.value = tools.removespaces_slash(newval)
|
||||
}
|
||||
// console.log('popuppedit: changevalRec', newval, 'COLName', col.value.name)
|
||||
|
||||
// console.log('row', props.row, 'col', props.mycol, 'newval', newval)
|
||||
// console.log('row[col.value.name]', props.row[col.value.name])
|
||||
if (props.type === costanti.FieldType.image) {
|
||||
// console.log('image', newval)
|
||||
}
|
||||
|
||||
myrow.value[col.value.name] = newval
|
||||
|
||||
|
||||
// console.log('changevalRec update:row', myrow.value)
|
||||
// emit('update:row', myrow.value)
|
||||
emit('update_col', col.value.name, newval)
|
||||
if (props.isInModif)
|
||||
OpenEdit()
|
||||
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
function changevalRecHours(newval: any) {
|
||||
@@ -501,7 +504,7 @@ export default defineComponent({
|
||||
|
||||
function SaveValueInt(newVal: any, valinitial: any) {
|
||||
|
||||
//console.log('SaveValueInt', newVal, valinitial)
|
||||
console.log('SaveValueInt', newVal, valinitial)
|
||||
|
||||
if (props.tablesel) {
|
||||
if (true) {
|
||||
|
||||
Reference in New Issue
Block a user