Merge branch '1945-item_type_category' of verdnatura/salix into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-12-26 12:59:33 +00:00 committed by Gitea
commit e4279733f4
5 changed files with 41 additions and 11 deletions

View File

@ -31,7 +31,15 @@
show-field="name"
value-field="id"
ng-model="$ctrl.item.typeFk"
initial-data="$ctrl.item.itemType">
initial-data="$ctrl.item.itemType"
fields="['categoryFk']"
include="'category'">
<tpl-item>
<div>{{name}}</div>
<div class="text-caption text-secondary">
{{category.name}}
</div>
</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>

View File

@ -19,13 +19,19 @@
<vn-autocomplete vn-one
url="ItemTypes"
label="Type"
fields="['code', 'name']"
fields="['code', 'name', 'categoryFk']"
value-field="id"
ng-model="$ctrl.item.typeFk"
search-function="{or: [{code: {like: $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}">
<tpl-item style="display: flex;">
<div style="width: 3em; padding-right: 1em;">{{::code}}</div>
<div>{{::name}}</div>
search-function="{or: [{code: {like: $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}"
include="'category'">
<tpl-item>
<div style="display: flex;">
<div style="width: 3em; padding-right: 1em;">{{::code}}</div>
<div>{{::name}}</div>
</div>
<div class="text-caption text-secondary">
{{category.name}}
</div>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete vn-one

View File

@ -20,14 +20,21 @@
value-field="id"
ng-model="filter.categoryFk">
</vn-autocomplete>
<vn-autocomplete
vn-one
<vn-autocomplete vn-one
url="ItemTypes"
label="Type"
where="{categoryFk: filter.categoryFk}"
show-field="name"
value-field="id"
ng-model="filter.typeFk">
ng-model="filter.typeFk"
fields="['categoryFk']"
include="'category'">
<tpl-item>
<div>{{name}}</div>
<div class="text-caption text-secondary">
{{category.name}}
</div>
</tpl-item>>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>

View File

@ -38,11 +38,12 @@ module.exports = Self => {
order.agencyModeFk
]);
stmts.push(stmt);
stmt = new ParameterizedSQL(`SELECT it.id, it.name
stmt = new ParameterizedSQL(`SELECT it.id, it.name, ic.name categoryName
FROM tmp.availableCalc ac
JOIN cache.available a ON a.calc_id = ac.calcFk
JOIN item i ON i.id = a.item_id
JOIN itemType it ON it.id = i.typeFk
JOIN itemCategory ic ON ic.id = it.categoryFk
WHERE it.categoryFk = ?
GROUP BY it.id`, [
itemCategoryId

View File

@ -29,7 +29,15 @@
ng-model="$ctrl.type.id"
show-field="name"
value-field="id"
label="Type">
label="Type"
fields="['categoryFk']"
include="'category'">
<tpl-item>
<div>{{name}}</div>
<div class="text-caption text-secondary">
{{categoryName}}
</div>
</tpl-item>
<prepend>
<vn-icon icon="search"></vn-icon>
</prepend>