#7864 - 7864_testToMaster_2434 #2867

Merged
jsegarra merged 139 commits from 7864_testToMaster_2434 into master 2024-08-20 06:33:22 +00:00
4 changed files with 6 additions and 29 deletions
Showing only changes of commit 6f26dc4990 - Show all commits

View File

@ -0,0 +1,3 @@
ALTER TABLE vn.productionConfig
DROP COLUMN scannableCodeType,
DROP COLUMN scannablePreviusCodeType;

View File

@ -10,14 +10,10 @@
</td> </td>
<td colspan="2" id="shipped">{{dashIfEmpty(labelData.shipped)}}</td> <td colspan="2" id="shipped">{{dashIfEmpty(labelData.shipped)}}</td>
</tr> </tr>
<tr v-if="labelData?.qrData"> <tr>
<td rowspan="3"><img :src="labelData.qrData" class="qr"/></td> <td rowspan="3"><img :src="labelData.qrData" class="qr"/></td>
<td id="outline" class="ellipsize">{{dashIfEmpty(labelData.workerCode)}}</td> <td id="outline" class="ellipsize">{{dashIfEmpty(labelData.workerCode)}}</td>
</tr> </tr>
<tr v-else>
<td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" class="basrcode"></div></td>
<td id="outline" class="ellipsize">{{dashIfEmpty(labelData.workerCode)}}</td>
</tr>
<tr> <tr>
<td id="outline" class="ellipsize">{{labelCount || labelData.labelCount || 0}}</td> <td id="outline" class="ellipsize">{{labelCount || labelData.labelCount || 0}}</td>
</tr> </tr>

View File

@ -1,7 +1,5 @@
const {DOMImplementation, XMLSerializer} = require('xmldom');
const vnReport = require('../../../core/mixins/vn-report.js'); const vnReport = require('../../../core/mixins/vn-report.js');
const {toDataURL} = require('qrcode'); const {toDataURL} = require('qrcode');
const jsBarcode = require('jsbarcode');
module.exports = { module.exports = {
name: 'collection-label', name: 'collection-label',
@ -30,11 +28,8 @@ module.exports = {
const labels = await this.rawSqlFromDef('labelsData', [ticketIds]); const labels = await this.rawSqlFromDef('labelsData', [ticketIds]);
const [{scannableCodeType}] = await this.rawSqlFromDef('barcodeType'); for (const labelData of labels)
if (scannableCodeType === 'qr') { labelData.qrData = await this.getQr(labelData?.ticketFk, labelData?.workerFk);
for (const labelData of labels)
labelData.qrData = await this.getQr(labelData?.ticketFk, labelData?.workerFk);
}
this.labelsData = labels; this.labelsData = labels;
this.checkMainEntity(this.labelsData); this.checkMainEntity(this.labelsData);
@ -50,20 +45,6 @@ module.exports = {
}); });
return toDataURL(QRdata, {margin: 0}); return toDataURL(QRdata, {margin: 0});
}, },
getBarcode(id) {
const xmlSerializer = new XMLSerializer();
const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null);
const svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
jsBarcode(svgNode, id, {
xmlDocument: document,
format: 'code128',
displayValue: false,
width: 3.8,
height: 115,
});
return xmlSerializer.serializeToString(svgNode);
},
getVertical(labelData) { getVertical(labelData) {
let value; let value;
if (labelData.collectionFk) { if (labelData.collectionFk) {

View File

@ -1,3 +0,0 @@
SELECT scannableCodeType
FROM productionConfig
LIMIT 1