Commit 915d1f825df78e37dc0b01d4681ec7a8d4b1f52c

Authored by Jose Pinto
1 parent 8e68afc8d4
Exists in master and in 1 other branch develop

arreglos detalles visitas

Showing 2 changed files with 57 additions and 55 deletions   Show diff stats
src/js/controller.js
... ... @@ -145,62 +145,64 @@ angular.module('focaAdminSeguimiento').controller('focaAdminSeguimientoControlle
145 145 individual: $scope.idUsuario !== 0 ? true : false
146 146 };
147 147  
148   - focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) {
149   - $scope.marcadores = datos.data;
150   - $scope.$broadcast('cleanCabecera');
151   -
152   - if ($scope.idUsuario !== 0) {
153   - $scope.$broadcast('addCabecera', {
154   - label: 'Individual',
155   - valor: ''
156   - });
  148 + focaAdminSeguimientoService
  149 + .obtenerActividad(datos)
  150 + .then(function(datos) {
  151 + $scope.marcadores = datos.data;
  152 + $scope.$broadcast('cleanCabecera');
  153 +
  154 + if ($scope.idUsuario !== 0) {
  155 + $scope.$broadcast('addCabecera', {
  156 + label: 'Individual',
  157 + valor: ''
  158 + });
157 159  
158   - var valor = '';
159   - switch ($routeParams.parametro) {
160   - case 'nota-pedido':
161   - if (datos.data.length) {
162   - valor = datos.data[0].notaPedido.vendedor.NUM + ' - ' +
163   - datos.data[0].notaPedido.vendedor.NOM.trim();
164   - } else {
165   - valor = $scope.idUsuario;
166   - }
167   - break;
168   - case 'hoja-ruta':
169   - if (datos.data.length) {
170   - valor = $scope.idUsuario + ' - ' + datos.data[0]
171   - .hojaRutaMovimiento.remito.hojaRuta.vehiculo.tractor.trim();
172   - } else {
173   - valor = $scope.idUsuario;
174   - }
175   -
176   - break;
177   - case 'cobranza':
178   - if (datos.data.length) {
179   - valor = datos.data[0].recibo.cobrador.NUM + ' - ' +
180   - datos.data[0].recibo.cobrador.NOM.trim();
181   - } else {
182   - valor = $scope.idUsuario;
183   - }
184   - break;
  160 + var valor = '';
  161 + switch ($routeParams.parametro) {
  162 + case 'nota-pedido':
  163 + if (datos.data.length) {
  164 + valor = datos.data[0].notaPedido.vendedor.NUM + ' - ' +
  165 + datos.data[0].notaPedido.vendedor.NOM.trim();
  166 + } else {
  167 + valor = $scope.idUsuario;
  168 + }
  169 + break;
  170 + case 'hoja-ruta':
  171 + if (datos.data.length) {
  172 + valor = $scope.idUsuario + ' - ' + datos.data[0]
  173 + .hojaRutaMovimiento.remito.hojaRuta.vehiculo.tractor.trim();
  174 + } else {
  175 + valor = $scope.idUsuario;
  176 + }
  177 +
  178 + break;
  179 + case 'cobranza':
  180 + if (datos.data.length) {
  181 + valor = datos.data[0].recibo.cobrador.NUM + ' - ' +
  182 + datos.data[0].recibo.cobrador.NOM.trim();
  183 + } else {
  184 + valor = $scope.idUsuario;
  185 + }
  186 + break;
  187 + }
  188 +
  189 + $scope.$broadcast('addCabecera', {
  190 + label: cabecera,
  191 + valor: valor
  192 + });
  193 +
  194 + } else {
  195 + $scope.$broadcast('addCabecera',{
  196 + label: 'General',
  197 + valor: ''
  198 + });
185 199 }
186 200  
187 201 $scope.$broadcast('addCabecera', {
188   - label: cabecera,
189   - valor: valor
  202 + label: 'Cantidad: ',
  203 + valor: datos.data.length + ' Marcadores'
190 204 });
191   -
192   - } else {
193   - $scope.$broadcast('addCabecera',{
194   - label: 'General',
195   - valor: ''
196   - });
197   - }
198   -
199   - $scope.$broadcast('addCabecera', {
200   - label: 'Cantidad: ',
201   - valor: datos.data.length + ' Marcadores'
202 205 });
203   - });
204 206 }
205 207 }
206 208 ]);
src/js/osm-directive.js
... ... @@ -227,15 +227,15 @@ angular.module('focaAdminSeguimiento').directive('osm', function() {
227 227 var observacion = [];
228 228 var textFecha = $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') +
229 229 ' ' + marcador.fecha.slice(11,19);
230   - var prospecto = marcador.visitas.cliente.ES_PROS;
  230 + var prospecto = marcador.visita.cliente.ES_PROS;
231 231 var tipoVisitante =
232   - (marcador.visitas.tipoVisitante) === 1 ? 'Vendedor' : 'Cobrador';
233   - var visitante = marcador.visitas.visitante.NUM + ' - ' +
234   - marcador.visitas.visitante.NOM;
  232 + (marcador.visita.tipoVisitante) === 1 ? 'Vendedor' : 'Cobrador';
  233 + var visitante = marcador.visita.visitante.NUM + ' - ' +
  234 + marcador.visita.visitante.NOM;
235 235  
236 236 observacion.push([tipoVisitante, visitante]);
237 237 observacion.push(['Fecha', textFecha]);
238   - observacion.push(['Cliente', marcador.visitas.cliente.NOM]);
  238 + observacion.push(['Cliente', marcador.visita.cliente.NOM]);
239 239 observacion.push(['Es prospecto', (prospecto) ? 'Si' : 'No']);
240 240  
241 241 return observacion;