improved cpev2

This commit is contained in:
Luca Haid
2025-07-22 10:38:42 +02:00
parent d8bff67391
commit e8be372560
3 changed files with 101 additions and 4 deletions

View File

@@ -51,6 +51,9 @@ Vue.component('Cpeprovisioning', {
<a target="_blank" :href="window.TT_CONFIG.ORDER_URL + '/Index/?id=' + row.order_id + '&addJournal=1'" class="mr-2">
<i class="fas fa-scroll"></i>
</a>
<a target="_blank" :href="window.TT_CONFIG.CPE_PROV_PRINT_PDF_URL + '?order_id=' + row.order_id" class="mr-2">
<i class="fas fa-print"></i>
</a>
<template v-if="row.vot || row.hw || row.voip || row.note">
<tt-tooltip v-if="row.vot" text="Vorortinstallation" position="top">
<i class="fas fa-tools text-purple mr-2"></i>
@@ -94,7 +97,7 @@ Vue.component('Cpeprovisioning', {
<tt-input label="ONT SN" v-model="row.ont_sn" @input="markDirty(row, 6)" sm/>
<h5 class="section-title">Versand</h5>
<tt-checkbox label="Versandauftrag" v-model="row.cpe_data.shipping" @input="markDirty(row, 7)" sm/>
<tt-checkbox label="Versandauftrag" v-model="row.cpe_data.shipping" @input="markDirty(row, 7);checkShipping(row)" sm/>
<tt-input label="Gewicht (kg)" v-model="row.cpe_data.ship_weight" @input="markDirty(row, 8)" sm type="number" :disabled="!row.cpe_data.shipping"/>
<tt-input label="Länge (cm)" v-model="row.cpe_data.ship_length" @input="markDirty(row, 9)" sm type="number" :disabled="!row.cpe_data.shipping"/>
<tt-input label="Breite (cm)" v-model="row.cpe_data.ship_width" @input="markDirty(row, 10)" sm type="number" :disabled="!row.cpe_data.shipping"/>
@@ -180,6 +183,24 @@ Vue.component('Cpeprovisioning', {
console.log(`Marking row as dirty for field ${field}`);
this.$set(row, 'isDirty', true);
},
async checkShipping (row) {
await this.$nextTick();
if (row.cpe_data.shipping && row.cpe_data.routertype) {
const shippingData = this.window.TT_CONFIG.ROUTER_SHIPPING_DATA[row.cpe_data.routertype];
if (shippingData) {
if (!row.cpe_data.ship_weight) row.cpe_data.ship_weight = shippingData.weight;
if (!row.cpe_data.ship_length) row.cpe_data.ship_length = shippingData.length;
if (!row.cpe_data.ship_width) row.cpe_data.ship_width = shippingData.width;
if (!row.cpe_data.ship_height) row.cpe_data.ship_height = shippingData.height;
}
} else {
row.cpe_data.ship_weight = '';
row.cpe_data.ship_length = '';
row.cpe_data.ship_width = '';
row.cpe_data.ship_height = '';
}
},
async saveCpe(row) {
this.$set(row, 'isSaving', true);