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,128 +70,278 @@
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%' }
}) })
// 2. MÜDÜRLÜK
header.push({
name: 'mudurluk',
title: 'Müdürlük',
compute: (v: Record<string, any>): string => {
return v.mudurluk || ''
}
})
// 3. PİYANGO AMACI
header.push({
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
filterId: 'piyangoAmacId'
}
})
// 4. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) { if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({ name: 'duzenleyen', title: 'Düzenleyen' }) header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
} }
header.push( // 5. ARACI FİRMA
{ header.push({
name: 'baslik', name: 'araciFirma',
title: 'Başlık', title: 'Araci Firma',
sort: true, compute: (v: Record<string, any>): string => {
style: { width: '15%' } return v.araciFirma || ''
},
{
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
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) { // 6. DURUM
header.push({ header.push({
name: 'cekilisTarihi', name: 'durum',
title: 'Çekiliş Tarihi', title: 'Durum',
compute: (v: Record<string, any>): string => { style: { width: '10%' },
if (v.piyangoAmacId === 3) return '' computeHtml: (v: Record<string, any>): string => {
else return dateStore.dateFormat({ date: v.cekilisTarihi }) return `<span class="${piyangoStore.LoterryStatusClass(v.durum)}">
}, ${v.durum}
sort: true, </span>`
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(
{
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%' } }, filter: {
{ type: 'select',
name: 'durum', data: piyangoOnayDurumlari.value,
title: 'Durum', listVal: 'id',
style: { width: '10%' }, listText: 'tipAdi',
computeHtml: (v: Record<string, any>): string => { filterId: 'durumId'
return `<span class="${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
},
filter: {
type: 'select',
data: piyangoOnayDurumlari.value,
listVal: 'id',
listText: 'tipAdi',
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',
@ -197,17 +349,15 @@
computeHtml: (v: Record<string, any>): string => { computeHtml: (v: Record<string, any>): string => {
if (v.atanmis) { if (v.atanmis) {
return `<strong class="back-grad back-grad-sevk-ok"> return `<strong class="back-grad back-grad-sevk-ok">
${v.atananlar} ${v.atananlar}
</strong>` </strong>`
} else { } else {
return `<span class="back-grad back-grad-sevk"> return `<span class="back-grad back-grad-sevk">
Sevk Edilmemiş</span>` Sevk Edilmemiş</span>`
} }
} }
}) })
}
if (usersStore.isPanelUser) {
header.push({ header.push({
name: 'basvuruBedelNo', name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu', title: 'Muhasebeleştirme Durumu',
@ -215,16 +365,17 @@
let durum = '' let durum = ''
if (v.basvuruBedelNo !== null) { if (v.basvuruBedelNo !== null) {
durum += `<strong">Başvuru Bedel No: </strong> durum += `<strong">Başvuru Bedel No: </strong>
${v.basvuruBedelNo}<br>` ${v.basvuruBedelNo}<br>`
} }
if (v.izinBedelNo !== null) { if (v.izinBedelNo !== null) {
durum += `<strong">İzin Bedel No: </strong> durum += `<strong">İzin Bedel No: </strong>
${v.izinBedelNo}` ${v.izinBedelNo}`
} }
return durum return durum
} }
}) })
} }
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,156 +52,310 @@
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({
name: 'piyangoId',
title: 'Piyango ID',
sort: true,
style: { width: '10%' }
})
// 2. MÜDÜRLÜK
header.push({
name: 'mudurluk',
title: 'Müdürlük',
compute: (v: Record<string, any>): string => {
return v.mudurluk || ''
}
})
// 3. PİYANGO AMACI
header.push({
name: 'piyangoamac',
title: 'Piyango Amacı',
sort: true,
filter: {
type: 'select',
data: piyangoAmaclari.value,
listVal: 'id',
listText: 'amacAdi',
filterId: 'piyangoAmacId'
}
})
// 4. DÜZENLEYEN (koşullu)
if (usersStore.isAraciFirma || usersStore.isPanelUser) { if (usersStore.isAraciFirma || usersStore.isPanelUser) {
header.push({ name: 'duzenleyen', title: 'Düzenleyen' }) header.push({ name: 'duzenleyen', title: 'Düzenleyen' })
} }
header.push( // 5. ARACI FİRMA
{ header.push({
name: 'piyangoId', name: 'araciFirma',
title: 'Piyango ID', title: 'Araci Firma',
sort: true, compute: (v: Record<string, any>): string => {
style: { width: '10%' } return v.araciFirma || ''
}
})
// 6. DURUM
header.push({
name: 'durum',
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class="${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
}, },
{ filter: {
name: 'baslik', type: 'select',
title: 'Başlık', data: piyangoOnayDurumlari.value,
sort: true, listVal: 'id',
style: { width: '15%' } listText: 'tipAdi',
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,
name: 'piyangoamac', filter: {
title: 'Piyango Amacı', type: 'date',
sort: true, between: true
filter: { }
type: 'select', })
data: piyangoAmaclari.value,
listVal: 'id', // 8. İZİN SAYISI
listText: 'amacAdi', header.push({
filterId: 'piyangoAmacId' name: 'izinSayisi',
} title: 'İzin Sayısı',
compute: (v: Record<string, any>): string => {
return v.izinSayisi || ''
}, },
{ sort: true
name: 'olusturmaTarihi', })
title: 'Oluşturulma Tarihi',
compute: (v: Record<string, any>): string => { // 9. BAŞLANGIÇ TARİHİ
return dateStore.dateFormat({ date: v.olusturmaTarihi }) header.push({
}, name: 'baslangicTarihi',
sort: true, title: 'Başlangıç Tarihi',
filter: { compute: (v: Record<string, any>): string => {
type: 'date', if (!v.baslangicTarihi || v.baslangicTarihi.includes('0001-')) return ''
between: true 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',
title: 'Sevk Durumu',
computeHtml: (v: Record<string, any>): string => {
if (v.atanmis) {
return `<strong class="back-grad back-grad-sevk-ok">
${v.atananlar}
</strong>`
} else {
return `<span class="back-grad back-grad-sevk">
Sevk Edilmemiş</span>`
} }
} }
) })
if (usersStore.isVakifDernek || usersStore.isPanelUser) { header.push({
header.push({ name: 'basvuruBedelNo',
name: 'cekilisTarihi', title: 'Muhasebeleştirme Durumu',
title: 'Çekiliş Tarihi', computeHtml: (v: Record<string, any>): string => {
compute: (v: Record<string, any>): string => { let durum = ''
return dateStore.dateFormat({ date: v.cekilisTarihi }) if (v.basvuruBedelNo !== null) {
}, durum += `<strong">Başvuru Bedel No: </strong>
sort: true, ${v.basvuruBedelNo}<br>`
filter: {
type: 'date',
between: true
} }
}) if (v.izinBedelNo !== null) {
} durum += `<strong">İzin Bedel No: </strong>
if (!usersStore.isVakifDernek || usersStore.isPanelUser) { ${v.izinBedelNo}`
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(
{
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',
title: 'Durum',
style: { width: '10%' },
computeHtml: (v: Record<string, any>): string => {
return `<span class="${piyangoStore.LoterryStatusClass(v.durum)}">
${v.durum}
</span>`
},
filter: {
type: 'select',
data: piyangoOnayDurumlari.value,
listVal: 'id',
listText: 'tipAdi',
filterId: 'durumId'
}
},
{
name: 'atanmis',
title: 'Sevk Durumu',
computeHtml: (v: Record<string, any>): string => {
if (v.atanmis) {
return `<strong class="back-grad back-grad-sevk-ok">
${v.atananlar}
</strong>`
} else {
return `<span class="back-grad back-grad-sevk">
Sevk Edilmemiş</span>`
}
}
},
{
name: 'basvuruBedelNo',
title: 'Muhasebeleştirme Durumu',
computeHtml: (v: Record<string, any>): string => {
let durum = ''
if (v.basvuruBedelNo !== null) {
durum += `<strong">Başvuru Bedel No: </strong>
${v.basvuruBedelNo}<br>`
}
if (v.izinBedelNo !== null) {
durum += `<strong">İzin Bedel No: </strong>
${v.izinBedelNo}`
}
return durum
} }
return durum
} }
) })
return header return header
}) })