From 522cff7c6ba1ec6f4e56f9d0f899b7002dec56db Mon Sep 17 00:00:00 2001 From: Surya Paolo Date: Mon, 30 Sep 2024 00:05:53 +0200 Subject: [PATCH] - fix: Errore se premevo "Aggiungi" e poi "Annulla" poi la tabella non si aggiornava piu. --- src/common/shared_vuejs.ts | 5 ++-- src/components/CFinder/CFinder.ts | 11 +++++++++ src/components/CGridTableRec/CGridTableRec.ts | 23 ++++++++++++------- .../CGridTableRec/CGridTableRec.vue | 1 + src/store/Modules/fieldsTable.ts | 10 ++++++++ src/store/Modules/tools.ts | 1 + src/views/admin/dbop/dbop.vue | 8 +++++++ 7 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 7c46d9c5..1208c251 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -316,7 +316,7 @@ export const shared_consts = { TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'bots'], TABLES_FINDER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'], TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'], - TABLES_SHOW_ADTYPE: ['myskills', 'mygoods'], + TABLES_SHOW_ADTYPE: ['myskills', 'mygoods', 'myhosps'], TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'users'], TABLES_FIELDS_DESCR_AND_CITY_AND_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods'], @@ -2026,6 +2026,7 @@ export const shared_consts = { } else if (table === this.TABLES_MYHOSPS) { proj = { visibile: 1, + adType: 1, typeHosp: 1, numMaxPeopleHosp: 1, accomodation: 1, @@ -2104,7 +2105,7 @@ export const shared_consts = { photos: 1, note: 1, descr: 1, - date_created: 1, + date_createzd: 1, date_updated: 1, userId: 1, username: 1, diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 5b63d43a..68f686c7 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -652,6 +652,17 @@ export default defineComponent({ // param1: shared_consts.PARAM_SHOW_PROVINCE, tablesel: 'cities', }, + { + label: 'Offro/Cerco', + table: 'adtypes', + key: 'adType', + value: tools.getCookie(tools.COOK_SEARCH + costanti.FILTER_SEP + props.table + costanti.FILTER_SEP + 'adtypes', costanti.FILTER_TUTTI, true), + arrvalue: [], + addall: true, + type: costanti.FieldType.select, + filter: null, + useinput: false, + }, { label: 'Tipologia', table: toolsext.TABTYPEHOSP, diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 58428141..02ab8dcc 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -341,10 +341,10 @@ export default defineComponent({ const newRecordBool = ref(false) const newRecordBoolOld = ref(false) const editRecordBool = ref(false) - const newRecord: any = ref({}) - const recSaved: any = ref({}) - const recModif: any = ref({}) - const showInnerDialog: any = ref(false) + const newRecord = ref({}) + const recSaved = ref({}) + const recModif = ref({}) + const showInnerDialog = ref(false) const mytable = ref('') const mytitle = ref('') @@ -1231,7 +1231,11 @@ export default defineComponent({ // fetch data from "server" return fetchFromServer(startRow, endRow, myfilternow, myfilterandnow, sortBy, descending).then((ris: any) => { - pagination.value.rowsNumber = getRowsNumberCount() + try { + pagination.value.rowsNumber = getRowsNumberCount() + } catch (e) { + console.error('Err', e) + } // console.log(' ...rowsNumber', pagination.value.rowsNumber) if (!returnedData.value || returnedData.value.length === 0) { @@ -1472,7 +1476,8 @@ export default defineComponent({ } */ - newRecord.value = null + newRecordBool.value = false + newRecord.value = {} } function SaveValue(newVal: any, valinitial: any) { @@ -1576,6 +1581,7 @@ export default defineComponent({ newRecord.value = tools.getdefaultnewrec(mytable.value, { groupname: props.groupname }) } if (!newRecord.value) { + newRecordBool.value = false newRecord.value = {} } newRecord.value.userId = userStore.my._id @@ -2153,8 +2159,9 @@ export default defineComponent({ else serverData.value = [ris, ...serverData.value] - newRecord.value = null - + newRecord.value = {} + newRecordBool.value = false + tools.showPositiveNotif($q, t('db.recupdated')) // refresh() } else { diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 88c6d69d..9b6d4be7 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -1,5 +1,6 @@