salix/modules/item/front/search-panel/index.html

156 lines
5.3 KiB
HTML
Raw Normal View History

<mg-ajax path="Tags" options="mgIndex as tags"></mg-ajax>
<div class="search-panel">
<form ng-submit="$ctrl.onSearch()">
<vn-horizontal>
<vn-textfield
vn-one
label="General search"
2019-10-09 22:47:29 +00:00
ng-model="filter.search"
2019-04-12 12:33:08 +00:00
info="Search items by id, name or barcode"
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
vn-focus
url="ItemCategories"
2019-02-14 10:24:04 +00:00
label="Category"
show-field="name"
value-field="id"
2019-10-09 22:47:29 +00:00
ng-model="filter.categoryFk">
2019-02-14 10:24:04 +00:00
</vn-autocomplete>
<vn-autocomplete
vn-one
url="ItemTypes"
label="Type"
where="{categoryFk: filter.categoryFk}"
show-field="name"
value-field="id"
2019-10-09 22:47:29 +00:00
ng-model="filter.typeFk">
</vn-autocomplete>
</vn-horizontal>
2019-02-19 09:15:39 +00:00
<vn-horizontal>
<vn-autocomplete
vn-one
disabled="false"
2019-10-09 22:47:29 +00:00
ng-model="filter.salesPersonFk"
url="Clients/activeWorkersWithRole"
show-field="nickname"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
label="Buyer">
</vn-autocomplete>
2019-02-19 09:15:39 +00:00
</vn-horizontal>
<vn-horizontal class="vn-pt-sm">
<vn-one class="text-subtitle1" translate>
Tags
</vn-one>
<vn-icon-button
vn-none
vn-bind="+"
vn-tooltip="Add tag"
icon="add_circle"
ng-click="filter.tags.push({})">
</vn-icon-button>
</vn-horizontal>
<vn-horizontal ng-repeat="itemTag in filter.tags">
<vn-autocomplete
vn-id="tag"
vn-one
2019-10-09 22:47:29 +00:00
ng-model="itemTag.tagFk"
data="tags.model"
show-field="name"
label="Tag"
on-change="itemTag.value = null">
</vn-autocomplete>
<vn-textfield
vn-one
ng-show="tag.selection.isFree !== false"
vn-id="text"
label="Value"
2019-10-09 22:47:29 +00:00
ng-model="itemTag.value">
</vn-textfield>
<vn-autocomplete
vn-one
ng-show="tag.selection.isFree === false"
url="{{$ctrl.getSourceTable(tag.selection)}}"
label="Value"
2019-10-09 22:47:29 +00:00
ng-model="itemTag.value"
show-field="name"
value-field="name">
</vn-autocomplete>
2019-02-08 16:49:51 +00:00
<vn-icon-button
vn-none
2018-10-17 10:49:18 +00:00
vn-tooltip="Remove tag"
icon="delete"
2018-10-17 10:49:18 +00:00
ng-click="filter.tags.splice($index, 1)"
tabindex="-1">
</vn-icon-button>
</vn-horizontal>
<vn-horizontal class="vn-pt-sm">
<vn-one class="text-subtitle1" translate>
More fields
</vn-one>
<vn-icon-button
vn-none
vn-bind="+"
vn-tooltip="Add field"
icon="add_circle"
ng-click="$ctrl.fieldFilters.push({})">
</vn-icon-button>
</vn-horizontal>
<vn-horizontal ng-repeat="fieldFilter in $ctrl.fieldFilters">
<vn-autocomplete
vn-one
label="Field"
ng-model="fieldFilter.name"
data="$ctrl.moreFields"
value-field="name"
show-field="label"
show-filter="false"
translate-fields="['label']"
selection="info"
on-change="fieldFilter.value = null">
</vn-autocomplete>
<vn-one ng-switch="info.type">
<div ng-switch-when="Number">
<vn-input-number
label="Value"
ng-model="fieldFilter.value">
</vn-input-number>
</div>
<div ng-switch-when="Boolean">
<vn-check
label="Value"
ng-model="fieldFilter.value">
</vn-check>
</div>
<div ng-switch-when="Date">
<vn-date-picker
label="Value"
ng-model="fieldFilter.value">
</vn-date-picker>
</div>
<div ng-switch-default>
<vn-textfield
label="Value"
ng-model="fieldFilter.value">
</vn-textfield>
</div>
</vn-one>
<vn-icon-button
vn-none
vn-tooltip="Remove field"
icon="delete"
ng-click="$ctrl.removeField($index, fieldFilter.name)"
tabindex="-1">
</vn-icon-button>
</vn-horizontal>
<vn-horizontal class="vn-mt-lg">
<vn-submit label="Search"></vn-submit>
</vn-horizontal>
</form>
</div>