7383-testToMaster #2445

Merged
alexm merged 233 commits from 7383-testToMaster into master 2024-05-14 05:44:13 +00:00
4 changed files with 22 additions and 3 deletions
Showing only changes of commit aaef10b8d8 - Show all commits

View File

@ -0,0 +1,2 @@
ALTER TABLE vn.productionConfig MODIFY COLUMN id INT(10) UNSIGNED FIRST;
ALTER TABLE vn.productionConfig ADD scannableCodeType enum('qr','barcode') DEFAULT 'barcode' NOT NULL;

View File

@ -10,7 +10,11 @@
</td> </td>
<td colspan="2" id="shipped">{{labelData.shipped || '---'}}</td> <td colspan="2" id="shipped">{{labelData.shipped || '---'}}</td>
</tr> </tr>
<tr> <tr v-if="labelData.scannableCodeType === 'qr'">
<td rowspan="3"><div v-html="getQr(labelData.ticketFk)" id="barcode"></div></td>
<td id="outline" class="ellipsize">{{labelData.workerCode || '---'}}</td>
</tr>
<tr v-else>
<td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" id="barcode"></div></td> <td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" id="barcode"></div></td>
<td id="outline" class="ellipsize">{{labelData.workerCode || '---'}}</td> <td id="outline" class="ellipsize">{{labelData.workerCode || '---'}}</td>
</tr> </tr>

View File

@ -1,4 +1,6 @@
const jsBarcode = require('jsbarcode'); import qrcode from 'qrcode';
import jsBarcode from 'jsbarcode';
const {DOMImplementation, XMLSerializer} = require('xmldom'); const {DOMImplementation, XMLSerializer} = require('xmldom');
const vnReport = require('../../../core/mixins/vn-report.js'); const vnReport = require('../../../core/mixins/vn-report.js');
@ -31,6 +33,16 @@ module.exports = {
this.checkMainEntity(this.labelsData); this.checkMainEntity(this.labelsData);
}, },
methods: { methods: {
getQR(id) {
let QRdata = JSON.stringify({
company: 'vnl',
user: this.userFk,
created: Date.vnNew(),
table: 'ticket',
id
});
return qrcode.toDataURL(QRdata, {margin: 0});
},
getBarcode(id) { getBarcode(id) {
const xmlSerializer = new XMLSerializer(); const xmlSerializer = new XMLSerializer();
const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null); const document = new DOMImplementation().createDocument('http://www.w3.org/1999/xhtml', 'html', null);

View File

@ -17,7 +17,8 @@ SELECT c.itemPackingTypeFk code,
tt.labelCount, tt.labelCount,
t.nickName, t.nickName,
SUM(IF(sgd.id IS NULL, 1, 0)) + IF(sgd.id , 1, 0) lineCount, SUM(IF(sgd.id IS NULL, 1, 0)) + IF(sgd.id , 1, 0) lineCount,
rm.routeFk rm.routeFk,
pc.scannableCodeType
FROM vn.ticket t FROM vn.ticket t
JOIN vn.ticketCollection tc ON tc.ticketFk = t.id JOIN vn.ticketCollection tc ON tc.ticketFk = t.id
JOIN vn.collection c ON c.id = tc.collectionFk JOIN vn.collection c ON c.id = tc.collectionFk