Default username property
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2023-04-18 13:16:25 +02:00
parent 1d7c1f8d41
commit 90b38d02a0
2 changed files with 44 additions and 38 deletions

View File

@ -1,41 +1,46 @@
<!DOCTYPE html>
<html>
<body>
<table class="mainTable">
<tbody>
<tr>
<td id="truck" class="ellipsize">{{labelData.truck || '---'}}</td>
</tr>
<tr>
<td>
<div v-html="getBarcode(labelData.palletFk)" id="barcode"></div>
<table v-for="labelData in labelsData" class="zoneTable">
<thead>
<tr v-if="!labelData.isMatch" id="black">
<td id="routeFk" class="ellipsize">{{labelData.routeFk}}</td>
<td id="zone" class="ellipsize">{{labelData.zone || '---'}}</td>
<td id="labels" class="ellipsize">{{labelData.labels}}</td>
</tr>
<tr v-else>
<td id="routeFk" class="ellipsize">{{labelData.routeFk}}</td>
<td id="zone" class="ellipsize">{{labelData.zone || '---'}}</td>
<td id="labels" class="ellipsize">{{labelData.labels || '--'}}</td>
</tr>
</thead>
</table>
</td>
</tr>
<tr>
<td>
<img :src="QR" id="QR"/>
<div id="right">
<div id="additionalInfo" class="ellipsize"><b>Pallet: </b>{{id}}</div>
<div id="additionalInfo" class="ellipsize"><b>User: </b> {{username ? username.name : '---'}}</div>
<div id="additionalInfo" class="ellipsize"><b>Day: </b>{{labelData.dayName.toUpperCase() || '---'}}</div>
<body>
<table class="mainTable">
<tbody>
<tr>
<td id="truck" class="ellipsize">{{labelData.truck || '---'}}</td>
</tr>
<tr>
<td>
<div v-html="getBarcode(labelData.palletFk)" id="barcode"></div>
<table v-for="labelData in labelsData" class="zoneTable">
<thead>
<tr v-if="!labelData.isMatch" id="black">
<td id="routeFk" class="ellipsize">{{labelData.routeFk}}</td>
<td id="zone" class="ellipsize">{{labelData.zone || '---'}}</td>
<td id="labels" class="ellipsize">{{labelData.labels}}</td>
</tr>
<tr v-else>
<td id="routeFk" class="ellipsize">{{labelData.routeFk}}</td>
<td id="zone" class="ellipsize">{{labelData.zone || '---'}}</td>
<td id="labels" class="ellipsize">{{labelData.labels || '--'}}</td>
</tr>
</thead>
</table>
</td>
</tr>
<tr>
<td>
<img :src="QR" id="QR" />
<div id="right">
<div id="additionalInfo" class="ellipsize"><b>Pallet: </b>{{id}}</div>
<div id="additionalInfo" class="ellipsize"><b>User: </b>
{{ (username ? username.name : '---')}}
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>
<div id="additionalInfo" class="ellipsize"><b>Day: </b>{{labelData.dayName.toUpperCase() ||
'---'}}</div>
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -18,6 +18,7 @@ module.exports = {
}
},
async serverPrefetch() {
this.username = null;
this.labelsData = await this.rawSqlFromDef('labelData', this.id);
if (this.userFk) this.username = await this.findOneFromDef('username', this.userFk);
this.labelData = this.labelsData[0];