96 lines
3.1 KiB
HTML
96 lines
3.1 KiB
HTML
|
<vn-watcher
|
||
|
vn-id="watcher"
|
||
|
url="Items/new"
|
||
|
data="$ctrl.item"
|
||
|
insert-mode="true"
|
||
|
form="form">
|
||
|
</vn-watcher>
|
||
|
<vn-crud-model
|
||
|
auto-load="true"
|
||
|
url="Origins"
|
||
|
data="originsData"
|
||
|
order="name"
|
||
|
vn-id="origin-model">
|
||
|
</vn-crud-model>
|
||
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||
|
<vn-card class="vn-pa-lg">
|
||
|
<vn-horizontal>
|
||
|
<vn-textfield
|
||
|
label="Name"
|
||
|
ng-model="$ctrl.item.provisionalName"
|
||
|
vn-name="name"
|
||
|
vn-focus>
|
||
|
</vn-textfield>
|
||
|
<vn-autocomplete
|
||
|
ng-model="$ctrl.item.tag"
|
||
|
url="Tags"
|
||
|
show-field="name"
|
||
|
value-field="id"
|
||
|
label="Tag"
|
||
|
vn-name="tag">
|
||
|
</vn-autocomplete>
|
||
|
<vn-autocomplete
|
||
|
data="$ctrl.validPriorities"
|
||
|
label="Priority"
|
||
|
ng-model="$ctrl.item.priority"
|
||
|
show-field="priority"
|
||
|
value-field="priority"
|
||
|
vn-name="priority">
|
||
|
</vn-autocomplete>
|
||
|
</vn-horizontal>
|
||
|
<vn-horizontal>
|
||
|
<vn-autocomplete
|
||
|
label="Type"
|
||
|
ng-model="$ctrl.item.typeFk"
|
||
|
vn-name="type"
|
||
|
url="ItemTypes"
|
||
|
fields="['code', 'categoryFk']"
|
||
|
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
|
||
|
label="Intrastat"
|
||
|
ng-model="$ctrl.item.intrastatFk"
|
||
|
vn-name="intrastat"
|
||
|
url="Intrastats"
|
||
|
show-field="description"
|
||
|
search-function="{or: [{id: {like: $search +'%'}}, {description: {like: '%'+ $search +'%'}}]}">
|
||
|
<tpl-item>
|
||
|
<div>{{::description}}</div>
|
||
|
<div class="text-caption text-secondary">
|
||
|
#{{::id}}
|
||
|
</div>
|
||
|
</tpl-item>
|
||
|
</vn-autocomplete>
|
||
|
</vn-horizontal>
|
||
|
<vn-horizontal>
|
||
|
<vn-autocomplete
|
||
|
data="originsData"
|
||
|
label="Origin"
|
||
|
ng-model="$ctrl.item.originFk"
|
||
|
vn-name="origin">
|
||
|
</vn-autocomplete>
|
||
|
</vn-horizontal>
|
||
|
</vn-card>
|
||
|
<vn-button-bar>
|
||
|
<vn-submit
|
||
|
disabled="!watcher.dataChanged()"
|
||
|
label="Create">
|
||
|
</vn-submit>
|
||
|
<vn-button
|
||
|
class="cancel"
|
||
|
label="Cancel"
|
||
|
ui-sref="item.index">
|
||
|
</vn-button>
|
||
|
</vn-button-bar>
|
||
|
</form>
|