Commit 2094b28fdbbddac4c2544470e0473b3093beb6bd
1 parent
0149b643da
Exists in
master
agrego fecha y hora
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaOrdenCarga') | 1 | angular.module('focaOrdenCarga') |
2 | .controller('focaOrdenCargaController', [ | 2 | .controller('focaOrdenCargaController', [ |
3 | '$scope', | 3 | '$scope', |
4 | '$uibModal', | 4 | '$uibModal', |
5 | '$location', | 5 | '$location', |
6 | '$filter', | 6 | '$filter', |
7 | '$timeout', | 7 | '$timeout', |
8 | 'focaOrdenCargaService', | 8 | 'focaOrdenCargaService', |
9 | 'focaBotoneraLateralService', | 9 | 'focaBotoneraLateralService', |
10 | 'focaModalService', | 10 | 'focaModalService', |
11 | 'notaPedidoBusinessService', | 11 | 'notaPedidoBusinessService', |
12 | '$rootScope', | 12 | '$rootScope', |
13 | 'focaSeguimientoService', | 13 | 'focaSeguimientoService', |
14 | 'APP', | 14 | 'APP', |
15 | 'focaLoginService', | 15 | 'focaLoginService', |
16 | '$localStorage', | 16 | '$localStorage', |
17 | function ( | 17 | function ( |
18 | $scope, $uibModal, $location, $filter, $timeout, focaOrdenCargaService, | 18 | $scope, $uibModal, $location, $filter, $timeout, focaOrdenCargaService, |
19 | focaBotoneraLateralService, focaModalService, notaPedidoBusinessService, | 19 | focaBotoneraLateralService, focaModalService, notaPedidoBusinessService, |
20 | $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) { | 20 | $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) { |
21 | config(); | 21 | config(); |
22 | 22 | ||
23 | function config() { | 23 | function config() { |
24 | // PARAMETROS INICIALES PARA FUNCIONAMIENTO DEL PROGRAMA | 24 | // PARAMETROS INICIALES PARA FUNCIONAMIENTO DEL PROGRAMA |
25 | $scope.tmpCantidad = Number; | 25 | $scope.tmpCantidad = Number; |
26 | $scope.tmpPrecio = Number; | 26 | $scope.tmpPrecio = Number; |
27 | $scope.isNumber = angular.isNumber; | 27 | $scope.isNumber = angular.isNumber; |
28 | $scope.datepickerAbierto = false; | 28 | $scope.datepickerAbierto = false; |
29 | $scope.show = false; | 29 | $scope.show = false; |
30 | $scope.cargando = true; | 30 | $scope.cargando = true; |
31 | $scope.cabeceras = []; | 31 | $scope.cabeceras = []; |
32 | $scope.botonera = focaOrdenCargaService.getBotonera(); | 32 | $scope.botonera = focaOrdenCargaService.getBotonera(); |
33 | $scope.puntoVenta = $filter('rellenarDigitos')(0, 4); | 33 | $scope.puntoVenta = $filter('rellenarDigitos')(0, 4); |
34 | $scope.comprobante = $filter('rellenarDigitos')(0, 8); | 34 | $scope.comprobante = $filter('rellenarDigitos')(0, 8); |
35 | $scope.dateOptions = { | 35 | $scope.dateOptions = { |
36 | maxDate: new Date(), | 36 | maxDate: new Date(), |
37 | minDate: new Date(2010, 0, 1) | 37 | minDate: new Date(2010, 0, 1) |
38 | }; | 38 | }; |
39 | 39 | ||
40 | //SETEO BOTONERA LATERAL | 40 | //SETEO BOTONERA LATERAL |
41 | $timeout(function () { | 41 | $timeout(function () { |
42 | focaBotoneraLateralService.showSalir(false); | 42 | focaBotoneraLateralService.showSalir(false); |
43 | focaBotoneraLateralService.showPausar(true); | 43 | focaBotoneraLateralService.showPausar(true); |
44 | focaBotoneraLateralService.showGuardar(true, $scope.crearNotaPedido); | 44 | focaBotoneraLateralService.showGuardar(true, $scope.crearNotaPedido); |
45 | focaBotoneraLateralService.addCustomButton('Salir', salir); | 45 | focaBotoneraLateralService.addCustomButton('Salir', salir); |
46 | }); | 46 | }); |
47 | 47 | ||
48 | init(); | 48 | init(); |
49 | 49 | ||
50 | } | 50 | } |
51 | 51 | ||
52 | function init() { | 52 | function init() { |
53 | $scope.ordenCarga = { | ||
54 | id: 0, | ||
55 | cliente: {}, | ||
56 | proveedor: {}, | ||
57 | domicilio: { dom: '' }, | ||
58 | vendedor: {}, | ||
59 | fechaCarga: new Date(), | ||
60 | cotizacion: {}, | ||
61 | articulosNotaPedido: [], | ||
62 | notaPedidoPlazo: [], | ||
63 | notaPedidoPuntoDescarga: [] | ||
64 | }; | ||
53 | 65 | ||
54 | } | 66 | } |
55 | 67 | ||
56 | $scope.$watch('ordenCarga', function (newValue) { | 68 | $scope.$watch('ordenCarga', function (newValue) { |
57 | focaBotoneraLateralService.setPausarData({ | 69 | focaBotoneraLateralService.setPausarData({ |
58 | label: 'ordenCarga', | 70 | label: 'ordenCarga', |
59 | val: newValue | 71 | val: newValue |
60 | }); | 72 | }); |
61 | }, true); | 73 | }, true); |
62 | 74 | ||
63 | $scope.$watch('ordenCarga', function (newValue) { | 75 | $scope.$watch('ordenCarga', function (newValue) { |
64 | focaBotoneraLateralService.setPausarData({ | 76 | focaBotoneraLateralService.setPausarData({ |
65 | label: 'ordenCarga', | 77 | label: 'ordenCarga', |
66 | val: newValue | 78 | val: newValue |
67 | }); | 79 | }); |
68 | focaBotoneraLateralService.setRutasPausadas({ | 80 | focaBotoneraLateralService.setRutasPausadas({ |
69 | label: 'rutas', | 81 | label: 'rutas', |
70 | val: 'orden-carga' | 82 | val: 'orden-carga' |
71 | }); | 83 | }); |
72 | }, true); | 84 | }, true); |
73 | 85 | ||
74 | $scope.crearOrdenCarga = function () { | 86 | $scope.crearOrdenCarga = function () { |
75 | 87 | ||
76 | focaBotoneraLateralService.startGuardar(); | 88 | focaBotoneraLateralService.startGuardar(); |
77 | $scope.saveLoading = true; | 89 | $scope.saveLoading = true; |
78 | 90 | ||
79 | } | 91 | } |
80 | 92 | ||
81 | $scope.salir = function () { | 93 | $scope.salir = function () { |
82 | $location.path('/'); | 94 | $location.path('/'); |
83 | }; | 95 | }; |
84 | 96 | ||
85 | function salir() { | 97 | function salir() { |
86 | var confirmacion = false; | 98 | var confirmacion = false; |
87 | 99 | ||
88 | if (!angular.equals($scope.ordenCarga, $scope.inicial)) { | 100 | if (!angular.equals($scope.ordenCarga, $scope.inicial)) { |
89 | confirmacion = true; | 101 | confirmacion = true; |
90 | } | 102 | } |
91 | 103 | ||
92 | if (confirmacion) { | 104 | if (confirmacion) { |
93 | focaModalService.confirm( | 105 | focaModalService.confirm( |
94 | '¿Está seguro de que desea salir? Se perderán todos los datos cargados.' | 106 | '¿Está seguro de que desea salir? Se perderán todos los datos cargados.' |
95 | ).then(function (data) { | 107 | ).then(function (data) { |
96 | if (data) { | 108 | if (data) { |
97 | $location.path('/'); | 109 | $location.path('/'); |
98 | } | 110 | } |
99 | }); | 111 | }); |
100 | } else { | 112 | } else { |
101 | $location.path('/'); | 113 | $location.path('/'); |
102 | } | 114 | } |
103 | } | 115 | } |
104 | }]); | 116 | }]); |
105 | 117 |
src/views/orden-carga.html
1 | <div class="row"> | 1 | <div class="row"> |
2 | <foca-cabecera-facturador | 2 | <foca-cabecera-facturador |
3 | titulo="'Orden de Carga'" | 3 | titulo="'Orden de Carga'" |
4 | numero="puntoVenta + '-' + comprobante" | 4 | numero="puntoVenta + '-' + comprobante" |
5 | fecha="notaPedido.fechaCarga" | 5 | fecha="ordenCarga.fechaCarga" |
6 | class="mb-0 col-lg-12" | 6 | class="mb-0 col-lg-12" |
7 | ></foca-cabecera-facturador> | 7 | ></foca-cabecera-facturador> |
8 | </div> | 8 | </div> |
9 | <div class="row"> | 9 | <div class="row"> |
10 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> | 10 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> |
11 | <div class="row px-5 py-2 botonera-secundaria"> | 11 | <div class="row px-5 py-2 botonera-secundaria"> |
12 | <div class="col-12"> | 12 | <div class="col-12"> |
13 | <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador> | 13 | <foca-botonera-facturador botones="botonera" max="6" class="row"></foca-botonera-facturador> |
14 | </div> | 14 | </div> |
15 | </div> | 15 | </div> |
16 | 16 | ||
17 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> | 17 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> |
18 | <thead> | 18 | <thead> |
19 | <tr> | 19 | <tr> |
20 | <th>Cisterna</th> | 20 | <th>Cisterna</th> |
21 | <th>Producto</th> | 21 | <th>Producto</th> |
22 | <th>Capacidad Total</th> | 22 | <th>Capacidad Total</th> |
23 | <th>Carga</th> | 23 | <th>Carga</th> |
24 | <th>Disponible</th> | 24 | <th>Disponible</th> |
25 | <th class="text-center"> | 25 | <th class="text-center"> |
26 | </th> | 26 | </th> |
27 | </tr> | 27 | </tr> |
28 | </thead> | 28 | </thead> |
29 | <tbody> | 29 | <tbody> |
30 | <tr ng-repeat="hojaRuta in hojasRuta | filter:filtros"> | 30 | <tr ng-repeat="hojaRuta in hojasRuta | filter:filtros"> |
31 | <td> | 31 | <td> |
32 | <b ng-show="hojaRuta.abierta !== null">RA </b> | 32 | <b ng-show="hojaRuta.abierta !== null">RA </b> |
33 | <b ng-show="hojaRuta.abierta === null">  </b> | 33 | <b ng-show="hojaRuta.abierta === null">  </b> |
34 | <span ng-bind="[hojaRuta.sucursal, hojaRuta.numeroHojaRuta] | comprobante"></span> | 34 | <span ng-bind="[hojaRuta.sucursal, hojaRuta.numeroHojaRuta] | comprobante"></span> |
35 | </td> | 35 | </td> |
36 | <td ng-bind="hojaRuta.fechaReparto | date:'yyyy-MM-dd':'-0300'"></td> | 36 | <td ng-bind="hojaRuta.fechaReparto | date:'yyyy-MM-dd':'-0300'"></td> |
37 | <td> | 37 | <td> |
38 | <div ng-bind="hojaRuta.remitos.length" class="d-inline-block"></div> | 38 | <div ng-bind="hojaRuta.remitos.length" class="d-inline-block"></div> |
39 | <button class="btn btn-outline-dark boton-accion" ng-click="mostrarRemitos(hojaRuta)"> | 39 | <button class="btn btn-outline-dark boton-accion" ng-click="mostrarRemitos(hojaRuta)"> |
40 | <i class="fa fa-eye"></i> | 40 | <i class="fa fa-eye"></i> |
41 | </button> | 41 | </button> |
42 | </td> | 42 | </td> |
43 | <td | 43 | <td |
44 | ng-bind="setearEstado(hojaRuta.estado)" | 44 | ng-bind="setearEstado(hojaRuta.estado)" |
45 | ng-class="{'text-white':hojaRuta.estado == 0, | 45 | ng-class="{'text-white':hojaRuta.estado == 0, |
46 | 'text-danger':hojaRuta.estado == 1, | 46 | 'text-danger':hojaRuta.estado == 1, |
47 | 'text-dark': hojaRuta.estado == 2 | 47 | 'text-dark': hojaRuta.estado == 2 |
48 | }" | 48 | }" |
49 | ></td> | 49 | ></td> |
50 | <td></td> | 50 | <td></td> |
51 | <td class="text-center"> | 51 | <td class="text-center"> |
52 | <button | 52 | <button |
53 | class="btn btn-outline-dark boton-accion" | 53 | class="btn btn-outline-dark boton-accion" |
54 | title="Activar" | 54 | title="Activar" |
55 | ng-click="activarHojaRuta(hojaRuta)" | 55 | ng-click="activarHojaRuta(hojaRuta)" |
56 | > | 56 | > |
57 | <i | 57 | <i |
58 | ng-class="{'fa-check': hojaRuta.estado == 0,'fa-times': hojaRuta.estado == 1}" | 58 | ng-class="{'fa-check': hojaRuta.estado == 0,'fa-times': hojaRuta.estado == 1}" |
59 | class="fa"> | 59 | class="fa"> |
60 | </i> | 60 | </i> |
61 | </button> | 61 | </button> |
62 | </td> | 62 | </td> |
63 | </tr> | 63 | </tr> |
64 | </body> | 64 | </body> |
65 | </table> | 65 | </table> |
66 | </div> | 66 | </div> |
67 | </div> | 67 | </div> |
68 | 68 |