- Se inserisco un evento solo "On Line" non dovrebbe comparire obbligatorio il Comune.

This commit is contained in:
Surya Paolo
2024-02-28 15:02:08 +01:00
parent fe7e492a8d
commit 965f32b65c
5 changed files with 21 additions and 6 deletions

View File

@@ -1898,12 +1898,10 @@ export default defineComponent({
}
}
function enableSaveNewRec(newrec: boolean) {
function enableSaveNewRec(newrec: boolean, showmsg: boolean = true) {
const ok = true
const showmsg = true
let myrec = null
if (newrec) {
myrec = { ...newRecord.value }
@@ -1918,6 +1916,17 @@ export default defineComponent({
for (col of mycolumns.value) {
if (!msg) {
if (col.showonlyif_dipersona) {
const valori = myrec['idStatusSkill']
if (valori.length === 1 && valori.includes(shared_consts.STATUSSKILL_ONLINE)) {
col.required = false
} else {
col.required = true
}
col.visible = col.required
}
if (col.required) {
// console.log('newRecord.value', newRecord.value, newRecord.value[col.name])
if (tools.isArray(myrec[col.name])) {
@@ -2288,14 +2297,17 @@ 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
}
}
enableSaveNewRec(newRecordBool.value, false)
}
function setShowMonth(row: any, index: number) {

View File

@@ -548,7 +548,7 @@
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="myrec.mycities[0].comune">
<q-item v-if="myrec.mycities && myrec.mycities.length > 0 && myrec.mycities[0].comune">
<q-item-section avatar>
<q-icon color="amber" name="fas fa-map-marker-alt" />
</q-item-section>

View File

@@ -744,7 +744,7 @@
</div>
<div v-else>(Scegli)</div>
</div>
<div v-else-if="col.fieldtype === costanti.FieldType.multioption">
<div v-else-if="col.fieldtype === costanti.FieldType.multioption">
<q-option-group
v-model="myvalue"
:inline="col.inline"

View File

@@ -772,6 +772,7 @@ export interface IColGridTable {
remote_table?: string
remote_key?: string
remote_field?: string
showonlyif_dipersona?: boolean
field_extra1?: string
field_toduplicate_nospace?: string
showLinkResult?: string

View File

@@ -96,6 +96,7 @@ function AddCol(params: IColGridTable) {
remote_table: (params.remote_table === undefined) ? '' : params.remote_table,
remote_key: (params.remote_key === undefined) ? '' : params.remote_key,
remote_field: (params.remote_field === undefined) ? '' : params.remote_field,
showonlyif_dipersona: (params.showonlyif_dipersona === undefined) ? false : params.showonlyif_dipersona,
maxlength: (params.maxlength === undefined) ? 0 : params.maxlength,
minlength: (params.minlength === undefined) ? 0 : params.minlength,
filter_field: (params.filter_field === undefined) ? '' : params.filter_field,
@@ -1245,6 +1246,7 @@ export const colmySkills = [
remote_key: '_id',
remote_field: 'comune',
required: true,
showonlyif_dipersona: true,
numpag_carousel: 2,
}),
AddCol({