Enhance vehicle speed display by adding localized labels in DirectorInfo, SaleSection, and BranchView components
This commit is contained in:
@@ -132,7 +132,7 @@
|
||||
<select v-model.number="emptyTransportForm.vehicleTypeId" @change="loadEmptyTransportRoute">
|
||||
<option :value="null" disabled>{{ $t('falukant.branch.director.emptyTransport.selectVehicle') }}</option>
|
||||
<option v-for="vt in vehicleTypeOptions()" :key="vt.id" :value="vt.id">
|
||||
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }})
|
||||
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }}) - {{ speedLabel(vt.speed) }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
@@ -255,6 +255,14 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
speedLabel(value) {
|
||||
const key = value == null ? 'unknown' : String(value);
|
||||
const tKey = `falukant.branch.transport.speed.${key}`;
|
||||
const translated = this.$t(tKey);
|
||||
if (!translated || translated === tKey) return value;
|
||||
return translated;
|
||||
},
|
||||
|
||||
openNewDirectorDialog() {
|
||||
console.log('openNewDirectorDialog');
|
||||
this.$refs.newDirectorDialog.open(this.branchId);
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<select v-model.number="transportForm.vehicleTypeId" @change="() => { recalcMaxQuantity(); loadRouteInfo(); }">
|
||||
<option :value="null" disabled>{{ $t('falukant.branch.sale.transportVehiclePlaceholder') }}</option>
|
||||
<option v-for="vt in vehicleTypeOptions()" :key="vt.id" :value="vt.id">
|
||||
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }})
|
||||
{{ $t(`falukant.branch.vehicles.${vt.tr}`) }} ({{ vt.count }} × {{ vt.capacity }}) - {{ speedLabel(vt.speed) }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
@@ -251,6 +251,13 @@
|
||||
return new Date(a.eta).getTime() - new Date(b.eta).getTime();
|
||||
});
|
||||
},
|
||||
speedLabel(value) {
|
||||
const key = value == null ? 'unknown' : String(value);
|
||||
const tKey = `falukant.branch.transport.speed.${key}`;
|
||||
const translated = this.$t(tKey);
|
||||
if (!translated || translated === tKey) return value;
|
||||
return translated;
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
await this.loadInventory();
|
||||
|
||||
Reference in New Issue
Block a user