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

194 lines
6.4 KiB
HTML
Raw Normal View History

2017-12-21 13:09:55 +00:00
<mg-ajax
path="Items/{{patch.params.id}}"
2017-12-21 13:09:55 +00:00
options="vnPatch"
override="{filter: {include: [{relation: 'itemType'}, {relation: 'origin'}, {relation: 'ink'}, {relation: 'producer'}, {relation: 'expense'}]}}">
2017-12-21 13:09:55 +00:00
</mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.item"
form="form"
save="patch">
</vn-watcher>
2020-09-17 18:12:52 +00:00
<vn-crud-model
auto-load="true"
url="Origins"
data="originsData"
order="name"
vn-id="origin-model">
</vn-crud-model>
2019-11-10 10:08:44 +00:00
<form name="form" ng-submit="watcher.submit()" ng-cloak class="vn-w-md">
<vn-card class="vn-pa-lg">
2018-03-01 22:38:14 +00:00
<vn-horizontal>
2019-10-09 22:47:29 +00:00
<vn-textfield
vn-one
label="Name"
ng-model="$ctrl.item.name"
rule
vn-focus>
</vn-textfield>
2018-10-15 11:20:55 +00:00
<vn-textfield
vn-one label="Full name"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.longName"
rule
2018-10-15 11:20:55 +00:00
info="Full name calculates based on tags 1-3. Is not recommended to change it manually">
</vn-textfield>
2018-12-17 13:15:39 +00:00
<vn-autocomplete vn-one
url="ItemTypes"
2018-03-01 22:38:14 +00:00
label="Type"
show-field="name"
value-field="id"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.typeFk"
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>
2018-03-01 22:38:14 +00:00
</vn-autocomplete>
2018-12-17 13:15:39 +00:00
</vn-horizontal>
<vn-horizontal>
2018-03-01 22:38:14 +00:00
<vn-autocomplete vn-one
url="Intrastats"
2018-03-01 22:38:14 +00:00
label="Intrastat"
show-field="description"
value-field="id"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.intrastatFk"
2019-01-28 09:04:08 +00:00
search-function="{or: [{id: {like: $search +'%'}}, {description: {like: '%'+ $search +'%'}}]}"
2018-03-01 22:38:14 +00:00
initial-data="$ctrl.item.intrastat">
2018-05-31 12:40:42 +00:00
<tpl-item style="display: flex;">
<div style="width: 6em; text-align: right; padding-right: 1em;">{{::id}}</div>
<div>{{::description}}</div>
</tpl-item>
2020-02-17 06:22:55 +00:00
<append>
<vn-icon-button
icon="add_circle"
vn-tooltip="New intrastat"
ng-click="$ctrl.showIntrastat($event)">
</vn-icon-button>
</append>
2018-03-01 22:38:14 +00:00
</vn-autocomplete>
<vn-autocomplete vn-one
url="Expenses"
label="Expense"
ng-model="$ctrl.item.expenseFk"
initial-data="$ctrl.item.expense">
2018-03-01 22:38:14 +00:00
</vn-autocomplete>
2018-10-15 11:20:55 +00:00
<vn-autocomplete vn-one
2020-09-17 18:12:52 +00:00
data="originsData"
2018-10-15 11:20:55 +00:00
label="Origin"
show-field="name"
value-field="id"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.originFk"
2018-10-15 11:20:55 +00:00
initial-data="$ctrl.item.origin">
2020-02-17 06:22:55 +00:00
</vn-autocomplete>
2018-12-17 13:15:39 +00:00
<vn-textfield
vn-one
label="Reference"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.comment"
rule>
2018-12-17 13:15:39 +00:00
</vn-textfield>
2020-09-17 07:58:00 +00:00
</vn-horizontal>
<vn-horizontal>
<vn-input-number
vn-one
min="0"
label="Relevancy"
ng-model="$ctrl.item.relevancy"
rule>
</vn-input-number>
<vn-input-number
vn-one
min="0"
label="Size"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.size"
rule>
</vn-input-number>
<vn-input-number
vn-one
min="0"
label="stems"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.stems"
rule>
</vn-input-number>
2018-12-17 13:15:39 +00:00
</vn-horizontal>
<vn-horizontal>
<vn-input-number
vn-one
min="0"
2019-05-30 06:04:46 +00:00
step="0.01"
label="Density"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.density"
rule>
</vn-input-number>
2020-08-31 10:29:51 +00:00
<vn-input-number
vn-one
min="0"
step="0.01"
label="Compression"
ng-model="$ctrl.item.compression"
rule>
</vn-input-number>
2020-09-17 07:58:00 +00:00
<vn-textarea
vn-one
2020-09-17 07:58:00 +00:00
label="Description"
ng-model="$ctrl.item.description"
rule>
2020-09-17 07:58:00 +00:00
</vn-textarea>
2018-12-17 13:15:39 +00:00
</vn-horizontal>
<vn-horizontal>
2018-10-15 11:20:55 +00:00
<vn-check
vn-one
label="Active"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.item.isActive">
2018-10-15 11:20:55 +00:00
</vn-check>
<vn-check
2019-10-09 22:47:29 +00:00
vn-one
2020-09-17 07:58:00 +00:00
label="Price in kg"
ng-model="$ctrl.item.hasKgPrice">
</vn-check>
<vn-check
vn-one
label="Fragile"
ng-model="$ctrl.item.isFragile"
info="Is shown at website, app that this item cannot travel (wreath, palms, ...)">
</vn-check>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
2017-12-21 13:09:55 +00:00
</vn-card>
<vn-button-bar>
2020-12-13 12:54:17 +00:00
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button label="Undo changes" ng-if="$ctrl.$scope.form.$dirty" ng-click="watcher.loadOriginalData()"></vn-button>
2017-12-21 13:09:55 +00:00
</vn-button-bar>
</form>
2020-02-17 06:22:55 +00:00
<!-- Create custom agent dialog -->
<vn-dialog class="edit"
vn-id="intrastat"
2020-05-06 12:38:09 +00:00
on-accept="$ctrl.onIntrastatAccept()"
message="New intrastat">
2020-02-17 06:22:55 +00:00
<tpl-body>
<vn-horizontal>
2020-02-17 11:47:03 +00:00
<vn-input-number vn-one vn-focus
2020-02-17 06:22:55 +00:00
label="Identifier"
2020-02-17 11:47:03 +00:00
ng-model="$ctrl.newIntrastat.intrastatId"
2020-02-17 06:22:55 +00:00
required="true">
2020-02-17 11:47:03 +00:00
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
2020-02-17 06:22:55 +00:00
<vn-textfield vn-one
label="Description"
ng-model="$ctrl.newIntrastat.description"
required="true">
</vn-textfield>
</vn-horizontal>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Create</button>
</tpl-buttons>
</vn-dialog>