salix/print/core/mixins/vn-report.js

24 lines
765 B
JavaScript
Raw Permalink Normal View History

2023-01-23 09:12:34 +00:00
const Component = require(`vn-print/core/component`);
const reportHeader = new Component('report-header');
const reportFooter = new Component('report-footer');
const reportBody = new Component('report-body');
const NotFoundError = require('vn-loopback/util/not-found-error');
module.exports = {
components: {
'report-body': reportBody.build(),
'report-header': reportHeader.build(),
'report-footer': reportFooter.build()
},
methods: {
checkMainEntity: function(entity) {
if (entity == null)
throw new NotFoundError();
},
2023-01-23 12:15:30 +00:00
formatDate: function(date, format) {
const filters = this.$options.filters;
2023-01-23 09:12:34 +00:00
return filters.date(date, format);
}
},
};