2018-07-18 12:38:43 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-17 14:18:02 +00:00
|
|
|
import Section from 'salix/components/section';
|
2018-07-18 12:38:43 +00:00
|
|
|
|
2020-03-17 14:18:02 +00:00
|
|
|
export default class Controller extends Section {
|
2020-04-25 09:50:04 +00:00
|
|
|
preview(order) {
|
2018-11-19 07:42:29 +00:00
|
|
|
this.selectedOrder = order;
|
2019-02-15 11:39:21 +00:00
|
|
|
this.$.summary.show();
|
2018-07-18 12:38:43 +00:00
|
|
|
}
|
2020-06-30 06:32:04 +00:00
|
|
|
|
|
|
|
compareDate(date) {
|
|
|
|
let today = new Date();
|
|
|
|
today.setHours(0, 0, 0, 0);
|
|
|
|
|
2020-11-11 11:02:40 +00:00
|
|
|
date = new Date(date);
|
|
|
|
date.setHours(0, 0, 0, 0);
|
2020-06-30 06:32:04 +00:00
|
|
|
|
2020-11-11 11:02:40 +00:00
|
|
|
const timeDifference = today - date;
|
|
|
|
if (timeDifference == 0) return 'warning';
|
|
|
|
if (timeDifference < 0) return 'success';
|
2020-06-30 06:32:04 +00:00
|
|
|
}
|
2018-07-18 12:38:43 +00:00
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnOrderIndex', {
|
2018-07-18 12:38:43 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|