31 lines
780 B
JavaScript
31 lines
780 B
JavaScript
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
|
|
});
|