salix/modules/entry/front/buy/import/index.html

107 lines
4.4 KiB
HTML
Raw Normal View History

2021-01-26 06:21:05 +00:00
<mg-ajax path="dms/upload" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.dms">
</vn-watcher>
<form
name="form"
ng-submit="$ctrl.onSubmit()"
class="vn-ma-md">
2021-03-09 09:01:40 +00:00
<div class="vn-w-lg">
2021-01-26 06:21:05 +00:00
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-input-file
vn-one
label="File"
ng-model="$ctrl.import.file"
on-change="$ctrl.onFileChange($event)"
2021-03-10 08:01:32 +00:00
accept="application/json"
required="true">
2021-01-26 06:21:05 +00:00
<append>
<vn-icon vn-none
color-marginal
2021-03-10 08:01:32 +00:00
title="{{'JSON files only' | translate}}"
2021-01-26 06:21:05 +00:00
icon="info">
</vn-icon>
</append>
</vn-input-file>
</vn-horizontal>
<vn-horizontal ng-show="$ctrl.import.ref">
<vn-textfield vn-focus
vn-one
label="Reference"
ng-model="$ctrl.import.ref">
</vn-textfield>
</vn-horizontal>
<vn-horizontal ng-show="$ctrl.import.observation">
<vn-textarea
vn-one
label="Observation"
ng-model="$ctrl.import.observation">
</vn-textarea>
</vn-horizontal>
2021-03-10 08:01:32 +00:00
<vn-horizontal ng-show="$ctrl.import.buys.length > 0">
2021-01-26 06:21:05 +00:00
<table class="vn-table">
<thead>
<tr>
2021-03-10 08:01:32 +00:00
<th translate>Item</th>
2021-01-26 06:21:05 +00:00
<th translate expand>Description</th>
<th translate center>Size</th>
<th translate center>Packing</th>
<th translate center>Grouping</th>
<th translate center>Buying value</th>
2021-02-09 06:59:55 +00:00
<th translate center>Box</th>
2021-01-26 06:21:05 +00:00
</tr>
</thead>
<tbody ng-repeat="buy in $ctrl.import.buys">
<tr>
2021-03-10 08:01:32 +00:00
<td title="{{::buy.itemFk}}">
2021-01-26 06:21:05 +00:00
<vn-autocomplete
class="dense"
vn-focus
url="Items"
ng-model="buy.itemFk"
show-field="name"
value-field="id"
search-function="$ctrl.itemSearchFunc($search)"
order="id DESC"
tabindex="1">
<tpl-item>
{{::id}} - {{::name}}
</tpl-item>
</vn-autocomplete>
</td>
<td title="{{::buy.description}}" expand>{{::buy.description | dashIfEmpty}}</td>
<td center title="{{::buy.size}}">{{::buy.size | dashIfEmpty}}</td>
<td center>{{::buy.packing | dashIfEmpty}}</td>
<td center>{{::buy.grouping | dashIfEmpty}}</td>
2021-01-26 06:21:05 +00:00
<td>{{::buy.buyingValue | currency: 'EUR':2}}</td>
2021-02-09 06:59:55 +00:00
<td center title="{{::buy.packageFk | dashIfEmpty}}">
<vn-autocomplete
vn-one
url="Packagings"
show-field="id"
value-field="id"
where="{isBox: true}"
ng-model="buy.packageFk">
</vn-autocomplete>
</td>
2021-01-26 06:21:05 +00:00
</tr>
</tbody>
</table>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
2021-03-10 08:01:32 +00:00
label="Import buys">
2021-01-26 06:21:05 +00:00
</vn-submit>
<vn-button
class="cancel"
label="Cancel"
2021-03-12 07:17:56 +00:00
ui-sref="entry.card.buy.index">
</vn-button>
2021-01-26 06:21:05 +00:00
</vn-button>
</vn-button-bar>
</div>
</form>