- aggiornato tabella modifica prodotti.

- codice sconto etichetta.
This commit is contained in:
Surya Paolo
2025-10-03 18:02:26 +02:00
parent b07d4c822f
commit e827744f51
13 changed files with 223 additions and 98 deletions

View File

@@ -70,7 +70,7 @@
</tr>
<tr v-if="!recOrderCart?.codice_sconto">
<td class="label">{{ t('ecomm.codice_sconto') }}:</td>
<td class="label">{{ t('ecomm.add_codice_sconto') }}:</td>
<td>
<q-input
v-model="codice_sconto"
@@ -81,6 +81,7 @@
@keyup.enter="confermaCodiceSconto"
/>
<q-btn
v-if="codice_sconto"
:disabled="!codice_sconto || codice_sconto.trim() === ''"
:label="$t('ecomm.applica_sconto')"
icon="fas fa-check-circle"

View File

@@ -497,6 +497,7 @@ export default defineComponent({
const rowsel: any = ref({});
const dark = true;
const canEdit = ref(false);
const canEditPrec = ref(false);
const returnedData: any = ref([]);
let returnedCount = 0;
@@ -2158,7 +2159,9 @@ export default defineComponent({
};
if (col.action === lists.MenuAction.CAN_EDIT_TABLE) {
console.log('Edit', item);
canEditPrec.value = canEdit.value
canEdit.value = true
// console.log('Edit', item);
selItem(item, col);
recModif.value = { ...item };
recSaved.value = { ...item };
@@ -2939,6 +2942,11 @@ export default defineComponent({
annulla(0);
}
function hidewindowEdit() {
annulla(0);
canEdit.value = canEditPrec.value
}
function clickMarker(id: any) {
console.log('clickMarker', id);
cmdExt(costanti.CMD_SHOW_PAGE, id, null);
@@ -3240,6 +3248,7 @@ export default defineComponent({
showfilteradv,
getisDettagliByCatalog,
getisDettagliByRaccolta,
hidewindowEdit,
};
},
});

View File

@@ -5,7 +5,7 @@
v-if="isfinishLoading"
>
<q-toggle
v-if="(tools.isCollaboratore()) && !showMap && editOn"
v-if="tools.isCollaboratore() && !showMap && editOn"
v-model="editOn"
color="green"
icon="fas fa-pencil-alt"
@@ -41,19 +41,20 @@
<q-space></q-space>
<div
v-if="butt_modif_new"
class="row justify-center"
class="row justify-center q-mx-sm"
>
<q-btn
v-if="mytable && !shared_consts.TABLES_FINDER.includes(mytable) && !showMap"
rounded
dense
size="sm"
flat
outline
size="md"
class="q-ma-sm"
:color="canEdit ? 'positive' : 'light-gray'"
:disable="disabilita()"
:val="lists.MenuAction.CAN_EDIT_TABLE"
icon="fas fa-pencil-alt"
@update:model-value="changefuncAct"
:label="canEdit ? t('grid.edit_table') : t('grid.disable_edit_table')"
@update:model-value="canEdit = !canEdit"
@click="canEdit = !canEdit"
>
</q-btn>
@@ -63,7 +64,7 @@
outline
size="md"
color="primary"
class="q-mb-sm"
class="q-ma-sm"
:label="labelBtnAddExtra"
:disable="startsearch"
icon="fas fa-plus"
@@ -120,7 +121,11 @@
color="positive"
rounded
:icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'"
:label="!showfilteradv ? t('grid.advanced_filters') : t('grid.hide_advanced_filters')"
:label="
!showfilteradv
? t('grid.advanced_filters')
: t('grid.hide_advanced_filters')
"
@click="showfilteradv = !showfilteradv"
></q-btn>
</div>
@@ -132,7 +137,8 @@
<CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="
(item.type === costanti.FieldType.select || item.type === costanti.FieldType.select_by_server) &&
(item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server) &&
lengthopt(item, false, false) > 1
"
:label="labelcombo(item)"
@@ -140,7 +146,9 @@
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
:tablesel="
item.type === costanti.FieldType.select_by_server ? item.tablesel : ''
"
:pickup="item.type === costanti.FieldType.select_by_server"
label-color="primary"
class="combowidth"
@@ -151,12 +159,17 @@
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item && item.filter ? item.filter : null"
:filter_extra="item.filter_extra"
:useinput="item.useinput && item.type !== costanti.FieldType.select_by_server"
:useinput="
item.useinput && item.type !== costanti.FieldType.select_by_server
"
>
</CMySelect>
<CMySelect
v-if="item.type === costanti.FieldType.multiselect_by_server && lengthopt(item, false) > 1"
v-if="
item.type === costanti.FieldType.multiselect_by_server &&
lengthopt(item, false) > 1
"
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
:multiselect_by_server="true"
:label="labelcombo(item)"
@@ -213,7 +226,8 @@
>
<div
v-if="
scope.opt[fieldsTable.getLabelByTable(item.table)] || (scope.opt && checkIfShowRec(scope.opt))
scope.opt[fieldsTable.getLabelByTable(item.table)] ||
(scope.opt && checkIfShowRec(scope.opt))
"
>
<q-chip
@@ -231,14 +245,18 @@
:icon="item.icon"
size="12px"
/>
{{ scope.opt[fieldsTable.getLabelByTable(item.table)] || scope.opt }}
{{
scope.opt[fieldsTable.getLabelByTable(item.table)] || scope.opt
}}
</q-chip>
</div>
</template>
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(item.table)] }}</q-item-label>
<q-item-label>{{
opt[fieldsTable.getLabelByTable(item.table)]
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle
@@ -341,7 +359,13 @@
<q-space></q-space>
<q-select
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit) && showCol && myvertical === 0"
v-if="
mytable &&
pagination.rowsNumber > 0 &&
(prop_search || canEdit) &&
showCol &&
myvertical === 0
"
v-model="colVisib"
rounded
outlined
@@ -498,7 +522,11 @@
<q-infinite-scroll
ref="myinfscroll"
v-else-if="shared_consts.VERTIC_SHOW_GRID.includes(myvertical) && !loading && alreadymounting"
v-else-if="
shared_consts.VERTIC_SHOW_GRID.includes(myvertical) &&
!loading &&
alreadymounting
"
:initial-index="0"
@load="onLoadScroll"
:offset="350"
@@ -536,9 +564,9 @@
}"
>
<div
:class="{
'items-stretch': opt.rowclass,
}"
:class="{
'items-stretch': opt.rowclass,
}"
v-if="
showType === costanti.SHOW_MYCARD ||
(myvertical !== costanti.VISUTABLE_USER_TABGROUP &&
@@ -608,8 +636,10 @@
</div>
<div
v-else-if="
(showType === costanti.SHOW_USERINFO && myvertical !== costanti.VISUTABLE_SCHEDA_USER) ||
(myvertical === 2 && shared_consts.TABLES_VISU_LISTA_USER.includes(tablesel))
(showType === costanti.SHOW_USERINFO &&
myvertical !== costanti.VISUTABLE_SCHEDA_USER) ||
(myvertical === 2 &&
shared_consts.TABLES_VISU_LISTA_USER.includes(tablesel))
"
class="fill-all-width"
>
@@ -622,7 +652,9 @@
:circuitname="circuitname"
:actionType="actionType"
:labelextra="col_title ? row[col_title] : ''"
:labelFooter="col_footer ? tools.getLabelFooterByRow(row, col_footer, tablesel) : ''"
:labelFooter="
col_footer ? tools.getLabelFooterByRow(row, col_footer, tablesel) : ''
"
@showInnerDialog="showInnerDialog"
>
</CMyUser>
@@ -632,7 +664,8 @@
</div>
<div
v-else-if="
(showType === costanti.SHOW_GROUPINFO && myvertical !== costanti.VISUTABLE_SCHEDA_GROUP) ||
(showType === costanti.SHOW_GROUPINFO &&
myvertical !== costanti.VISUTABLE_SCHEDA_GROUP) ||
(myvertical === 2 && tablesel === 'mygroups') ||
myvertical === costanti.VISUTABLE_GROUP_CIRCUIT
"
@@ -648,7 +681,9 @@
/>
</div>
</div>
<div v-else-if="showType === costanti.SHOW_MOVEMENTS && tablesel === 'movements'">
<div
v-else-if="showType === costanti.SHOW_MOVEMENTS && tablesel === 'movements'"
>
<CSingleMovement :mov="row" />
</div>
</div>
@@ -663,10 +698,16 @@
</template>
</q-infinite-scroll>
<q-table
v-else-if="!shared_consts.VERTIC_SHOW_GRID.includes(myvertical) && !loading && serverData && mycolumns"
v-else-if="
!shared_consts.VERTIC_SHOW_GRID.includes(myvertical) &&
!loading &&
serverData &&
mycolumns
"
:grid="shared_consts.VERTIC_SHOW_GRID.includes(myvertical)"
:grid-header="
shared_consts.VERTIC_SHOW_GRID.includes(myvertical) && shared_consts.TABLES_WITH_SORTING.includes(mytable)
shared_consts.VERTIC_SHOW_GRID.includes(myvertical) &&
shared_consts.TABLES_WITH_SORTING.includes(mytable)
"
flat
bordered
@@ -802,21 +843,30 @@
size="sm"
color="positive"
:icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'"
:label="!showfilteradv ? t('grid.advanced_filters') : t('grid.hide_advanced_filters')"
:label="
!showfilteradv
? t('grid.advanced_filters')
: t('grid.hide_advanced_filters')
"
@click="showfilteradv = !showfilteradv"
></q-btn>
</div>
<CMySelect
:col="fieldsTable.getColByColumns(mycolumns, item.key)"
v-if="item.type === costanti.FieldType.select || item.type === costanti.FieldType.select_by_server"
v-if="
item.type === costanti.FieldType.select ||
item.type === costanti.FieldType.select_by_server
"
v-show="item.visible"
:label="labelcombo(item)"
v-model:value="item.value"
@update:value="searchval(item.value, item.table)"
:addall="item.addall"
:addnone="item.addnone"
:tablesel="item.type === costanti.FieldType.select_by_server ? item.tablesel : ''"
:tablesel="
item.type === costanti.FieldType.select_by_server ? item.tablesel : ''
"
:pickup="item.type === costanti.FieldType.select_by_server"
label-color="primary"
class="combowidth"
@@ -827,7 +877,9 @@
:options="valoriopt(item, item.addall, item.addnone)"
:filter="item && item.filter ? item.filter : null"
:filter_extra="item.filter_extra"
:useinput="item.useinput && item.type !== costanti.FieldType.select_by_server"
:useinput="
item.useinput && item.type !== costanti.FieldType.select_by_server
"
>
</CMySelect>
@@ -895,7 +947,8 @@
>
<div
v-if="
scope.opt[fieldsTable.getLabelByTable(item.table)] || (scope.opt && checkIfShowRec(scope.opt))
scope.opt[fieldsTable.getLabelByTable(item.table)] ||
(scope.opt && checkIfShowRec(scope.opt))
"
>
<q-chip
@@ -913,14 +966,18 @@
:icon="item.icon"
size="12px"
/>
{{ scope.opt[fieldsTable.getLabelByTable(item.table)] || scope.opt }}
{{
scope.opt[fieldsTable.getLabelByTable(item.table)] || scope.opt
}}
</q-chip>
</div>
</template>
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
<q-item v-bind="itemProps">
<q-item-section>
<q-item-label>{{ opt[fieldsTable.getLabelByTable(item.table)] }}</q-item-label>
<q-item-label>{{
opt[fieldsTable.getLabelByTable(item.table)]
}}</q-item-label>
</q-item-section>
<q-item-section side>
<q-toggle
@@ -976,7 +1033,13 @@
<q-space></q-space>
<q-select
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
v-if="mytable && pagination.rowsNumber > 0 && (prop_search || canEdit) && showCol && myvertical === 0"
v-if="
mytable &&
pagination.rowsNumber > 0 &&
(prop_search || canEdit) &&
showCol &&
myvertical === 0
"
v-model="colVisib"
rounded
outlined
@@ -993,8 +1056,12 @@
</q-select>
</div>
<div v-if="pagination.rowsNumber === 1 && prop_search">{{ pagination.rowsNumber }} elemento trovato</div>
<div v-if="pagination.rowsNumber > 1 && prop_search">{{ pagination.rowsNumber }} elementi trovati</div>
<div v-if="pagination.rowsNumber === 1 && prop_search">
{{ pagination.rowsNumber }} elemento trovato
</div>
<div v-if="pagination.rowsNumber > 1 && prop_search">
{{ pagination.rowsNumber }} elementi trovati
</div>
<div
v-if="choose_visutype && $q.screen.gt.xs"
@@ -1040,7 +1107,29 @@
:props="props"
>
<div
v-if="showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1, props.row)"
v-if="colExtra.includes(col.name)"
class="tdclass"
>
<div v-if="col.action && visCol(col)">
<q-btn
dense
no-caps
unelevated
:color="col.color"
:icon="col.icon"
size="md"
@click="clickFunz(props.row, col)"
>
<q-tooltip :offset="[10, 10]">
{{ col.label }}
</q-tooltip>
</q-btn>
</div>
</div>
<div
v-else-if="
showColCheck(col, tools.TIPOVIS_SHOW_RECORD, true, 1, props.row)
"
class="tdclass"
>
<div :class="getclrow(props.row)">
@@ -1063,27 +1152,6 @@
</div>
</div>
</q-td>
<q-td
v-for="col in mycolumns"
:key="col.name"
:props="props"
>
<div
v-if="colExtra.includes(col.name)"
class="tdclass"
>
<div v-if="col.action && visCol(col)">
<q-btn
flat
round
color="red"
:icon="col.icon"
size="sm"
@click="clickFunz(props.row, col)"
></q-btn>
</div>
</div>
</q-td>
</q-tr>
<br />
</template>
@@ -1094,11 +1162,17 @@
:style="props.selected ? 'transform: scale(0.95);' : ''"
>
<q-card
:class="props.selected ? 'bg-grey-2 my-card-withshadow no-padding' : 'my-card-withshadow no-padding'"
:class="
props.selected
? 'bg-grey-2 my-card-withshadow no-padding'
: 'my-card-withshadow no-padding'
"
style="background: radial-gradient(circle, #ffffff 0%, #bbddff 100%)"
>
<q-bar
v-if="!visuinpage && (tools.canModifyThisRec(props.row, tablesel) || editOn)"
v-if="
!visuinpage && (tools.canModifyThisRec(props.row, tablesel) || editOn)
"
dense
class="bg-primary text-white full-height"
>
@@ -1106,7 +1180,9 @@
v-if="props.row['adType']"
:color="fieldsTable.getColByAdType(props.row['adType'])"
>
{{ fieldsTable.getValByTabAndId(tablesel, 'adType', props.row['adType']) }}
{{
fieldsTable.getValByTabAndId(tablesel, 'adType', props.row['adType'])
}}
<!--<q-icon
:name="fieldsTable.getIconByAdType(props.row['adType'])"
color="white"
@@ -1126,7 +1202,9 @@
@click="
clickFunz(
props.row,
prop_mycolumns.find((rec) => rec.action === lists.MenuAction.CAN_EDIT_TABLE)
prop_mycolumns.find(
(rec) => rec.action === lists.MenuAction.CAN_EDIT_TABLE
)
)
"
></q-btn>
@@ -1140,7 +1218,9 @@
@click="
clickFunz(
props.row,
prop_mycolumns.find((rec) => rec.action === lists.MenuAction.DELETE_RECTABLE)
prop_mycolumns.find(
(rec) => rec.action === lists.MenuAction.DELETE_RECTABLE
)
)
"
></q-btn>
@@ -1190,7 +1270,9 @@
<CMyPopupEdit
:table="mytable"
:canEdit="canEdit"
:canModify="tools.canModifyThisRec(props.row, tablesel) || editOn"
:canModify="
tools.canModifyThisRec(props.row, tablesel) || editOn
"
:disable="disabilita()"
:mycol="col"
v-model:row="props.row"
@@ -1247,9 +1329,14 @@
type="search"
:hint="
pagination.rowsNumber === 1 && prop_search
? `${pagination.rowsNumber} ` + t('grid.found') + ' ' + getLabelAreaMap(false)
? `${pagination.rowsNumber} ` +
t('grid.found') +
' ' +
getLabelAreaMap(false)
: pagination.rowsNumber > 1 && prop_search
? `${pagination.rowsNumber} ${labelElemFind}` + ' ' + getLabelAreaMap(false)
? `${pagination.rowsNumber} ${labelElemFind}` +
' ' +
getLabelAreaMap(false)
: ''
"
debounce="500"
@@ -1314,7 +1401,9 @@
@hide="hidewindow"
:maximized="$q.screen.lt.sm"
:persistent="false"
:class="'dialog_annunci ' + ($q.screen.lt.sm ? 'bottom-dialog' : ' right-align-dialog')"
:class="
'dialog_annunci ' + ($q.screen.lt.sm ? 'bottom-dialog' : ' right-align-dialog')
"
>
<CMyCardGrpPopup
v-if="mytable === shared_consts.TABLES_MYGROUPS"
@@ -1446,13 +1535,22 @@
dense
rounded
:icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'"
:label="showfilteradv ? t('grid.hide_campi_avanzati') : t('grid.show_campi_avanzati')"
:label="
showfilteradv
? t('grid.hide_campi_avanzati')
: t('grid.show_campi_avanzati')
"
:class="{ 'q-btn--active': showfilteradv }"
:aria-expanded="showfilteradv.toString()"
@click="showfilteradv = !showfilteradv"
></q-btn>
</div>
<div v-if="showColCheck(col, tools.TIPOVIS_NEW_RECORD, true, 0, newRecord) && col.foredit">
<div
v-if="
showColCheck(col, tools.TIPOVIS_NEW_RECORD, true, 0, newRecord) &&
col.foredit
"
>
<div class="">
<CMyPopupEdit
:table="mytable"
@@ -1497,7 +1595,7 @@
</q-dialog>
<q-dialog
v-model="editRecordBool"
@hide="hidewindow"
@hide="hidewindowEdit"
:maximized="$q.screen.lt.sm"
>
<q-card class="dialog_card">
@@ -1529,12 +1627,18 @@
size="md"
dense
:icon="!showfilteradv ? 'fas fa-arrow-down' : 'fas fa-arrow-up'"
:label="!showfilteradv ? t('grid.show_campi_avanzati') : t('grid.hide_campi_avanzati')"
:label="
!showfilteradv
? t('grid.show_campi_avanzati')
: t('grid.hide_campi_avanzati')
"
@click="showfilteradv = !showfilteradv"
></q-btn>
</div>
<div
v-else-if="showColCheck(col, tools.TIPOVIS_EDIT_RECORD, false) && col.foredit"
v-else-if="
showColCheck(col, tools.TIPOVIS_EDIT_RECORD, false) && col.foredit
"
class="tdclass"
>
<div>

View File

@@ -53,7 +53,7 @@
</tr>
<tr v-if="!recOrderCart?.codice_sconto">
<td class="label">{{ t('ecomm.codice_sconto') }}:</td>
<td class="label">{{ t('ecomm.add_codice_sconto') }}:</td>
<td>
<q-input
v-model="codice_sconto"
@@ -64,6 +64,7 @@
@keyup.enter="confermaCodiceSconto"
/>
<q-btn
v-if="codice_sconto"
:disabled="!codice_sconto || codice_sconto.trim() === ''"
:label="$t('ecomm.applica_sconto')"
icon="fas fa-check-circle"