added Tipi di Contributi
This commit is contained in:
@@ -808,7 +808,7 @@ export default defineComponent({
|
||||
|
||||
function createContribType(value: any) {
|
||||
console.log('createContribType', value)
|
||||
tools.createNewRecord($q, 'contribtype', { label: value }).then((myrec) => {
|
||||
tools.createNewRecord($q, 'contribtypes', { label: value }).then((myrec) => {
|
||||
// console.log('myrec')
|
||||
calendarStore.contribtype.push(myrec)
|
||||
})
|
||||
|
||||
@@ -98,6 +98,15 @@ export default defineComponent({
|
||||
type: costanti.FieldType.multiselect,
|
||||
filter: null,
|
||||
},
|
||||
{
|
||||
label: 'Contributo',
|
||||
table: 'contribtypes',
|
||||
key: 'idContribType',
|
||||
value: 0,
|
||||
arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', [costanti.FILTER_TUTTI]),
|
||||
type: costanti.FieldType.multiselect,
|
||||
filter: null,
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
@@ -126,11 +135,12 @@ export default defineComponent({
|
||||
const data = await globalStore.saveSubRec(mydata)
|
||||
}
|
||||
|
||||
function getdefaultnewrec(): any {
|
||||
function getdefaultnewrec(): IMySkill {
|
||||
return {
|
||||
_id: 0,
|
||||
idSkill: 0,
|
||||
idStatusSkill: [],
|
||||
idContribType: [],
|
||||
idCity: [],
|
||||
NumLevel: 0,
|
||||
photos: [],
|
||||
@@ -148,10 +158,19 @@ export default defineComponent({
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
},
|
||||
lookup2: {
|
||||
lk_tab: 'skills',
|
||||
lk_LF: 'idSkill',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'recSkill',
|
||||
af_objId_tab: '',
|
||||
lk_proj: {
|
||||
'sector.idSector': 1,
|
||||
recSkill: 1,
|
||||
sector: 1,
|
||||
idSkill: 1,
|
||||
idStatusSkill: 1,
|
||||
idContribType: 1,
|
||||
idCity: 1,
|
||||
numLevel: 1,
|
||||
photos: 1,
|
||||
@@ -165,29 +184,13 @@ export default defineComponent({
|
||||
surname: 1
|
||||
}
|
||||
},
|
||||
lookup2: {
|
||||
lookup3: {
|
||||
lk_tab: 'sectors',
|
||||
lk_LF: 'idSkill',
|
||||
lk_LF: 'recSkill.idSector',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'sector',
|
||||
af_objId_tab: '',
|
||||
lk_proj: {
|
||||
'sector.idSector': 1,
|
||||
idSkill: 1,
|
||||
idStatusSkill: 1,
|
||||
idCity: 1,
|
||||
numLevel: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
subTitle: 1,
|
||||
date_created: 1,
|
||||
date_updated: 1,
|
||||
userId: 1,
|
||||
username: 1,
|
||||
name: 1,
|
||||
surname: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -263,9 +263,16 @@ export default defineComponent({
|
||||
// console.log('sortBy', sortBy)
|
||||
|
||||
let filtersearch: any[] = []
|
||||
let filtersearch2: any[] = []
|
||||
|
||||
let recSector = searchList.value.find((item: ISearchList) => item.table === 'sectors')
|
||||
let idSector = recSector ? recSector.value : 0
|
||||
let recSector = null;
|
||||
let idSector = 0;
|
||||
if (searchList.value) {
|
||||
recSector = searchList.value.find((item: ISearchList) => item.table === 'sectors')
|
||||
idSector = recSector ? recSector.value : 0
|
||||
}
|
||||
|
||||
// console.table(searchList.value)
|
||||
|
||||
if (searchList.value) {
|
||||
searchList.value.forEach((item: ISearchList) => {
|
||||
@@ -275,7 +282,12 @@ export default defineComponent({
|
||||
objitem[item.key] = item.value
|
||||
filtersearch.push(objitem)
|
||||
} else if (item.arrvalue.length > 0) {
|
||||
const myarr = item.arrvalue.filter((value: any) => value > 0)
|
||||
const myarr = item.arrvalue.filter((value: any) => {
|
||||
if (typeof value === 'number') {
|
||||
return value > 0;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
|
||||
let arr2: any = []
|
||||
|
||||
@@ -292,11 +304,10 @@ export default defineComponent({
|
||||
filtersearch.push(obj2)
|
||||
} else {
|
||||
if (item.table === 'skills' && item.value === costanti.FILTER_TUTTI) {
|
||||
let obj2: any = {}
|
||||
// idSector
|
||||
let obj2: any = {
|
||||
idSector: idSector
|
||||
}
|
||||
filtersearch.push(obj2)
|
||||
obj2['sector._id'] = idSector
|
||||
filtersearch2.push(obj2)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -305,7 +316,6 @@ export default defineComponent({
|
||||
|
||||
console.log('filtersearch', filtersearch)
|
||||
|
||||
|
||||
if (props.prop_search) {
|
||||
let nosearch = false
|
||||
if (filtersearch.length <= 0 && !param_myfilter) {
|
||||
@@ -342,6 +352,8 @@ export default defineComponent({
|
||||
// @ts-ignore
|
||||
filtersearch: filtersearch,
|
||||
// @ts-ignore
|
||||
filtersearch2: filtersearch2,
|
||||
// @ts-ignore
|
||||
filtercustom: props.filtercustom,
|
||||
sortBy: myobj,
|
||||
descending,
|
||||
@@ -995,8 +1007,14 @@ export default defineComponent({
|
||||
if (ris) {
|
||||
// console.log('ris', ris)
|
||||
newRecordBool.value = false
|
||||
const indrec = serverData.value.findIndex((rec: IMySkill) => rec._id === ris._id)
|
||||
const indrec = serverData.value.findIndex((rec: any) => rec._id === ris._id)
|
||||
console.log('indrec', indrec, serverData.value[indrec])
|
||||
|
||||
if (fieldsTable.tableWithUsername.includes(props.prop_mytable)) {
|
||||
ris.username = userStore.my.username
|
||||
}
|
||||
|
||||
// console.table(serverData.value)
|
||||
if (indrec >= 0)
|
||||
serverData.value[indrec] = ris
|
||||
else
|
||||
@@ -1049,6 +1067,10 @@ export default defineComponent({
|
||||
return props.labelBtnAddRow !== addRow.value
|
||||
}
|
||||
|
||||
function checkIfShowRec(rec: any) {
|
||||
return (rec._id > 0 && typeof rec._id === 'number') || rec._id !== 'number'
|
||||
}
|
||||
|
||||
|
||||
// onMounted(mounted)
|
||||
|
||||
@@ -1118,6 +1140,7 @@ export default defineComponent({
|
||||
searchList,
|
||||
searchval,
|
||||
canModifyThisRec,
|
||||
checkIfShowRec,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
|
||||
<template v-slot:top-left v-if="searchList">
|
||||
<div class="row">
|
||||
<div class="row text-blue">
|
||||
<div v-for="(item, index) in searchList" :key="index">
|
||||
<CMySelect
|
||||
v-if="item.type === costanti.FieldType.select"
|
||||
@@ -138,10 +138,13 @@
|
||||
v-model:value="item.value"
|
||||
@update:value="searchval(item.value, item.table)"
|
||||
:addall="true"
|
||||
label-color="primary"
|
||||
color="primary"
|
||||
:optval="fieldsTable.getKeyByTable(item.table)"
|
||||
:optlab="fieldsTable.getLabelByTable(item.table)"
|
||||
:options="globalStore.getTableJoinByName(item.table, true, item.filter)"
|
||||
:useinput="false">
|
||||
:useinput="false"
|
||||
>
|
||||
</CMySelect>
|
||||
|
||||
<q-select
|
||||
@@ -156,11 +159,31 @@
|
||||
:display-value="fieldsTable.getTitleByTable(item.table)"
|
||||
emit-value
|
||||
map-options
|
||||
stack-label
|
||||
:options="globalStore.getTableJoinByName(item.table, item.filter)"
|
||||
style="min-width: 150px"
|
||||
:option-value="fieldsTable.getKeyByTable(item.table)"
|
||||
>
|
||||
>
|
||||
|
||||
<template
|
||||
v-if="item.arrvalue.length >= 1"
|
||||
v-slot:selected-item="scope">
|
||||
<q-chip
|
||||
removable
|
||||
dense
|
||||
@remove="scope.removeAtIndex(scope.index)"
|
||||
v-if="checkIfShowRec(scope.opt)"
|
||||
color="white"
|
||||
text-color="mycol"
|
||||
class="q-my-none q-ml-xs q-mr-none"
|
||||
>
|
||||
<q-avatar color="primary" text-color="white" :icon="item.icon" size="12px"/>
|
||||
{{ scope.opt[fieldsTable.getLabelByTable(item.table)] }}
|
||||
</q-chip>
|
||||
<div v-if="scope.opt === -100 && item.arrvalue.length === 1">
|
||||
{{ fieldsTable.getTitleByTable(item.table) }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
|
||||
<q-item v-bind="itemProps">
|
||||
|
||||
|
||||
@@ -445,10 +445,16 @@ export default defineComponent({
|
||||
else
|
||||
return '***************'
|
||||
} else {
|
||||
if (val === undefined || val === null)
|
||||
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
||||
else if (val === '') {
|
||||
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
||||
if (val === undefined || val === null) {
|
||||
if (props.canEdit)
|
||||
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
||||
else
|
||||
return ''
|
||||
} else if (val === '') {
|
||||
if (props.canEdit)
|
||||
return ' <span class="text-grey">(' + t('reg.select') + ')</span> '
|
||||
else
|
||||
return ''
|
||||
} else {
|
||||
let mystr = ''
|
||||
if (props.showall) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
:multiple="multiple"
|
||||
rounded
|
||||
outlined
|
||||
v-bind="$attrs"
|
||||
:input-class="myclass"
|
||||
:model-value="myvalue"
|
||||
:use-input="useinput"
|
||||
@@ -33,8 +34,21 @@
|
||||
@update:model-value="changeval"
|
||||
:label="label"
|
||||
emit-value
|
||||
options-selected-class="text-deep-orange"
|
||||
map-options
|
||||
v-bind="$attrs"
|
||||
style="min-width: 170px; max-width: 400px;">
|
||||
<template v-slot:option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.descr }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,6 +66,7 @@ export default defineComponent({
|
||||
filter: '',
|
||||
filterand: '',
|
||||
filtersearch: '',
|
||||
filtersearch2: '',
|
||||
filtercustom: '',
|
||||
sortBy: myobj,
|
||||
descending,
|
||||
|
||||
@@ -55,11 +55,12 @@ export default defineComponent({
|
||||
const data = await globalStore.saveSubRec(mydata)
|
||||
}
|
||||
|
||||
function getdefaultnewrec(): any {
|
||||
function getdefaultnewrec(): IMySkill {
|
||||
return {
|
||||
_id: 0,
|
||||
idSkill: 0,
|
||||
idStatusSkill: [],
|
||||
idContribType: [],
|
||||
idCity: [],
|
||||
NumLevel: 0,
|
||||
photos: [],
|
||||
@@ -79,8 +80,6 @@ export default defineComponent({
|
||||
af_objId_tab: 'myId',
|
||||
lk_proj: {
|
||||
idSkill: 1,
|
||||
idStatusSkill: 1,
|
||||
idCity: 1,
|
||||
numLevel: 1,
|
||||
photos: 1,
|
||||
note: 1,
|
||||
|
||||
@@ -7,6 +7,13 @@ body {
|
||||
//font-size: 1rem;
|
||||
}
|
||||
|
||||
.text-mycol {
|
||||
color: #333333 !important;
|
||||
}
|
||||
.bg-mycol {
|
||||
background: #333333 !important;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 100%; // default font size (browser 16) -> (10 62.5%)
|
||||
}
|
||||
|
||||
@@ -446,9 +446,11 @@ export interface IParamsQuery {
|
||||
userId: string
|
||||
codeId?: string
|
||||
filtersearch: string
|
||||
filtersearch2: string
|
||||
filtercustom: string
|
||||
lookup1?: IParLookup
|
||||
lookup2?: IParLookup
|
||||
lookup3?: IParLookup
|
||||
}
|
||||
|
||||
export interface IColGridTable {
|
||||
@@ -595,6 +597,7 @@ export interface IMySkill {
|
||||
_id: number
|
||||
idSkill: number
|
||||
idStatusSkill: number[]
|
||||
idContribType: string[]
|
||||
idCity: number[]
|
||||
photos: IGallery[]
|
||||
NumLevel: number
|
||||
|
||||
@@ -295,6 +295,7 @@ const msg_enUs = {
|
||||
registered: 'Registrato',
|
||||
contacted: 'Contattato',
|
||||
name_complete: 'Nome Completo',
|
||||
edit: 'Edit',
|
||||
num_invitati: 'Num.Invitati',
|
||||
is_in_whatsapp: 'In Whatsapp',
|
||||
is_in_telegram: 'In Telegram',
|
||||
|
||||
@@ -329,6 +329,7 @@ const msg_it = {
|
||||
consiglio: 'Consiglio',
|
||||
volta: 'volta',
|
||||
volte: 'volte',
|
||||
edit: 'Modifica',
|
||||
registered: 'Registrato',
|
||||
contacted: 'Contattato',
|
||||
name_complete: 'Nome Completo',
|
||||
@@ -784,6 +785,9 @@ const msg_it = {
|
||||
},
|
||||
sectors: {
|
||||
name: 'Settore',
|
||||
},
|
||||
contribtype: {
|
||||
name: 'Contributo'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -339,9 +339,10 @@ export const colSkills = [
|
||||
]
|
||||
|
||||
export const colmySkills = [
|
||||
AddCol({
|
||||
name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.select, jointable: 'users',
|
||||
}),
|
||||
/*AddCol({
|
||||
name: 'userId', label_trans: 'order.users', fieldtype: costanti.FieldType.string, jointable: 'users',
|
||||
visible: false
|
||||
}), */
|
||||
//AddCol({ name: 'name', label_trans: 'reg.name', fieldtype: costanti.FieldType.string }),
|
||||
//AddCol({ name: 'surname', label_trans: 'reg.surname', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({ name: 'username', label_trans: 'reg.username', foredit: false }),
|
||||
@@ -365,6 +366,12 @@ export const colmySkills = [
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'statusSkills',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idContribType',
|
||||
label_trans: 'contribtype.name',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'contribtypes',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idCity',
|
||||
label_trans: 'skill.city',
|
||||
@@ -705,7 +712,7 @@ const colTableEvents = [
|
||||
name: 'contribtype',
|
||||
label_trans: 'event.contribtype',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'contribtype',
|
||||
jointable: 'contribtypes',
|
||||
}),
|
||||
AddCol({ name: 'price', label_trans: 'event.price' }),
|
||||
AddCol({ name: 'infoafterprice', label_trans: 'event.infoafterprice' }),
|
||||
@@ -1257,6 +1264,10 @@ export const fieldsTable = {
|
||||
'myskills',
|
||||
],
|
||||
|
||||
tableWithUsername: [
|
||||
'myskills',
|
||||
],
|
||||
|
||||
tablesList: [
|
||||
{
|
||||
value: 'operators',
|
||||
@@ -1322,7 +1333,7 @@ export const fieldsTable = {
|
||||
collabel: 'title',
|
||||
},
|
||||
{
|
||||
value: 'contribtype',
|
||||
value: 'contribtypes',
|
||||
label: 'Tipi di Contributi',
|
||||
columns: colcontribtype,
|
||||
colkey: '_id',
|
||||
|
||||
@@ -196,7 +196,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return calendarStore.internalpages
|
||||
else if (table === 'wheres')
|
||||
return calendarStore.wheres
|
||||
else if (table === 'contribtype')
|
||||
else if (table === 'contribtypes')
|
||||
return calendarStore.contribtype
|
||||
else if (table === 'disciplines') ris = state.disciplines
|
||||
else if (table === toolsext.TABNEWSLETTER) ris = state.newstosent
|
||||
|
||||
Reference in New Issue
Block a user