salix/modules/order/front/index/index.js

27 lines
654 B
JavaScript
Raw Permalink Normal View History

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) {
this.selectedOrder = order;
this.$.summary.show();
2018-07-18 12:38:43 +00:00
}
2020-06-30 06:32:04 +00:00
compareDate(date) {
2023-01-16 14:18:24 +00:00
let today = Date.vnNew();
2020-06-30 06:32:04 +00:00
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
}
ngModule.vnComponent('vnOrderIndex', {
2018-07-18 12:38:43 +00:00
template: require('./index.html'),
controller: Controller
});