42 lines
875 B
JavaScript
42 lines
875 B
JavaScript
import ngModule from '../module';
|
|
import SearchPanel from 'core/components/searchbar/search-panel';
|
|
import './style.scss';
|
|
|
|
class Controller extends SearchPanel {
|
|
constructor($element, $) {
|
|
super($element, $);
|
|
const filter = {
|
|
fields: ['daysAgo']
|
|
};
|
|
this.$http.get('InvoiceInConfigs', {filter});
|
|
}
|
|
|
|
$onInit() {
|
|
this.filter = {
|
|
tags: []
|
|
};
|
|
}
|
|
|
|
removeItemFilter(param) {
|
|
this.filter[param] = null;
|
|
this.addFilters();
|
|
}
|
|
|
|
onKeyPress($event) {
|
|
if ($event.key === 'Enter')
|
|
this.addFilters();
|
|
}
|
|
|
|
addFilters() {
|
|
return this.model.addFilter({}, this.filter);
|
|
}
|
|
}
|
|
|
|
ngModule.component('vnInvoiceInSerialSearchPanel', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
model: '<'
|
|
}
|
|
});
|