salix/modules/invoiceIn/front/serial/index.js

36 lines
852 B
JavaScript
Raw Normal View History

2023-03-27 12:29:22 +00:00
import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
constructor($element, $) {
super($element, $);
}
exprBuilder(param, value) {
switch (param) {
case 'issued':
return {'ii.issued': {
between: this.dateRange(value)}
};
case 'serial':
return {[`ii.${param}`]: value};
}
}
dateRange(value) {
const minHour = new Date(value);
minHour.setHours(0, 0, 0, 0);
const maxHour = new Date(value);
maxHour.setHours(23, 59, 59, 59);
return [minHour, maxHour];
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnInvoiceInSerial', {
template: require('./index.html'),
controller: Controller
});