import ngModule from '../module'; import Section from 'salix/components/section'; import './style.scss'; export default class Controller extends Section { preview(travel) { this.travelSelected = travel; this.$.summary.show(); } onCloneAccept(travel) { const params = JSON.stringify({ ref: travel.ref, agencyModeFk: travel.agencyModeFk, shipped: travel.shipped, landed: travel.landed, warehouseInFk: travel.warehouseInFk, warehouseOutFk: travel.warehouseOutFk }); this.$state.go('travel.create', {q: params}); } compareDate(date) { let today = Date.vnNew(); today.setHours(0, 0, 0, 0); date = new Date(date); date.setHours(0, 0, 0, 0); const timeDifference = today - date; if (timeDifference == 0) return 'warning'; if (timeDifference < 0) return 'success'; } } ngModule.vnComponent('vnTravelIndex', { template: require('./index.html'), controller: Controller });