Files
thetool/public/js/pages/WarehouseHistory/WarehouseHistoryModal.js
2024-07-16 06:55:46 +00:00

46 lines
1.6 KiB
JavaScript

Vue.component('warehouse-history-modal', {
//language=Vue
template: `
<tt-modal :show.sync="showModal" title="History" :delete="false" :save="false"
@close="$emit('update:show', false)"
>
<tt-table
v-if="showModal"
:fetch-url="window['TT_CONFIG']['BASE_URL'] + '/getHistory?id=' + id"
:config="WarehouseHistoryTableConfig" small>
<template v-slot:create="{ row }">
{{ window.moment(row.create * 1000).format('DD.MM.YYYY HH:mm:ss') }}
</template>
</tt-table>
</tt-modal>
`,
props: {
show: { type: Boolean, default: false },
id: { type: Number, default: null },
},
data() {
return {
window: window,
showModal: false,
WarehouseHistoryTableConfig: {
key: 'WarehouseHistory',
tableHeader: 'Lager Historie',
headers: [
{text: "Zeit", key: "create", filter: false, sortable: false},
{text: "Feld", key: "columnHeader", filter: false, sortable: false},
{text: "Alter Wert", key: "old_value", filter: false, sortable: false},
{text: "Neuer Wert", key: "new_value", filter: false, sortable: false},
{text: "Geändert von", key: "user_name", filter: false, sortable: false},
],
}
}
},
watch: {
show(newVal) {
this.showModal = newVal
}
}
})