diff --git a/db/install/dump/fixtures.sql b/db/install/dump/fixtures.sql index 5fbe8f863..99a073e63 100644 --- a/db/install/dump/fixtures.sql +++ b/db/install/dump/fixtures.sql @@ -353,15 +353,15 @@ INSERT INTO `vn`.`creditInsurance`(`id`, `creditClassification`, `credit`, `crea (2, 2 , 6000, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), NULL), (3, 3, 10000 , DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL); -INSERT INTO `vn`.`route`(`id`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`) +INSERT INTO `vn`.`route`(`id`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`) VALUES - (1, 56, CURDATE(), 1, 1, 'first route', null), - (2, 56, CURDATE(), 1, 1, 'second route', 4.2), - (3, 56, CURDATE(), 2, 7, 'third route', 5.3), - (4, 56, CURDATE(), 3, 7, 'fourth route', 6.4), - (5, 56, CURDATE(), 4, 8, 'fifth route', 7.5), - (6, 57, CURDATE(), 5, 8, 'sixth route', 8.6), - (7, 57, CURDATE(), 6, null, 'seventh route', 9.7); + (1, 56, CURDATE(), 1, 1, 'first route', null, 10, CURDATE(), CURDATE()), + (2, 56, CURDATE(), 1, 1, 'second route', 4.2, 20, CURDATE(), CURDATE()), + (3, 56, CURDATE(), 2, 7, 'third route', 5.3, 30, CURDATE(), CURDATE()), + (4, 56, CURDATE(), 3, 7, 'fourth route', 6.4, 40, CURDATE(), CURDATE()), + (5, 56, CURDATE(), 4, 8, 'fifth route', 7.5, 50, CURDATE(), CURDATE()), + (6, 57, CURDATE(), 5, 8, 'sixth route', 8.6, 60, CURDATE(), CURDATE()), + (7, 57, CURDATE(), 6, null, 'seventh route', 9.7, 70, CURDATE(), CURDATE()); INSERT INTO `vn2008`.`empresa_grupo`(`empresa_grupo_id`, `grupo`) VALUES diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html new file mode 100644 index 000000000..10d8c0b62 --- /dev/null +++ b/modules/route/front/basic-data/index.html @@ -0,0 +1,76 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js new file mode 100644 index 000000000..30e8abfb3 --- /dev/null +++ b/modules/route/front/basic-data/index.js @@ -0,0 +1,8 @@ +import ngModule from '../module'; + +ngModule.component('vnRouteBasicData', { + template: require('./index.html'), + bindings: { + route: '<' + } +}); diff --git a/modules/route/front/basic-data/locale/es.yml b/modules/route/front/basic-data/locale/es.yml new file mode 100644 index 000000000..49bc89294 --- /dev/null +++ b/modules/route/front/basic-data/locale/es.yml @@ -0,0 +1,4 @@ +Date finished: Fecha fin +Date started: Fecha inicio +Km start: Km de inicio +Km end: Km de fin diff --git a/modules/route/front/card/index.js b/modules/route/front/card/index.js index 99441584e..9182d9cdc 100644 --- a/modules/route/front/card/index.js +++ b/modules/route/front/card/index.js @@ -6,7 +6,22 @@ export default class Controller { this.$stateParams = $stateParams; this.route = null; this.filter = { - fields: ['id', 'agencyModeFk', 'created', 'm3', 'warehouseFk', 'description', 'vehicleFk'], + fields: [ + 'id', + 'workerFk', + 'agencyModeFk', + 'created', + 'm3', + 'warehouseFk', + 'description', + 'vehicleFk', + 'kmStart', + 'kmEnd', + 'started', + 'finished', + 'cost' + ], + where: {id: $stateParams.id}, include: [ { diff --git a/modules/route/front/index.js b/modules/route/front/index.js index 456221186..33df6dfca 100644 --- a/modules/route/front/index.js +++ b/modules/route/front/index.js @@ -6,3 +6,4 @@ import './descriptor'; import './summary'; import './card'; import './create'; +import './basic-data'; diff --git a/modules/route/front/routes.json b/modules/route/front/routes.json index 01f5d4bab..521ccd9be 100644 --- a/modules/route/front/routes.json +++ b/modules/route/front/routes.json @@ -4,6 +4,8 @@ "icon": "icon-delivery", "validations" : true, "dependencies": ["client", "worker", "ticket"], + "menu": [ + {"state": "route.card.basicData", "icon": "settings"}], "routes": [ { "url": "/route", @@ -39,6 +41,16 @@ "params": { "route": "$ctrl.route" } + }, + { + "url": "/basic-data", + "state": "route.card.basicData", + "component": "vn-route-basic-data", + "description": "Basic data", + "params": { + "route": "$ctrl.route" + }, + "acl": ["delivery"] } ] } \ No newline at end of file