2022-09-27 05:24:45 +00:00
|
|
|
const Component = require(`vn-print/core/component`);
|
2020-01-09 08:01:17 +00:00
|
|
|
const emailHeader = new Component('email-header');
|
|
|
|
const emailFooter = new Component('email-footer');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'buyer-week-waste',
|
|
|
|
async serverPrefetch() {
|
|
|
|
this.wastes = await this.fetchWastes();
|
|
|
|
|
|
|
|
if (!this.wastes)
|
|
|
|
throw new Error('Something went wrong');
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
dated: function() {
|
|
|
|
const filters = this.$options.filters;
|
|
|
|
|
|
|
|
return filters.date(new Date(), '%d-%m-%Y');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
fetchWastes() {
|
2021-04-06 11:46:38 +00:00
|
|
|
return this.rawSqlFromDef('wasteWeekly');
|
2020-01-09 08:01:17 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
'email-header': emailHeader.build(),
|
|
|
|
'email-footer': emailFooter.build()
|
|
|
|
},
|
|
|
|
props: {}
|
|
|
|
};
|