Files

101 lines
4.4 KiB
JavaScript

Vue.component('a-d-b-wohneinheit-duplicate', {
//language=Vue
template: `
<tt-card>
<tt-table :data="window['TT_CONFIG']['DUPLICATE_HOMES']" :config="DuplicateHomesTableConfig" excel-export>
<template v-slot:extref="{ row }">
<span class="badge badge-warning">{{ row.duplicateType === 'extref' ? row.extref : row.oaid }}</span>
</template>
<template v-slot:count="{ row }">
<span class="badge badge-danger">{{ row.count }}</span>
</template>
<template v-slot:homedetails="{ row }">
<div class="duplicate-homes-container">
<table class="table table-sm table-bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>OAID</th>
<th>SDIBuilding</th>
<th>Firma</th>
<th>Num</th>
<th>Nutzung</th>
<th>Rimo Ex State</th>
<th>Rimo Op State</th>
<th>Erstellt</th>
<th>Zuletzt editiert</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<tr v-for="home in row.homeData" :key="home.id" :class="{'bg-light': home.id % 2 === 0}">
<td>{{ home.id }}</td>
<td>{{ home.oaid || 'N/A' }}</td>
<td>{{ home.hausnummer_extref || 'N/A' }}</td>
<td>{{ home.network_company || 'N/A' }}</td>
<td>{{ home.num }}</td>
<td>{{ home.nutzung || 'N/A' }}</td>
<td>{{ home.rimo_ex_state || 'N/A' }}</td>
<td>{{ home.rimo_op_state || 'N/A' }}</td>
<td>{{ formatDate(home.create) }}</td>
<td>{{ formatDate(home.edit) }}</td>
<td>
<div class="btn-group btn-group-sm">
<a :href="window['TT_CONFIG']['BASE_URL'] + '/AddressDB/view/?id=' + home.hausnummer_id"
class="btn btn-info"
target="_blank"
title="View">
<i class="far fa-eye"></i>
</a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</template>
</tt-table>
</tt-card>
`,
data() {
return {
window: window,
markedForDeletion: [],
DuplicateHomesTableConfig: {
key: 'DuplicateHomesTable',
tableHeader: 'Datenqualitäts-Checks',
defaultPageSize: 10,
headers: [
{text: 'Netzgebiet', key: 'netzgebiet_id', sortable: true, class: 'text-nowrap', priority: 11, filter: 'select', filterOptions: window['TT_CONFIG']['ADB_NETZGEBIETE']},
{text: 'Firma', key: 'netzgebiet_owner', sortable: true, class: 'text-nowrap', priority: 11, filter: 'select', filterOptions: window['TT_CONFIG']['NETWORK_OWNERS']},
{text: 'HomeID/OAID', key: 'extref', sortable: true, class: 'text-nowrap', priority: 10},
{text: 'Check-Typ', key: 'duplicateType', sortable: true, class: 'text-nowrap', priority: 9, filter: 'select', filterOptions: [
{text: 'HomeID', value: 'extref'},
{text: 'OAID', value: 'oaid'},
{text: 'RIMO gelöscht', value: 'rimo_deleted'},
{text: 'Unsch. + BE', value: 'rml_unscheduled_with_order'},
{text: 'Greenfield + BE', value: 'greenfield_with_order'},
]},
{text: 'Anz. HomeIDs', key: 'count', sortable: true, class: 'text-center', priority: 8},
{
text: 'Home Details',
key: 'homeDetails',
sortable: false,
class: 'w-75',
filter: false,
priority: 7
},
],
},
}
},
methods: {
formatDate(timestamp) {
if (!timestamp) return 'N/A';
return this.window.moment.unix(timestamp).format('DD.MM.YYYY HH:mm:ss');
},
},
})