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'),
|
2021-06-15 11:48:42 +00:00
|
|
|
controller: Controller,
|
|
|
|
require: {
|
|
|
|
main: '^vnMonitorIndex'
|
|
|
|
}
|
2021-05-11 07:43:15 +00:00
|
|
|
});
|