.
This commit is contained in:
3319
package-lock.json
generated
Normal file
3319
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
45
package.json
Normal file
45
package.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "panel-vue",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build --force"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/signalr": "^8.0.7",
|
||||
"axios": "^1.7.2",
|
||||
"html-to-pdfmake": "^2.5.19",
|
||||
"html2canvas": "^1.4.1",
|
||||
"jquery": "^3.7.1",
|
||||
"parchment": "^3.0.0",
|
||||
"pinia": "^2.1.7",
|
||||
"quill": "^2.0.3",
|
||||
"quill-image-resize-module": "^3.0.0",
|
||||
"summernote": "^0.9.1",
|
||||
"uuid": "^11.1.0",
|
||||
"vue": "^3.4.29",
|
||||
"vue-router": "^4.3.3",
|
||||
"vue3-pdfmake": "^2.2.0",
|
||||
"vue3-summernote-editor": "^1.0.2",
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node20": "^20.1.4",
|
||||
"@types/html-to-pdfmake": "^2.4.4",
|
||||
"@types/jquery": "^3.5.30",
|
||||
"@types/node": "^20.14.5",
|
||||
"@types/summernote": "^0.8.10",
|
||||
"@vitejs/plugin-vue": "^5.0.5",
|
||||
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
||||
"@vue/tsconfig": "^0.5.1",
|
||||
"npm-run-all2": "^6.2.0",
|
||||
"typescript": "~5.4.0",
|
||||
"vite": "^5.3.1",
|
||||
"vue-tsc": "^2.0.21"
|
||||
}
|
||||
}
|
||||
BIN
public/data/ornek-talihli-listesi.xlsx
Normal file
BIN
public/data/ornek-talihli-listesi.xlsx
Normal file
Binary file not shown.
110
src/components/global/FormDisplay.vue
Normal file
110
src/components/global/FormDisplay.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div
|
||||
:class="[
|
||||
'form-item form-item-display',
|
||||
half ? 'form-item-half' : '',
|
||||
elclass || '',
|
||||
label === undefined ? 'form-item-display-nb' : '',
|
||||
$slots.button ? 'form-item-wb' : ''
|
||||
]">
|
||||
<slot name="content">
|
||||
<label>
|
||||
<span v-if="label !== undefined && label !== ''" class="display-title">
|
||||
<strong>{{ label }}</strong>
|
||||
</span>
|
||||
<template v-if="modelText !== undefined && modelText !== ''">
|
||||
<template v-if="typeof modelText === 'string'">
|
||||
<span>{{ price ? globalStore.toTrLocale(modelText) : modelText }}</span>
|
||||
</template>
|
||||
<template v-if="typeof modelText === 'object'">
|
||||
<ul>
|
||||
<li v-for="txt in modelText">
|
||||
{{ txt }}
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>{{ price ? globalStore.toTrLocale(localValue) : localValue }}</span>
|
||||
</template>
|
||||
<span
|
||||
class="form-item-alert"
|
||||
v-if="InvalidMessages.length > 0 && InvalidMessages !== ''">
|
||||
{{ InvalidMessages }}
|
||||
</span>
|
||||
</label>
|
||||
<div v-if="$slots.button" class="form-item-button"><slot name="button"></slot></div>
|
||||
</slot>
|
||||
<div
|
||||
class="form-display-extra"
|
||||
v-if="messages !== undefined && messages.length !== 0">
|
||||
<ul>
|
||||
<li v-for="txt in messages">
|
||||
{{ txt }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, watch } from 'vue'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
const globalStore = useGlobalStore()
|
||||
const dateStore = useDateStore()
|
||||
|
||||
export interface Props {
|
||||
label?: string
|
||||
modelValue?: any
|
||||
half?: boolean
|
||||
title?: string
|
||||
elclass?: string
|
||||
type?: string
|
||||
messages?: string[]
|
||||
modelText?: any
|
||||
invalidText?: string
|
||||
price?: boolean
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
half: false,
|
||||
price: false
|
||||
})
|
||||
const localValue = ref<any>(props.modelValue)
|
||||
|
||||
if (props.type === 'date' && props.modelValue !== null && props.modelValue !== undefined && props.modelValue !== '')
|
||||
localValue.value = dateStore.dateFormat({
|
||||
date: props.modelValue as Date,
|
||||
pattern: 'dd-mm-yy'
|
||||
})
|
||||
|
||||
if (props.type === 'datetime' && props.modelValue !== null && props.modelValue !== undefined && props.modelValue !== '')
|
||||
localValue.value = dateStore.dateFormat({
|
||||
date: props.modelValue as Date,
|
||||
pattern: 'dd-mm-yy-t'
|
||||
})
|
||||
|
||||
if (props.type === 'array') {
|
||||
localValue.value = props.modelValue.toString()
|
||||
}
|
||||
|
||||
const InvalidMessageText = reactive<Record<string, any>>({})
|
||||
const InvalidMessages = computed<string>(() => {
|
||||
let text = ''
|
||||
Object.keys(InvalidMessageText).forEach((k: string, i: number) => {
|
||||
text += InvalidMessageText[k] + ', '
|
||||
})
|
||||
return text
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.invalidText,
|
||||
() => {
|
||||
if (props.invalidText !== undefined && props.invalidText !== '') {
|
||||
Object.assign(InvalidMessageText, {})
|
||||
InvalidMessageText.invalid = props.invalidText
|
||||
} else {
|
||||
delete InvalidMessageText.invalid
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
147
src/components/global/FormFile.vue
Normal file
147
src/components/global/FormFile.vue
Normal file
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div :class="['form-item', half ? 'form-item-half' : '', elclass || '']">
|
||||
<slot name="input">
|
||||
<label>
|
||||
<span v-if="label !== undefined && label !== ''">
|
||||
{{ label }}
|
||||
<i v-if="required" class="form-item-alert">*</i>
|
||||
</span>
|
||||
<div class="input-a">
|
||||
<span>
|
||||
{{
|
||||
localFilename !== undefined && localFilename !== ''
|
||||
? localFilename
|
||||
: 'Dosya yüklemek için tıklayın'
|
||||
}}
|
||||
</span>
|
||||
<i class="ico-c ico-section ico-section-header-btn">
|
||||
<svg><use href="/src/assets/images/icons.svg#upload"></use></svg>
|
||||
</i>
|
||||
</div>
|
||||
<input
|
||||
type="file"
|
||||
:disabled="disabled"
|
||||
@change="OnChange"
|
||||
:class="[
|
||||
invalidText !== undefined && invalidText !== '' ? 'invalid' : '',
|
||||
iclass || ''
|
||||
]" />
|
||||
<span
|
||||
class="form-item-alert"
|
||||
v-if="InvalidMessages.length > 0 && InvalidMessages !== ''">
|
||||
{{ InvalidMessages }}
|
||||
</span>
|
||||
<span
|
||||
class="form-item-description"
|
||||
v-if="description !== undefined && description !== ''">
|
||||
{{ description }}
|
||||
</span>
|
||||
</label>
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
export interface Props {
|
||||
label?: string
|
||||
fileName?: string
|
||||
disabled?: boolean
|
||||
modelValue: number | string | FileList | File
|
||||
half?: boolean
|
||||
title?: string
|
||||
invalidText?: string
|
||||
description?: string
|
||||
maxFileSize?: number
|
||||
maxFileSizeText?: string
|
||||
required?: boolean
|
||||
iclass?: string
|
||||
elclass?: string
|
||||
modelKey?: string
|
||||
fileTypes?: string[]
|
||||
fileType?: string
|
||||
isValid?: boolean
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
disabled: false,
|
||||
half: false,
|
||||
required: false,
|
||||
fileName: '',
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'change','update:isValid',])
|
||||
|
||||
const localFilename = ref<string>(props.fileName)
|
||||
|
||||
const InvalidMessageText = ref<Record<string, any>>({})
|
||||
|
||||
const InvalidMessages = computed<string>(() => {
|
||||
let text = ''
|
||||
Object.keys(InvalidMessageText.value).forEach((k: string, i: number) => {
|
||||
text += InvalidMessageText.value[k] + ', '
|
||||
})
|
||||
return text
|
||||
})
|
||||
|
||||
const OnChange = (e: Event) => {
|
||||
let el: any = (e.target as HTMLInputElement)!['files']![0]
|
||||
localFilename.value = el.name
|
||||
let fileType: string = globalStore.FileType(el.name)
|
||||
let fileName: string = globalStore.FileName(el.name)
|
||||
let fileSize: number = el.size
|
||||
InvalidMessageText.value = {}
|
||||
|
||||
if (props.fileType !== undefined) {
|
||||
if (props.fileType === 'img') {
|
||||
if (!globalStore.imageFormats.includes(fileType.toLowerCase())) {
|
||||
InvalidMessageText.value.type = `Sadece Resim dosyası yükleyebilirsiniz. Lütfen ${globalStore.imageFormats} formatındaki dosyaları yükleyin`
|
||||
el = null
|
||||
localFilename.value = ''
|
||||
}
|
||||
} else if (props.fileType === 'doc') {
|
||||
if (!globalStore.docFormats.includes(fileType.toLowerCase())) {
|
||||
InvalidMessageText.value.type = `Sadece doküman yükleyebilirsiniz. Lütfen ${globalStore.docFormats} formatındaki dosyaları yükleyin`
|
||||
el = null
|
||||
localFilename.value = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
if (props.fileTypes !== undefined) {
|
||||
if (!props.fileTypes.includes(fileType.toLowerCase())) {
|
||||
InvalidMessageText.value.type = `Lütfen ${props.fileTypes} formatındaki dosyaları yükleyin`
|
||||
el = null
|
||||
localFilename.value = ''
|
||||
if(props.isValid !== undefined) {
|
||||
emit('update:isValid', false)
|
||||
}
|
||||
}else{
|
||||
if(props.isValid !== undefined) {
|
||||
emit('update:isValid', true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (props.maxFileSize !== undefined) {
|
||||
if (fileSize > props.maxFileSize) {
|
||||
InvalidMessageText.value.size = `Dosya boyutu en fazla ${props.maxFileSizeText} olabilir. Lütfen daha küçük boyutlu bir dosya yükleyin.`
|
||||
el = null
|
||||
}
|
||||
}
|
||||
emit('update:modelValue', el)
|
||||
emit('change', e, { filetype: fileType, filename: fileName, filesize: fileSize })
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.invalidText,
|
||||
() => {
|
||||
if (props.invalidText !== undefined && props.invalidText !== '') {
|
||||
InvalidMessageText.value = {}
|
||||
InvalidMessageText.value.invalid = props.invalidText
|
||||
} else {
|
||||
delete InvalidMessageText.value.invalid
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
59
src/init/axios-init.ts
Normal file
59
src/init/axios-init.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import axios from 'axios'
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
import router from '@/router'
|
||||
|
||||
axios.defaults.baseURL = 'http://panel.cekilisevi.gov.tr:5001/'
|
||||
// axios.defaults.baseURL = 'https://localhost:7241/'
|
||||
//axios.defaults.timeout = 2000;
|
||||
axios.defaults.headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
|
||||
// İstek Öncesinde Çalışacak Bir Fonksiyon
|
||||
axios.interceptors.request.use(
|
||||
function (config) {
|
||||
const dataStore = useDataStore()
|
||||
if (!dataStore.isLoading) dataStore.isLoading = true
|
||||
// İstek gönderilmeden önce yapılacak işlemler
|
||||
//console.log('İstek Yapılıyor:', config)
|
||||
const token = sessionStorage.getItem('token')
|
||||
|
||||
if (!token) {
|
||||
console.log('No token found')
|
||||
} else {
|
||||
config.headers['Authorization'] = `Bearer ${token}`
|
||||
}
|
||||
|
||||
return config
|
||||
},
|
||||
function (error) {
|
||||
// İstek gönderilmeden önce hata oluşursa burada yakalanır
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
// İstek Sonrası Çalışacak Bir Fonksiyon
|
||||
axios.interceptors.response.use(
|
||||
function (response) {
|
||||
const dataStore = useDataStore()
|
||||
dataStore.isLoading = false
|
||||
// Yanıt başarılı olursa yapılacak işlemler
|
||||
//console.log('Yanıt Alındı:', response)
|
||||
return response
|
||||
},
|
||||
function (error) {
|
||||
const usersStore = useUsersStore()
|
||||
const dataStore = useDataStore()
|
||||
dataStore.isLoading = false
|
||||
// Yanıtta hata oluşursa burada yakalanır
|
||||
// error.status kodu undefined geliyor
|
||||
if (error.response.status === 401) {
|
||||
const token = sessionStorage.getItem(usersStore.userStorageKeys.TOKEN)
|
||||
if (token !== undefined) {
|
||||
usersStore.ResetUserData()
|
||||
router.push('/login')
|
||||
}
|
||||
}
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
export default axios
|
||||
416
src/module/cekilisler/components/TabPiyangoKatilimciListesi.vue
Normal file
416
src/module/cekilisler/components/TabPiyangoKatilimciListesi.vue
Normal file
@ -0,0 +1,416 @@
|
||||
<template>
|
||||
<section class='section-list'>
|
||||
<list-table-content
|
||||
:tableHeader='tableHeader'
|
||||
icon='draws'
|
||||
title='Katılım Listesi'
|
||||
listText='Katılımcı'
|
||||
:rowAction='OpenUser'
|
||||
:apiList="'Katilimci/ByCekilisId/' + piyangoStore.selectedLottery"
|
||||
v-model:pagination='paginationData'
|
||||
v-model:refresh='piyangoKatilimciStore.refreshPiyangoKatilimciList'>
|
||||
<template #extraButtons>
|
||||
<button
|
||||
class='button-c'
|
||||
@click='piyangoKatilimciService.CreateOnlineDraw'
|
||||
v-if='
|
||||
paginationData.totalRecords > 0 &&
|
||||
usersStore.isPanelUser &&
|
||||
!piyangoStore.lotteryDrawState &&
|
||||
piyangoStore.lotteryApprove === 4 &&
|
||||
piyangoStore.lotteryData.cekilisYontemiId === 2
|
||||
'>
|
||||
Online Çekiliş Düzenle
|
||||
</button>
|
||||
<a href='/data/ornek-katilimci-listesi.xlsx' target='_blank' class='button-c'>
|
||||
Örnek Katılımcı Dosyası İndir
|
||||
</a>
|
||||
<button
|
||||
class='button-c'
|
||||
@click='AddNewDocument'
|
||||
v-if='!usersStore.isPanelUser && !piyangoStore.lotteryDrawState'>
|
||||
Katılımcı Dosyası Yükle
|
||||
</button>
|
||||
<button
|
||||
class="button-c button-alert"
|
||||
@click="DeleteAllButton"
|
||||
v-if="
|
||||
paginationData.totalRecords > 0 &&
|
||||
usersStore.isPanelUser &&
|
||||
!piyangoStore.lotteryDrawState &&
|
||||
(piyangoStore.lotteryApprove === 7 || piyangoStore.lotteryApprove === 14)
|
||||
">
|
||||
|
||||
Tüm katılımcıları Sil
|
||||
</button>
|
||||
<button
|
||||
@click="SendChangeRequest"
|
||||
v-if="piyangoStore.lotteryApprove === 4 && !usersStore.isPanelUser">
|
||||
Katılım Listesi Değişiklik Talebi Gönder
|
||||
</button>
|
||||
</template>
|
||||
</list-table-content>
|
||||
<panel-wrapper
|
||||
v-if='piyangoKatilimciStore.katilimciFilePanel'
|
||||
v-model='piyangoKatilimciStore.katilimciFilePanel'
|
||||
panel-title='Katılımcı Dosyası Yükle'>
|
||||
<template #panelContent>
|
||||
<panel-katilimci-document />
|
||||
</template>
|
||||
<template #footerButton>
|
||||
<button class='button-c button-save' @click='FileUpload'>Yükle</button>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
<panel-wrapper
|
||||
wide
|
||||
v-if='piyangoKatilimciStore.katilimciUserPanel'
|
||||
v-model='piyangoKatilimciStore.katilimciUserPanel'
|
||||
:panel-title="
|
||||
piyangoKatilimciStore.isPiyangoKatilimciUserUpdate
|
||||
? 'Katılımcı Düzenle'
|
||||
: 'Katılımcı Ekle'
|
||||
">
|
||||
<template #panelContent>
|
||||
<panel-piyango-katilimci />
|
||||
</template>
|
||||
<template #footerButton v-if='!usersStore.isPanelUser'>
|
||||
<button
|
||||
:disabled='!piyangoKatilimciValidationStore.userFormChanged'
|
||||
class='button-c button-save'
|
||||
@click='piyangoKatilimciService.SaveKatilimciUser'>
|
||||
{{ piyangoKatilimciStore.isPiyangoKatilimciUserUpdate ? 'Kaydet' : 'Ekle' }}
|
||||
</button>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
<panel-wrapper
|
||||
v-if="uploadProgressPanel"
|
||||
v-model="uploadProgressPanel"
|
||||
panel-title="Yükleme Durumu">
|
||||
<template #panelContent>
|
||||
<div class="progress-container">
|
||||
<div class="upload-warning">
|
||||
📌 İşlem sırasında tarayıcıyı veya bu sekmeyi kapatmayınız.
|
||||
</div>
|
||||
<div class="progress-bar">
|
||||
<div
|
||||
class="progress-fill"
|
||||
:style="{ width: uploadProgressValue + '%' }"
|
||||
></div>
|
||||
</div>
|
||||
<div class="progress-text">
|
||||
<template v-if="uploadProgressValue === 0">
|
||||
Dosya içeriği okunuyor, yükleme başlatılıyor...
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ uploadProgressValue }}%
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
</section>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { ref, computed } from 'vue'
|
||||
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||
import PanelKatilimciDocument from '@/module/cekilisler/components/panel/PanelKatilimciDocument.vue'
|
||||
import PanelPiyangoKatilimci from '@/module/cekilisler/components/panel/PanelPiyangoKatilimci.vue'
|
||||
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
|
||||
const dateStore = useDateStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
|
||||
const usersStore = useUsersStore()
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
|
||||
const dataStore = useDataStore()
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoKatilimciStore } from '../stores/piyangoKatilimciStore'
|
||||
|
||||
const piyangoKatilimciStore = usePiyangoKatilimciStore()
|
||||
import { usePiyangoKatilimciValidationStore } from '../validation/piyangoKatilimciValidationStore'
|
||||
|
||||
const piyangoKatilimciValidationStore = usePiyangoKatilimciValidationStore()
|
||||
import { usePiyangoKatilimciService } from '../service/piyangoKatilimciService'
|
||||
|
||||
const piyangoKatilimciService = usePiyangoKatilimciService()
|
||||
import { useDialogStore } from '@/components/global/dialogStore'
|
||||
|
||||
const dialogStore = useDialogStore()
|
||||
|
||||
import { usePiyangoOnayStore } from '../stores/piyangoOnayStore'
|
||||
const piyangoOnayStore = usePiyangoOnayStore()
|
||||
import { usePiyangoOnayService } from '../service/piyangoOnayService'
|
||||
const piyangoOnayService = usePiyangoOnayService()
|
||||
|
||||
import { connectToHub, onProgress, onInsertProgress, onCompleted, onError } from '../service/signalrService'
|
||||
|
||||
|
||||
const uploadProgressValue = ref(0)
|
||||
const uploadProgressPanel = ref(false)
|
||||
const today = ref<Date>(new Date())
|
||||
const ilanTarihi = ref<Date>(new Date(piyangoStore.lotteryIlanTarihi!))
|
||||
|
||||
const tableHeader = ref<Record<string, any>[]>([
|
||||
{
|
||||
name: 'cekilisKatilimSiraNo',
|
||||
title: 'Çekiliş Katılım Sıra No',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
{
|
||||
name: 'cekilisHakkiAdedi',
|
||||
title: 'Çekiliş Hakkı Adedi',
|
||||
style: { width: '10%' }
|
||||
},
|
||||
{
|
||||
name: 'sifreCode',
|
||||
title: 'Şifre (Code)',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
{
|
||||
name: 'magazaKartNumarasi',
|
||||
title: '(Mağaza Kartı) (Müşteri Kartı) Numarası',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
{
|
||||
name: 'isimSoyisim',
|
||||
title: 'Ad Soyad',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'telefonNumarasi',
|
||||
title: 'Telefon',
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'ilce',
|
||||
title: 'İlçe',
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'il',
|
||||
title: 'İl',
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'email',
|
||||
title: 'Email',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'katilimTarihi',
|
||||
title: 'Katılım Tarihi',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'fisFaturaTarihi',
|
||||
title: 'Fiş/Fatura Tarihi',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'fisFaturaNo',
|
||||
title: 'Fiş/Fatura No',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'kampanyaliUrunTutari',
|
||||
title: 'Fiş/Fatura (Kampanyalı Ürün Tutarı)',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'toplamTutar',
|
||||
title: 'Fiş/Fatura Toplam Tutarı',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'magazaAdiYeri',
|
||||
title: 'Mağaza Adı/Yeri',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
}
|
||||
])
|
||||
|
||||
const paginationData = ref<Record<string, any>>({})
|
||||
|
||||
const KatilimciAddAction = computed(() => {
|
||||
if (
|
||||
!usersStore.isPanelUser &&
|
||||
piyangoStore.lotteryApprove === 4 &&
|
||||
!piyangoStore.lotteryDrawState
|
||||
)
|
||||
return AddNewKatilimci
|
||||
else return ''
|
||||
})
|
||||
|
||||
const AddNewDocument = () => {
|
||||
dataStore.panelData = {
|
||||
title: '',
|
||||
file: ''
|
||||
}
|
||||
piyangoKatilimciStore.katilimciFilePanel = true
|
||||
}
|
||||
|
||||
const AddNewKatilimci = () => {
|
||||
piyangoKatilimciStore.isPiyangoKatilimciUserUpdate = false
|
||||
piyangoKatilimciValidationStore.userFormChanged = false
|
||||
piyangoKatilimciStore.RestoreUserFormData()
|
||||
piyangoKatilimciStore.isNewKatilimci = true
|
||||
piyangoKatilimciStore.katilimciUserPanel = true
|
||||
}
|
||||
|
||||
const OpenUser = async (row: any) => {
|
||||
piyangoKatilimciStore.isPiyangoKatilimciUserUpdate = true
|
||||
piyangoKatilimciValidationStore.userFormChanged = false
|
||||
let data = await piyangoKatilimciService.KatilimciData(row.id)
|
||||
Object.assign(piyangoKatilimciStore.piyangoKatilimciUserFormData, data)
|
||||
piyangoKatilimciStore.isNewKatilimci = false
|
||||
piyangoKatilimciStore.katilimciUserPanel = true
|
||||
}
|
||||
const FileUpload = async () => {
|
||||
const connectionId = await connectToHub()
|
||||
|
||||
// Progress modal'ı aç
|
||||
uploadProgressValue.value = 0
|
||||
uploadProgressPanel.value = true
|
||||
|
||||
onProgress((data) => {
|
||||
uploadProgressValue.value = data.Percent
|
||||
console.log('Progress:', data.Percent)
|
||||
})
|
||||
|
||||
onCompleted((data) => {
|
||||
console.log('Tamamlandı:', data)
|
||||
uploadProgressPanel.value = false
|
||||
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
|
||||
piyangoKatilimciStore.katilimciFilePanel = false
|
||||
})
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append('excelFile', piyangoKatilimciStore.piyangoKatilimciFileFormData.excelFile)
|
||||
console.log( dataStore.panelData)
|
||||
const response = await dataStore.dataPost(
|
||||
`Katilimci/ExcelleYukle/${piyangoStore.selectedLottery}?connectionId=${connectionId}`,
|
||||
{
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
)
|
||||
|
||||
if (response.data !== 'errorfalse') {
|
||||
// Başarı işlemi zaten onCompleted içinde yapıldı
|
||||
} else {
|
||||
// Hata olursa paneli kapat
|
||||
uploadProgressPanel.value = false
|
||||
}
|
||||
}
|
||||
// const FileUpload = async () => {
|
||||
// if (true) {
|
||||
// const formData = new FormData()
|
||||
// formData.append('excelFile', dataStore.panelData.file)
|
||||
// let dt: any
|
||||
//
|
||||
// dt = await dataStore.dataPost(
|
||||
// `Katilimci/ExcelleYukle/${piyangoStore.selectedLottery}?connectionId=${connectionId}`,
|
||||
// {
|
||||
// data: formData,
|
||||
// headers: { 'Content-Type': 'multipart/form-data' }
|
||||
// }
|
||||
// )
|
||||
// if (dt !== 'errorfalse') {
|
||||
// piyangoKatilimciStore.refreshPiyangoKatilimciList = true
|
||||
// piyangoKatilimciStore.katilimciFilePanel = false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
const DeleteAllButton = () => {
|
||||
dialogStore.CreateDialog({
|
||||
title: 'Tüm Katılımcıları Sil',
|
||||
content:
|
||||
'Tüm katılımcıları silmek istediğinize emin misiniz? Bu işlem geri alınamaz.',
|
||||
closeText: 'Vazgeç',
|
||||
buttons: [
|
||||
{
|
||||
label: 'Tüm katılımcıları Sil',
|
||||
type: 'alert',
|
||||
function: DeleteAll
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const DeleteAll = async (id: number) => {
|
||||
var dt = await dataStore.dataDelete(
|
||||
'Katilimci/DeleteCekilisKatilimci/' + piyangoStore.selectedLottery
|
||||
)
|
||||
|
||||
if (dt !== 'errorfalse') {
|
||||
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
|
||||
dialogStore.CloseDialog(id)
|
||||
}
|
||||
}
|
||||
|
||||
const SendChangeRequest = async () => {
|
||||
piyangoOnayStore.piyangoOnayForm.onayDurumuIslemTipiId = 14
|
||||
piyangoOnayStore.piyangoOnayForm.file = ''
|
||||
piyangoOnayStore.piyangoOnayForm.aciklama = ''
|
||||
await piyangoOnayService.SaveOnayDurum()
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.progress-container {
|
||||
width: 100%;
|
||||
padding: 20px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 90%;
|
||||
max-width: 400px;
|
||||
height: 30px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
height: 100%;
|
||||
background-color: #42b983;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.progress-text {
|
||||
margin-top: 12px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.upload-warning {
|
||||
background: #fff8db;
|
||||
color: #856404;
|
||||
border: 1px solid #ffeeba;
|
||||
padding: 10px 14px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
231
src/module/cekilisler/components/TabPiyangoTalihliListesi.vue
Normal file
231
src/module/cekilisler/components/TabPiyangoTalihliListesi.vue
Normal file
@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<section class="section-list">
|
||||
<list-table-content
|
||||
:tableHeader="tableHeader"
|
||||
icon="draws"
|
||||
title="Talihli Listesi"
|
||||
listText="Talihli"
|
||||
:apiList="'Katilimci/AsilYedek/' + piyangoStore.selectedLottery"
|
||||
v-model:refresh='refreshList'
|
||||
>
|
||||
<template #extraButtons>
|
||||
<a href='/data/ornek-talihli-listesi.xlsx' target='_blank' class='button-c' v-if='piyangoStore.lotteryData.cekilisYontemi =="Fiziksel"'>
|
||||
Örnek Talihli Dosyası İndir
|
||||
</a>
|
||||
<button
|
||||
class='button-c'
|
||||
@click='AddNewDocument'
|
||||
v-if='!usersStore.isPanelUser && !piyangoStore.lotteryDrawState && piyangoStore.lotteryData.cekilisYontemi =="Fiziksel"'>
|
||||
Talihli Dosyası Yükle
|
||||
</button>
|
||||
</template>
|
||||
</list-table-content>
|
||||
<panel-wrapper
|
||||
v-if='talihliFilePanel'
|
||||
v-model='talihliFilePanel'
|
||||
panel-title='Talihli Dosyası Yükle'>
|
||||
<template #panelContent>
|
||||
<panel-talihli-document />
|
||||
</template>
|
||||
<template #footerButton>
|
||||
<button class='button-c button-save' @click='FileUpload'>Yükle</button>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
<panel-wrapper
|
||||
v-if="uploadProgressPanel"
|
||||
v-model="uploadProgressPanel"
|
||||
panel-title="Yükleme Durumu">
|
||||
<template #panelContent>
|
||||
<div class="progress-container">
|
||||
<div class="upload-warning">
|
||||
📌 İşlem sırasında tarayıcıyı veya bu sekmeyi kapatmayınız.
|
||||
</div>
|
||||
<div class="progress-bar">
|
||||
<div
|
||||
class="progress-fill"
|
||||
:style="{ width: uploadProgressValue + '%' }"
|
||||
></div>
|
||||
</div>
|
||||
<div class="progress-text">
|
||||
<template v-if="uploadProgressValue === 0">
|
||||
Dosya içeriği okunuyor, yükleme başlatılıyor...
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ uploadProgressValue }}%
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
</section>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
const dataStore = useDataStore()
|
||||
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||
import PanelTalihliDocument from '@/module/cekilisler/components/panel/PanelTalihliDocument.vue'
|
||||
import { connectToHub, onCompleted, onProgress } from '@/module/cekilisler/service/signalrService'
|
||||
const usersStore = useUsersStore()
|
||||
const tableHeader = ref<Record<string, any>>([
|
||||
{
|
||||
name: 'cekilisKatilimSiraNo',
|
||||
title: 'Çekiliş Katılım Sıra No',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'sifreCode',
|
||||
title: 'Şifre (Code)',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
{
|
||||
name: 'magazaKartNumarasi',
|
||||
title: '(Mağaza Kartı) (Müşteri Kartı) Numarası',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},
|
||||
{
|
||||
name: 'isimSoyisim',
|
||||
title: 'Ad Soyad',
|
||||
sort: true,
|
||||
style: { width: '20%' }
|
||||
},{
|
||||
name: 'ikramiye',
|
||||
title: 'İkramiyesi'
|
||||
},{
|
||||
name: '',
|
||||
title: 'Talihli',
|
||||
computeHtml: (v: Record<string, any>) => {
|
||||
if (v.asilTalihli)
|
||||
return `<span class="back-grad back-grad-ok">${v.talihliSira !== undefined && v.talihliSira !== null ? v.talihliSira+'.' : ''} Asıl Talihli </span>`
|
||||
if (v.yedekTalihli)
|
||||
return `<span class="back-grad back-grad-waiting">${v.talihliSira !== undefined && v.talihliSira !== null ? v.talihliSira+'.' : ''} Yedek Talihli </span>`
|
||||
},
|
||||
style: { width: '15%' }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'telefonNumarasi',
|
||||
title: 'Telefon',
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'ilce',
|
||||
title: 'İlçe',
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'il',
|
||||
title: 'İl',
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'email',
|
||||
title: 'Email',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},{
|
||||
name: 'katilimTarihi',
|
||||
title: 'Katılım Tarihi',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'fisFaturaTarihi',
|
||||
title: 'Fiş/Fatura Tarihi',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'fisFaturaNo',
|
||||
title: 'Fiş/Fatura No',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'kampanyaliUrunTutari',
|
||||
title: 'Fiş/Fatura (Kampanyalı Ürün Tutarı)',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'toplamTutar',
|
||||
title: 'Fiş/Fatura Toplam Tutarı',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'magazaAdiYeri',
|
||||
title: 'Mağaza Adı/Yeri',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
}
|
||||
])
|
||||
const talihliFilePanel = ref<boolean>(false)
|
||||
const refreshList = ref<boolean>(false)
|
||||
const uploadProgressPanel = ref<boolean>(false)
|
||||
const uploadProgressValue = ref(0)
|
||||
|
||||
|
||||
import { usePiyangoTalihliStore } from '../stores/piyangoTalihliStore'
|
||||
|
||||
const piyangoTalihliStore = usePiyangoTalihliStore()
|
||||
import { usePiyangoKatilimciValidationStore } from '../validation/piyangoKatilimciValidationStore'
|
||||
|
||||
const piyangoKatilimciValidationStore = usePiyangoKatilimciValidationStore()
|
||||
const AddNewDocument = () => {
|
||||
dataStore.panelData = {
|
||||
title: '',
|
||||
file: ''
|
||||
}
|
||||
talihliFilePanel.value = true
|
||||
}
|
||||
const FileUpload = async () => {
|
||||
// const connectionId = await connectToHub()
|
||||
|
||||
// Progress modal'ı aç
|
||||
uploadProgressValue.value = 0
|
||||
uploadProgressPanel.value = true
|
||||
|
||||
// onProgress((data) => {
|
||||
// uploadProgressValue.value = data.Percent
|
||||
// console.log('Progress:', data.Percent)
|
||||
// })
|
||||
//
|
||||
// onCompleted((data) => {
|
||||
// console.log('Tamamlandı:', data)
|
||||
// uploadProgressPanel.value = false
|
||||
// refreshList.value = true
|
||||
// talihliFilePanel.value = false
|
||||
// })
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append('file', piyangoTalihliStore.piyangoTalihliFileFormData.excelFile)
|
||||
console.log( dataStore.panelData)
|
||||
const response = await dataStore.dataPost(
|
||||
`Katilimci/talihli-yukle/${piyangoStore.selectedLottery}`,
|
||||
{
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
)
|
||||
|
||||
if (response.data !== 'errorfalse') {
|
||||
uploadProgressPanel.value = false
|
||||
refreshList.value = true
|
||||
talihliFilePanel.value = false
|
||||
} else {
|
||||
// Hata olursa paneli kapat
|
||||
uploadProgressPanel.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
166
src/module/cekilisler/components/TabPiyangoTeminatDurumu.vue
Normal file
166
src/module/cekilisler/components/TabPiyangoTeminatDurumu.vue
Normal file
@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<section class="section-list">
|
||||
<list-table-content
|
||||
:tableHeader="tableHeader"
|
||||
icon="draws"
|
||||
title="Teminat Listesi"
|
||||
listText="Teminat"
|
||||
:rowAction="OpenTeminatDurum"
|
||||
:addAction="teminatAddAction"
|
||||
:apiList="
|
||||
'TeminantStates/GetTeminantStateCekilisList/' + piyangoStore.selectedLottery
|
||||
"
|
||||
v-model:refresh="piyangoTeminatStore.refreshList" />
|
||||
</section>
|
||||
<panel-wrapper
|
||||
wide
|
||||
v-if="piyangoTeminatStore.teminatPanel"
|
||||
v-model="piyangoTeminatStore.teminatPanel"
|
||||
:panel-title="piyangoTeminatStore.isNew ? 'Teminat Ekle' : 'Teminat Detayı'">
|
||||
<template #panelContent>
|
||||
<panel-piyango-teminat-durumu-display
|
||||
v-if="
|
||||
usersStore.isPanelUser ||
|
||||
(!usersStore.isPanelUser &&
|
||||
piyangoStore.lotteryApprove !== 3 &&
|
||||
!piyangoTeminatStore.isNew)
|
||||
" />
|
||||
<panel-piyango-teminat-durumu
|
||||
v-if="
|
||||
!usersStore.isPanelUser &&
|
||||
(piyangoStore.lotteryApprove === 3 || piyangoTeminatStore.isNew)
|
||||
" />
|
||||
</template>
|
||||
<template #footerButton>
|
||||
<button
|
||||
class="button-c button-save"
|
||||
:disabled="!piyangoTeminatValidationStore.formChanged"
|
||||
@click="piyangoTeminatService.SaveTeminatDurum"
|
||||
v-if="piyangoTeminatStore.isNew || usersStore.isPanelUser">
|
||||
Kaydet
|
||||
</button>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed,onBeforeMount } from 'vue'
|
||||
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||
|
||||
import PanelPiyangoTeminatDurumu from './panel/PanelPiyangoTeminatDurumu.vue'
|
||||
import PanelPiyangoTeminatDurumuDisplay from './panel/PanelPiyangoTeminatDurumuDisplay.vue'
|
||||
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
const globalStore = useGlobalStore()
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
const dateStore = useDateStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoTeminatStore } from '../stores/piyangoTeminatStore'
|
||||
const piyangoTeminatStore = usePiyangoTeminatStore()
|
||||
import { usePiyangoTeminatService } from '../service/piyangoTeminatService'
|
||||
const piyangoTeminatService = usePiyangoTeminatService()
|
||||
import { usePiyangoServices } from '../service/piyangoServices'
|
||||
const piyangoServices = usePiyangoServices()
|
||||
import { usePiyangoTeminatValidationStore } from '../validation/piyangoTeminatValidationStore'
|
||||
const piyangoTeminatValidationStore = usePiyangoTeminatValidationStore()
|
||||
|
||||
const tableHeader = ref<Record<string, any>[]>([
|
||||
{
|
||||
name: 'teminantNo',
|
||||
title: 'Teminat No',
|
||||
sort: true,
|
||||
style: { width: '10%' }
|
||||
},
|
||||
{
|
||||
name: 'teminantDate',
|
||||
title: 'Teminat Tarihi',
|
||||
sort: true,
|
||||
style: { width: '10%' },
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({
|
||||
date: v.teminantDate,
|
||||
pattern: 'yy-mm-dd',
|
||||
splitDate: '-'
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'amount',
|
||||
title: 'Tutarı',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return globalStore.toTrLocale(v.amount)
|
||||
},
|
||||
style: { width: '10%' },
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'teminatParentTypeText',
|
||||
title: 'Para Birimi',
|
||||
style: { width: '5%' },
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'teminantChildTypeText',
|
||||
title: 'Teminat Türü',
|
||||
style: { width: '10%' }
|
||||
},
|
||||
{
|
||||
name: 'bankName',
|
||||
title: 'Banka',
|
||||
style: { width: '10%' }
|
||||
},
|
||||
{
|
||||
name: 'bankBranch',
|
||||
title: 'Şube'
|
||||
},
|
||||
{
|
||||
name: 'bankBranch',
|
||||
title: 'Dosya',
|
||||
computeHtml: (v: Record<string, any>) => {
|
||||
if (v.teminantDocumentUrl !== null && v.teminantDocumentUrl !== undefined) {
|
||||
return globalStore.TableCellDocument(v.teminantDocumentUrl)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '',
|
||||
title: 'Teminat Durumu',
|
||||
computeHtml: (v: Record<string, any>) => {
|
||||
if (v.state === 1) {
|
||||
return `<span class='back-grad back-grad-ok'>${v.stateText}</span>`
|
||||
}
|
||||
if (v.state === 2) {
|
||||
return `<span class='back-grad back-grad-alert'>${v.stateText}</span>`
|
||||
}
|
||||
if (v.state === 3) {
|
||||
return `<span class='back-grad back-grad-waiting'>${v.stateText}</span>`
|
||||
}
|
||||
},
|
||||
style: { width: '10%' }
|
||||
}
|
||||
])
|
||||
|
||||
const teminatAddAction = computed(() => {
|
||||
if (
|
||||
!usersStore.isPanelUser
|
||||
)
|
||||
return NewTeminatDurum
|
||||
else return ''
|
||||
})
|
||||
|
||||
const NewTeminatDurum = () => {
|
||||
piyangoTeminatStore.isNew = true
|
||||
piyangoTeminatStore.loaded = false
|
||||
piyangoTeminatStore.selectedTeminatId = null
|
||||
piyangoTeminatStore.teminatPanel = true
|
||||
}
|
||||
|
||||
const OpenTeminatDurum = (row: Record<string, any>) => {
|
||||
piyangoTeminatStore.isNew = false
|
||||
piyangoTeminatStore.loaded = false
|
||||
piyangoTeminatStore.teminatPanel = true
|
||||
piyangoTeminatStore.selectedTeminatId = row.id
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div class="form-part section-list" v-if="piyangoIkramiyeStore.loaded">
|
||||
<list-table-content
|
||||
title="İkramiye Listesi"
|
||||
icon="draws"
|
||||
:tableHeader="ikramiyeTableHeader"
|
||||
:rowAction="EditIkramiye"
|
||||
listText="İkramiye"
|
||||
:addAction="AddActionFunction()"
|
||||
:apiList="'Ikramiye/Cekilis/' + piyangoStore.selectedLottery"
|
||||
apiText="İkramiye Listesi"
|
||||
v-model:refresh="piyangoIkramiyeStore.refreshList"
|
||||
rowNumber
|
||||
:totalValues="piyangoIkramiyeStore.totalIkramiyeValues" />
|
||||
</div>
|
||||
<panel-wrapper
|
||||
wide
|
||||
v-if="piyangoIkramiyeStore.ikramiyePanel"
|
||||
v-model="piyangoIkramiyeStore.ikramiyePanel"
|
||||
:panel-title="piyangoIkramiyeStore.isUpdate ? 'İkramiye Düzenle' : 'İkramiye Ekle'">
|
||||
<template #panelContent>
|
||||
<panel-piyango-ikramiye />
|
||||
</template>
|
||||
<template #footerButton>
|
||||
<div class="button-c button-save" @click="piyangoIkramiyeService.SaveIkramiye">
|
||||
{{ piyangoIkramiyeStore.isUpdate ? 'Kaydet' : 'Ekle' }}
|
||||
</div>
|
||||
</template>
|
||||
</panel-wrapper>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onBeforeMount, watch } from 'vue'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
const dateStore = useDateStore()
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
const globalStore = useGlobalStore()
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
const dataStore = useDataStore()
|
||||
import { useValidationStore } from '@/stores/validationStore'
|
||||
const validationStore = useValidationStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
import { usePiyangoStore } from '../../stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoServices } from '../../service/piyangoServices'
|
||||
const piyangoServices = usePiyangoServices()
|
||||
|
||||
import { usePiyangoIkramiyeStore } from '../../stores/piyangoIkramiyeStore'
|
||||
const piyangoIkramiyeStore = usePiyangoIkramiyeStore()
|
||||
import { usePiyangoIkramiyeService } from '../../service/piyangoIkramiyeService'
|
||||
const piyangoIkramiyeService = usePiyangoIkramiyeService()
|
||||
|
||||
import PanelPiyangoIkramiye from '../panel/PanelPiyangoIkramiye.vue'
|
||||
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||
|
||||
const talihliTitle = ref<string>('Talihli Adedi')
|
||||
|
||||
const ikramiyeTableHeader = ref<Record<string, any>[]>([
|
||||
{
|
||||
name: 'cinsi',
|
||||
title: 'Cinsi, Markası, Modeli',
|
||||
computeHtml: (v: Record<string, any>): string => {
|
||||
return `${v.cinsi}, ${v.marka} ${v.model !== null ? ', ' + v.model : ''}`
|
||||
},
|
||||
style: { width: '20%' }
|
||||
},
|
||||
{
|
||||
name: 'birimFiyat',
|
||||
title: 'Birim Değeri (KDV+ÖTV Dahil)',
|
||||
sort: true,
|
||||
price: true,
|
||||
computeHtml: (v: Record<string, any>): string => {
|
||||
if (v.paraBirimi !== null)
|
||||
return `${globalStore.toTrLocale(v.birimFiyat)} ${
|
||||
v.paraBirimi.paraBirimiSembol
|
||||
}`
|
||||
else return globalStore.toTrLocale(v.birimFiyat)
|
||||
},
|
||||
style: { width: '10%' }
|
||||
},
|
||||
{
|
||||
name: 'asilTalihliAdedi',
|
||||
title: talihliTitle.value,
|
||||
sort: true
|
||||
},
|
||||
{
|
||||
name: 'toplamDeger',
|
||||
title: 'Toplam Değer',
|
||||
sort: true,
|
||||
price: true,
|
||||
compute: (v: Record<string, any>): string => {
|
||||
if (v.paraBirimi !== null)
|
||||
return `${globalStore.toTrLocale(v.toplamDeger)} ${
|
||||
v.paraBirimi.paraBirimiSembol
|
||||
}`
|
||||
else return globalStore.toTrLocale(v.toplamDeger)
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
const AddActionFunction = (): any => {
|
||||
if (usersStore.isPanelUser) {
|
||||
return ''
|
||||
} else {
|
||||
return NewIkramiye as Function
|
||||
}
|
||||
}
|
||||
|
||||
const NewIkramiye = () => {
|
||||
piyangoIkramiyeStore.ResetForm()
|
||||
piyangoIkramiyeStore.isUpdate = false
|
||||
piyangoIkramiyeStore.ikramiyePanel = true
|
||||
}
|
||||
|
||||
const EditIkramiye = (d: Record<string, any>) => {
|
||||
Object.assign(piyangoIkramiyeStore.piyangoIkramiyeForm, d)
|
||||
piyangoIkramiyeStore.piyangoIkramiyeForm.birimFiyat = globalStore.toTrLocale(
|
||||
piyangoIkramiyeStore.piyangoIkramiyeForm.birimFiyat
|
||||
)
|
||||
|
||||
piyangoIkramiyeStore.ikramiyePanel = true
|
||||
piyangoIkramiyeStore.isUpdate = true
|
||||
}
|
||||
|
||||
const TableHeaderColumns = () => {
|
||||
if (!piyangoStore.isLotteryForCharity) {
|
||||
talihliTitle.value = 'Asil Talihli Adedi'
|
||||
ikramiyeTableHeader.value.push({
|
||||
name: 'yedekTalihliAdedi',
|
||||
title: 'Yedek Talihli Adedi',
|
||||
sort: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
piyangoIkramiyeStore.loaded = false
|
||||
await piyangoServices.GetParaBirimleri()
|
||||
TableHeaderColumns()
|
||||
piyangoIkramiyeStore.loaded = true
|
||||
})
|
||||
|
||||
watch(
|
||||
() => piyangoStore.isLotteryForCharity,
|
||||
() => {
|
||||
TableHeaderColumns()
|
||||
}
|
||||
)
|
||||
</script>
|
||||
@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<form-file
|
||||
v-model="piyangoKatilimciStore.piyangoKatilimciFileFormData.excelFile"
|
||||
elclass="panel-documents-item"
|
||||
:invalidText="piyangoKatilimciValidationStore.fileFormInvalidTexts.excelFile"
|
||||
:fileTypes="['xls','xlsx']"
|
||||
:maxFileSize="4294967296"
|
||||
maxFileSizeText="4GB"
|
||||
v-model:isValid="piyangoKatilimciValidationStore.isFileFormValid"
|
||||
description="Sadece XLS veya XLSX uzantılı dosya yükleyiniz. Dosya boyutu 4GB'dan fazla olmamalıdır."/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { usePiyangoKatilimciStore } from '../../stores/piyangoKatilimciStore'
|
||||
const piyangoKatilimciStore = usePiyangoKatilimciStore()
|
||||
import { usePiyangoKatilimciValidationStore } from '../../validation/piyangoKatilimciValidationStore'
|
||||
const piyangoKatilimciValidationStore = usePiyangoKatilimciValidationStore()
|
||||
</script>
|
||||
@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<form-file
|
||||
v-model="piyangoTalihliStore.piyangoTalihliFileFormData.excelFile"
|
||||
elclass="panel-documents-item"
|
||||
:invalidText="piyangoTalihliValidationStore.fileFormInvalidTexts.excelFile"
|
||||
:fileTypes="['xls','xlsx']"
|
||||
:maxFileSize="4294967296"
|
||||
maxFileSizeText="4GB"
|
||||
v-model:isValid="piyangoTalihliValidationStore.isFileFormValid"
|
||||
description="Sadece XLS veya XLSX uzantılı dosya yükleyiniz. Dosya boyutu 4GB'dan fazla olmamalıdır."/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { usePiyangoTalihliStore } from '../../stores/piyangoTalihliStore'
|
||||
const piyangoTalihliStore = usePiyangoTalihliStore()
|
||||
|
||||
import { usePiyangoTalihliValidationStore } from '../../validation/piyangoTalihliValidationStore'
|
||||
const piyangoTalihliValidationStore = usePiyangoTalihliValidationStore()
|
||||
</script>
|
||||
65
src/module/cekilisler/service/piyangoIkramiyeService.ts
Normal file
65
src/module/cekilisler/service/piyangoIkramiyeService.ts
Normal file
@ -0,0 +1,65 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
import { usePiyangoIkramiyeStore } from '../stores/piyangoIkramiyeStore'
|
||||
import { usePiyangoIkramiyeValidationStore } from '../validation/piyangoIkramiyeValidationStore'
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
|
||||
export const usePiyangoIkramiyeService = defineStore('piyangoIkramiyeService', () => {
|
||||
const dataStore = useDataStore()
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const piyangoIkramiyeStore = usePiyangoIkramiyeStore()
|
||||
const piyangoIkramiyeValidationStore = usePiyangoIkramiyeValidationStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const GetAllIkramiyeler = async () => {
|
||||
let data: Record<string, any> | any = await dataStore.dataGet(
|
||||
'Ikramiye/Cekilis/' + piyangoStore.selectedLottery + '?pageNumber=0'
|
||||
)
|
||||
|
||||
if (data !== 'errorfalse') {
|
||||
piyangoIkramiyeStore.piyangoAllIkramiyeTotals.yedekTalihliAdedi =
|
||||
data.toplamyedektalihli
|
||||
piyangoIkramiyeStore.piyangoAllIkramiyeTotals.asilTalihliAdedi =
|
||||
data.toplamasiltalihli
|
||||
piyangoIkramiyeStore.piyangoAllIkramiyeTotals.toplamDeger = data.toplamdeger
|
||||
|
||||
if (data.data.length > 0 && data.data[0].paraBirimi !== null)
|
||||
piyangoIkramiyeStore.piyangoAllIkramiyeParaBirimi =
|
||||
data.data[0].paraBirimi.paraBirimiSembol
|
||||
|
||||
piyangoIkramiyeStore.piyangoAllIkramiyeData = data.data
|
||||
}
|
||||
}
|
||||
|
||||
const SaveIkramiye = async () => {
|
||||
if (piyangoIkramiyeValidationStore.FormCheck()) {
|
||||
let dt: any
|
||||
piyangoIkramiyeStore.piyangoIkramiyeForm.birimFiyat = globalStore.floatEnLocale(piyangoIkramiyeStore.piyangoIkramiyeForm.birimFiyat)
|
||||
piyangoIkramiyeStore.piyangoIkramiyeForm.toplamDeger = globalStore.floatEnLocale(piyangoIkramiyeStore.piyangoIkramiyeForm.toplamDeger)
|
||||
|
||||
if (!piyangoIkramiyeStore.isUpdate) {
|
||||
piyangoIkramiyeStore.piyangoIkramiyeForm.cekilisId = piyangoStore.selectedLottery
|
||||
dt = await dataStore.dataPost('Ikramiye', {
|
||||
data: piyangoIkramiyeStore.piyangoIkramiyeForm
|
||||
})
|
||||
} else {
|
||||
dt = await dataStore.dataPut(
|
||||
'Ikramiye/' + piyangoIkramiyeStore.piyangoIkramiyeForm.id,
|
||||
{
|
||||
data: piyangoIkramiyeStore.piyangoIkramiyeForm
|
||||
}
|
||||
)
|
||||
}
|
||||
if (dt !== 'errorfalse') {
|
||||
piyangoIkramiyeStore.refreshList = true
|
||||
piyangoIkramiyeStore.isUpdate = false
|
||||
piyangoIkramiyeStore.ikramiyePanel = false
|
||||
}
|
||||
} else {
|
||||
piyangoIkramiyeValidationStore.isFormValid = true
|
||||
}
|
||||
}
|
||||
|
||||
return { GetAllIkramiyeler, SaveIkramiye }
|
||||
})
|
||||
87
src/module/cekilisler/service/piyangoKatilimciService.ts
Normal file
87
src/module/cekilisler/service/piyangoKatilimciService.ts
Normal file
@ -0,0 +1,87 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
import { usePiyangoKatilimciStore } from '../stores/piyangoKatilimciStore'
|
||||
import { usePiyangoKatilimciValidationStore } from '../validation/piyangoKatilimciValidationStore'
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
|
||||
export const usePiyangoKatilimciService = defineStore('piyangoKatilimciService', () => {
|
||||
const dataStore = useDataStore()
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const piyangoKatilimciStore = usePiyangoKatilimciStore()
|
||||
const piyangoKatilimciValidationStore = usePiyangoKatilimciValidationStore()
|
||||
const usersStore = useUsersStore()
|
||||
|
||||
const SaveKatilimciUser = async () => {
|
||||
if (piyangoKatilimciValidationStore.UserFormCheck()) {
|
||||
let form: any
|
||||
|
||||
if (!piyangoKatilimciStore.isPiyangoKatilimciUserUpdate) {
|
||||
delete piyangoKatilimciStore.piyangoKatilimciUserFormData.id
|
||||
delete piyangoKatilimciStore.piyangoKatilimciUserFormData.cekilis
|
||||
form = await dataStore.dataPost('Katilimci', {
|
||||
data: piyangoKatilimciStore.piyangoKatilimciUserFormData
|
||||
})
|
||||
} else {
|
||||
form = await dataStore.dataPut(
|
||||
'Katilimci/' + piyangoKatilimciStore.piyangoKatilimciUserFormData.id,
|
||||
{
|
||||
data: piyangoKatilimciStore.piyangoKatilimciUserFormData
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if (form !== 'errorfalse') {
|
||||
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
|
||||
piyangoKatilimciStore.katilimciUserPanel = false
|
||||
}
|
||||
|
||||
if (form !== 'errorfalse') {
|
||||
piyangoKatilimciStore.ResetFormData()
|
||||
}
|
||||
} else {
|
||||
piyangoKatilimciValidationStore.isUserFormValid = true
|
||||
}
|
||||
}
|
||||
|
||||
const CreateOnlineDraw = async () => {
|
||||
if (usersStore.isPanelUser) {
|
||||
let dt = await dataStore.dataGet(
|
||||
'Cekilis/CekilisDuzenle/' + piyangoStore.selectedLottery
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const KatilimciData = async (id: number): Promise<Record<string, any>> => {
|
||||
let dt = await dataStore.dataGet('Katilimci/' + id)
|
||||
|
||||
if (dt !== 'errorfalse') {
|
||||
return dt
|
||||
} else return {}
|
||||
}
|
||||
|
||||
const KatilimciFileUpload = async () => {
|
||||
if (piyangoKatilimciValidationStore.FileFormCheck()) {
|
||||
console.log('Katilimci File Upload')
|
||||
const formData = new FormData()
|
||||
formData.append('excelFile', piyangoKatilimciStore.piyangoKatilimciFileFormData.excelFile)
|
||||
let dt: any
|
||||
|
||||
dt = await dataStore.dataPost(
|
||||
'Katilimci/ExcelleYukle/' + piyangoStore.selectedLottery,
|
||||
{
|
||||
data: formData,
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
)
|
||||
if (dt !== 'errorfalse') {
|
||||
piyangoKatilimciStore.refreshPiyangoKatilimciList = true
|
||||
piyangoKatilimciStore.katilimciFilePanel = false
|
||||
}
|
||||
} else {
|
||||
piyangoKatilimciValidationStore.isFileFormValid = true
|
||||
}
|
||||
}
|
||||
|
||||
return { SaveKatilimciUser, CreateOnlineDraw, KatilimciData, KatilimciFileUpload }
|
||||
})
|
||||
95
src/module/cekilisler/service/piyangoTeminatService.ts
Normal file
95
src/module/cekilisler/service/piyangoTeminatService.ts
Normal file
@ -0,0 +1,95 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
import { usePiyangoTeminatStore } from '../stores/piyangoTeminatStore'
|
||||
import { usePiyangoTeminatValidationStore } from '../validation/piyangoTeminatValidationStore'
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
|
||||
export const usePiyangoTeminatService = defineStore('piyangoTeminatService', () => {
|
||||
const dataStore = useDataStore()
|
||||
const usersStore = useUsersStore()
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const piyangoTeminatStore = usePiyangoTeminatStore()
|
||||
const piyangoTeminatValidationStore = usePiyangoTeminatValidationStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const SaveTeminatDurum = async () => {
|
||||
if (piyangoTeminatValidationStore.FormCheck()) {
|
||||
let form: any
|
||||
let dataForm = new FormData()
|
||||
|
||||
dataForm.append('state', piyangoTeminatStore.piyangoTeminatFormData.state)
|
||||
dataForm.append('amount', globalStore.floatEnLocale(piyangoTeminatStore.piyangoTeminatFormData.amount))
|
||||
dataForm.append('bankName', piyangoTeminatStore.piyangoTeminatFormData.bankName)
|
||||
dataForm.append('bankBranch', piyangoTeminatStore.piyangoTeminatFormData.bankBranch)
|
||||
dataForm.append(
|
||||
'teminatParentType',
|
||||
piyangoTeminatStore.piyangoTeminatFormData.teminatParentType
|
||||
)
|
||||
dataForm.append(
|
||||
'teminantChildType',
|
||||
piyangoTeminatStore.piyangoTeminatFormData.teminantChildType
|
||||
)
|
||||
dataForm.append(
|
||||
'teminantDate',
|
||||
piyangoTeminatStore.piyangoTeminatFormData.teminantDate
|
||||
)
|
||||
dataForm.append('teminantNo', piyangoTeminatStore.piyangoTeminatFormData.teminantNo)
|
||||
dataForm.append('cekilisId', String(piyangoStore.selectedLottery))
|
||||
dataForm.append('kisiId', String(usersStore.userId))
|
||||
dataForm.append('file', piyangoTeminatStore.piyangoTeminatFormData.file)
|
||||
dataForm.append(
|
||||
'description',
|
||||
piyangoTeminatStore.piyangoTeminatFormData.description
|
||||
)
|
||||
if (piyangoTeminatStore.isNew) {
|
||||
form = await dataStore.dataPost('TeminantStates/', {
|
||||
data: dataForm,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
toast: { toast: 'Teminat durumu başarıyla kaydedildi', type: 'success' }
|
||||
})
|
||||
} else {
|
||||
form = await dataStore.dataPut(
|
||||
'TeminantStates/' + piyangoTeminatStore.piyangoTeminatFormData.id,
|
||||
{
|
||||
data: dataForm,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
toast: { toast: 'Teminat durumu başarıyla güncellendi', type: 'success' }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
if (form !== 'errorfalse') {
|
||||
piyangoTeminatStore.isNew = false
|
||||
piyangoTeminatValidationStore.formChanged = false
|
||||
piyangoTeminatStore.refreshList = true
|
||||
piyangoTeminatStore.teminatPanel = false
|
||||
}
|
||||
} else {
|
||||
piyangoTeminatValidationStore.isFormValid = true
|
||||
}
|
||||
}
|
||||
|
||||
const GetTeminatDurum = async () => {
|
||||
piyangoTeminatStore.loaded = false
|
||||
|
||||
let form = await dataStore.dataGet(
|
||||
'TeminantStates/' + piyangoTeminatStore.selectedTeminatId
|
||||
)
|
||||
|
||||
if (form !== 'errorfalse') {
|
||||
piyangoTeminatStore.isNew = false
|
||||
await Object.assign(piyangoTeminatStore.piyangoTeminatFormData, form)
|
||||
} else {
|
||||
await piyangoTeminatStore.ResetFormData()
|
||||
await piyangoTeminatStore.RestoreFormData()
|
||||
piyangoTeminatStore.isNew = true
|
||||
}
|
||||
setTimeout(() => {
|
||||
piyangoTeminatStore.loaded = true
|
||||
}, 30)
|
||||
}
|
||||
|
||||
return { SaveTeminatDurum, GetTeminatDurum }
|
||||
})
|
||||
66
src/module/cekilisler/stores/piyangoDataStore.ts
Normal file
66
src/module/cekilisler/stores/piyangoDataStore.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const usePiyangoDataStore = defineStore('piyangoDataStore', () => {
|
||||
const katilimciTeslimYontemi = ref<Record<string, any>[]>([])
|
||||
const cekilisYontemi = ref<Record<string, any>[]>([])
|
||||
const paraBirimleri = ref<Record<string, any>[]>([])
|
||||
const piyangoAmaclari = ref<Record<string, any>[]>([])
|
||||
const piyangoOnayDurumlari = ref<Record<string, any>[]>([])
|
||||
const piyangoTeminatDurumlari = ref<Record<string, any>[]>([])
|
||||
const piyangoTeminatTurleri = ref<Record<string, any>[]>([])
|
||||
const piyangoTeminatParaBirimleri = ref<Record<string, any>[]>([])
|
||||
|
||||
const digerHusularTexts = ref<string[]>([
|
||||
'- 18 yaşından küçükler piyango ve çekilişlere katılamaz, katılmış ve kazanmış olsalar bile ikramiyeleri verilmez.',
|
||||
'- İkramiyeye konu olan mal ve/veya hizmetin bedeli içinde bulunan vergiler(KDV-ÖTV) dışındaki vergi ve diğer yasal yükümlülükler talihliler tarafından ödenir.',
|
||||
'- 6698 sayılı Kişisel Verilerin Korunması Kanunu kapsamında aydınlatma yükümlülüğünün yerine getirilmesi ve KNOP çekilişlerine katılan katılımcılardan (kişisel verilerinin işlenmesine ve paylaşılmasına ilişkin) açık rızanın alınması önem arz etmektedir.',
|
||||
'- Bu hususlar, piyango ile ilgili tüm duyuru ve basılı materyallerde yer alacaktır',
|
||||
'- Piyango için, ilgili Mevzuat uyarınca diğer kurum ve kuruluşlardan izin alınması gerekmemektedir.'
|
||||
])
|
||||
const digerHusularYardimAmacliTexts = ref<string[]>([
|
||||
'- 18 yaşından küçükler piyango ve çekilişlere katılamaz, katılmış ve kazanmış olsalar bile ikramiyeleri verilmez.',
|
||||
'- İkramiyeye konu olan mal ve/veya hizmetin bedeli içinde bulunan vergiler(KDV-ÖTV) dışındaki vergi ve diğer yasal yükümlülükler talihliler tarafından ödenir.',
|
||||
'- 6698 sayılı Kişisel Verilerin Korunması Kanunu kapsamında aydınlatma yükümlülüğünün yerine getirilmesi ve KNOP çekilişlerine katılan katılımcılardan (kişisel verilerinin işlenmesine ve paylaşılmasına ilişkin) açık rızanın alınması önem arz etmektedir.',
|
||||
'- Bu hususlar, piyango ile ilgili tüm duyuru ve basılı materyallerde yer alacaktır',
|
||||
'- Tahrif edilmiş, yırtılmış, ilgili dernek mührü taşımayan biletlere ikramiye verilmeyecektir.',
|
||||
'- İkramiye tesliminde bilet ibrazı zorunludur.'
|
||||
])
|
||||
const fizikselYardimMessage = ref<string[]>([
|
||||
'- Çekiliş, bastırılan bilet adedini kapsayacak kadar numaralı toplarla çekilmesi suretiyle, noter huzurunda ve halka açık olarak gerçekleştirilecektir.'
|
||||
])
|
||||
|
||||
const fizikselTicariMessage = ref<string[]>([
|
||||
'- Toplam katılım sayısının rakam haneleri kadar içini göstermeyen torba veya kutulara yeterli adette konulan numaralı toplarla çekilmesi suretiyle, noter huzurunda ve halka açık olarak gerçekleştirilecektir.'
|
||||
])
|
||||
|
||||
const ikramiyeMessage = ref<string[]>([
|
||||
'- İkramiye olarak Türk Parası, döviz, tahvil, nakit gibi işlem gören değerli madenler ve taşlar ile bunlardan mamul eşya ile misli eşyalar konulamaz.',
|
||||
'- 2860 sayılı "Yardım Toplama Kanunu" gereğince, elde edilecek hasılatın (gelirin) %10\'dan daha az %40\'dan daha fazla ikramiye taahhüt edilemez.'
|
||||
])
|
||||
|
||||
const RemoveOnayDurumIncelemeBekleniyor = () => {
|
||||
const removeAdminIndex: number[] = [7, 8,14]
|
||||
for (let i: number = 0; i < removeAdminIndex.length; i++) {
|
||||
let ind = piyangoOnayDurumlari.value.findIndex((p) => p.islemId === removeAdminIndex[i])
|
||||
if (ind >= 0) piyangoOnayDurumlari.value.splice(ind, 1)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
katilimciTeslimYontemi,
|
||||
cekilisYontemi,
|
||||
paraBirimleri,
|
||||
piyangoAmaclari,
|
||||
piyangoOnayDurumlari,
|
||||
piyangoTeminatDurumlari,
|
||||
piyangoTeminatTurleri,
|
||||
piyangoTeminatParaBirimleri,
|
||||
digerHusularTexts,
|
||||
digerHusularYardimAmacliTexts,
|
||||
fizikselYardimMessage,
|
||||
fizikselTicariMessage,
|
||||
ikramiyeMessage,
|
||||
RemoveOnayDurumIncelemeBekleniyor
|
||||
}
|
||||
})
|
||||
102
src/module/cekilisler/stores/piyangoKatilimciStore.ts
Normal file
102
src/module/cekilisler/stores/piyangoKatilimciStore.ts
Normal file
@ -0,0 +1,102 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { usePiyangoStore } from './piyangoStore'
|
||||
import { usePiyangoKatilimciValidationStore } from '../validation/piyangoKatilimciValidationStore'
|
||||
|
||||
export const usePiyangoKatilimciStore = defineStore('piyangoKatilimciStore', () => {
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const piyangoKatilimciValidationStore = usePiyangoKatilimciValidationStore()
|
||||
|
||||
const piyangoKatilimciUserSafeFormData = reactive<Record<string, any>>({
|
||||
ikramiyeId: null,
|
||||
cekilisKatilimSiraNo: null,
|
||||
sifreCode: '',
|
||||
magazaKartNumarasi: '',
|
||||
adi: '',
|
||||
soyadi: '',
|
||||
dogumTarihi: '',
|
||||
telefonNo: '',
|
||||
evIkametgahAdresi: '',
|
||||
ilce: '',
|
||||
il: '',
|
||||
eposta: '',
|
||||
katilimTarihi: '',
|
||||
fisFaturaTarihi: '',
|
||||
fisFaturaNo: '',
|
||||
kampanyaliUrunTutari: null,
|
||||
toplamTutar: null,
|
||||
magazaAdiYeri: '',
|
||||
cekilisId: piyangoStore.selectedLottery,
|
||||
asilTalihli: false,
|
||||
yedekTalihli: false
|
||||
})
|
||||
|
||||
const piyangoKatilimciFileSafeFormData = reactive<Record<string, any>>({
|
||||
excelFile: ''
|
||||
})
|
||||
|
||||
const piyangoKatilimciUserFormData = reactive<Record<string, any>>({})
|
||||
const piyangoKatilimciFileFormData = reactive<Record<string, any>>({})
|
||||
const isPiyangoKatilimciUserUpdate = ref<boolean>(false)
|
||||
const refreshPiyangoKatilimciList = ref<boolean>(false)
|
||||
const loaded = ref<boolean>(false)
|
||||
const katilimciUserPanel = ref<boolean>(false)
|
||||
const katilimciFilePanel = ref<boolean>(false)
|
||||
const isNewKatilimci = ref<boolean>(false)
|
||||
|
||||
const drawDateControl = computed<boolean>(() => {
|
||||
let drawDate = new Date(piyangoStore.lotteryDrawDate)
|
||||
let today = new Date()
|
||||
drawDate.setHours(0, 0, 0, 0)
|
||||
today.setHours(0, 0, 0, 0)
|
||||
return today >= drawDate
|
||||
})
|
||||
|
||||
const ResetFormData = () => {
|
||||
loaded.value = false
|
||||
Object.assign(piyangoKatilimciUserFormData, piyangoKatilimciUserSafeFormData)
|
||||
piyangoKatilimciValidationStore.userFormChanged = false
|
||||
setTimeout(() => {
|
||||
loaded.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const RestoreUserFormData = () => {
|
||||
Object.assign(piyangoKatilimciUserFormData, piyangoKatilimciUserSafeFormData)
|
||||
delete piyangoKatilimciUserFormData.id
|
||||
}
|
||||
|
||||
const RestoreFileFormData = () => {
|
||||
Object.assign(piyangoKatilimciFileFormData, piyangoKatilimciFileSafeFormData)
|
||||
}
|
||||
|
||||
const ResetTalihli = () => {
|
||||
loaded.value = false
|
||||
piyangoKatilimciUserFormData.ikramiyeId = null
|
||||
piyangoKatilimciUserFormData.asilTalihli = false
|
||||
piyangoKatilimciUserFormData.yedekTalihli = false
|
||||
piyangoKatilimciValidationStore.userFormInvalidTexts.ikramiyeId = ''
|
||||
piyangoKatilimciValidationStore.userFormChanged = true
|
||||
setTimeout(() => {
|
||||
loaded.value = true
|
||||
}, 50)
|
||||
}
|
||||
|
||||
return {
|
||||
piyangoKatilimciUserSafeFormData,
|
||||
piyangoKatilimciFileSafeFormData,
|
||||
piyangoKatilimciUserFormData,
|
||||
piyangoKatilimciFileFormData,
|
||||
loaded,
|
||||
isPiyangoKatilimciUserUpdate,
|
||||
refreshPiyangoKatilimciList,
|
||||
katilimciUserPanel,
|
||||
katilimciFilePanel,
|
||||
drawDateControl,
|
||||
isNewKatilimci,
|
||||
ResetFormData,
|
||||
RestoreUserFormData,
|
||||
RestoreFileFormData,
|
||||
ResetTalihli
|
||||
}
|
||||
})
|
||||
105
src/module/cekilisler/stores/piyangoTalihliStore.ts
Normal file
105
src/module/cekilisler/stores/piyangoTalihliStore.ts
Normal file
@ -0,0 +1,105 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, reactive, computed } from 'vue'
|
||||
import { usePiyangoStore } from './piyangoStore'
|
||||
import { usePiyangoKatilimciValidationStore } from '../validation/piyangoKatilimciValidationStore'
|
||||
|
||||
export const usePiyangoTalihliStore = defineStore('piyangoTalihliStore', () => {
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const piyangoKatilimciValidationStore = usePiyangoKatilimciValidationStore()
|
||||
|
||||
const piyangoKatilimciUserSafeFormData = reactive<Record<string, any>>({
|
||||
ikramiyeId: null,
|
||||
cekilisKatilimSiraNo: null,
|
||||
sifreCode: '',
|
||||
magazaKartNumarasi: '',
|
||||
adi: '',
|
||||
soyadi: '',
|
||||
dogumTarihi: '',
|
||||
telefonNo: '',
|
||||
evIkametgahAdresi: '',
|
||||
ilce: '',
|
||||
il: '',
|
||||
eposta: '',
|
||||
katilimTarihi: '',
|
||||
fisFaturaTarihi: '',
|
||||
fisFaturaNo: '',
|
||||
kampanyaliUrunTutari: null,
|
||||
toplamTutar: null,
|
||||
magazaAdiYeri: '',
|
||||
cekilisId: piyangoStore.selectedLottery,
|
||||
asilTalihli: false,
|
||||
yedekTalihli: false
|
||||
})
|
||||
|
||||
const piyangoKatilimciFileSafeFormData = reactive<Record<string, any>>({
|
||||
excelFile: ''
|
||||
})
|
||||
|
||||
const piyangoKatilimciUserFormData = reactive<Record<string, any>>({})
|
||||
|
||||
const piyangoTalihliFileFormData = reactive<Record<string, any>>({})
|
||||
|
||||
|
||||
const isPiyangoKatilimciUserUpdate = ref<boolean>(false)
|
||||
const refreshPiyangoKatilimciList = ref<boolean>(false)
|
||||
const loaded = ref<boolean>(false)
|
||||
const katilimciUserPanel = ref<boolean>(false)
|
||||
const katilimciFilePanel = ref<boolean>(false)
|
||||
const isNewKatilimci = ref<boolean>(false)
|
||||
|
||||
const drawDateControl = computed<boolean>(() => {
|
||||
let drawDate = new Date(piyangoStore.lotteryDrawDate)
|
||||
let today = new Date()
|
||||
drawDate.setHours(0, 0, 0, 0)
|
||||
today.setHours(0, 0, 0, 0)
|
||||
return today >= drawDate
|
||||
})
|
||||
|
||||
const ResetFormData = () => {
|
||||
loaded.value = false
|
||||
Object.assign(piyangoKatilimciUserFormData, piyangoKatilimciUserSafeFormData)
|
||||
piyangoKatilimciValidationStore.userFormChanged = false
|
||||
setTimeout(() => {
|
||||
loaded.value = true
|
||||
})
|
||||
}
|
||||
|
||||
const RestoreUserFormData = () => {
|
||||
Object.assign(piyangoKatilimciUserFormData, piyangoKatilimciUserSafeFormData)
|
||||
delete piyangoKatilimciUserFormData.id
|
||||
}
|
||||
|
||||
const RestoreFileFormData = () => {
|
||||
Object.assign(piyangoTalihliFileFormData, piyangoKatilimciFileSafeFormData)
|
||||
}
|
||||
|
||||
const ResetTalihli = () => {
|
||||
loaded.value = false
|
||||
piyangoKatilimciUserFormData.ikramiyeId = null
|
||||
piyangoKatilimciUserFormData.asilTalihli = false
|
||||
piyangoKatilimciUserFormData.yedekTalihli = false
|
||||
piyangoKatilimciValidationStore.userFormInvalidTexts.ikramiyeId = ''
|
||||
piyangoKatilimciValidationStore.userFormChanged = true
|
||||
setTimeout(() => {
|
||||
loaded.value = true
|
||||
}, 50)
|
||||
}
|
||||
|
||||
return {
|
||||
piyangoKatilimciUserSafeFormData,
|
||||
piyangoKatilimciFileSafeFormData,
|
||||
piyangoKatilimciUserFormData,
|
||||
piyangoTalihliFileFormData,
|
||||
loaded,
|
||||
isPiyangoKatilimciUserUpdate,
|
||||
refreshPiyangoKatilimciList,
|
||||
katilimciUserPanel,
|
||||
katilimciFilePanel,
|
||||
drawDateControl,
|
||||
isNewKatilimci,
|
||||
ResetFormData,
|
||||
RestoreUserFormData,
|
||||
RestoreFileFormData,
|
||||
ResetTalihli
|
||||
}
|
||||
})
|
||||
59
src/module/cekilisler/stores/piyangoTeminatStore.ts
Normal file
59
src/module/cekilisler/stores/piyangoTeminatStore.ts
Normal file
@ -0,0 +1,59 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
import { usePiyangoStore } from './piyangoStore'
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
import { usePiyangoTeminatValidationStore } from '../validation/piyangoTeminatValidationStore'
|
||||
|
||||
export const usePiyangoTeminatStore = defineStore('piyangoTeminatStore', () => {
|
||||
const globalStore = useGlobalStore()
|
||||
const usersStore = useUsersStore()
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const piyangoTeminatValidationStore = usePiyangoTeminatValidationStore()
|
||||
|
||||
const piyangoTeminatSafeFormData = reactive<Record<string, any>>({
|
||||
state: 1,
|
||||
amount: null,
|
||||
bankName: '',
|
||||
bankBranch: '',
|
||||
teminatParentType: null,
|
||||
teminantChildType: null,
|
||||
teminantDate: '',
|
||||
teminantNo: null,
|
||||
cekilisId: piyangoStore.selectedLottery,
|
||||
kisiId: usersStore.userId,
|
||||
description: '',
|
||||
file: ''
|
||||
})
|
||||
|
||||
const piyangoTeminatFormData = reactive<Record<string, any>>({})
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
const isNew = ref<boolean>(false)
|
||||
const teminatPanel = ref<boolean>(false)
|
||||
const selectedTeminatId = ref<number|null>(null)
|
||||
const refreshList = ref<boolean>(false)
|
||||
|
||||
const ResetFormData = () => {
|
||||
loaded.value = false
|
||||
globalStore.ResetObject(piyangoTeminatFormData, piyangoTeminatSafeFormData)
|
||||
piyangoTeminatValidationStore.formChanged = false
|
||||
setTimeout(() => {
|
||||
loaded.value = true
|
||||
}, 30)
|
||||
}
|
||||
const RestoreFormData = () => {
|
||||
Object.assign(piyangoTeminatFormData, piyangoTeminatSafeFormData)
|
||||
}
|
||||
return {
|
||||
piyangoTeminatSafeFormData,
|
||||
piyangoTeminatFormData,
|
||||
loaded,
|
||||
isNew,
|
||||
teminatPanel,
|
||||
selectedTeminatId,
|
||||
refreshList,
|
||||
ResetFormData,
|
||||
RestoreFormData
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,144 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useValidationStore } from '@/stores/validationStore'
|
||||
import { usePiyangoKatilimciStore } from '../stores/piyangoKatilimciStore'
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
|
||||
export const usePiyangoKatilimciValidationStore = defineStore(
|
||||
'piyangoKatilimciValidationStore',
|
||||
() => {
|
||||
const piyangoKatilimciStore = usePiyangoKatilimciStore()
|
||||
const validationStore = useValidationStore()
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const dateStore = useDateStore()
|
||||
|
||||
const userFormChanged = ref<boolean>(false)
|
||||
const isUserFormValid = ref<boolean>(true)
|
||||
const isFileFormValid = ref<boolean>(true)
|
||||
const userFormInvalidTexts = reactive<Record<string, any>>({})
|
||||
const fileFormInvalidTexts = reactive<Record<string, any>>({})
|
||||
|
||||
const FileFormCheck = (): boolean => {
|
||||
Object.assign(userFormInvalidTexts, {})
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciFileFormData,
|
||||
fileFormInvalidTexts,
|
||||
'excelFile',
|
||||
'Lütfen dosya seçiniz'
|
||||
)
|
||||
|
||||
isFileFormValid.value = Object.keys(fileFormInvalidTexts).length === 0
|
||||
return isFileFormValid.value
|
||||
}
|
||||
|
||||
const UserFormCheck = (): boolean => {
|
||||
Object.assign(userFormInvalidTexts, {})
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData,
|
||||
userFormInvalidTexts,
|
||||
'eposta',
|
||||
'Lütfen e-posta adresini giriniz.'
|
||||
)
|
||||
|
||||
if (
|
||||
!validationStore.checkEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData.eposta
|
||||
)
|
||||
) {
|
||||
if (
|
||||
!validationStore.checkEmail(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData.eposta
|
||||
)
|
||||
) {
|
||||
userFormInvalidTexts.eposta =
|
||||
'Lütfen eposta adresinizi doğru formatta giriniz. Örn: isim@alanadi.td'
|
||||
isUserFormValid.value = false
|
||||
} else {
|
||||
delete userFormInvalidTexts.eposta
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!validationStore.checkEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData.telefonNo
|
||||
)
|
||||
) {
|
||||
if (piyangoKatilimciStore.piyangoKatilimciUserFormData.telefonNo.length !== 10) {
|
||||
userFormInvalidTexts.telefonNo =
|
||||
'Telefon Numaranız başında 0 olmadan 10 haneden oluşmalıdır.'
|
||||
isUserFormValid.value = false
|
||||
} else {
|
||||
delete userFormInvalidTexts.telefonNo
|
||||
}
|
||||
}
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData,
|
||||
userFormInvalidTexts,
|
||||
'adi',
|
||||
'Lütfen adını giriniz.'
|
||||
)
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData,
|
||||
userFormInvalidTexts,
|
||||
'sifreCode',
|
||||
'Lütfen katılım kodunu giriniz.'
|
||||
)
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData,
|
||||
userFormInvalidTexts,
|
||||
'soyadi',
|
||||
'Lütfen soyadını giriniz.'
|
||||
)
|
||||
|
||||
var today: Date | string = new Date()
|
||||
today = dateStore.dateFormat({
|
||||
date: today,
|
||||
pattern: 'yy-mm-dd'
|
||||
})
|
||||
|
||||
var ilanTarihi: string = dateStore.dateFormat({
|
||||
date: piyangoStore.lotteryIlanTarihi!,
|
||||
pattern: 'yy-mm-dd'
|
||||
})
|
||||
|
||||
if (
|
||||
(piyangoStore.lotteryDrawState || today === ilanTarihi) &&
|
||||
piyangoStore.lotteryApprove === 4 &&
|
||||
piyangoStore.lotteryData.cekilisYontemiId === 1
|
||||
) {
|
||||
if (
|
||||
((piyangoKatilimciStore.piyangoKatilimciUserFormData.asilTalihli ||
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData.yedekTalihli) &&
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData.ikramiyeId === null) ||
|
||||
(!piyangoKatilimciStore.piyangoKatilimciUserFormData.asilTalihli &&
|
||||
!piyangoKatilimciStore.piyangoKatilimciUserFormData.yedekTalihli &&
|
||||
piyangoKatilimciStore.piyangoKatilimciUserFormData.ikramiyeId !== null)
|
||||
) {
|
||||
userFormInvalidTexts.ikramiyeId =
|
||||
'Talihli tipi ve hediye seçimi birlikte yapılmış olmalıdır.'
|
||||
isUserFormValid.value = false
|
||||
} else {
|
||||
delete userFormInvalidTexts.ikramiyeId
|
||||
}
|
||||
}
|
||||
isUserFormValid.value = Object.keys(userFormInvalidTexts).length === 0
|
||||
return isUserFormValid.value
|
||||
}
|
||||
|
||||
return {
|
||||
userFormChanged,
|
||||
isUserFormValid,
|
||||
isFileFormValid,
|
||||
userFormInvalidTexts,
|
||||
fileFormInvalidTexts,
|
||||
FileFormCheck,
|
||||
UserFormCheck
|
||||
}
|
||||
}
|
||||
)
|
||||
@ -0,0 +1,45 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useValidationStore } from '@/stores/validationStore'
|
||||
import { usePiyangoTalihliStore } from '../stores/piyangoTalihliStore'
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
|
||||
export const usePiyangoTalihliValidationStore = defineStore(
|
||||
'piyangoTalihliValidationStore',
|
||||
() => {
|
||||
const piyangoTalihliStore = usePiyangoTalihliStore()
|
||||
const validationStore = useValidationStore()
|
||||
const piyangoStore = usePiyangoStore()
|
||||
const dateStore = useDateStore()
|
||||
|
||||
const userFormChanged = ref<boolean>(false)
|
||||
const isUserFormValid = ref<boolean>(true)
|
||||
const isFileFormValid = ref<boolean>(true)
|
||||
const userFormInvalidTexts = reactive<Record<string, any>>({})
|
||||
const fileFormInvalidTexts = reactive<Record<string, any>>({})
|
||||
|
||||
const FileFormCheck = (): boolean => {
|
||||
Object.assign(userFormInvalidTexts, {})
|
||||
|
||||
validationStore.IsFieldEmpty(
|
||||
piyangoTalihliStore.piyangoTalihliFileFormData,
|
||||
fileFormInvalidTexts,
|
||||
'excelFile',
|
||||
'Lütfen dosya seçiniz'
|
||||
)
|
||||
|
||||
isFileFormValid.value = Object.keys(fileFormInvalidTexts).length === 0
|
||||
return isFileFormValid.value
|
||||
}
|
||||
|
||||
return {
|
||||
userFormChanged,
|
||||
isUserFormValid,
|
||||
isFileFormValid,
|
||||
userFormInvalidTexts,
|
||||
fileFormInvalidTexts,
|
||||
FileFormCheck,
|
||||
}
|
||||
}
|
||||
)
|
||||
102
src/module/cekilisler/views/PiyangoDetay.vue
Normal file
102
src/module/cekilisler/views/PiyangoDetay.vue
Normal file
@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<AdminLayout>
|
||||
<Breadcrumb currentPageText="Piyango Detay" />
|
||||
<tabs :tabList="tabList" v-if="loaded">
|
||||
<template #piyangobilgileri>
|
||||
<tab-piyango-bilgileri-display
|
||||
v-if="
|
||||
usersStore.isPanelUser ||
|
||||
(piyangoStore.lotteryApprove !== 0 &&
|
||||
piyangoStore.lotteryApprove !== 3 &&
|
||||
piyangoStore.lotteryApprove !== 8)
|
||||
" />
|
||||
<tab-piyango-bilgileri v-else />
|
||||
</template>
|
||||
<template #katilimcilistesi><tab-piyango-katilimci-listesi /></template>
|
||||
<template #talihliler><tab-piyango-talihli-listesi /></template>
|
||||
<template #itirazsikayet><tab-piyango-itiraz /></template>
|
||||
<template #piyangologlari><tab-piyango-loglari /></template>
|
||||
<template #yetkilendirme>
|
||||
<tab-piyango-yetkilendirme />
|
||||
</template>
|
||||
<template #onaydurumu>
|
||||
<tab-piyango-onay-durumu v-if="usersStore.isPanelUser" />
|
||||
<tab-piyango-onay-durumu-user v-else />
|
||||
</template>
|
||||
<template #teminatlistesi>
|
||||
<tab-piyango-teminat-durumu />
|
||||
</template>
|
||||
</tabs>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onBeforeMount, ref } from 'vue'
|
||||
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
import { useDataStore } from '@/stores/dataStore'
|
||||
const dataStore = useDataStore()
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
|
||||
import AdminLayout from '@/layouts/AdminLayout.vue'
|
||||
import TabPiyangoYetkilendirme from '@/module/cekilisler/components/TabPiyangoYetkilendirme.vue'
|
||||
import TabPiyangoOnayDurumu from '@/module/cekilisler/components/TabPiyangoOnayDurumu.vue'
|
||||
import TabPiyangoOnayDurumuUser from '@/module/cekilisler/components/TabPiyangoOnayDurumuUser.vue'
|
||||
import TabPiyangoTeminatDurumu from '@/module/cekilisler/components/TabPiyangoTeminatDurumu.vue'
|
||||
import TabPiyangoLoglari from '@/module/cekilisler/components/TabPiyangoLoglari.vue'
|
||||
import TabPiyangoKatilimciListesi from '@/module/cekilisler/components/TabPiyangoKatilimciListesi.vue'
|
||||
import TabPiyangoTalihliListesi from '@/module/cekilisler/components/TabPiyangoTalihliListesi.vue'
|
||||
import TabPiyangoBilgileri from '@/module/cekilisler/components/TabPiyangoBilgileri.vue'
|
||||
import TabPiyangoBilgileriDisplay from '../components/TabPiyangoBilgileriDisplay.vue'
|
||||
import TabPiyangoItiraz from '@/module/cekilisler/components/TabPiyangoItiraz.vue'
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
const tabList = ref<Record<string, any>[]>([
|
||||
{ text: 'Piyango Bilgileri', id: 'piyangobilgileri' }
|
||||
])
|
||||
|
||||
const CreateTabs = () => {
|
||||
if (
|
||||
piyangoStore.lotteryApprove === 4 ||
|
||||
piyangoStore.lotteryApprove === 10 ||
|
||||
piyangoStore.lotteryApprove === 11 ||
|
||||
piyangoStore.lotteryApprove === 12 ||
|
||||
piyangoStore.lotteryApprove === 13 ||
|
||||
piyangoStore.lotteryApprove === 14 ||
|
||||
usersStore.isPanelUser
|
||||
) {
|
||||
tabList.value.push(
|
||||
{ text: 'Katılım Listesi', id: 'katilimcilistesi' },
|
||||
{ text: 'Talihliler', id: 'talihliler' },
|
||||
{ text: 'İtiraz/Şikayet', id: 'itirazsikayet' }
|
||||
)
|
||||
}
|
||||
if (usersStore.isPanelUser) {
|
||||
tabList.value.push(
|
||||
{ text: 'Piyango Logları', id: 'piyangologlari' },
|
||||
{ text: 'Yetkilendirme', id: 'yetkilendirme' }
|
||||
)
|
||||
}
|
||||
tabList.value.push({ text: 'Onay Durumu', id: 'onaydurumu' })
|
||||
|
||||
if (piyangoStore.lotteryApprove !== 0) {
|
||||
tabList.value.push({ text: 'Teminat Listesi', id: 'teminatlistesi' })
|
||||
}
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
piyangoStore.selectedLottery = Number(route.params.piyangoId)
|
||||
|
||||
const lotteryData: Record<string, any> = await dataStore.dataGet(
|
||||
'Cekilis/durum-sorgu/' + piyangoStore.selectedLottery
|
||||
)
|
||||
piyangoStore.SetLotteryControlData(lotteryData)
|
||||
|
||||
CreateTabs()
|
||||
|
||||
loaded.value = true
|
||||
})
|
||||
</script>
|
||||
233
src/module/cekilisler/views/PiyangoListe.vue
Normal file
233
src/module/cekilisler/views/PiyangoListe.vue
Normal file
@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<AdminLayout>
|
||||
<Breadcrumb currentPageText="Piyango Listesi" />
|
||||
<div
|
||||
class="form-inner-comment waiting-d"
|
||||
v-if="!usersStore.isPanelUser && usersStore.userApproveId !== 4">
|
||||
Üyeliğiniz onaylandıktan sonra Piyango ekleyebilirsiniz.
|
||||
</div>
|
||||
|
||||
<section class="section-list">
|
||||
<list-table-content
|
||||
v-if="loaded"
|
||||
:tableHeader="tableHeader"
|
||||
:rowAction="OpenPiyango"
|
||||
icon="draws"
|
||||
title="Piyangolar"
|
||||
listText="Piyango"
|
||||
:addRoute="addApiControl"
|
||||
:apiList="apiList"
|
||||
apiText="Piyango Listesi" />
|
||||
</section>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onBeforeMount } from 'vue'
|
||||
|
||||
import AdminLayout from '@/layouts/AdminLayout.vue'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
|
||||
const dateStore = useDateStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoDataStore } from '../stores/piyangoDataStore'
|
||||
const piyangoDataStore = usePiyangoDataStore()
|
||||
import { usePiyangoServices } from '../service/piyangoServices'
|
||||
const piyangoServices = usePiyangoServices()
|
||||
|
||||
import router from '@/router'
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
const apiList = ref<string>('')
|
||||
const addApiControl = ref<string>('')
|
||||
|
||||
if (usersStore.userApproveId === 4 && !usersStore.isPanelUser)
|
||||
addApiControl.value = 'yeni-piyango'
|
||||
|
||||
apiList.value = usersStore.isPanelUser
|
||||
? usersStore.isSuperAdmin
|
||||
? 'Cekilis/GetCekilislerList'
|
||||
: 'Cekilis/GetCekilislerListAtanan/' + usersStore.userId
|
||||
: 'Cekilis/GetCekilislerListDuzenleyen/' + usersStore.userId
|
||||
|
||||
const cekilisYontemleri = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.cekilisYontemi
|
||||
})
|
||||
|
||||
const piyangoAmaclari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoAmaclari
|
||||
})
|
||||
|
||||
const piyangoOnayDurumlari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoOnayDurumlari
|
||||
})
|
||||
|
||||
const tableHeader = computed<Record<string, any>[]>(() => {
|
||||
let header: Record<string, any>[] = []
|
||||
|
||||
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, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.olusturmaTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
})
|
||||
|
||||
if (usersStore.isVakifDernek || usersStore.isPanelUser) {
|
||||
header.push({
|
||||
name: 'cekilisTarihi',
|
||||
title: 'Çekiliş Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.cekilisTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: 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',
|
||||
range: 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',
|
||||
range: 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="back-grad ${piyangoStore.LoterryStatusClass(v.durum)}">
|
||||
${v.durum}
|
||||
</span>`
|
||||
},
|
||||
filter: {
|
||||
type: 'select',
|
||||
data: piyangoOnayDurumlari.value,
|
||||
listVal: 'id',
|
||||
listText: 'tipAdi',
|
||||
filterId: 'durumId'
|
||||
}
|
||||
}
|
||||
)
|
||||
if (usersStore.isPanelUser) {
|
||||
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.isPanelUser) {
|
||||
header.push({
|
||||
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 header
|
||||
})
|
||||
|
||||
// tablodan herhangi bir satır tıklayınca çalısır
|
||||
const OpenPiyango = (row: any) => {
|
||||
router.push('detay/' + row.id)
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await piyangoServices.GetCekilisYontemiList()
|
||||
await piyangoServices.GetPiyangoAmaclariList()
|
||||
await piyangoServices.GetPiyangoOnayDurumList()
|
||||
|
||||
loaded.value = true
|
||||
})
|
||||
</script>
|
||||
@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<section class="section-list">
|
||||
<list-table-content
|
||||
v-if="loaded"
|
||||
:tableHeader="tableHeader"
|
||||
:rowAction="rwAction"
|
||||
icon="users"
|
||||
title="Piyangolar"
|
||||
listText="Piyango"
|
||||
:apiList="apiList"
|
||||
apiText="Piyango Listesi" />
|
||||
</section>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onBeforeMount, computed } from 'vue'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
|
||||
const dateStore = useDateStore()
|
||||
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'
|
||||
const piyangoDataStore = usePiyangoDataStore()
|
||||
import { usePiyangoServices } from '@/module/cekilisler/service/piyangoServices'
|
||||
const piyangoServices = usePiyangoServices()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
|
||||
import router from '@/router'
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
const apiList = ref<string>('')
|
||||
|
||||
apiList.value = usersStore.isSuperAdmin
|
||||
? 'Cekilis/GetCekilislerListAtananAdmin/' + globalStore.selUser
|
||||
: 'Cekilis/GetCekilislerListAtanan/' + globalStore.selUser
|
||||
|
||||
const cekilisYontemleri = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.cekilisYontemi
|
||||
})
|
||||
|
||||
const piyangoAmaclari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoAmaclari
|
||||
})
|
||||
|
||||
const piyangoOnayDurumlari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoOnayDurumlari
|
||||
})
|
||||
|
||||
const tableHeader = ref<Record<string, any>[]>([
|
||||
{ name: 'duzenleyen', title: 'Düzenleyen', sort: true },
|
||||
{
|
||||
name: 'baslik',
|
||||
title: 'Başlık',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'piyangoamac',
|
||||
title: 'Piyango Amacı',
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'select',
|
||||
data: piyangoAmaclari,
|
||||
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',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'cekilisTarihi',
|
||||
title: 'Çekiliş Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.cekilisTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'baslangicTarihi',
|
||||
title: 'Başlangıç Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.baslangicTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'bitisTarihi',
|
||||
title: 'Bitis Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.bitisTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
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',
|
||||
computeHtml: (v: Record<string, any>): string => {
|
||||
return `<span class='back-grad ${piyangoStore.LoterryStatusClass(v.durum)}'>
|
||||
${v.durum}
|
||||
</span>`
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'select',
|
||||
data: piyangoOnayDurumlari.value,
|
||||
listVal: 'id',
|
||||
listText: 'tipAdi',
|
||||
filterId: 'durumId',
|
||||
style: { width: '10%' }
|
||||
}
|
||||
},
|
||||
{
|
||||
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>`
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
// tablodan herhangi bir satır tıklayınca çalısır
|
||||
const rwAction = (row: any) => {
|
||||
router.push('/piyangolar/detay/' + row.id)
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await piyangoServices.GetCekilisYontemiList()
|
||||
await piyangoServices.GetPiyangoAmaclariList()
|
||||
await piyangoServices.GetPiyangoOnayDurumList()
|
||||
|
||||
loaded.value = true
|
||||
})
|
||||
</script>
|
||||
211
src/module/muhasebe/views/MuhasebePiyangoListesi.vue
Normal file
211
src/module/muhasebe/views/MuhasebePiyangoListesi.vue
Normal file
@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<AdminLayout>
|
||||
<Breadcrumb currentPageText="Muhasebe / Piyango Listesi" />
|
||||
<section class="section-list">
|
||||
<list-table-content
|
||||
v-if="loaded"
|
||||
:tableHeader="tableHeader"
|
||||
:rowAction="OpenPiyango"
|
||||
icon="draws"
|
||||
title="Piyangolar"
|
||||
listText="Piyango"
|
||||
:apiList="'Cekilis/GetCekilislerListAtanan/' + usersStore.userId"
|
||||
apiText="Piyango Listesi" />
|
||||
</section>
|
||||
</AdminLayout>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onBeforeMount } from 'vue'
|
||||
|
||||
import AdminLayout from '@/layouts/AdminLayout.vue'
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
|
||||
const dateStore = useDateStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoDataStore } from '@/module/cekilisler/stores/piyangoDataStore'
|
||||
const piyangoDataStore = usePiyangoDataStore()
|
||||
import { usePiyangoServices } from '@/module/cekilisler/service/piyangoServices'
|
||||
const piyangoServices = usePiyangoServices()
|
||||
|
||||
import router from '@/router'
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
|
||||
const cekilisYontemleri = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.cekilisYontemi
|
||||
})
|
||||
|
||||
const piyangoAmaclari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoAmaclari
|
||||
})
|
||||
|
||||
const piyangoOnayDurumlari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoOnayDurumlari
|
||||
})
|
||||
|
||||
const tableHeader = computed<Record<string, any>[]>(() => {
|
||||
let header: Record<string, any>[] = []
|
||||
|
||||
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, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.olusturmaTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
if (usersStore.isVakifDernek || usersStore.isPanelUser) {
|
||||
header.push({
|
||||
name: 'cekilisTarihi',
|
||||
title: 'Çekiliş Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.cekilisTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: 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',
|
||||
range: 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',
|
||||
range: 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="back-grad ${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 header
|
||||
})
|
||||
|
||||
// tablodan herhangi bir satır tıklayınca çalısır
|
||||
const OpenPiyango = (row: any) => {
|
||||
router.push('/muhasebe/piyango-detay/' + row.id)
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await piyangoServices.GetCekilisYontemiList()
|
||||
await piyangoServices.GetPiyangoAmaclariList()
|
||||
await piyangoServices.GetPiyangoOnayDurumList()
|
||||
|
||||
loaded.value = true
|
||||
})
|
||||
</script>
|
||||
189
src/module/uyeler/components/TabUyePiyangolar.vue
Normal file
189
src/module/uyeler/components/TabUyePiyangolar.vue
Normal file
@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<section class="section-list">
|
||||
<list-table-content
|
||||
v-if="loaded"
|
||||
:tableHeader="tableHeader"
|
||||
:rowAction="rwAction"
|
||||
icon="draws"
|
||||
title="Piyangolar"
|
||||
listText="Piyango"
|
||||
:addRoute="PiyangoLink()"
|
||||
:apiList="apiList"
|
||||
apiText="Piyango Listesi" />
|
||||
</section>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onBeforeMount } from 'vue'
|
||||
|
||||
import { useDateStore } from '@/stores/dateStore'
|
||||
const dateStore = useDateStore()
|
||||
import { useGlobalStore } from '@/stores/globalStore'
|
||||
const globalStore = useGlobalStore()
|
||||
import { useGlobalDataStore } from '@/stores/globalDataStore'
|
||||
const globalDataStore = useGlobalDataStore()
|
||||
import { useUsersStore } from '@/stores/usersStore'
|
||||
const usersStore = useUsersStore()
|
||||
import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore'
|
||||
const piyangoStore = usePiyangoStore()
|
||||
import { usePiyangoDataStore } from '@/module/cekilisler/stores/piyangoDataStore'
|
||||
const piyangoDataStore = usePiyangoDataStore()
|
||||
import { usePiyangoServices } from '@/module/cekilisler/service/piyangoServices'
|
||||
const piyangoServices = usePiyangoServices()
|
||||
|
||||
import router from '@/router'
|
||||
|
||||
const loaded = ref<boolean>(false)
|
||||
const apiList = ref<string>('')
|
||||
|
||||
apiList.value = usersStore.isSuperAdmin
|
||||
? 'Cekilis/GetCekilislerListDuzenleyenAdmin/' + usersStore.selectedUserId()
|
||||
: 'Cekilis/GetCekilislerListDuzenleyen/' + usersStore.selectedUserId()
|
||||
|
||||
const cekilisYontemleri = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.cekilisYontemi
|
||||
})
|
||||
|
||||
const piyangoAmaclari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoAmaclari
|
||||
})
|
||||
|
||||
const piyangoOnayDurumlari = computed<Record<string, any>[]>(() => {
|
||||
return piyangoDataStore.piyangoOnayDurumlari
|
||||
})
|
||||
|
||||
const PiyangoLink = (): string => {
|
||||
if (usersStore.isPanelUser) return ''
|
||||
else return 'yeni-piyango'
|
||||
}
|
||||
|
||||
const tableHeader = ref<Record<string, any>[]>([
|
||||
{ name: 'duzenleyen', title: 'Düzenleyen', sort: true },
|
||||
{
|
||||
name: 'baslik',
|
||||
title: 'Başlık',
|
||||
sort: true,
|
||||
style: { width: '15%' }
|
||||
},
|
||||
{
|
||||
name: 'piyangoamac',
|
||||
title: 'Piyango Amacı',
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'select',
|
||||
data: piyangoAmaclari,
|
||||
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',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'cekilisTarihi',
|
||||
title: 'Çekiliş Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.cekilisTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'baslangicTarihi',
|
||||
title: 'Başlangıç Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.baslangicTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'bitisTarihi',
|
||||
title: 'Bitis Tarihi',
|
||||
compute: (v: Record<string, any>): string => {
|
||||
return dateStore.dateFormat({ date: v.bitisTarihi })
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'date',
|
||||
range: true
|
||||
}
|
||||
},
|
||||
{
|
||||
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='back-grad ${piyangoStore.LoterryStatusClass(v.durum)}'>
|
||||
${v.durum}
|
||||
</span>`
|
||||
},
|
||||
sort: true,
|
||||
filter: {
|
||||
type: 'select',
|
||||
data: piyangoOnayDurumlari.value,
|
||||
listVal: 'id',
|
||||
listText: 'tipAdi',
|
||||
filterId: 'durumId'
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
if (usersStore.isPanelUser) {
|
||||
tableHeader.value.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>`
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// tablodan herhangi bir satır tıklayınca çalısır
|
||||
const rwAction = (row: any) => {
|
||||
router.push('/piyangolar/detay/' + row.id)
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await piyangoServices.GetCekilisYontemiList()
|
||||
await piyangoServices.GetPiyangoAmaclariList()
|
||||
await piyangoServices.GetPiyangoOnayDurumList()
|
||||
|
||||
loaded.value = true
|
||||
})
|
||||
</script>
|
||||
210
src/stores/globalStore.ts
Normal file
210
src/stores/globalStore.ts
Normal file
@ -0,0 +1,210 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, reactive } from 'vue'
|
||||
import axios from 'axios'
|
||||
|
||||
export const useGlobalStore = defineStore('globalStore', () => {
|
||||
const menuLoaded = ref<boolean>(false)
|
||||
const animateTime = ref<number>(300)
|
||||
const sideMenu = ref<boolean>(true)
|
||||
const sideMenuWidth = ref<number>(0)
|
||||
const screenWidth = ref<number>(0)
|
||||
const mainPadding = ref<number>(24)
|
||||
const notificationPanel = ref<boolean>(false)
|
||||
const profileMenu = ref<boolean>(false)
|
||||
const breakPoints = reactive<Record<string, any>>({
|
||||
mobile: 576,
|
||||
tablet: 992,
|
||||
tabletp: 768
|
||||
})
|
||||
const perPage = ref<number>(10)
|
||||
const selUser = ref<number>(0)
|
||||
const selAuthUser = ref<number>(0)
|
||||
const selCustomer = ref<number>(0)
|
||||
const selCustomerType = ref<number>(0)
|
||||
const imageFormats = ref<string[]>(['png', 'jpg', 'jpeg', 'webp'])
|
||||
const docFormats = ref<string[]>(['doc', 'docx', 'xls', 'xlsx', 'pdf'])
|
||||
const allowFormats = ref<string[]>([
|
||||
'png',
|
||||
'jpg',
|
||||
'jpeg',
|
||||
'webp',
|
||||
'doc',
|
||||
'docx',
|
||||
'xls',
|
||||
'xlsx',
|
||||
'pdf'
|
||||
])
|
||||
|
||||
const trToLower = (s: string): string => {
|
||||
if (s === null || s == '' || s == undefined) {
|
||||
return ''
|
||||
} else {
|
||||
s = s.toString()
|
||||
var letters: { [key: string]: string } = {
|
||||
İ: 'i',
|
||||
I: 'ı',
|
||||
Ş: 'ş',
|
||||
Ğ: 'ğ',
|
||||
Ü: 'ü',
|
||||
Ö: 'ö',
|
||||
Ç: 'ç'
|
||||
}
|
||||
s = s.replace(/(([İIŞĞÜÇÖ]))/g, function (letter: string) {
|
||||
return letters[letter]
|
||||
})
|
||||
return s.toLowerCase()
|
||||
}
|
||||
}
|
||||
|
||||
const trToEngLower = (s: string): string => {
|
||||
if (s === null || s == '' || s == undefined) {
|
||||
return ''
|
||||
} else {
|
||||
s = s.toString()
|
||||
var letters: { [key: string]: string } = {
|
||||
İ: 'i',
|
||||
I: 'i',
|
||||
Ş: 's',
|
||||
Ğ: 'g',
|
||||
Ü: 'u',
|
||||
Ö: 'o',
|
||||
Ç: 'c',
|
||||
ı: 'i',
|
||||
ş: 's',
|
||||
ğ: 'g',
|
||||
ü: 'u',
|
||||
ö: 'o',
|
||||
ç: 'c'
|
||||
}
|
||||
s = s.replace(/(([İIŞĞÜÇÖışğüöç]))/g, function (letter: string) {
|
||||
return letters[letter]
|
||||
})
|
||||
return s.toLowerCase()
|
||||
}
|
||||
}
|
||||
|
||||
const trToUpper = (s: string): string => {
|
||||
if (s === null || s == '' || s == undefined) {
|
||||
return ''
|
||||
} else {
|
||||
s = s.toString()
|
||||
var letters: { [key: string]: string } = {
|
||||
i: 'İ',
|
||||
ş: 'Ş',
|
||||
ğ: 'Ğ',
|
||||
ü: 'Ü',
|
||||
ö: 'Ö',
|
||||
ç: 'Ç',
|
||||
ı: 'I'
|
||||
}
|
||||
if (s === null || s == '') {
|
||||
return ''
|
||||
} else {
|
||||
s = s.replace(/(([iışğüçö]))/g, function (letter: string) {
|
||||
return letters[letter]
|
||||
})
|
||||
return s.toUpperCase()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const toTrLocale = (
|
||||
num: number | string,
|
||||
prec?: number | string,
|
||||
curr?: string | number
|
||||
): string => {
|
||||
var val: string
|
||||
var opt: Record<string, any> = {}
|
||||
if (prec) {
|
||||
if (prec) opt.minimumFractionDigits = prec
|
||||
if (curr) {
|
||||
opt.style = 'currency'
|
||||
opt.currency = curr
|
||||
}
|
||||
val = new Intl.NumberFormat('tr-TR', opt).format(Number(num))
|
||||
} else {
|
||||
let d = num.toString().split('.')[1] ? num.toString().split('.')[1].length : 0
|
||||
opt.minimumFractionDigits = d
|
||||
val = new Intl.NumberFormat('tr-TR', opt).format(Number(num))
|
||||
}
|
||||
return String(val)
|
||||
}
|
||||
|
||||
const floatEnLocale = (num: number | string): string => {
|
||||
return num.toString().replace('.', '').replace(',', '.')
|
||||
}
|
||||
|
||||
const CreateSlug = (s: string, dlm?: string): string => {
|
||||
let slug = trToEngLower(s)
|
||||
let inDlm = dlm !== undefined ? dlm : '-'
|
||||
slug = slug.replace(/\W+/g, inDlm).toLowerCase()
|
||||
return slug
|
||||
}
|
||||
|
||||
const FileType = (s: string): string => {
|
||||
return s.slice(s.lastIndexOf('.') + 1)
|
||||
}
|
||||
|
||||
const FileName = (s: string): string => {
|
||||
if (s.includes('/')) return s.slice(s.lastIndexOf('/') + 1)
|
||||
else if (s.includes('\\')) return s.slice(s.lastIndexOf('\\') + 1)
|
||||
else return s.slice(s.lastIndexOf('/') + 1)
|
||||
}
|
||||
|
||||
const IsImage = (s: string): boolean => {
|
||||
return imageFormats.value.includes(FileType(s).toLocaleLowerCase())
|
||||
}
|
||||
|
||||
const TableCellDocument = (v: string) => {
|
||||
if (IsImage(v)) {
|
||||
return `<a href="${
|
||||
axios.defaults.baseURL + v
|
||||
}" target="_blank" onclick="event.stopPropagation()"><img class="table-cell-image" src="${
|
||||
axios.defaults.baseURL + v
|
||||
}" /></a>`
|
||||
} else {
|
||||
return `<a class="back-grad back-grad-grey" target="_blank" onclick="event.stopPropagation()" href="${
|
||||
axios.defaults.baseURL + v
|
||||
}">${FileName(v)}</a>`
|
||||
}
|
||||
}
|
||||
|
||||
const ResetObject = (target: Record<string, any>, base: Record<string, any>) => {
|
||||
Object.keys(target).forEach((tk) => {
|
||||
Object.keys(base).forEach((bk) => {
|
||||
if (base[tk] === undefined) delete target[tk]
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
menuLoaded,
|
||||
animateTime,
|
||||
sideMenu,
|
||||
sideMenuWidth,
|
||||
screenWidth,
|
||||
mainPadding,
|
||||
notificationPanel,
|
||||
profileMenu,
|
||||
breakPoints,
|
||||
perPage,
|
||||
selUser,
|
||||
selAuthUser,
|
||||
selCustomer,
|
||||
selCustomerType,
|
||||
imageFormats,
|
||||
docFormats,
|
||||
allowFormats,
|
||||
toTrLocale,
|
||||
floatEnLocale,
|
||||
trToLower,
|
||||
trToEngLower,
|
||||
trToUpper,
|
||||
CreateSlug,
|
||||
FileType,
|
||||
FileName,
|
||||
IsImage,
|
||||
TableCellDocument,
|
||||
ResetObject
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user