salix/modules/monitor/front/index/clients/index.js

31 lines
780 B
JavaScript
Raw Normal View History

2021-05-11 07:43:15 +00:00
import ngModule from '../../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
exprBuilder(param, value) {
switch (param) {
case 'dated':
return {'s.lastUpdate': {
between: this.dateRange(value)}
};
case 'clientFk':
case 'salesPersonFk':
return {[`c.${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];
}
}
ngModule.vnComponent('vnMonitorSalesClients', {
template: require('./index.html'),
controller: Controller
});