Compare commits

...

7 Commits

Author SHA1 Message Date
Guillermo Bonet 76d8c6c668 feat: refs #7644 Minor changes
gitea/salix/pipeline/pr-master This commit looks good Details
2024-08-02 11:08:22 +02:00
Guillermo Bonet b1109af1e8 feat: refs #7644 Minor changes
gitea/salix/pipeline/pr-master This commit looks good Details
2024-08-02 10:13:31 +02:00
Guillermo Bonet fcca2b65c2 feat: refs #7644 Fix traduction
gitea/salix/pipeline/pr-master This commit looks good Details
2024-07-31 14:20:36 +02:00
Guillermo Bonet ddeba33f19 Merge branch '7644-optimizedBarcode' of https://gitea.verdnatura.es/verdnatura/salix into 7644-optimizedBarcode
gitea/salix/pipeline/pr-master This commit looks good Details
2024-07-31 12:25:27 +02:00
Guillermo Bonet 8edb115c2b feat: refs #7644 Fix msg print 2024-07-31 12:25:26 +02:00
Guillermo Bonet ef017f41d5 Merge branch 'master' into 7644-optimizedBarcode
gitea/salix/pipeline/pr-master This commit looks good Details
2024-07-31 09:33:45 +00:00
Guillermo Bonet 1a2ed9ce68 refactor: refs #7644 Optimized barcode
gitea/salix/pipeline/pr-master This commit looks good Details
2024-07-31 11:33:12 +02:00
5 changed files with 26 additions and 16 deletions

View File

@ -35,8 +35,10 @@ module.exports = {
logger.error(`[Print] => ${err.message}`);
});
cluster.on('queue', () =>
process.env.SPEC_IS_RUNNING === 'false' && logger.info('Printing task initialized by pool'));
cluster.on('queue', () => {
if (process.env.SPEC_IS_RUNNING !== 'true')
logger.info('Printing task initialized by pool');
});
});
}
};

View File

@ -7,11 +7,11 @@ table {
border: 1px solid;
width: 100%;
font-size: inherit;
page-break-before: always;
}
td {
border: 1px solid;
padding: 5px;
width: 100%;
}
span {
font-size: 48px;

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
<table v-for="buy in buys" style="break-before: page">
<table v-for="buy in buys" :key="buy.id">
<tbody>
<tr>
<td colspan="2">

View File

@ -12,20 +12,28 @@ module.exports = {
const date = new Date();
this.weekNum = moment(date).isoWeek();
this.dayNum = moment(date).day();
this.barcodes = [];
await this.generateAllBarcodes(this.buys);
},
methods: {
getBarcode(id) {
const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null);
const svgNode = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
generateAllBarcodes(buys) {
const uniqueBuyIds = new Set(buys.map(buy => buy.id));
for (let buy of uniqueBuyIds) {
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 new XMLSerializer().serializeToString(svgNode);
jsBarcode(svgNode, buy, {
xmlDocument: document,
format: 'code128',
displayValue: false,
width: 3.8,
height: 115,
});
this.barcodes.push({id: buy, barcode: new XMLSerializer().serializeToString(svgNode)});
}
},
getBarcode(id) {
return this.barcodes.find(item => item.id === id).barcode;
}
},
props: {

View File

@ -6,7 +6,7 @@ color: Color
origin: Origin
packing: Packing
grouping: Grouping
unitSale: Un. sale
saleUnit: Un. sale
producer: Producer
control: Control
boxNum: Box no.