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

29 lines
685 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
preview(order) {
this.selectedOrder = order;
this.$.summary.show();
}
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';
}
}
ngModule.component('vnOrderIndex', {
template: require('./index.html'),
controller: Controller
});