5995-newCmr #1698
Binary file not shown.
|
@ -180,7 +180,7 @@
|
|||
</span>
|
||||
<hr>
|
||||
<div class="imgSection">
|
||||
<img v-bind:src="getReportSrc('signature.png')"/>
|
||||
<img v-bind:src="getStamp"/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -191,7 +191,7 @@
|
|||
</span>
|
||||
<hr>
|
||||
<div class="imgSection">
|
||||
<img v-bind:src="dmsPath"/>
|
||||
Aquí va la el stamp
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -202,7 +202,7 @@
|
|||
</span>
|
||||
<hr>
|
||||
<div class="imgSection">
|
||||
<img v-bind:src="dmsPath(true)"/>
|
||||
<img v-bind:src="signPath"/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -10,8 +10,9 @@ module.exports = {
|
|||
this.data = await this.findOneFromDef('data', [this.id]);
|
||||
if (this.data.ticketFk) {
|
||||
this.merchandises = await this.rawSqlFromDef('merchandise', [this.data.ticketFk]);
|
||||
this.signatures = await this.findOneFromDef('signatures', [this.data.ticketFk]);
|
||||
}
|
||||
this.signature = await this.findOneFromDef('signature', [this.data.ticketFk]);
|
||||
} else
|
||||
this.merchandises = null;
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
|
@ -20,19 +21,20 @@ module.exports = {
|
|||
description: 'The cmr id'
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
dmsPath(isClient) {
|
||||
if (!this.signatures) return;
|
||||
computed: {
|
||||
signPath() {
|
||||
if (!this.signature) return;
|
||||
|
||||
const signatureName = (isClient)
|
||||
? this.signatures.clientSignature
|
||||
: this.signatures.deliverySignature;
|
||||
const signatureName = this.signature.signature
|
||||
const hash = md5(signatureName.toString()).substring(0, 3);
|
||||
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')}`;
|
||||
},
|
||||
async getStamp() {
|
||||
const data = this.data.stamp.toString('base64');
|
||||
return `data:image/png;base64, ${data}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
|
@ -31,7 +31,8 @@ SELECT c.id cmrFk,
|
|||
a2.street loadStreet,
|
||||
a2.postalCode loadPostalCode,
|
||||
a2.city loadCity,
|
||||
cou4.country loadCountry
|
||||
cou4.country loadCountry,
|
||||
co.stamp
|
||||
FROM cmr c
|
||||
LEFT JOIN supplier s ON s.id = c.supplierFk
|
||||
LEFT JOIN country cou ON cou.id = s.countryFk
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
SELECT dc.id `signature`
|
||||
FROM ticket t
|
||||
JOIN ticketDms dt ON dt.ticketFk = t.id
|
||||
LEFT JOIN dms dc ON dc.id = dt.dmsFk
|
||||
WHERE t.id = ?
|
|
@ -1,7 +0,0 @@
|
|||
SELECT dc.id clientSignature, dd.id deliverySignature
|
||||
FROM ticket t
|
||||
JOIN ticketDms dt ON dt.ticketFk = t.id
|
||||
LEFT JOIN dms dc ON dc.id = dt.dmsFk
|
||||
JOIN `route` r ON r.id = t.routeFk
|
||||
LEFT JOIN dms dd ON dd.id = r.deliverySignFk
|
||||
WHERE t.id = ?
|
Loading…
Reference in New Issue