From f6c1b242b2e1991f428a93b05baee00d6fb9099a Mon Sep 17 00:00:00 2001 From: burakovec Date: Tue, 9 Dec 2025 07:47:04 +0300 Subject: [PATCH] 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. --- src/module/cekilisler/views/PiyangoListe.vue | 381 +++++++++++----- .../muhasebe/views/MuhasebePiyangoListesi.vue | 430 ++++++++++++------ 2 files changed, 559 insertions(+), 252 deletions(-) diff --git a/src/module/cekilisler/views/PiyangoListe.vue b/src/module/cekilisler/views/PiyangoListe.vue index 4a90dfa..7b8c512 100644 --- a/src/module/cekilisler/views/PiyangoListe.vue +++ b/src/module/cekilisler/views/PiyangoListe.vue @@ -31,6 +31,8 @@ const dateStore = useDateStore() import { useUsersStore } from '@/stores/usersStore' const usersStore = useUsersStore() + import { useGlobalStore } from '@/stores/globalStore' + const globalStore = useGlobalStore() import { usePiyangoStore } from '../stores/piyangoStore' const piyangoStore = usePiyangoStore() import { usePiyangoDataStore } from '../stores/piyangoDataStore' @@ -68,128 +70,278 @@ const tableHeader = computed[]>(() => { let header: Record[] = [] + // 1. PİYANGO ID header.push({ name: 'piyangoId', - title: 'Piyango Id', + 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 => { + 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) { header.push({ name: 'duzenleyen', title: 'Düzenleyen' }) } - header.push( - { - name: 'baslik', - title: 'Başlık', - sort: true, - style: { width: '15%' } - }, - { - 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 => { - return dateStore.dateFormat({ date: v.olusturmaTarihi }) - }, - sort: true, - filter: { - type: 'date', - between: true - } + // 5. ARACI FİRMA + header.push({ + name: 'araciFirma', + title: 'Araci Firma', + compute: (v: Record): string => { + return v.araciFirma || '' } - ) + }) - if (usersStore.isVakifDernek || usersStore.isPanelUser) { - header.push({ - name: 'cekilisTarihi', - title: 'Çekiliş Tarihi', - compute: (v: Record): string => { - if (v.piyangoAmacId === 3) return '' - 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 => { - 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 => { - 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' - } + // 6. DURUM + header.push({ + name: 'durum', + title: 'Durum', + style: { width: '10%' }, + computeHtml: (v: Record): string => { + return ` + ${v.durum} + ` }, - { name: 'ikramiyeler', title: 'İkramiyeler', style: { width: '15%' } }, - { - name: 'durum', - title: 'Durum', - style: { width: '10%' }, - computeHtml: (v: Record): string => { - return ` - ${v.durum} - ` - }, - filter: { - type: 'select', - data: piyangoOnayDurumlari.value, - listVal: 'id', - listText: 'tipAdi', - filterId: 'durumId' - } + 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 => { + 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 => { + return v.izinSayisi || '' + }, + sort: true + }) + + // 9. BAŞLANGIÇ TARİHİ + header.push({ + name: 'baslangicTarihi', + title: 'Başlangıç Tarihi', + compute: (v: Record): 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 => { + 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 => { + 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 => { + return v.cekilisGorevlisi || '' + } + }) + + // 13. GAZETE İLAN TARİHİ + header.push({ + name: 'gazeteIlanTarihi', + title: 'Gazete İlan Tarihi', + compute: (v: Record): 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 => { + return v.gazeteAdi || '' + } + }) + + // 15. İZİN BEDELİ + header.push({ + name: 'izinBedeliTutari', + title: 'İzin Bedeli', + compute: (v: Record): 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 => { + 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 => { + 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 => { + return v.teminatSayisi || '' + }, + sort: true + }) + + // 19. TEMİNAT BANKASI + header.push({ + name: 'teminatBankasi', + title: 'Teminat Bankası', + compute: (v: Record): string => { + return v.teminatBankasi || '' + } + }) + + // 20. TEMİNAT TUTARI + header.push({ + name: 'teminatTutari', + title: 'Teminat Tutarı', + compute: (v: Record): 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 => { + return v.paraBirimiSembol || '' + } + }) + + // 22. T. İADE TARİHİ + header.push({ + name: 'teminatIadeTarihi', + title: 'T. İade Tarihi', + compute: (v: Record): 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 => { + return v.teminatIadeSayisi || '' + }, + sort: true + }) + + // 24. İKRAMİYELER + header.push({ + name: 'ikramiyeler', + title: 'İkramiyeler', + style: { width: '15%' }, + compute: (v: Record): string => { + return v.ikramiyeler || '' + } + }) + + // Panel User için ek sütunlar if (usersStore.isPanelUser) { header.push({ name: 'atanmis', @@ -197,17 +349,15 @@ computeHtml: (v: Record): string => { if (v.atanmis) { return ` - ${v.atananlar} - ` + ${v.atananlar} + ` } else { return ` - Sevk Edilmemiş` + Sevk Edilmemiş` } } }) - } - if (usersStore.isPanelUser) { header.push({ name: 'basvuruBedelNo', title: 'Muhasebeleştirme Durumu', @@ -215,16 +365,17 @@ let durum = '' if (v.basvuruBedelNo !== null) { durum += `Başvuru Bedel No: - ${v.basvuruBedelNo}
` + ${v.basvuruBedelNo}
` } if (v.izinBedelNo !== null) { durum += `İzin Bedel No: - ${v.izinBedelNo}` + ${v.izinBedelNo}` } return durum } }) } + return header }) diff --git a/src/module/muhasebe/views/MuhasebePiyangoListesi.vue b/src/module/muhasebe/views/MuhasebePiyangoListesi.vue index 909cfb2..ffdab3e 100644 --- a/src/module/muhasebe/views/MuhasebePiyangoListesi.vue +++ b/src/module/muhasebe/views/MuhasebePiyangoListesi.vue @@ -24,6 +24,8 @@ const dateStore = useDateStore() import { useUsersStore } from '@/stores/usersStore' const usersStore = useUsersStore() + import { useGlobalStore } from '@/stores/globalStore' + const globalStore = useGlobalStore() import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore' const piyangoStore = usePiyangoStore() import { usePiyangoDataStore } from '@/module/cekilisler/stores/piyangoDataStore' @@ -50,156 +52,310 @@ const tableHeader = computed[]>(() => { let header: Record[] = [] + // 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 => { + 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) { header.push({ name: 'duzenleyen', title: 'Düzenleyen' }) } - header.push( - { - name: 'piyangoId', - title: 'Piyango ID', - sort: true, - style: { width: '10%' } + // 5. ARACI FİRMA + header.push({ + name: 'araciFirma', + title: 'Araci Firma', + compute: (v: Record): string => { + return v.araciFirma || '' + } + }) + + // 6. DURUM + header.push({ + name: 'durum', + title: 'Durum', + style: { width: '10%' }, + computeHtml: (v: Record): string => { + return ` + ${v.durum} + ` }, - { - name: 'baslik', - title: 'Başlık', - sort: true, - style: { width: '15%' } + 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 => { + if (!v.izinTarihi || v.izinTarihi === null) return '' + return dateStore.dateFormat({ date: v.izinTarihi }) }, - { - name: 'piyangoamac', - title: 'Piyango Amacı', - sort: true, - filter: { - type: 'select', - data: piyangoAmaclari.value, - listVal: 'id', - listText: 'amacAdi', - filterId: 'piyangoAmacId' - } + sort: true, + filter: { + type: 'date', + between: true + } + }) + + // 8. İZİN SAYISI + header.push({ + name: 'izinSayisi', + title: 'İzin Sayısı', + compute: (v: Record): string => { + return v.izinSayisi || '' }, - { - name: 'olusturmaTarihi', - title: 'Oluşturulma Tarihi', - compute: (v: Record): string => { - return dateStore.dateFormat({ date: v.olusturmaTarihi }) - }, - sort: true, - filter: { - type: 'date', - between: true + sort: true + }) + + // 9. BAŞLANGIÇ TARİHİ + header.push({ + name: 'baslangicTarihi', + title: 'Başlangıç Tarihi', + compute: (v: Record): 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 => { + 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 => { + 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 => { + return v.cekilisGorevlisi || '' + } + }) + + // 13. GAZETE İLAN TARİHİ + header.push({ + name: 'gazeteIlanTarihi', + title: 'Gazete İlan Tarihi', + compute: (v: Record): 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 => { + return v.gazeteAdi || '' + } + }) + + // 15. İZİN BEDELİ + header.push({ + name: 'izinBedeliTutari', + title: 'İzin Bedeli', + compute: (v: Record): 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 => { + 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 => { + 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 => { + return v.teminatSayisi || '' + }, + sort: true + }) + + // 19. TEMİNAT BANKASI + header.push({ + name: 'teminatBankasi', + title: 'Teminat Bankası', + compute: (v: Record): string => { + return v.teminatBankasi || '' + } + }) + + // 20. TEMİNAT TUTARI + header.push({ + name: 'teminatTutari', + title: 'Teminat Tutarı', + compute: (v: Record): 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 => { + return v.paraBirimiSembol || '' + } + }) + + // 22. T. İADE TARİHİ + header.push({ + name: 'teminatIadeTarihi', + title: 'T. İade Tarihi', + compute: (v: Record): 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 => { + return v.teminatIadeSayisi || '' + }, + sort: true + }) + + // 24. İKRAMİYELER + header.push({ + name: 'ikramiyeler', + title: 'İkramiyeler', + style: { width: '15%' }, + compute: (v: Record): string => { + return v.ikramiyeler || '' + } + }) + + // Muhasebe özel sütunlar + header.push({ + name: 'atanmis', + title: 'Sevk Durumu', + computeHtml: (v: Record): string => { + if (v.atanmis) { + return ` + ${v.atananlar} + ` + } else { + return ` + Sevk Edilmemiş` } } - ) + }) - if (usersStore.isVakifDernek || usersStore.isPanelUser) { - header.push({ - name: 'cekilisTarihi', - title: 'Çekiliş Tarihi', - compute: (v: Record): string => { - return dateStore.dateFormat({ date: v.cekilisTarihi }) - }, - sort: true, - filter: { - type: 'date', - between: true + header.push({ + name: 'basvuruBedelNo', + title: 'Muhasebeleştirme Durumu', + computeHtml: (v: Record): string => { + let durum = '' + if (v.basvuruBedelNo !== null) { + durum += `Başvuru Bedel No: + ${v.basvuruBedelNo}
` } - }) - } - if (!usersStore.isVakifDernek || usersStore.isPanelUser) { - header.push( - { - name: 'baslangicTarihi', - title: 'Başlangıç Tarihi', - compute: (v: Record): 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 => { - 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 => { - return ` - ${v.durum} - ` - }, - filter: { - type: 'select', - data: piyangoOnayDurumlari.value, - listVal: 'id', - listText: 'tipAdi', - filterId: 'durumId' - } - }, - { - name: 'atanmis', - title: 'Sevk Durumu', - computeHtml: (v: Record): string => { - if (v.atanmis) { - return ` - ${v.atananlar} - ` - } else { - return ` - Sevk Edilmemiş` - } - } - }, - { - name: 'basvuruBedelNo', - title: 'Muhasebeleştirme Durumu', - computeHtml: (v: Record): string => { - let durum = '' - if (v.basvuruBedelNo !== null) { - durum += `Başvuru Bedel No: - ${v.basvuruBedelNo}
` - } - if (v.izinBedelNo !== null) { - durum += `İzin Bedel No: - ${v.izinBedelNo}` - } - return durum + if (v.izinBedelNo !== null) { + durum += `İzin Bedel No: + ${v.izinBedelNo}` } + return durum } - ) + }) + return header })