Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SistemaGestionAdministrativa
ModuloPersonalCliente
Commits
a587ea51
Commit
a587ea51
authored
May 11, 2016
by
D’jalmar Gutierrez Titirico
🚲
Browse files
Merge branch 'release-0.3.1' into 'master'
Release 0.3.1 See merge request
!18
parents
e3062666
1be81808
Pipeline
#8
failed with stage
Changes
59
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/app/postulaciones/modals/postulaciones.cargo.modal.controller.js
View file @
a587ea51
...
...
@@ -13,7 +13,7 @@
postulanteService
.
getPostulantes
({
ordenarPor
:
'
nombres
'
})
.
then
(
postulantes
=>
{
this
.
postulantes
=
postulantes
;
this
.
postulanteSeleccionado
=
{};
//
this.postulanteSeleccionado = {};
});
}
...
...
client/app/postulaciones/modals/postulaciones.crear.modal.controller.js
View file @
a587ea51
...
...
@@ -10,8 +10,8 @@
this
.
postulacion
=
{
fk_postulante
:
this
.
postulante
.
_id
};
this
.
service
=
postulacionService
;
cargoService
.
getCargos
().
then
(
cargos
=>
{
this
.
cargos
=
cargos
;
this
.
cargoSeleccionado
=
{};
this
.
cargos
=
{
rows
:
cargos
.
rows
.
filter
(
cargo
=>
this
.
postulante
.
Postulaciones
.
findIndex
(
x
=>
x
.
_id
==
cargo
.
_id
)
==
-
1
)}
;
//
this.cargoSeleccionado = {};
})
}
...
...
client/app/postulaciones/modals/postulaciones.editar.modal.controller.js
View file @
a587ea51
...
...
@@ -2,16 +2,18 @@
(()
=>
{
class
PostulacionesEditarModalController
{
constructor
(
$uibModalInstance
,
c
ar
g
o
,
cargoService
,
postulacionService
)
{
constructor
(
$uibModalInstance
,
p
ar
ametr
o
,
cargoService
,
postulacionService
)
{
this
.
errores
=
{};
this
.
enviado
=
false
;
this
.
modal
=
$uibModalInstance
;
this
.
postulacion
=
Object
.
assign
({},
cargo
.
Postulacion
);
this
.
cargo
=
cargo
;
this
.
postulacion
=
Object
.
assign
({},
parametro
.
cargo
.
Postulacion
);
this
.
cargo
=
parametro
.
cargo
;
this
.
postulante
=
parametro
.
postulante
;
this
.
service
=
postulacionService
;
cargoService
.
getCargos
().
then
(
cargos
=>
{
this
.
cargos
=
cargos
;
this
.
cargoSeleccionado
=
cargos
.
rows
.
find
(
x
=>
x
.
_id
===
this
.
postulacion
.
fk_cargo
);
this
.
cargos
=
{
rows
:
cargos
.
rows
.
filter
(
cargo
=>
this
.
postulante
.
Postulaciones
.
findIndex
(
x
=>
x
.
_id
==
cargo
.
_id
)
==
-
1
)};
this
.
cargos
.
rows
.
push
(
this
.
cargoSeleccionado
);
})
}
...
...
client/app/postulaciones/modals/postulaciones.modal.html
View file @
a587ea51
...
...
@@ -19,10 +19,13 @@
<div
class=
"col-md-10"
>
<label>
Presentación
</label>
<div
class=
""
>
<textarea
type=
"text"
name=
"presentacion"
class=
"form-control "
ng-model=
"vm.postulacion.presentacion"
required
></textarea>
<p
class=
"help-block"
ng-show=
"form.presentacion.$error.required && vm.enviado"
>
Ingrese una presentacion para postular al cargo
<textarea
type=
"text"
name=
"presentacion"
class=
"form-control "
ng-model=
"vm.postulacion.presentacion"
></textarea>
<p
class=
"help-block"
ng-show=
"vm.postulacion.presentacion.length"
>
<label
ng-class=
"{'text-danger':vm.postulacion.presentacion.length<25||vm.postulacion.presentacion.length>200,'text-success':vm.postulacion.presentacion.length>25||vm.postulacion.presentacion.length<200}"
>
{{vm.postulacion.presentacion.length}} / 200 (25 min)
</label>
</p>
</div>
</div>
...
...
@@ -32,7 +35,8 @@
</div>
</div>
<div
class=
"modal-footer"
>
<button
class=
"btn btn-primary-outline"
type=
"submit"
ng-disabled=
"!(form.cargos.$dirty ||form.presentacion.$dirty)"
>
<button
class=
"btn btn-primary-outline"
type=
"submit"
ng-disabled=
"!(form.cargos.$dirty ||form.presentacion.$dirty)"
>
Guardar
</button>
<button
class=
"btn btn-default"
type=
"button"
ng-click=
"vm.modal.dismiss()"
>
Cancelar
</button>
...
...
client/app/postulantes/editar/postulantes.editar.controller.js
View file @
a587ea51
...
...
@@ -15,7 +15,7 @@
this
.
postulacionService
=
postulacionService
;
this
.
comentarioService
=
comentarioService
;
this
.
id
=
$stateParams
.
postulanteId
;
this
.
tags
=
[]
;
this
.
tags
=
{
count
:
0
}
;
this
.
service
.
getPostulante
(
this
.
id
,
{
incluye
:
[
{
entidad
:
'
Tags
'
},
...
...
@@ -27,6 +27,10 @@
this
.
postulante
=
postulante
;
console
.
log
(
postulante
);
});
this
.
tagService
.
getTags
()
.
then
(
tags
=>
{
this
.
tags
=
tags
;
});
}
//region datos del postulante
...
...
@@ -88,7 +92,7 @@
controller
:
'
PostulacionesEditarModalCtrl
'
,
controllerAs
:
'
vm
'
,
resolve
:
{
cargo
:
cargo
parametro
:
{
postulante
:
this
.
postulante
,
cargo
:
cargo
}
}
})
}
...
...
@@ -118,14 +122,15 @@
//region tags
autoCompletarTags
(
query
)
{
console
.
log
(
this
.
tags
)
if
(
this
.
tags
.
length
==
0
)
{
this
.
tagService
.
getTags
()
.
then
(
tags
=>
{
this
.
tags
=
tags
;
return
this
.
tags
.
rows
.
filter
(
x
=>
x
.
nombre
.
includes
(
query
));
})
}
else
return
this
.
tags
.
rows
.
filter
(
x
=>
x
.
nombre
.
includes
(
query
));
// if (this.tags.count == 0) {
// this.tagService.getTags()
// .then(tags=> {
// this.tags = tags;
// return this.tags.rows.filter(x=>x.nombre.includes(query));
// });
// }
// else
return
this
.
tags
.
rows
.
filter
(
x
=>
x
.
nombre
.
includes
(
query
));
}
adicionarTag
(
tag
)
{
...
...
client/app/postulantes/editar/postulantes.editar.html
View file @
a587ea51
...
...
@@ -102,7 +102,7 @@
<tags-input
class=
"primary"
ng-model=
"vm.postulante.Tags"
name=
"tags"
placeholder=
"Adicionar Tags"
display-property=
"nombre"
min-length=
"2"
on-tag-adding=
"vm.adicionarTag($tag)"
on-tag-removed=
"vm.quitarTag($tag)"
>
<auto-complete
source=
"vm.autoCompletarTags($query)"
min-length=
"2"
></auto-complete>
<auto-complete
source=
"vm.autoCompletarTags($query)"
min-length=
"2"
display-property=
"nombre"
></auto-complete>
</tags-input>
</blockquote>
</div>
...
...
@@ -139,7 +139,7 @@
</h4>
<p
class=
"list-group-item-text"
>
{{cargo.Postulacion.presentacion}}
</p>
<p
class=
"text-right fecha text-info"
>
{{cargo.Postulacion.fecha_modificacion |
date:"dd/MM/yyyyh:mma"}}
</p>
date:"dd/MM/yyyy
'a las'
h:mma"}}
</p>
</div>
</div>
</div>
...
...
@@ -179,8 +179,7 @@
<small>
dijo:
</small>
</h4>
<p
class=
"list-group-item-text"
>
{{comentarista.Comentario.contenido}}
</p>
<p
class=
"text-right fecha text-info"
>
{{comentarista.Comentario.fecha_modificacion |
date:"dd/MM/yyyyh:mma"}}
</p>
<p
class=
"text-right fecha text-info"
>
{{comentarista.Comentario.fecha_modificacion | date:"dd/MM/yyyy 'a las' h:mma"}}
</p>
</div>
</div>
</div>
...
...
client/app/postulantes/postulantes.controller.js
View file @
a587ea51
...
...
@@ -15,6 +15,7 @@
this
.
postulacionService
=
postulacionService
;
this
.
tagService
=
tagService
;
this
.
paginaActual
=
1
;
this
.
datosPersonalesBusqueda
=
[];
this
.
tags
=
[];
this
.
tagsSeleccionados
=
[];
this
.
cambiarPagina
();
...
...
@@ -47,45 +48,51 @@
})(
postulante
.
nombres
+
"
"
+
postulante
.
apellidos
,
postulante
);
}
buscar
(
valor
)
{
this
.
datosPersonalesBusqueda
=
[];
var
palabras
=
valor
.
split
(
"
"
);
var
campos
=
[
'
nombres
'
,
'
apellidos
'
,
'
ci
'
];
campos
.
forEach
(
campo
=>
{
palabras
.
forEach
(
palabra
=>
{
this
.
datosPersonalesBusqueda
.
push
({
en
:
campo
,
palabra
:
palabra
})
})
});
this
.
cambiarPagina
();
}
formatearTags
()
{
this
.
tagsBusqueda
=
[];
this
.
tagsSeleccionados
.
forEach
(
tag
=>
{
this
.
tagsBusqueda
.
push
({
palabra
:
tag
.
nombre
,
en
:
'
nombre
'
})
});
this
.
cambiarPagina
();
}
cambiarPagina
()
{
var
parametros
=
{
pagina
:
this
.
paginaActual
,
elementos
:
10
,
ordenarPor
:
this
.
ordenarPor
,
orden
:
this
.
ordenDescendente
};
if
(
this
.
tagsSeleccionados
.
length
>
0
)
{
var
palabras
=
[];
this
.
tagsSeleccionados
.
forEach
(
tag
=>
{
palabras
.
push
({
palabra
:
tag
.
nombre
,
en
:
'
nombre
'
})
});
this
.
service
.
getPostulantes
({
pagina
:
this
.
paginaActual
,
elementos
:
10
,
ordenarPor
:
this
.
ordenarPor
,
orden
:
this
.
ordenDescendente
,
incluye
:
[{
entidad
:
'
Tags
'
,
buscar
:
palabras
}]
})
.
then
(
respuesta
=>
{
console
.
log
(
respuesta
);
this
.
postulantes
=
respuesta
.
rows
;
this
.
totalElementos
=
respuesta
.
count
;
})
parametros
.
incluye
=
[{
entidad
:
'
Tags
'
,
buscar
:
this
.
tagsBusqueda
}]
}
else
{
this
.
service
.
getPostulantes
({
pagina
:
this
.
paginaActual
,
elementos
:
10
,
ordenarPor
:
this
.
ordenarPor
,
orden
:
this
.
ordenDescendente
})
.
then
(
respuesta
=>
{
console
.
log
(
respuesta
);
this
.
postulantes
=
respuesta
.
rows
;
this
.
totalElementos
=
respuesta
.
count
;
})
if
(
this
.
datosPersonalesBusqueda
.
length
>
0
)
{
parametros
.
buscar
=
this
.
datosPersonalesBusqueda
;
}
this
.
service
.
getPostulantes
(
parametros
)
.
then
(
respuesta
=>
{
console
.
log
(
respuesta
);
this
.
postulantes
=
respuesta
.
rows
;
this
.
totalElementos
=
respuesta
.
count
;
})
}
ordenar
(
campo
)
{
this
.
ordenDescendente
=
campo
!=
this
.
ordenarPor
?
false
:
this
.
ordenDescendente
;
this
.
ordenDescendente
=
campo
!=
this
.
ordenarPor
?
false
:
!
this
.
ordenDescendente
;
this
.
ordenarPor
=
campo
;
this
.
cambiarPagina
();
this
.
ordenDescendente
=
!
this
.
ordenDescendente
;
}
//region busqueda y filtros
...
...
@@ -99,9 +106,10 @@
}
else
return
this
.
tags
.
rows
.
filter
(
x
=>
x
.
nombre
.
includes
(
query
));
}
//endregion
}
angular
.
module
(
'
moduloPersonalApp
'
)
.
controller
(
'
PostulantesCtrl
'
,
PostulanteController
);
})();
})
();
client/app/postulantes/postulantes.html
View file @
a587ea51
<div
class=
"row"
>
<div
class=
"container"
>
<div
ui-view
class=
"container"
></div>
</div>
<div
class=
"container"
>
<div
ui-view
></div>
</div>
client/app/postulantes/postulantes.lista.html
View file @
a587ea51
...
...
@@ -21,13 +21,16 @@
<div
class=
"form-group"
>
<div
class=
""
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
id=
"basic-addon1"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></span>
<span
class=
"input-group-addon"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></span>
<tags-input
ng-model=
"vm.tagsSeleccionados"
name=
"tags"
placeholder=
"Buscar por tag"
display-property=
"nombre"
min-length=
"2"
on-tag-added=
"vm.
cambi
ar
P
ag
ina
()"
on-tag-removed=
"vm.
cambi
ar
P
ag
ina
()"
min-length=
"2"
on-tag-added=
"vm.
formate
ar
T
ag
s
()"
on-tag-removed=
"vm.
formate
ar
T
ag
s
()"
add-from-autocomplete-only=
"true"
>
<auto-complete
source=
"vm.autoCompletarTags($query)"
min-length=
"2"
></auto-complete>
</tags-input>
</div>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"fa fa-search"
aria-hidden=
"true"
></i></span>
<input
type=
"text"
class=
"form-control"
placeholder=
"Buscar al postulante"
ng-model=
"vm.palabra"
ng-change=
"vm.buscar(vm.palabra)"
ng-model-options=
"{debounce: 1000}"
>
</div>
</div>
<div
class=
"table-responsive"
>
...
...
@@ -60,7 +63,7 @@
<uib-pagination
ng-hide=
"vm.totalElementos<10"
total-items=
"vm.totalElementos"
items-per-page=
"1
5
"
items-per-page=
"1
0
"
max-size=
"8"
force-ellipses=
"true"
ng-model=
"vm.paginaActual"
...
...
client/app/postulantes/postulantes.service.js
View file @
a587ea51
'
use strict
'
;
(()
=>
{
'
use strict
'
;
class
PostulanteService
{
constructor
(
$resource
,
appConfig
)
{
...
...
client/app/tiposDato/modals/tiposDato.crear.modal.controller.js
0 → 100644
View file @
a587ea51
'
use strict
'
;
(()
=>
{
class
TipoDatoCrearModalController
{
constructor
(
$uibModalInstance
,
tipoDatoService
)
{
this
.
enviado
=
false
;
this
.
errores
=
{};
this
.
modal
=
$uibModalInstance
;
this
.
service
=
tipoDatoService
;
this
.
tipoDato
=
{}
}
guardar
(
form
)
{
this
.
enviado
=
true
;
if
(
form
.
$valid
)
{
this
.
service
.
crearTipoDato
(
this
.
tipoDato
)
.
then
(
tipoDato
=>
{
this
.
modal
.
close
(
tipoDato
);
})
.
catch
(
err
=>
{
this
.
errores
.
otros
=
err
.
data
.
message
;
})
}
}
}
angular
.
module
(
'
moduloPersonalApp
'
)
.
controller
(
'
TipoDatoCrearModalCtrl
'
,
TipoDatoCrearModalController
);
})();
client/app/tiposDato/modals/tiposDato.editar.modal.controller.js
0 → 100644
View file @
a587ea51
'
use strict
'
;
(()
=>
{
class
TipoDatoEditarModalController
{
constructor
(
$uibModalInstance
,
tipoDato
,
tipoDatoService
)
{
this
.
enviado
=
false
;
this
.
errores
=
{};
this
.
modal
=
$uibModalInstance
;
this
.
service
=
tipoDatoService
;
this
.
tipoDatoOriginal
=
tipoDato
;
this
.
tipoDato
=
Object
.
assign
({},
this
.
tipoDatoOriginal
);
this
.
readOnly
=
true
;
}
guardar
(
form
)
{
this
.
enviado
=
true
;
if
(
form
.
$valid
)
{
this
.
service
.
editarTipoDato
(
this
.
tipoDatoOriginal
.
propiedad
,
{
nombre
:
this
.
tipoDato
.
nombre
})
.
then
(
tipoDato
=>
{
this
.
tipoDatoOriginal
=
Object
.
assign
(
this
.
tipoDatoOriginal
,
tipoDato
);
this
.
modal
.
close
(
tipoDato
);
})
.
catch
(
err
=>
{
this
.
errores
.
otros
=
err
.
data
.
message
;
})
}
}
}
angular
.
module
(
'
moduloPersonalApp
'
)
.
controller
(
'
TipoDatoEditarModalCtrl
'
,
TipoDatoEditarModalController
);
})();
client/app/tiposDato/modals/tiposDato.modal.html
0 → 100644
View file @
a587ea51
<form
class=
"form"
name=
"form"
ng-submit=
"vm.guardar(form)"
novalidate
>
<div
class=
"modal-header modal-header-primary "
>
<button
type=
"button"
ng-click=
"vm.modal.dismiss()"
class=
"close"
>
×
</button>
<h4
class=
"modal-title"
>
Dato
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
"row"
>
<div
class=
"col-md-10"
>
<label>
Propiedad
</label>
<div
class=
""
>
<input
type=
"text"
name=
"propiedad"
class=
"form-control"
ng-model=
"vm.tipoDato.propiedad"
ng-readonly=
"vm.readOnly"
required
>
<p
class=
"help-block"
ng-show=
"form.propiedad.$error.required && vm.enviado"
>
Ingrese la llave primaria del nuevo Dato
</p>
</div>
</div>
<div
class=
"col-md-10"
>
<label>
Nombre
</label>
<div
class=
""
>
<input
type=
"text"
name=
"nombre"
class=
"form-control"
ng-model=
"vm.tipoDato.nombre"
required
>
<p
class=
"help-block"
ng-show=
"form.nombre.$error.required && vm.enviado"
>
Ingrese el nombre que sera visible para los usuarios.
</p>
</div>
</div>
</div>
<div
class=
"form-group has-error"
>
<p
class=
"help-block"
>
{{ vm.errores.otros}}
</p>
</div>
</div>
<div
class=
"modal-footer"
>
<button
class=
"btn btn-primary-outline"
type=
"submit"
ng-disabled=
"!(form.propiedad.$dirty ||form.nombre.$dirty)"
>
Guardar
</button>
<button
class=
"btn btn-default"
type=
"button"
ng-click=
"vm.modal.dismiss()"
>
Cancelar
</button>
</div>
</form>
client/app/tiposDato/tiposDato.controller.js
View file @
a587ea51
(()
=>
{
(()
=>
{
'
use strict
'
;
class
TipoDatoController
{
constructor
(
$state
,
tipoDatoService
)
{
class
TipoDatoController
{
constructor
(
$state
,
tipoDatoService
,
$uibModal
,
Modal
)
{
this
.
state
=
$state
;
this
.
servicio
=
tipoDatoService
;
this
.
modal
=
$uibModal
;
this
.
Modal
=
Modal
;
this
.
alertas
=
[];
this
.
tiposDato
=
[];
this
.
tipoDato
=
{};
this
.
paginaActual
=
1
;
this
.
cambiarPagina
();
}
detalle
(
id
)
{
this
.
tipoDato
=
this
.
tiposDato
.
find
(
x
=>
x
.
_id
===
id
);
this
.
state
.
go
(
'
tiposDato.detalle
'
,
{
tipoDatoId
:
id
});
}
cambiarPagina
(){
this
.
servicio
.
getTiposDato
(
this
.
paginaActual
).
then
(
respuesta
=>
{
cambiarPagina
()
{
this
.
servicio
.
getTiposDato
(
this
.
paginaActual
).
then
(
respuesta
=>
{
this
.
tiposDato
=
respuesta
.
rows
;
this
.
totalElementos
=
respuesta
.
count
;
})
}
crear
()
{
this
.
modal
.
open
({
templateUrl
:
'
app/tiposDato/modals/tiposDato.modal.html
'
,
controller
:
'
TipoDatoCrearModalCtrl
'
,
controllerAs
:
'
vm
'
}).
result
.
then
(
tipoDato
=>
{
this
.
tiposDato
.
push
(
tipoDato
);
this
.
alertas
.
push
({
tipo
:
'
success
'
,
mensaje
:
'
Se creo corectamente el tipo de dato:
'
+
tipoDato
.
nombre
})
})
}
editar
(
tipoDato
)
{
this
.
modal
.
open
({
templateUrl
:
'
app/tiposDato/modals/tiposDato.modal.html
'
,
controller
:
'
TipoDatoEditarModalCtrl
'
,
controllerAs
:
'
vm
'
,
resolve
:
{
tipoDato
:
tipoDato
}
}).
result
.
then
(
tipoDato
=>
{
this
.
alertas
.
push
({
tipo
:
'
info
'
,
mensaje
:
'
Se edito corectamente el tipo de dato:
'
+
tipoDato
.
propiedad
})
})
}
eliminar
(
tipoDato
)
{
this
.
Modal
.
confirm
.
eliminar
(
tipoDato
=>
{
this
.
servicio
.
eliminarTipoDato
(
tipoDato
.
propiedad
).
then
(()
=>
{
this
.
tiposDato
.
splice
(
this
.
tiposDato
.
indexOf
(
tipoDato
),
1
);
this
.
alertas
.
push
({
tipo
:
'
danger
'
,
mensaje
:
'
El tipo de dato
'
+
tipoDato
.
nombre
+
'
fue correctamente eliminado
'
});
})
})(
tipoDato
.
nombre
,
tipoDato
);
}
}
angular
.
module
(
'
moduloPersonalApp
'
)
...
...
client/app/tiposDato/tiposDato.lista.html
View file @
a587ea51
<div
class=
"row"
>
<div
class=
"container"
>
<h2
class=
"sub-header"
>
Tipos de dato
</h2>
<div
class=
"row"
>
<div
class=
"col-sm-4 col-xs-6"
>
<h3>
Tipos de Dato
<small><span
class=
"label label-default"
>
{{vm.totalElementos}}
</span></small>
</h3>
</div>
<div
class=
"col-sm-3 col-sm-offset-5"
>
<div
class=
"pull-right"
>
<button
class=
"btn btn-success-outline header-button"
ng-click=
"vm.crear()"
>
<i
class=
"fa fa-plus"
></i>
Crear Tipo de Dato
</button>
</div>
</div>
</div>
<uib-alert
ng-repeat=
"alerta in vm.alertas"
type=
"{{alerta.tipo}}"
close=
"vm.alertas.splice($index,1)"
dismiss-on-timeout=
"5000"
>
{{alerta.mensaje}}
</uib-alert>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped"
>
<thead>
...
...
@@ -14,9 +30,14 @@
<tr
ng-repeat=
"tipoDato in vm.tiposDato"
>
<td>
{{tipoDato.propiedad}}
</td>
<td>
{{tipoDato.nombre}}
</td>
<td><a
ng-click=
"vm.editar(tipoDato._id)"
>
Editar
</a></td>
<!--TODO Mostrar un dialogo de eliminar-->
<td><a
ng-click=
"vm.eliminar(tipoDato._id)"
>
Eliminar
</a></td>
<td>
<div
class=
"btn-group"
>
<button
class=
"btn btn-info-outline btn-xs"
ng-click=
"vm.editar(tipoDato)"
>
<i
class=
"fa fa-edit fa-lg"
></i></button>
<button
class=
"btn btn-danger-outline btn-xs"
ng-click=
"vm.eliminar(tipoDato)"
>
<i
class=
"fa fa-trash fa-lg"
></i></button>
</div>
</td>
</tr>
</tbody>
</table>
...
...
client/app/tiposDato/tiposDato.service.js
View file @
a587ea51
...
...
@@ -16,6 +16,18 @@
getTipoDato
(
id
,
parametros
)
{
return
this
.
resource
.
get
({
id
:
id
,
parametros
});
}
crearTipoDato
(
tipoDato
)
{
return
this
.
resource
.
save
(
tipoDato
).
$promise
;
}
editarTipoDato
(
id
,
tipoDato
)
{
return
this
.
resource
.
update
({
id
:
id
},
tipoDato
).
$promise
;
}
eliminarTipoDato
(
id
)
{
return
this
.
resource
.
remove
({
id
:
id
}).
$promise
;
}
}
angular
.
module
(
'
moduloPersonalApp
'
)
...
...
client/app/tiposEntidad/modals/tiposEntidad.crear.modal.controller.js
0 → 100644
View file @
a587ea51
'
use strict
'
;
(()
=>
{
class
TipoEntidadCrearModalController
{
constructor
(
$uibModalInstance
,
tipoEntidadService
)
{
this
.
enviado
=
false
;
this
.
errores
=
{};
this
.
modal
=
$uibModalInstance
;
this
.
service
=
tipoEntidadService
;
this
.
tipoEntidad
=
{}
}
guardarEntidad
(
form
)
{
this
.
enviado
=
true
;
if
(
form
.
$valid
)
{
this
.
service
.
crearTipoEntidad
(
this
.
tipoEntidad
)
.
then
(
tipoDato
=>
{
this
.
modal
.
close
(
tipoDato
);
})
.
catch
(
err
=>
{
this
.
errores
.
otros
=
err
.
data
.
message
;
})
}
}
}
angular
.
module
(
'
moduloPersonalApp
'
)
.
controller
(
'
TipoEntidadCrearModalCtrl
'
,
TipoEntidadCrearModalController
);
})();
client/app/tiposEntidad/modals/tiposEntidad.editar.modal.controller.js
0 → 100644
View file @
a587ea51
'
use strict
'
;
(()
=>
{
class
TipoEntidadEditarModalController
{
constructor
(
$uibModalInstance
,
tipoEntidad
,
tipoEntidadService
)
{
this
.
enviado
=
false
;
this
.
errores
=
{};
this
.
modal
=
$uibModalInstance
;
this
.
service
=
tipoEntidadService
;