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