refs #4770 añadido searchPanel
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-05-03 09:25:23 +02:00
parent 5d40b5615d
commit 6ac12187c5
5 changed files with 77 additions and 20 deletions

View File

@ -33,7 +33,6 @@
ng-model="$ctrl.roadmap.trailerPlate" ng-model="$ctrl.roadmap.trailerPlate"
rule> rule>
</vn-textfield> </vn-textfield>
</vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textfield <vn-textfield

View File

@ -7,7 +7,7 @@
</vn-crud-model> </vn-crud-model>
<vn-portal slot="topbar"> <vn-portal slot="topbar">
<vn-searchbar <vn-searchbar
info="Search roadmap by id, name or code" info="Search roadmap by id or trunk"
panel="vn-roadmap-search-panel" panel="vn-roadmap-search-panel"
model="model" model="model"
expr-builder="$ctrl.exprBuilder(param, value)" expr-builder="$ctrl.exprBuilder(param, value)"

View File

@ -1,7 +1,7 @@
import ngModule from '../../module'; import ngModule from '../../module';
import ModuleMain from 'salix/components/module-main'; import ModuleMain from 'salix/components/module-main';
export default class ItemType extends ModuleMain { export default class Roadmap extends ModuleMain {
constructor($element, $) { constructor($element, $) {
super($element, $); super($element, $);
this.include = { this.include = {
@ -14,18 +14,24 @@ export default class ItemType extends ModuleMain {
case 'search': case 'search':
return /^\d+$/.test(value) return /^\d+$/.test(value)
? {id: value} ? {id: value}
: {or: [ : {name: {like: `%${value}%`}};
{name: {like: `%${value}%`}}, case 'from':
{code: {like: `%${value}%`}} return {etd: {gte: value}};
]}; case 'to':
case 'name': return {etd: {lte: value}};
case 'code': case 'supplierFk':
case 'price':
return {[param]: value};
case 'tractorPlate':
case 'trailerPlate':
case 'phone':
case 'driverName':
return {[param]: {like: `%${value}%`}}; return {[param]: {like: `%${value}%`}};
} }
} }
} }
ngModule.vnComponent('vnRoadmap', { ngModule.vnComponent('vnRoadmap', {
controller: ItemType, controller: Roadmap,
template: require('./index.html') template: require('./index.html')
}); });

View File

@ -1 +1 @@
Search itemType by id, name or code: Buscar familia por id, nombre o código Search roadmap by id or trunk: Buscar troncales por id o troncal

View File

@ -1,22 +1,74 @@
<div class="search-panel"> <div class="search-panel">
<form ng-submit="$ctrl.onSearch()"> <form id="manifold-form" ng-submit="$ctrl.onSearch()">
<vn-horizontal> <vn-horizontal class="vn-px-lg vn-pt-lg">
<vn-textfield <vn-textfield
vn-one vn-one
label="Name" label="General search"
ng-model="filter.name" ng-model="filter.search"
info="Search routes by id"
vn-focus> vn-focus>
</vn-textfield> </vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <section class="vn-px-md">
<vn-horizontal class="manifold-panel vn-pa-md">
<vn-date-picker
vn-one
label="From"
ng-model="filter.from">
</vn-date-picker>
<vn-date-picker
vn-one
label="To"
ng-model="filter.to">
</vn-date-picker>
</vn-horizontal>
</section>
<vn-horizontal class="vn-px-lg">
<vn-textfield <vn-textfield
vn-one vn-one
label="Code" label="Tractor plate"
ng-model="filter.code"> ng-model="filter.tractorPlate">
</vn-textfield>
<vn-textfield
vn-one
label="Trailer plate"
ng-model="filter.trailerPlate">
</vn-textfield> </vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal class="vn-mt-lg"> <vn-horizontal class="vn-px-lg">
<vn-textfield
vn-one
label="Phone"
ng-model="filter.phone">
</vn-textfield>
<vn-textfield
vn-one
label="Driver name"
ng-model="filter.driverName">
</vn-textfield>
</vn-horizontal>
<vn-horizontal class="vn-px-lg">
<vn-autocomplete
vn-one
ng-model="filter.supplierFk"
url="Suppliers"
show-field="nickname"
search-function="{or: [{id: $search}, {nickname: {like: '%'+ $search +'%'}}]}"
value-field="id"
order="nickname"
label="Carrier">
<tpl-item>
{{::id}} - {{::nickname}}
</tpl-item>
</vn-autocomplete>
<vn-input-number
vn-one
label="Price"
ng-model="filter.price">
</vn-input-number>
</vn-horizontal>
<vn-horizontal class="vn-px-lg vn-pb-lg vn-mt-lg">
<vn-submit label="Search"></vn-submit> <vn-submit label="Search"></vn-submit>
</vn-horizontal> </vn-horizontal>
</form> </form>
</div> </div>