test → dev #1701
|
@ -29,5 +29,5 @@ module.exports = Self => {
|
|||
const routeMaxKm = 1000;
|
||||
if (routeTotalKm > routeMaxKm || this.kmStart > this.kmEnd)
|
||||
err();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
</span>
|
||||
<hr>
|
||||
<div class="imgSection">
|
||||
<img v-bind:src="getStamp"/>
|
||||
<img :src="senderStamp"/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -191,7 +191,7 @@
|
|||
</span>
|
||||
<hr>
|
||||
<div class="imgSection">
|
||||
Aquí va la el stamp
|
||||
<img :src="deliveryStamp"/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
@ -3,6 +3,8 @@ const vnReport = require('../../../core/mixins/vn-report.js');
|
|||
const md5 = require('md5');
|
||||
const fs = require('fs-extra');
|
||||
|
||||
const prefixBase64 = 'data:image/png;base64,';
|
||||
|
||||
module.exports = {
|
||||
name: 'cmr',
|
||||
mixins: [vnReport],
|
||||
|
@ -13,6 +15,13 @@ module.exports = {
|
|||
this.signature = await this.findOneFromDef('signature', [this.data.ticketFk]);
|
||||
} else
|
||||
this.merchandises = null;
|
||||
|
||||
this.senderStamp = (this.data.senderStamp)
|
||||
? `${prefixBase64} ${this.data.senderStamp.toString('base64')}`
|
||||
: null;
|
||||
this.deliveryStamp = (this.data.deliveryStamp)
|
||||
? `${prefixBase64} ${this.data.deliveryStamp.toString('base64')}`
|
||||
: null;
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
|
@ -30,11 +39,7 @@ module.exports = {
|
|||
const file = `${config.storage.root}/${hash}/${signatureName}.png`;
|
||||
if (!fs.existsSync(file)) return null;
|
||||
|
||||
return `data:image/png;base64, ${Buffer.from(fs.readFileSync(file), 'utf8').toString('base64')}`;
|
||||
return `${prefixBase64} ${Buffer.from(fs.readFileSync(file), 'utf8').toString('base64')}`;
|
||||
},
|
||||
async getStamp() {
|
||||
const data = this.data.stamp.toString('base64');
|
||||
return `data:image/png;base64, ${data}`;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
|
@ -32,7 +32,8 @@ SELECT c.id cmrFk,
|
|||
a2.postalCode loadPostalCode,
|
||||
a2.city loadCity,
|
||||
cou4.country loadCountry,
|
||||
co.stamp
|
||||
co.stamp senderStamp,
|
||||
s.stamp deliveryStamp
|
||||
FROM cmr c
|
||||
LEFT JOIN supplier s ON s.id = c.supplierFk
|
||||
LEFT JOIN country cou ON cou.id = s.countryFk
|
||||
|
|
Loading…
Reference in New Issue