Enhance Piyango and Muhasebe views with additional table headers and computed properties for better data representation. Added global store integration for currency formatting and improved date handling. Updated conditional rendering for user roles and refined filter options.

This commit is contained in:
burakovec
2025-12-09 07:47:04 +03:00
parent b422187704
commit f6c1b242b2
2 changed files with 559 additions and 252 deletions

View File

@ -31,6 +31,8 @@
const dateStore = useDateStore() const dateStore = useDateStore()
import { useUsersStore } from '@/stores/usersStore' import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore() const usersStore = useUsersStore()
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { usePiyangoStore } from '../stores/piyangoStore' import { usePiyangoStore } from '../stores/piyangoStore'
const piyangoStore = usePiyangoStore() const piyangoStore = usePiyangoStore()
import { usePiyangoDataStore } from '../stores/piyangoDataStore' import { usePiyangoDataStore } from '../stores/piyangoDataStore'
@ -68,25 +70,25 @@
const tableHeader = computed<Record<string, any>[]>(() => { const tableHeader = computed<Record<string, any>[]>(() => {
let header: Record<string, any>[] = [] let header: Record<string, any>[] = []
// 1. PİYANGO ID
header.push({ header.push({
name: 'piyangoId', name: 'piyangoId',
title: 'Piyango Id', title: 'Piyango ID',
sort: true, sort: true,
style: { width: '10%' } style: { width: '10%' }
}) })
if (usersStore.isAraciFirma || usersStore.isPanelUser) { // 2. MÜDÜRLÜK
header.push({ name: 'duzenleyen', title: 'Düzenleyen' }) header.push({
name: 'mudurluk',
title: 'Müdürlük',
compute: (v: Record<string, any>): string => {
return v.mudurluk || ''
} }
})
header.push( // 3. PİYANGO AMACI
{ header.push({
name: 'baslik',
title: 'Başlık',
sort: true,
style: { width: '15%' }
},
{
name: 'piyangoamac', name: 'piyangoamac',
title: 'Piyango Amacı', title: 'Piyango Amacı',
sort: true, sort: true,
@ -97,82 +99,24 @@
listText: 'amacAdi', listText: 'amacAdi',
filterId: 'piyangoAmacId' filterId: 'piyangoAmacId'
} }
}, })
{
name: 'olusturmaTarihi',
title: 'Oluşturulma Tarihi',
compute: (v: Record<string, any>): string => {
return dateStore.dateFormat({ date: v.olusturmaTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
}
)
if (usersStore.isVakifDernek || usersStore.isPanelUser) { // 4. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
}
// 5. ARACI FİRMA
header.push({ header.push({
name: 'cekilisTarihi', name: 'araciFirma',
title: 'Çekiliş Tarihi', title: 'Araci Firma',
compute: (v: Record<string, any>): string => { compute: (v: Record<string, any>): string => {
if (v.piyangoAmacId === 3) return '' return v.araciFirma || ''
else return dateStore.dateFormat({ date: v.cekilisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
} }
}) })
}
if (!usersStore.isVakifDernek || usersStore.isPanelUser) {
header.push(
{
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (v.baslangicTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.baslangicTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
},
{
name: 'bitisTarihi',
title: 'Bitis Tarihi',
compute: (v: Record<string, any>): string => {
if (v.bitisTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.bitisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
}
)
}
header.push( // 6. DURUM
{ header.push({
name: 'cekilisYontemi',
title: 'Çekiliş Yöntemi',
sort: true,
filter: {
type: 'select',
data: cekilisYontemleri.value,
listVal: 'id',
listText: 'deger',
filterId: 'cekilisYontemiId'
}
},
{ name: 'ikramiyeler', title: 'İkramiyeler', style: { width: '15%' } },
{
name: 'durum', name: 'durum',
title: 'Durum', title: 'Durum',
style: { width: '10%' }, style: { width: '10%' },
@ -188,8 +132,216 @@
listText: 'tipAdi', listText: 'tipAdi',
filterId: 'durumId' filterId: 'durumId'
} }
})
// 7. İZİN TARİHİ
header.push({
name: 'izinTarihi',
title: 'İzin Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.izinTarihi || v.izinTarihi === null) return ''
return dateStore.dateFormat({ date: v.izinTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
} }
) })
// 8. İZİN SAYISI
header.push({
name: 'izinSayisi',
title: 'İzin Sayısı',
compute: (v: Record<string, any>): string => {
return v.izinSayisi || ''
},
sort: true
})
// 9. BAŞLANGIÇ TARİHİ
header.push({
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.baslangicTarihi || v.baslangicTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.baslangicTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 10. BİTİŞ TARİHİ
header.push({
name: 'bitisTarihi',
title: 'Bitiş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.bitisTarihi || v.bitisTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.bitisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 11. ÇEKİLİŞ TARİHİ
header.push({
name: 'cekilisTarihi',
title: 'Çekiliş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.cekilisTarihi || v.cekilisTarihi.includes('0001-')) return ''
if (v.piyangoAmacId === 3) return ''
return dateStore.dateFormat({ date: v.cekilisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 12. ÇEKİLİŞ GÖREVLİSİ
header.push({
name: 'cekilisGorevlisi',
title: 'Çekiliş Görevlisi',
compute: (v: Record<string, any>): string => {
return v.cekilisGorevlisi || ''
}
})
// 13. GAZETE İLAN TARİHİ
header.push({
name: 'gazeteIlanTarihi',
title: 'Gazete İlan Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.gazeteIlanTarihi || v.gazeteIlanTarihi === null) return ''
return dateStore.dateFormat({ date: v.gazeteIlanTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 14. GAZETE ADI
header.push({
name: 'gazeteAdi',
title: 'Gazete Adı',
compute: (v: Record<string, any>): string => {
return v.gazeteAdi || ''
}
})
// 15. İZİN BEDELİ
header.push({
name: 'izinBedeliTutari',
title: 'İzin Bedeli',
compute: (v: Record<string, any>): string => {
if (v.izinBedeliTutari === null || v.izinBedeliTutari === undefined) return ''
return globalStore.toTrLocale(v.izinBedeliTutari)
},
sort: true
})
// 16. İKRAMİYE TUTARI
header.push({
name: 'ikramiyeTutari',
title: 'İkramiye Tutarı',
compute: (v: Record<string, any>): string => {
if (v.ikramiyeTutari === null || v.ikramiyeTutari === undefined) return ''
return globalStore.toTrLocale(v.ikramiyeTutari)
},
sort: true
})
// 17. TEMİNAT TARİHİ
header.push({
name: 'teminatTarihi',
title: 'Teminat Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatTarihi || v.teminatTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatTarihi })
},
sort: true
})
// 18. TEMİNAT SAYISI
header.push({
name: 'teminatSayisi',
title: 'Teminat Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatSayisi || ''
},
sort: true
})
// 19. TEMİNAT BANKASI
header.push({
name: 'teminatBankasi',
title: 'Teminat Bankası',
compute: (v: Record<string, any>): string => {
return v.teminatBankasi || ''
}
})
// 20. TEMİNAT TUTARI
header.push({
name: 'teminatTutari',
title: 'Teminat Tutarı',
compute: (v: Record<string, any>): string => {
if (v.teminatTutari === null || v.teminatTutari === undefined) return ''
return globalStore.toTrLocale(v.teminatTutari)
},
sort: true
})
// 21. T. PARA CİNSİ
header.push({
name: 'paraBirimiSembol',
title: 'T. Para Cinsi',
compute: (v: Record<string, any>): string => {
return v.paraBirimiSembol || ''
}
})
// 22. T. İADE TARİHİ
header.push({
name: 'teminatIadeTarihi',
title: 'T. İade Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatIadeTarihi || v.teminatIadeTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatIadeTarihi })
},
sort: true
})
// 23. T. İADE SAYISI
header.push({
name: 'teminatIadeSayisi',
title: 'T. İade Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatIadeSayisi || ''
},
sort: true
})
// 24. İKRAMİYELER
header.push({
name: 'ikramiyeler',
title: 'İkramiyeler',
style: { width: '15%' },
compute: (v: Record<string, any>): string => {
return v.ikramiyeler || ''
}
})
// Panel User için ek sütunlar
if (usersStore.isPanelUser) { if (usersStore.isPanelUser) {
header.push({ header.push({
name: 'atanmis', name: 'atanmis',
@ -205,9 +357,7 @@
} }
} }
}) })
}
if (usersStore.isPanelUser) {
header.push({ header.push({
name: 'basvuruBedelNo', name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu', title: 'Muhasebeleştirme Durumu',
@ -225,6 +375,7 @@
} }
}) })
} }
return header return header
}) })

View File

@ -24,6 +24,8 @@
const dateStore = useDateStore() const dateStore = useDateStore()
import { useUsersStore } from '@/stores/usersStore' import { useUsersStore } from '@/stores/usersStore'
const usersStore = useUsersStore() const usersStore = useUsersStore()
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore' import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore'
const piyangoStore = usePiyangoStore() const piyangoStore = usePiyangoStore()
import { usePiyangoDataStore } from '@/module/cekilisler/stores/piyangoDataStore' import { usePiyangoDataStore } from '@/module/cekilisler/stores/piyangoDataStore'
@ -50,24 +52,25 @@
const tableHeader = computed<Record<string, any>[]>(() => { const tableHeader = computed<Record<string, any>[]>(() => {
let header: Record<string, any>[] = [] let header: Record<string, any>[] = []
if (usersStore.isAraciFirma || usersStore.isPanelUser) { // 1. PİYANGO ID
header.push({ name: 'duzenleyen', title: 'Düzenleyen' }) header.push({
}
header.push(
{
name: 'piyangoId', name: 'piyangoId',
title: 'Piyango ID', title: 'Piyango ID',
sort: true, sort: true,
style: { width: '10%' } style: { width: '10%' }
}, })
{
name: 'baslik', // 2. MÜDÜRLÜK
title: 'Başlık', header.push({
sort: true, name: 'mudurluk',
style: { width: '15%' } title: 'Müdürlük',
}, compute: (v: Record<string, any>): string => {
{ return v.mudurluk || ''
}
})
// 3. PİYANGO AMACI
header.push({
name: 'piyangoamac', name: 'piyangoamac',
title: 'Piyango Amacı', title: 'Piyango Amacı',
sort: true, sort: true,
@ -78,81 +81,24 @@
listText: 'amacAdi', listText: 'amacAdi',
filterId: 'piyangoAmacId' filterId: 'piyangoAmacId'
} }
}, })
{
name: 'olusturmaTarihi',
title: 'Oluşturulma Tarihi',
compute: (v: Record<string, any>): string => {
return dateStore.dateFormat({ date: v.olusturmaTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
}
)
if (usersStore.isVakifDernek || usersStore.isPanelUser) { // 4. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
}
// 5. ARACI FİRMA
header.push({ header.push({
name: 'cekilisTarihi', name: 'araciFirma',
title: 'Çekiliş Tarihi', title: 'Araci Firma',
compute: (v: Record<string, any>): string => { compute: (v: Record<string, any>): string => {
return dateStore.dateFormat({ date: v.cekilisTarihi }) return v.araciFirma || ''
},
sort: true,
filter: {
type: 'date',
between: true
} }
}) })
}
if (!usersStore.isVakifDernek || usersStore.isPanelUser) {
header.push(
{
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (v.baslangicTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.baslangicTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
},
{
name: 'bitisTarihi',
title: 'Bitis Tarihi',
compute: (v: Record<string, any>): string => {
if (v.bitisTarihi.includes('0001-')) return ''
else return dateStore.dateFormat({ date: v.bitisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
}
)
}
header.push( // 6. DURUM
{ header.push({
name: 'cekilisYontemi',
title: 'Çekiliş Yöntemi',
sort: true,
filter: {
type: 'select',
data: cekilisYontemleri.value,
listVal: 'id',
listText: 'deger',
filterId: 'cekilisYontemiId'
}
},
{ name: 'ikramiyeler', title: 'İkramiyeler', style: { width: '15%' } },
{
name: 'durum', name: 'durum',
title: 'Durum', title: 'Durum',
style: { width: '10%' }, style: { width: '10%' },
@ -168,8 +114,217 @@
listText: 'tipAdi', listText: 'tipAdi',
filterId: 'durumId' filterId: 'durumId'
} }
})
// 7. İZİN TARİHİ
header.push({
name: 'izinTarihi',
title: 'İzin Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.izinTarihi || v.izinTarihi === null) return ''
return dateStore.dateFormat({ date: v.izinTarihi })
}, },
{ sort: true,
filter: {
type: 'date',
between: true
}
})
// 8. İZİN SAYISI
header.push({
name: 'izinSayisi',
title: 'İzin Sayısı',
compute: (v: Record<string, any>): string => {
return v.izinSayisi || ''
},
sort: true
})
// 9. BAŞLANGIÇ TARİHİ
header.push({
name: 'baslangicTarihi',
title: 'Başlangıç Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.baslangicTarihi || v.baslangicTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.baslangicTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 10. BİTİŞ TARİHİ
header.push({
name: 'bitisTarihi',
title: 'Bitiş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.bitisTarihi || v.bitisTarihi.includes('0001-')) return ''
return dateStore.dateFormat({ date: v.bitisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 11. ÇEKİLİŞ TARİHİ
header.push({
name: 'cekilisTarihi',
title: 'Çekiliş Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.cekilisTarihi || v.cekilisTarihi.includes('0001-')) return ''
if (v.piyangoAmacId === 3) return ''
return dateStore.dateFormat({ date: v.cekilisTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 12. ÇEKİLİŞ GÖREVLİSİ
header.push({
name: 'cekilisGorevlisi',
title: 'Çekiliş Görevlisi',
compute: (v: Record<string, any>): string => {
return v.cekilisGorevlisi || ''
}
})
// 13. GAZETE İLAN TARİHİ
header.push({
name: 'gazeteIlanTarihi',
title: 'Gazete İlan Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.gazeteIlanTarihi || v.gazeteIlanTarihi === null) return ''
return dateStore.dateFormat({ date: v.gazeteIlanTarihi })
},
sort: true,
filter: {
type: 'date',
between: true
}
})
// 14. GAZETE ADI
header.push({
name: 'gazeteAdi',
title: 'Gazete Adı',
compute: (v: Record<string, any>): string => {
return v.gazeteAdi || ''
}
})
// 15. İZİN BEDELİ
header.push({
name: 'izinBedeliTutari',
title: 'İzin Bedeli',
compute: (v: Record<string, any>): string => {
if (v.izinBedeliTutari === null || v.izinBedeliTutari === undefined) return ''
return globalStore.toTrLocale(v.izinBedeliTutari)
},
sort: true
})
// 16. İKRAMİYE TUTARI
header.push({
name: 'ikramiyeTutari',
title: 'İkramiye Tutarı',
compute: (v: Record<string, any>): string => {
if (v.ikramiyeTutari === null || v.ikramiyeTutari === undefined) return ''
return globalStore.toTrLocale(v.ikramiyeTutari)
},
sort: true
})
// 17. TEMİNAT TARİHİ
header.push({
name: 'teminatTarihi',
title: 'Teminat Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatTarihi || v.teminatTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatTarihi })
},
sort: true
})
// 18. TEMİNAT SAYISI
header.push({
name: 'teminatSayisi',
title: 'Teminat Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatSayisi || ''
},
sort: true
})
// 19. TEMİNAT BANKASI
header.push({
name: 'teminatBankasi',
title: 'Teminat Bankası',
compute: (v: Record<string, any>): string => {
return v.teminatBankasi || ''
}
})
// 20. TEMİNAT TUTARI
header.push({
name: 'teminatTutari',
title: 'Teminat Tutarı',
compute: (v: Record<string, any>): string => {
if (v.teminatTutari === null || v.teminatTutari === undefined) return ''
return globalStore.toTrLocale(v.teminatTutari)
},
sort: true
})
// 21. T. PARA CİNSİ
header.push({
name: 'paraBirimiSembol',
title: 'T. Para Cinsi',
compute: (v: Record<string, any>): string => {
return v.paraBirimiSembol || ''
}
})
// 22. T. İADE TARİHİ
header.push({
name: 'teminatIadeTarihi',
title: 'T. İade Tarihi',
compute: (v: Record<string, any>): string => {
if (!v.teminatIadeTarihi || v.teminatIadeTarihi === null) return ''
return dateStore.dateFormat({ date: v.teminatIadeTarihi })
},
sort: true
})
// 23. T. İADE SAYISI
header.push({
name: 'teminatIadeSayisi',
title: 'T. İade Sayısı',
compute: (v: Record<string, any>): string => {
return v.teminatIadeSayisi || ''
},
sort: true
})
// 24. İKRAMİYELER
header.push({
name: 'ikramiyeler',
title: 'İkramiyeler',
style: { width: '15%' },
compute: (v: Record<string, any>): string => {
return v.ikramiyeler || ''
}
})
// Muhasebe özel sütunlar
header.push({
name: 'atanmis', name: 'atanmis',
title: 'Sevk Durumu', title: 'Sevk Durumu',
computeHtml: (v: Record<string, any>): string => { computeHtml: (v: Record<string, any>): string => {
@ -182,8 +337,9 @@
Sevk Edilmemiş</span>` Sevk Edilmemiş</span>`
} }
} }
}, })
{
header.push({
name: 'basvuruBedelNo', name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu', title: 'Muhasebeleştirme Durumu',
computeHtml: (v: Record<string, any>): string => { computeHtml: (v: Record<string, any>): string => {
@ -198,8 +354,8 @@
} }
return durum return durum
} }
} })
)
return header return header
}) })