salix/modules/item/front/data/index.html

98 lines
3.6 KiB
HTML

<mg-ajax
path="/item/api/Items/{{patch.params.id}}"
options="vnPatch"
override="{filter: {include: [{relation: 'itemType'}, {relation: 'origin'}, {relation: 'ink'}, {relation: 'producer'}, {relation: 'expence'}]}}">
</mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.item"
form="form"
save="patch">
</vn-watcher>
<form name="form" ng-submit="watcher.submit()" ng-cloak compact>
<vn-card pad-large>
<vn-horizontal>
<vn-textfield vn-one label="Name" field="$ctrl.item.name" vn-focus></vn-textfield>
<vn-textfield
vn-one label="Full name"
field="$ctrl.item.longName"
info="Full name calculates based on tags 1-3. Is not recommended to change it manually">
</vn-textfield>
<vn-autocomplete vn-one
url="/item/api/ItemTypes"
label="Type"
show-field="name"
value-field="id"
field="$ctrl.item.typeFk"
initial-data="$ctrl.item.itemType">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="/item/api/Intrastats"
label="Intrastat"
show-field="description"
value-field="id"
field="$ctrl.item.intrastatFk"
search-function="{or: [{id: {like: $search +'%'}}, {description: {like: '%'+ $search +'%'}}]}"
initial-data="$ctrl.item.intrastat">
<tpl-item style="display: flex;">
<div style="width: 6em; text-align: right; padding-right: 1em;">{{::id}}</div>
<div>{{::description}}</div>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Expences"
label="Expence"
field="$ctrl.item.expenceFk"
initial-data="$ctrl.item.expence">
</vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Origins"
label="Origin"
show-field="name"
value-field="id"
field="$ctrl.item.originFk"
initial-data="$ctrl.item.origin">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Reference"
field="$ctrl.item.comment">
</vn-textfield>
<vn-input-number vn-one min="0"
label="Size"
field="$ctrl.item.size">
</vn-input-number>
<vn-input-number vn-one min="0"
label="stems"
field="$ctrl.item.stems">
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-input-number vn-one min="0"
label="Density"
field="$ctrl.item.density">
</vn-input-number>
<!-- <vn-textfield vn-one label="compression" field="$ctrl.item.compression"></vn-textfield> -->
<vn-input-number vn-one min="0"
label="Relevancy"
field="$ctrl.item.relevancy">
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Active"
field="$ctrl.item.isActive">
</vn-check>
<vn-textarea vn-one label="description" field="$ctrl.item.description"></vn-textarea>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>