hesabixCore/webUI/src/views/acc/component/documentLogButton.vue

95 lines
2.5 KiB
Vue
Raw Normal View History

2025-03-21 14:20:43 +03:30
<script lang="ts">
import axios from 'axios';
import {defineComponent,ref} from 'vue'
export default defineComponent({
name: "documentLogButton",
props:{
docCode: String
},
data: ()=>{return {
2025-04-04 02:13:29 +03:30
dialog: false,
2025-03-21 14:20:43 +03:30
loading: ref(true),
items:[],
headers: [
2025-04-04 02:13:29 +03:30
{ title: "تاریخ", key: "date", align: "center" as const},
{ title: "کاربر", key: "user", align: "center" as const},
{ title: "شرح", key: "des", align: "center" as const},
],
searchValue: '',
logPermision: ref(false)
2025-03-21 14:20:43 +03:30
}},
methods:{
loadData(){
this.loading = true;
axios.post('/api/business/my/permission/state',{'permission':'log',}).then((response)=>{
if(response.data.state == true){
this.logPermision = true;
axios.post('/api/business/logs/doc/' + this.$props.docCode).then((response)=>{
this.items = response.data;
this.loading = false;
});
}
});
}
},
mounted(){
this.loadData();
}
})
</script>
<template>
2025-04-04 02:13:29 +03:30
<!-- دکمه در تولبار -->
<v-btn v-show="logPermision" icon color="info" class="ml-2" @click="dialog = true">
<v-icon>mdi-history</v-icon>
<v-tooltip activator="parent" location="bottom">تاریخچه سند</v-tooltip>
</v-btn>
2025-03-21 14:20:43 +03:30
2025-04-04 02:13:29 +03:30
<!-- دیالوگ تاریخچه -->
<v-dialog v-model="dialog" max-width="800" persistent>
<v-card>
<v-toolbar color="toolbar" flat dark>
<v-toolbar-title>
<v-icon color="info" left>mdi-history</v-icon>
تاریخچه تغییرات سند
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon @click="dialog = false">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-toolbar>
<v-card-text class="pa-0">
<v-data-table
:headers="headers"
:items="items"
:loading="loading"
:search="searchValue"
density="compact"
hover
class="elevation-1"
>
<template v-slot:loading>
<v-progress-circular
indeterminate
color="primary"
></v-progress-circular>
</template>
<template v-slot:no-data>
<div class="text-center py-4">
اطلاعاتی برای نمایش وجود ندارد
</div>
</template>
</v-data-table>
</v-card-text>
</v-card>
</v-dialog>
2025-03-21 14:20:43 +03:30
</template>
<style scoped>
2025-04-04 02:13:29 +03:30
.v-data-table {
--v-table-header-height: 40px;
--v-table-row-height: 40px;
}
2025-03-21 14:20:43 +03:30
</style>