bug fixed filter in clients
This commit is contained in:
parent
7dfed60e7d
commit
9fa608b11f
|
@ -25,7 +25,7 @@ class DatePicker extends Component {
|
|||
this.$filter = $filter;
|
||||
this.$timeout = $timeout;
|
||||
this.enabled = true;
|
||||
this._modelView = '';
|
||||
this._modelView = null;
|
||||
this._model = undefined;
|
||||
|
||||
componentHandler.upgradeElement($element[0].firstChild);
|
||||
|
@ -70,7 +70,7 @@ class DatePicker extends Component {
|
|||
parts.push(fromatEquivalence[val]);
|
||||
}
|
||||
);
|
||||
if (string.indexOf(' ') !== -1) { // datetime format
|
||||
if (string.indexOf(' ') !== -1 || string.indexOf('T') !== -1) { // datetime format
|
||||
let dates = parts.slice(0, 3).join('-');
|
||||
let hours = parts.slice(3, parts.length).join(':');
|
||||
return `${dates} ${hours}`.trim();
|
||||
|
|
|
@ -10,17 +10,17 @@ export default class Controller {
|
|||
this.$window = $window;
|
||||
}
|
||||
onClick(event) {
|
||||
var child = this.vnPopover.showComponent(this.popover, this.$scope, this.element);
|
||||
this.child = this.vnPopover.showComponent(this.popover, this.$scope, this.element);
|
||||
|
||||
// XXX: ¿Existe una forma más adecuada de acceder al controlador de un componente?
|
||||
var childCtrl = angular.element(child).isolateScope().$ctrl;
|
||||
var childCtrl = angular.element(this.child).isolateScope().$ctrl;
|
||||
childCtrl.filter = Object.assign({}, this.index.filter);
|
||||
childCtrl.onSubmit = filter => this.onChildSubmit(filter);
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
onChildSubmit(filter) {
|
||||
this.vnPopover.hide();
|
||||
// this.vnPopover.hide();
|
||||
Object.assign(this.index.filter, filter);
|
||||
this.onSubmit();
|
||||
}
|
||||
|
@ -28,6 +28,10 @@ export default class Controller {
|
|||
onSubmit() {
|
||||
if (this.onSearch)
|
||||
this.onSearch();
|
||||
|
||||
angular.element(this.child).scope().$destroy();
|
||||
angular.element(this.child).remove();
|
||||
delete this.child;
|
||||
}
|
||||
$onDestroy() {
|
||||
this.$window.sessionStorage.removeItem('filter');
|
||||
|
|
|
@ -22,7 +22,7 @@ module.exports = function(Client){
|
|||
}
|
||||
|
||||
function andWhere(p){
|
||||
return {
|
||||
let where = {
|
||||
where: {
|
||||
id: p.id,
|
||||
name: {regexp: p.name},
|
||||
|
@ -30,14 +30,17 @@ module.exports = function(Client){
|
|||
socialName: {regexp: p.socialName},
|
||||
city: {regexp: p.city},
|
||||
postcode: p.postcode,
|
||||
email: {regexp: p.email},
|
||||
or: [
|
||||
{phone: p.phone},
|
||||
{mobile: p.phone}
|
||||
]
|
||||
email: {regexp: p.email}
|
||||
},
|
||||
skip: (p.page - 1) * p.size,
|
||||
limit: p.size
|
||||
};
|
||||
if(p.phone){
|
||||
where.or = [
|
||||
{phone: p.phone},
|
||||
{mobile: p.phone}
|
||||
]
|
||||
}
|
||||
return where;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue