Tarea #170 Mostrar modelo ticketTracking

This commit is contained in:
Gerard 2018-03-27 14:24:47 +02:00
parent 56f774a07f
commit 4d1609c445
7 changed files with 35 additions and 15 deletions

View File

@ -109,6 +109,12 @@
{
"url": "/tracking",
"state": "ticket.card.tracking",
"abstract": true,
"component": "ui-view"
},
{
"url" : "/index",
"state": "ticket.card.tracking.index",
"component": "vn-ticket-tracking",
"params": {
"ticket": "$ctrl.ticket"
@ -118,6 +124,14 @@
"icon": "remove_red_eye"
}
},
{
"url": "/edit",
"state": "ticket.card.tracking.edit",
"component": "vn-ticket-tracking-edit",
"params": {
"ticket": "$ctrl.ticket"
}
},
{
"url": "/create",
"state": "ticket.card.tracking.create",

View File

@ -10,6 +10,7 @@ import './expedition/ticket-expedition';
import './volume/ticket-volume';
import './package/package';
import './sale/sale';
import './tracking/tracking';
import './tracking/index';
import './tracking/edit/edit';
import './fetched-tags/fetched-tags';
import './sale-checked/sale-checked';

View File

@ -1,5 +1,5 @@
<mg-ajax path="/ticket/api/TicketTrackings/filter" options="vnIndexNonAuto"></mg-ajax>
<vn-vertical pad-medium>
<vn-vertical>
<vn-card pad-large>
<vn-vertical>
<vn-title>Tracking</vn-title>
@ -7,7 +7,6 @@
<vn-column-header vn-one pad-medium-h field="state.name" text="State"></vn-column-header>
<vn-column-header vn-two pad-medium-h field="employee" text="Employee"></vn-column-header>
<vn-column-header vn-two pad-medium-h field="created" text="Created" default-order="ASC"></vn-column-header>
</vn-grid-header>
<vn-one class="list list-content">
<vn-horizontal
@ -15,9 +14,8 @@
pad-small-bottom
ng-repeat="ticket in index.model.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.worker.firstName}} {{ticket.worker.name}}</vn-two>
<vn-two pad-medium-h>{{::ticket.created | date:'dd/MM/yyyy HH:mm'}}</vn-two>
</vn-horizontal>
</vn-one>
<vn-one class="text-center pad-small-v" ng-if="index.model.count === 0" translate>No results</vn-one>
@ -26,6 +24,6 @@
</vn-vertical>
</vn-card>
</vn-vertical>
<a ui-sref="ticket.card.tracking.create" fixed-bottom-right>
<a ui-sref="ticket.card.tracking.edit" fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>
</a>

View File

@ -2,6 +2,6 @@ import ngModule from '../module';
import FilterTicketList from '../filter-ticket-list';
ngModule.component('vnTicketTracking', {
template: require('./tracking.html'),
template: require('./index.html'),
controller: FilterTicketList
});

View File

@ -1,5 +0,0 @@
Date : Fecha
Employee : Empleado
State: Estado
Tracking: Revisión
Created : Añadido

View File

@ -1,3 +1,14 @@
module.exports = function(Self) {
require('../methods/ticketTracking/filter')(Self);
Self.observe('before save', function(ctx, next) {
let token = ctx.options.accessToken;
let userId = token && token.userId;
Self.app.models.Worker.findOne({where: {userFk: userId}}, (err, user) => {
if (err) return next(err);
ctx.instance.workerFk = user.id;
next();
});
});
};

View File

@ -3,7 +3,8 @@
"base": "VnModel",
"options": {
"mysql": {
"table": "ticketTracking"
"table": "ticketTracking",
"database": "vn"
}
},
"properties": {