Added new pagination & module index search fixed #268

This commit is contained in:
Joan Sanchez 2018-05-07 08:33:45 +02:00
parent 22250984ae
commit 3c0fe7a4bc
24 changed files with 330 additions and 293 deletions

View File

@ -18,17 +18,19 @@
<vn-vertical vn-one pad-medium-h>
<vn-horizontal ng-repeat="insurance in classification.creditInsurances track by insurance.id">
<vn-one>
<vn-label translate>Credit</vn-label>
<span>{{::insurance.credit}}</span>
<vn-label-value label="Credit"
value="{{::insurance.credit}}">
</vn-label-value>
</vn-one>
<vn-one>
<vn-label translate>Grade</vn-label>
<span ng-if="!insurance.grade">-</span>
<span ng-if="insurance.grade">{{::insurance.grade}}</span>
<vn-label-value label="Grade"
value="{{::insurance.grade}}">
</vn-label-value>
</vn-one>
<vn-one>
<vn-label translate>Date</vn-label>
<span>{{::insurance.created | date:'dd/MM/yyyy' }}</span>
<vn-label-value label="Date"
value="{{::insurance.created | date:'dd/MM/yyyy' }}">
</vn-label-value>
</vn-one>
</vn-horizontal>
</vn-vertical>

View File

@ -12,7 +12,7 @@
<vn-horizontal
vn-one class="list list-element text-center"
pad-small-bottom
ng-repeat="insurance in index.model.instances track by insurance.id">
ng-repeat="insurance in $ctrl.instances track by insurance.id">
<vn-one pad-medium-h>{{::insurance.credit}}</vn-one>
<vn-one pad-medium-h>{{::insurance.grade}}</vn-one>
<vn-two pad-medium-h>{{::insurance.created | date: 'dd/MM/yyyy'}}</vn-two>
@ -22,6 +22,7 @@
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
<a ui-sref="clientCard.creditInsurance.create({classificationId: {{index.params.classificationId}}})"
fixed-bottom-right vn-tooltip="New classification" vn-bind="+" tooltip-position="left" ng-if="!$ctrl.isClosed">

View File

@ -12,7 +12,7 @@
<vn-horizontal
vn-one class="list list-element text-center"
pad-small-bottom
ng-repeat="credit in index.model.instances track by credit.id">
ng-repeat="credit in $ctrl.instances track by credit.id">
<vn-one pad-medium-h>{{::credit.amount | number:2}} €</vn-one>
<vn-two pad-medium-h>{{::credit.created | date:'dd/MM/yyyy HH:mm'}}</vn-two>
<vn-two pad-medium-h>{{::credit.worker.firstName}} {{::credit.worker.name}}</vn-two>
@ -20,9 +20,9 @@
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
<vn-paging vn-one margin-large-top index="index" total="index.model.count"></vn-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
<a ui-sref="clientCard.credit.create" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -15,10 +15,10 @@
class="list list-element text-center"
pad-small-bottom
ng-repeat="greuge in $ctrl.instances track by $index">
<vn-one pad-medium-h>{{greuge.shipped | date:'dd/MM/yyyy HH:mm' }}</vn-one>
<vn-two pad-medium-h>{{greuge.description}}</vn-two>
<vn-one pad-medium-h>{{greuge.amount | number:2}} €</vn-one>
<vn-one pad-medium-h>{{greuge.greugeType.name}}</vn-one>
<vn-one pad-medium-h>{{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }}</vn-one>
<vn-two pad-medium-h>{{::greuge.description}}</vn-two>
<vn-one pad-medium-h>{{::greuge.amount | number:2}} €</vn-one>
<vn-one pad-medium-h>{{::greuge.greugeType.name}}</vn-one>
</vn-horizontal>
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
@ -28,10 +28,9 @@
<vn-one pad-medium-h ng-if="index.model.count > 0">{{edit.model.sumAmount | number:2}} €</vn-one>
<vn-one pad-medium-h></vn-one>
</vn-horizontal>
<!--<vn-paging margin-large-top vn-one index="index" total="index.model.count"></vn-paging>-->
<vn-auto-paging margin-large-top vn-one index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging margin-large-top vn-one index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
<a ui-sref="clientCard.greuge.create" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -14,11 +14,11 @@
</vn-card>
<vn-card margin-medium-top>
<vn-item-client
ng-repeat="client in index.model.instances"
ng-repeat="client in $ctrl.clients"
client="client">
</vn-item-client>
</vn-card>
<vn-paging index="index" total="index.model.count"></vn-paging>
<vn-auto-paging index="index" total="index.model.count" items="$ctrl.clients"></vn-auto-paging>
</div>
</div>
<a ui-sref="create" vn-bind="+" fixed-bottom-right>

View File

@ -2,13 +2,19 @@ import ngModule from '../module';
import './item-client';
export default class Controller {
constructor($scope) {
this.$scope = $scope;
this.clientSelected = null;
}
search(index) {
index.accept();
this.clients = [];
index.accept().then(res => {
this.clients = res.instances;
});
}
openSummary(client) {
this.clientSelected = client;
this.$scope.dialogSummaryClient.show();

View File

@ -17,22 +17,18 @@
<vn-horizontal
class="list list-element"
pad-small-bottom
ng-repeat="invoice in index.model.instances track by greuge.id">
ng-repeat="invoice in $ctrl.instances track by greuge.id">
<vn-one>{{::invoice.ref}}</vn-one>
<vn-one>{{::invoice.issued | date:'dd/MM/yyyy' }}</vn-one>
<vn-one>{{::invoice.dued | date:'dd/MM/yyyy' }}</vn-one>
<vn-one>{{::invoice.amount | currency:'€':2}}</vn-one>
</vn-horizontal>
</vn-one>
<vn-one
ng-if="index.model.count === 0"
pad-small-v translate>
No results
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
</vn-vertical>
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
</vn-vertical>
<vn-paging margin-large-top vn-one index="index" total="index.model.count"></vn-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging margin-large-top vn-one index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>

View File

@ -14,7 +14,7 @@
<vn-horizontal
vn-one class="list list-element text-center"
pad-small-bottom
ng-repeat="mandate in index.model.instances track by mandate.id">
ng-repeat="mandate in $ctrl.instances track by mandate.id">
<vn-one pad-medium-h>{{::mandate.id}}</vn-one>
<vn-one pad-medium-h>{{::mandate.company.code}}</vn-one>
<vn-one pad-medium-h>{{::mandate.mandateType.name}}</vn-one>
@ -24,7 +24,7 @@
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
<vn-paging vn-one margin-large-top index="index" total="index.model.count"></vn-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>

View File

@ -28,9 +28,9 @@
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
<a ui-sref="clientCard.recovery.create" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -1,6 +1,6 @@
<section class="step-control">
<section class="steps">
<section class="step" ng-repeat="step in $ctrl.steps track by $index">
<section class="step" ng-repeat="step in $ctrl._steps track by $index">
<section class="circle"
vn-tooltip="{{::step.name}}"
tooltip-position="down"

View File

@ -6,6 +6,15 @@ export default class StepControl {
this.$state = $state;
}
set steps(steps) {
if (!steps) return;
this._steps = steps;
if (this.currentStepIndex > 0)
this.$state.go(this._steps[0].state);
}
set currentState(state) {
let isAllowed = true;
@ -17,7 +26,7 @@ export default class StepControl {
}
get totalSteps() {
return this.steps.length;
return this._steps.length;
}
get currentState() {
@ -25,36 +34,34 @@ export default class StepControl {
}
get currentStepIndex() {
for (let i = 0; i < this.steps.length; i++) {
if (this.steps[i].state == this.$state.current.name)
for (let i = 0; i < this._steps.length; i++) {
if (this._steps[i].state == this.$state.current.name)
return i;
}
}
onPreviousClick() {
let state = this.steps[this.currentStepIndex - 1].state;
let state = this._steps[this.currentStepIndex - 1].state;
this.currentState = state;
}
onNextClick() {
let state = this.steps[this.currentStepIndex + 1].state;
let state = this._steps[this.currentStepIndex + 1].state;
this.currentState = state;
}
canMovePrevious() {
return this.steps[0].state != this.currentState;
return this.currentStepIndex > 0;
}
canFinalize() {
let lastStep = this.steps[this.totalSteps - 1];
return lastStep.state == this.currentState;
return this.currentStepIndex === this.totalSteps - 1;
}
canMoveNext() {
let lastStep = this.steps[this.totalSteps - 1];
return lastStep.state != this.currentState;
return this.currentStepIndex < this.totalSteps - 1;
}
}

View File

@ -20,12 +20,9 @@
<vn-one pad-medium-h>{{::itemLog.creationDate | date:'dd/MM/yyyy HH:mm'}}</vn-one>
</vn-horizontal>
</vn-one>
<vn-horizontal vn-one class="list list-footer text-center">
<vn-one pad-medium-h></vn-one>
<vn-two pad-medium-h></vn-two>
<vn-one pad-medium-h></vn-one>
</vn-horizontal>
<vn-paging margin-large-top vn-one index="index" total="index.model.count"></vn-paging>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
<vn-horizontal vn-one class="list list-footer text-center"></vn-horizontal>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>

View File

@ -19,7 +19,6 @@
item="item">
</vn-item-product>
</vn-card>
<!-- <vn-paging index="index" total="index.model.count"></vn-paging> -->
<vn-auto-paging index="index" total="index.model.count" items="$ctrl.items"></vn-auto-paging>
</div>
</div>

View File

@ -42,3 +42,4 @@ Remove niche: Quitar nicho
Add barcode: Añadir código de barras
Remove barcode: Quitar código de barras
Buyer: Comprador
No results: Sin resultados

View File

@ -59,9 +59,12 @@
first: $index == 0,last: $index == sale.components.length - 1
}" number>{{::sale.quantity * component.value | currency:'€':3}}</td>
</tr>
<tr ng-if="index.model.count === 0" class="list list-element">
<td colspan="7" style="text-align: center" translate>No results</td>
</tr>
</tbody>
</table>
</vn-vertical>
<vn-paging margin-large-top vn-one index="index" total="index.model.count"></vn-paging>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-card>
</vn-vertical>

View File

@ -1,6 +1,6 @@
<form name="form">
<vn-card pad-large>
<vn-title>Basic data</vn-title>
<vn-title>Ticket configuration - Basic data</vn-title>
<vn-horizontal>
<vn-autocomplete vn-one
url="/api/Clients"

View File

@ -1,8 +1,15 @@
<form name="form">
<vn-card pad-large>
<vn-title>Step tree</vn-title>
<vn-title>Ticket configuration - Charge</vn-title>
<vn-horizontal>
Ticket id {{$ctrl.ticket.id}}
<vn-autocomplete vn-one
url="/api/Clients"
label="Charge difference to"
show-field="name"
value-field="id"
field="$ctrl.ticket.clientFk"
initial-data="$ctrl.ticket.clientFk">
</vn-autocomplete>
</vn-horizontal>
</vn-card>
</form>

View File

@ -17,7 +17,7 @@
<vn-horizontal
vn-one class="list list-element text-center"
pad-small-bottom
ng-repeat="expedition in index.model.instances track by expedition.id">
ng-repeat="expedition in $ctrl.instances track by expedition.id">
<vn-one pad-medium-h style="color:#FFA410;">
<i
pointer
@ -25,18 +25,18 @@
vn-tooltip="delete expedition"
ng-click="$ctrl.deleteExpedition(expedition)">delete</i>
</vn-one>
<vn-one pad-medium-h>{{expedition.itemFk}}</vn-one>
<vn-one pad-medium-h>{{expedition.item.name}}</vn-one>
<vn-one pad-medium-h>{{expedition.package.name}}</vn-one>
<vn-one pad-medium-h>{{expedition.counter}}</vn-one>
<vn-one pad-medium-h>{{expedition.checked}}</vn-one>
<vn-one pad-medium-h>{{expedition.worker.firstName}} {{expedition.worker.name}}</vn-one>
<vn-one pad-medium-h>{{expedition.created | date:'dd/MM/yyyy'}}</vn-one>
<vn-one pad-medium-h>{{::expedition.itemFk}}</vn-one>
<vn-one pad-medium-h>{{::expedition.item.name}}</vn-one>
<vn-one pad-medium-h>{{::expedition.package.name}}</vn-one>
<vn-one pad-medium-h>{{::expedition.counter}}</vn-one>
<vn-one pad-medium-h>{{::expedition.checked}}</vn-one>
<vn-one pad-medium-h>{{::expedition.worker.firstName}} {{::expedition.worker.name}}</vn-one>
<vn-one pad-medium-h>{{::expedition.created | date:'dd/MM/yyyy'}}</vn-one>
</vn-horizontal>
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
<vn-paging vn-one margin-large-top index="index" total="index.model.count"></vn-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>

View File

@ -30,7 +30,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="ticket in index.model.instances"
<tr ng-repeat="ticket in $ctrl.tickets track by ticket.id"
class="{{::$ctrl.compareDate(ticket.shipped)}} clickable"
ui-sref="ticket.card.summary({id: {{::ticket.id}}})">
<td>
@ -62,7 +62,7 @@
</table>
</vn-horizontal>
</vn-card>
<vn-paging index="index" total="index.model.count"></vn-paging>
<vn-auto-paging vn-one index="index" total="index.model.count" items="$ctrl.tickets"></vn-auto-paging>
</div>
</div>
<a ui-sref="ticket.create" vn-bind="+" fixed-bottom-right>

View File

@ -31,7 +31,10 @@ export default class Controller {
}
search(index) {
index.accept();
this.tickets = [];
index.accept().then(res => {
this.tickets = res.instances;
});
}
}

View File

@ -13,15 +13,23 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="sale in index.model.instances track by sale.id">
<td style="text-align:center!important"><vn-check style="text-align:center!important" vn-one field="sale.isChecked.isChecked" disabled="true"></vn-check></td>
<tr ng-repeat="sale in $ctrl.instances track by sale.id">
<td style="text-align:center!important">
<vn-check style="text-align:center!important"
vn-one field="sale.isChecked.isChecked"
disabled="true">
</vn-check>
</td>
<td number>{{::sale.itemFk}}</td>
<td><vn-fetched-tags sale="sale"/></td>
<td number>{{::sale.quantity}}</td>
</tr>
<tr ng-if="index.model.count === 0" class="list list-element">
<td colspan="4" style="text-align: center" translate>No results</td>
</tr>
</tbody>
</table>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>

View File

@ -15,7 +15,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="sale in index.model.instances track by sale.id">
<tr ng-repeat="sale in $ctrl.instances track by sale.id">
<td
pointer
number
@ -28,10 +28,14 @@
<td number>{{::sale.discount}} %</td>
<td number>{{::sale.quantity * sale.price | currency:'€':2}}</td>
</tr>
<tr ng-if="index.model.count === 0" class="list list-element">
<td colspan="6" style="text-align: center" translate>No results</td>
</tr>
</tbody>
</table>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
<vn-item-descriptor-popover vn-id="descriptor">
</vn-item-descriptor-popover>
</vn-popover>

View File

@ -12,7 +12,7 @@
<vn-horizontal
vn-one class="list list-element text-center"
pad-small-bottom
ng-repeat="ticket in index.model.instances track by ticket.id">
ng-repeat="ticket in $ctrl.instances track by ticket.id">
<vn-one pad-medium-h>{{::ticket.state.name}}</vn-one>
<vn-two pad-medium-h>{{::ticket.worker.firstName}} {{ticket.worker.name}}</vn-two>
<vn-two pad-medium-h>{{::ticket.created | date:'dd/MM/yyyy HH:mm'}}</vn-two>
@ -20,9 +20,9 @@
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
<vn-horizontal vn-one class="list list-footer"></vn-horizontal>
<vn-paging vn-one margin-large-top index="index" total="index.model.count"></vn-paging>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>
<a ui-sref="ticket.card.tracking.edit" vn-bind="+" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>

View File

@ -15,7 +15,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="sale in index.model.instances track by sale.id" class="list list-element">
<tr ng-repeat="sale in $ctrl.instances track by sale.id" class="list list-element">
<td number>{{::sale.itemFk}}</td>
<td><vn-fetched-tags sale="sale"/></td>
<td number>{{::sale.quantity}}</td>
@ -23,8 +23,12 @@
<td number>{{::sale.volume.volumeTimesQuantity | number:3}}</td>
<td number>{{::sale.volume.m3_total | number:3}}</td>
</tr>
<tr ng-if="index.model.count === 0" class="list list-element">
<td colspan="6" style="text-align: center" translate>No results</td>
</tr>
</tbody>
</table>
</vn-vertical>
</vn-card>
<vn-auto-paging vn-one margin-large-top index="index" total="index.model.count" items="$ctrl.instances"></vn-auto-paging>
</vn-vertical>