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

205 lines
8.2 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
2022-01-28 08:35:30 +00:00
url="Entries/{{$ctrl.$params.id}}/lastItemBuys"
2021-01-26 06:21:05 +00:00
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>
2021-07-15 11:41:29 +00:00
<append>
<vn-icon-button
icon="filter_alt"
vn-click-stop="$ctrl.showFilterDialog(buy)"
vn-tooltip="Filter...">
</vn-icon-button>
</append>
2021-01-26 06:21:05 +00:00
</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-bar>
</div>
</form>
2021-07-15 11:41:29 +00:00
<vn-dialog
vn-id="filterDialog"
message="Filter item">
<tpl-body class="itemFilter">
<vn-horizontal>
<vn-textfield
label="Name"
ng-model="$ctrl.itemFilterParams.name"
2022-01-28 08:35:30 +00:00
ng-keydown="$ctrl.onKeyPress($event)"
2021-07-15 11:41:29 +00:00
vn-focus>
</vn-textfield>
<vn-textfield
label="Size"
2022-01-28 08:35:30 +00:00
ng-model="$ctrl.itemFilterParams.size"
ng-keydown="$ctrl.onKeyPress($event)">
2021-07-15 11:41:29 +00:00
</vn-textfield>
<vn-autocomplete
label="Producer"
ng-model="$ctrl.itemFilterParams.producerFk"
2022-01-28 08:35:30 +00:00
ng-keydown="$ctrl.onKeyPress($event)"
2021-07-15 11:41:29 +00:00
url="Producers"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Type"
ng-model="$ctrl.itemFilterParams.typeFk"
2022-01-28 08:35:30 +00:00
ng-keydown="$ctrl.onKeyPress($event)"
2021-07-15 11:41:29 +00:00
url="ItemTypes"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Color"
ng-model="$ctrl.itemFilterParams.inkFk"
2022-01-28 08:35:30 +00:00
ng-keydown="$ctrl.onKeyPress($event)"
2021-07-15 11:41:29 +00:00
url="Inks"
show-field="name"
value-field="id">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal class="vn-mb-md">
<vn-button vn-none
label="Search"
ng-click="$ctrl.filter()">
</vn-button>
</vn-horizontal>
<vn-crud-model
vn-id="itemsModel"
2022-01-28 08:35:30 +00:00
url="Entries/{{$ctrl.$params.id}}/lastItemBuys"
2021-07-15 11:41:29 +00:00
filter="$ctrl.itemFilter"
data="items"
limit="10">
</vn-crud-model>
<vn-data-viewer
model="itemsModel"
class="vn-w-lg">
<vn-table class="scrollable">
<vn-thead>
<vn-tr>
<vn-th shrink>ID</vn-th>
<vn-th expand>Item</vn-th>
<vn-th number>Size</vn-th>
<vn-th expand>Producer</vn-th>
<vn-th>Color</vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<a ng-repeat="item in items"
class="clickable vn-tr search-result"
ng-click="$ctrl.selectItem(item.id)">
<vn-td shrink>
<span
2022-01-14 07:06:38 +00:00
vn-click-stop="itemDescriptor.show($event, item.id)"
2021-07-15 11:41:29 +00:00
class="link">
{{::item.id}}
</span>
</vn-td>
<vn-td expand>{{::item.name}}</vn-td>
<vn-td number>{{::item.size}}</vn-td>
2022-01-28 08:35:30 +00:00
<vn-td expand>{{::item.producerName}}</vn-td>
<vn-td>{{::item.inkName}}</vn-td>
2021-07-15 11:41:29 +00:00
</a>
</vn-tbody>
</vn-table>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
</tpl-body>
</vn-dialog>