From e335c6d95f3289a25edb8911d5b4706e8a069fe5 Mon Sep 17 00:00:00 2001 From: Jose Pinto Date: Mon, 17 Dec 2018 17:14:29 -0300 Subject: [PATCH] agrego foca-cabecera-facturador --- src/js/controller.js | 42 +++++++++++++++----------- src/views/hoja-ruta.html | 76 ++++-------------------------------------------- 2 files changed, 31 insertions(+), 87 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index eb1aed3..b7351f2 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -26,7 +26,6 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', } }; - $scope.cabecera = []; $scope.showCabecera = true; $scope.now = new Date(); @@ -157,7 +156,7 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', }; $scope.remitosTabla = []; - $scope.cabecera = []; + $scope.$broadcast('cleanCabecera'); crearHojaRutaService.getNumeroHojaRuta().then(function(res) { $scope.comprobante = $scope.rellenar(res.data.numeroHojaRuta, 8); @@ -188,7 +187,10 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', function(proveedor) { console.info($scope.hojaRuta); $scope.hojaRuta.transportista.codigo = proveedor.COD; - addCabecera('Transportista:', proveedor.NOM); + $scope.$broadcast('addCabecera', { + label: 'Transportista:', + valor: proveedor.NOM + }); }, function() { } @@ -208,7 +210,10 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', modalInstance.result.then( function(chofer) { $scope.hojaRuta.chofer = chofer; - addCabecera('Chofer: ', chofer.nombre); + $scope.$broadcast('addCabecera', { + label: 'Chofer:', + valor: chofer.nombre + }); }, function() { // funcion ejecutada cuando se cancela el modal } @@ -228,9 +233,18 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', modalInstance.result.then( function(vehiculo) { $scope.hojaRuta.vehiculo = vehiculo; - addCabecera('Tractor: ', vehiculo.tractor); - addCabecera('Semi: ', vehiculo.semi); - addCabecera('Capacidad: ', vehiculo.capacidad); + $scope.$broadcast('addCabecera', { + label: 'Tractor:', + valor: vehiculo.tractor + }); + $scope.$broadcast('addCabecera', { + label: 'Semi:', + valor: vehiculo.semi + }); + $scope.$broadcast('addCabecera', { + label: 'Capacidad:', + valor: vehiculo.capacidad + }); }, function() { // funcion ejecutada cuando se cancela el modal } @@ -255,7 +269,10 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', modalInstance.result.then( function(tarifario) { $scope.hojaRuta.tarifario = tarifario; - addCabecera('Tarifario: ', tarifario.costo); + $scope.$broadcast('addCabecera', { + label: 'Tarifario:', + valor: tarifario.costo + }); }, function() { // funcion ejecutada cuando se cancela el modal } @@ -385,15 +402,6 @@ angular.module('focaCrearHojaRuta') .controller('hojaRutaCtrl', }; - function addCabecera(label, valor) { - var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); - if(propiedad.length === 1) { - propiedad[0].valor = valor; - } else { - $scope.cabecera.push({label: label, valor: valor}); - } - } - /*function removeCabecera(label) { var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); if(propiedad.length === 1){ diff --git a/src/views/hoja-ruta.html b/src/views/hoja-ruta.html index 79b1076..b30a0bd 100644 --- a/src/views/hoja-ruta.html +++ b/src/views/hoja-ruta.html @@ -1,74 +1,10 @@
-
-
-
-
-
-
-
-
HOJA DE RUTA
-
-
NÂș {{puntoVenta}}-{{comprobante}} -
-
- Fecha: - - - -
-
- Hora: - - -
-
-
-
- - -
- - - - -
-
-
- -
-
-
+
-- 1.9.1