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

29 lines
687 B
JavaScript
Raw 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) {
let today = new Date();
today.setHours(0, 0, 0, 0);
let timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0);
let comparation = today - timeTicket;
if (comparation == 0)
return 'warning';
if (comparation < 0)
return 'success';
}
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
});