refs #4550 changed font-family of collection-label #1187

Merged
joan merged 4 commits from #4550-HOTFIX-collection-label-font into master 2022-11-30 10:35:37 +00:00
4 changed files with 34 additions and 22 deletions

View File

@ -1,5 +1,5 @@
html {
font-family: "Roboto";
font-family: Arial, Helvetica, sans-serif;
margin-top: -6px;
}
* {
@ -9,12 +9,14 @@ html {
}
#vertical {
writing-mode: vertical-rl;
height: 240px;
height: 235px;
font-size: 30px;
margin-left: -13px;
}
.outline {
border: 1px solid black;
padding: 5px;
height: 37px;
}
#nickname {
font-size: 22px;
@ -33,6 +35,6 @@ html {
#shipped {
font-weight: bold;
}
#ticketFk, #vertical {
font-size: 34px;
#ticketFk {
font-size: 32px;
}

View File

@ -4,31 +4,29 @@
<table v-for="labelData in labelsData" style="break-before: page">
<tbody>
<tr>
<td rowspan="6"><span id="vertical" class="ellipsize">
{{labelData.collectionFk ? `${labelData.collectionFk} ~ ${labelData.wagon}-${labelData.level}` : '-'.repeat(23)}}
</span></td>
<td rowspan="6"><span id="vertical" class="ellipsize">{{getVertical(labelData)}}</span></td>
<td id="ticketFk">
Outdated
Review

Estos fragments amb condicionals o formateig de datos es millor posarlos en una propietat computed. En este cas, al ser dins de un bucle tindría que ser amb una funció en la que li pases les dades de la fila, exemple:

collectionDescription(labelData)

Estos fragments amb condicionals o formateig de datos es millor posarlos en una propietat computed. En este cas, al ser dins de un bucle tindría que ser amb una funció en la que li pases les dades de la fila, exemple: `collectionDescription(labelData)`
{{labelData.clientFk ? `${labelData.ticketFk} « ${labelData.clientFk}` : labelData.ticketFk}}
</td>
<td colspan="2" id="shipped">{{labelData.shipped ? labelData.shipped : '---'}}</td>
<td colspan="2" id="shipped">{{labelData.shipped || '---'}}</td>
</tr>
<tr>
<td rowspan="3"><div v-html="getBarcode(labelData.ticketFk)" id="barcode"></div></td>
<td class="outline">{{labelData.workerCode ? labelData.workerCode : '---'}}</td>
<td class="outline">{{labelData.workerCode || '---'}}</td>
</tr>
<tr>
<td class="outline">{{labelData.labelCount ? labelData.labelCount : 0}}</td>
<td class="outline">{{labelData.labelCount || 0}}</td>
</tr>
<tr>
<td class="outline">{{labelData.code == 'plant' ? labelData.size + 'cm' : labelData.volume + 'm³'}}</td>
<td class="outline">{{labelData.code == 'V' ? (labelData.size || 0) + 'cm' : (labelData.volume || 0) + 'm³'}}</td>
</tr>
<tr>
<td><div id="agencyDescripton" class="ellipsize">{{labelData.agencyDescription}}</div></td>
<td id="bold">{{labelData.lineCount ? labelData.lineCount : 0}}</td>
<td><div id="agencyDescripton" class="ellipsize">{{labelData.agencyDescription ? labelData.agencyDescription.toUpperCase() : '---'}}</div></td>
<td id="bold">{{labelData.lineCount || 0}}</td>
</tr>
<tr>
<td id="nickname" class="ellipsize">{{labelData.nickName ? labelData.nickName : '---'}}</td>
<td id="bold">{{labelData.shipped ? labelData.shippedHour : labelData.zoneHour}}</td>
<td id="nickname" class="ellipsize">{{labelData.nickName ? labelData.nickName.toUpperCase() : '---'}}</td>
<td id="bold">{{labelData.shippedHour || labelData.zoneHour}}</td>
</tr>
</tbody>
</table>

View File

@ -25,7 +25,6 @@ module.exports = {
ticketIds = [this.id];
this.labelsData = await this.rawSqlFromDef('labelsData', [ticketIds]);
if (!this.labelsData.length)
throw new UserError('Empty data source');
},
@ -44,6 +43,19 @@ module.exports = {
});
return xmlSerializer.serializeToString(svgNode);
},
getVertical(labelData) {
let value;
if (labelData.collectionFk) {
value = `${labelData.collectionFk} ~ `;
if (labelData.code == 'V')
value = value + `${labelData.wagon}-${labelData.level}`;
else
value = value + `${labelData.color.substring(0, 4)}`;
} else
value = '-'.repeat(19);
return value;
},
},
components: {
'report-body': reportBody.build()

View File

@ -1,13 +1,13 @@
SELECT tc.collectionFk,
SELECT c.itemPackingTypeFk code,
tc.collectionFk,
SUBSTRING('ABCDEFGH', tc.wagon, 1) wagon,
tc.`level`,
t.id ticketFk,
COALESCE(et.description, zo.name, am.name) agencyDescription,
am.name,
cc.code color,
t.clientFk,
CAST(SUM(sv.volume) AS DECIMAL(5, 2)) volume,
MAX(i.`size`) `size`,
ic.code,
w.code workerCode,
TIME_FORMAT(t.shipped, '%H:%i') shippedHour,
TIME_FORMAT(zo.`hour`, '%H:%i') zoneHour,
@ -16,8 +16,8 @@ SELECT tc.collectionFk,
tt.labelCount,
COUNT(*) lineCount
FROM vn.ticket t
LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = t.id
LEFT JOIN vn.collection c ON c.id = tc.collectionFk
JOIN vn.ticketCollection tc ON tc.ticketFk = t.id
JOIN vn.collection c ON c.id = tc.collectionFk
LEFT JOIN vn.collectionColors cc ON cc.shelve = tc.`level`
AND cc.wagon = tc.wagon
AND cc.trainFk = c.trainFk
@ -26,7 +26,7 @@ SELECT tc.collectionFk,
JOIN vn.item i ON i.id = s.itemFk
JOIN vn.itemType it ON it.id = i.typeFk
JOIN vn.itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN vn.worker w ON w.id = c.workerFk
JOIN vn.worker w ON w.id = c.workerFk
JOIN vn.agencyMode am ON am.id = t.agencyModeFk
LEFT JOIN vn.ticketTrolley tt ON tt.ticket = t.id
LEFT JOIN vn.`zone` zo ON t.zoneFk = zo.id