added autocompletes to item index

This commit is contained in:
Carlos Jimenez Ruiz 2021-11-08 17:46:40 +01:00
parent eb36f86b9d
commit 262e46d7c9
8 changed files with 38 additions and 15 deletions

View File

@ -11,7 +11,7 @@
<
<span translate>Showing</span>
{{model.data.length}}
<span translate>rows</span>
<span translate>results</span>
>
</div>
</div>

View File

@ -5,4 +5,4 @@ Save data: Guardar datos
Shown columns: Columnas visibles
Check the columns you want to see: Marca las columnas que quieres ver
Showing: Mostrando
rows: filas
results: resultados

View File

@ -113,7 +113,7 @@ module.exports = Self => {
return {'i.typeFk': value};
case 'categoryFk':
return {'ic.id': value};
case 'salesPersonFk':
case 'buyerFk':
return {'it.workerFk': value};
case 'origin':
return {'ori.code': value};

View File

@ -8,12 +8,12 @@
},
"properties": {
"id": {
"type": "Number",
"type": "number",
"id": true,
"description": "Identifier"
},
"description": {
"type": "String"
"type": "string"
}
},
"relations": {

View File

@ -8,15 +8,15 @@
},
"properties": {
"id": {
"type": "Number",
"type": "number",
"id": true,
"description": "Identifier"
},
"code": {
"type": "String"
"type": "string"
},
"name": {
"type": "String"
"type": "string"
}
},
"acls": [

View File

@ -42,7 +42,7 @@
<th field="origin" shrink>
<span translate>Origin</span>
</th>
<th field="salesperson" shrink>
<th field="buyerFk" shrink>
<span translate>Buyer</span>
</th>
<th field="density" shrink>

View File

@ -5,10 +5,6 @@ import './style.scss';
class Controller extends Section {
constructor($element, $) {
super($element, $);
/* this.showFields = {
id: false,
actions: false
}; */
this.smartTableOptions = {
activeButtons: {
@ -20,12 +16,39 @@ class Controller extends Section {
field: 'category',
autocomplete: {
url: 'ItemCategories',
valueField: 'name',
}
},
{
field: 'origin',
autocomplete: {
url: 'Origins',
showField: 'name',
valueField: 'code'
}
},
{
field: 'typeFk',
autocomplete: {
url: 'ItemTypes',
}
},
{
field: 'intrastat',
autocomplete: {
url: 'Intrastats',
showField: 'description',
valueField: 'description'
}
},
{
field: 'buyerFk',
autocomplete: {
url: 'Workers/activeWithRole',
where: `{role: {inq: ['logistic', 'buyer']}}`,
searchFunction: '{firstName: $search}',
showField: 'nickname',
valueField: 'id',
}
},
]
@ -36,7 +59,7 @@ class Controller extends Section {
switch (param) {
case 'category':
return {'ic.name': value};
case 'salesPersonFk':
case 'buyerFk':
return {'it.workerFk': value};
case 'grouping':
return {'b.grouping': value};

View File

@ -41,7 +41,7 @@
<vn-autocomplete
vn-one
disabled="false"
ng-model="filter.salesPersonFk"
ng-model="filter.buyerFk"
url="Workers/activeWithRole"
show-field="nickname"
search-function="{firstName: $search}"