Dosya Kapam tabı işçin komponent ve store dosyaları eklendi
This commit is contained in:
10
src/module/cekilisler/components/TabPiyangoDosyaKapama.vue
Normal file
10
src/module/cekilisler/components/TabPiyangoDosyaKapama.vue
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<template>
|
||||||
|
<div class="form-content">
|
||||||
|
<div class="form-inner-content form-inner-content-left">
|
||||||
|
<form-piyango-dosya-kapama/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import FormPiyangoDosyaKapama from './form/FormPiyangoDosyaKapama.vue'
|
||||||
|
</script>
|
||||||
648
src/module/cekilisler/components/form/FormPiyangoDosyaKapama.vue
Normal file
648
src/module/cekilisler/components/form/FormPiyangoDosyaKapama.vue
Normal file
@ -0,0 +1,648 @@
|
|||||||
|
<template>
|
||||||
|
<div class="form-part form-title" v-if="piyangoStore.isNew">
|
||||||
|
<div class="form-title-buttons">
|
||||||
|
<div
|
||||||
|
class="button-c button-save"
|
||||||
|
@click="SaveData"
|
||||||
|
v-if="
|
||||||
|
!usersStore.isPanelUser &&
|
||||||
|
(!usersStore.isAraciFirma ||
|
||||||
|
(usersStore.isAraciFirma && piyangoStore.customerApproved))
|
||||||
|
">
|
||||||
|
Başvur
|
||||||
|
</div>
|
||||||
|
<router-link class="button-c button-cancel" to="/piyangolar/piyango-listesi">
|
||||||
|
Vazgeç
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div :class="['form-part', formChanged && !piyangoStore.isNew ? 'changed' : '']">
|
||||||
|
<div class="form-part-title">
|
||||||
|
<h4>Piyango Bilgileri</h4>
|
||||||
|
<div class="form-part-title-buttons" v-if="!usersStore.isPanelUser && !formChanged">
|
||||||
|
<button
|
||||||
|
@click="OpenPreviewPanel"
|
||||||
|
v-if="
|
||||||
|
piyangoStore.lotteryData.amacpiyangoId !== 3 && !piyangoStore.isNew && loaded
|
||||||
|
">
|
||||||
|
Önizleme
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-part-content" v-if="loaded">
|
||||||
|
<lottery-states :piyangoAmac="piyangoStore.lotteryData.amacpiyangoId" />
|
||||||
|
|
||||||
|
<form-input
|
||||||
|
modelKey="cekilisBaslik"
|
||||||
|
v-model="piyangoStore.lotteryData.baslik"
|
||||||
|
required
|
||||||
|
label="Piyango Başlığı"
|
||||||
|
placeholder="Piyango Başlığı"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.baslik"
|
||||||
|
@keyup="OnKeyup" />
|
||||||
|
|
||||||
|
<form-select
|
||||||
|
v-if="amacRefresh"
|
||||||
|
:disabled="usersStore.isVakifDernek || piyangoStore.subCustomerType === 22"
|
||||||
|
label="Piyango Amacı"
|
||||||
|
:listData="piyangoAmaclari"
|
||||||
|
listText="amacAdi"
|
||||||
|
listVal="id"
|
||||||
|
v-model="piyangoStore.lotteryData.amacpiyangoId"
|
||||||
|
required
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.amacpiyangoId"
|
||||||
|
@change="OnAmacChange" />
|
||||||
|
|
||||||
|
<template v-if="usersStore.isAraciFirma">
|
||||||
|
<form-select
|
||||||
|
label="Piyangoyu Düzenleyen"
|
||||||
|
:listData="childUsers"
|
||||||
|
listText="username"
|
||||||
|
listVal="id"
|
||||||
|
v-model="piyangoStore.lotteryData.duzenleyenId"
|
||||||
|
required
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.duzenleyenId"
|
||||||
|
@change="OnAraciFirmaChange">
|
||||||
|
<template #activator="data">
|
||||||
|
{{
|
||||||
|
data.activatorData !== undefined &&
|
||||||
|
piyangoValidationStore.invalidTexts.baglisirketId !== null
|
||||||
|
? data.activatorData.unvan + ' - ' + data.activatorData.basvuruTipi
|
||||||
|
: 'Lütfen Seçim Yapınız'
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
<template #option="data">
|
||||||
|
{{ data.optionData.unvan + ' - ' + data.optionData.basvuruTipi }}
|
||||||
|
</template>
|
||||||
|
<template #button v-if="piyangoStore.lotteryData.duzenleyenId !== null">
|
||||||
|
<router-link
|
||||||
|
:to="
|
||||||
|
'/uyeler/detay/' +
|
||||||
|
piyangoStore.lotteryData.baglisirketId +
|
||||||
|
'/yetkili-uye/detay/' +
|
||||||
|
piyangoStore.lotteryData.duzenleyenId
|
||||||
|
"
|
||||||
|
class="button-c">
|
||||||
|
Üyeyi Kontrol Et
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
|
</form-select>
|
||||||
|
<div
|
||||||
|
class="flx flx-jc-sb flx-ai-c form-inner-comment waiting-d"
|
||||||
|
v-if="
|
||||||
|
piyangoStore.lotteryData.duzenleyenId !== null &&
|
||||||
|
!piyangoStore.customerApproved
|
||||||
|
">
|
||||||
|
Yalnızca Onaylanmış Üyeler için piyango düzenlenebilir.
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template
|
||||||
|
v-if="
|
||||||
|
piyangoStore.lotteryData.amacpiyangoId !== 3 &&
|
||||||
|
piyangoStore.lotteryApprove !== 12
|
||||||
|
">
|
||||||
|
<form-textarea
|
||||||
|
v-if="piyangoStore.lotteryData.amacpiyangoId !== 2"
|
||||||
|
v-model="piyangoStore.lotteryData.cekilisSartveSekilleri"
|
||||||
|
required
|
||||||
|
label="Kampanya Katılma Şekil ve Şartları"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.cekilisSartveSekilleri"
|
||||||
|
@keyup="OnKeyup" />
|
||||||
|
|
||||||
|
<form-select
|
||||||
|
label="Kapsadığı Yerler"
|
||||||
|
:listData="globalDataStore.ilList"
|
||||||
|
listText="ad"
|
||||||
|
listVal="id"
|
||||||
|
v-model="piyangoStore.lotteryData.kapsamIl"
|
||||||
|
required
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.kapsamIl"
|
||||||
|
multiple
|
||||||
|
@change="OnKeyup"
|
||||||
|
multipleText="Türkiye Geneli" />
|
||||||
|
|
||||||
|
<template v-if="piyangoStore.lotteryData.amacpiyangoId !== 2">
|
||||||
|
<form-date
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="baslangicTarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.baslangicTarihi"
|
||||||
|
label="Kampanya Başlangıç Tarihi ve Saati"
|
||||||
|
:min="piyangoValidationStore.baslangicTarihiMin"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.baslangicTarihi"
|
||||||
|
@change="OnKeyupDate" />
|
||||||
|
|
||||||
|
<form-date
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="bitisTarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.bitisTarihi"
|
||||||
|
label="Kampanya Bitiş Tarihi ve Saati"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.bitisTarihi"
|
||||||
|
:min="piyangoValidationStore.kampanyaBitisMin"
|
||||||
|
:max="piyangoValidationStore.kampanyaBitisMax"
|
||||||
|
:disabled="piyangoValidationStore.kampanyaBitisDisabled"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<form-date
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="cekilisTarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.cekilisTarihi"
|
||||||
|
label="Çekiliş Tarihi ve Saati"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.cekilisTarihi"
|
||||||
|
:disabled="piyangoValidationStore.cekilisTarihiDisabled"
|
||||||
|
:min="piyangoValidationStore.cekilisTarihiMin"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="form-item form-item-half"
|
||||||
|
v-if="piyangoStore.lotteryData.amacpiyangoId === 2"></div>
|
||||||
|
|
||||||
|
<form-date
|
||||||
|
type="date"
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="ilantarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.ilantarihi"
|
||||||
|
label="İlan Tarihi"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.ilantarihi"
|
||||||
|
:disabled="piyangoValidationStore.ilanTarihiDisabled"
|
||||||
|
:min="piyangoValidationStore.ilanTarihiMin"
|
||||||
|
:max="piyangoValidationStore.ilanTarihiMax"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
<form-date
|
||||||
|
type="date"
|
||||||
|
v-if="piyangoStore.lotteryData.amacpiyangoId === 2"
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="ilantarihi2"
|
||||||
|
v-model="piyangoStore.lotteryData.ilantarihi2"
|
||||||
|
label="2. İlan Tarihi"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.ilantarihi2"
|
||||||
|
:disabled="piyangoValidationStore.ilanTarihi2Disabled"
|
||||||
|
:min="piyangoValidationStore.ilanTarihi2Min"
|
||||||
|
:max="piyangoValidationStore.ilanTarihi2Max"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
<form-date
|
||||||
|
type="date"
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="asilSonBasvuruTarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.asilSonBasvuruTarihi"
|
||||||
|
:label="
|
||||||
|
piyangoStore.lotteryData.amacpiyangoId === 2
|
||||||
|
? 'Talihlilerin Son Başvuru Tarihi'
|
||||||
|
: 'Asıl Talihli Son Başvuru Tarihi'
|
||||||
|
"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.asilSonBasvuruTarihi"
|
||||||
|
:disabled="piyangoValidationStore.asilSonBasvuruDisabled"
|
||||||
|
:min="piyangoValidationStore.asilSonBasvuruMin"
|
||||||
|
:max="piyangoValidationStore.asilSonBasvuruMax"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
|
||||||
|
<form-date
|
||||||
|
v-if="piyangoStore.lotteryData.amacpiyangoId !== 2"
|
||||||
|
type="date"
|
||||||
|
half
|
||||||
|
required
|
||||||
|
modelKey="yedekSonBasvuruTarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.yedekSonBasvuruTarihi"
|
||||||
|
label="Yedek Talihli Son Başvuru Tarihi"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.yedekSonBasvuruTarihi"
|
||||||
|
:disabled="piyangoValidationStore.yedekSonBasvuruDisabled"
|
||||||
|
:min="piyangoValidationStore.yedekSonBasvuruMin"
|
||||||
|
:max="piyangoValidationStore.yedekSonBasvuruMax"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
|
||||||
|
<form-date
|
||||||
|
half
|
||||||
|
required
|
||||||
|
type="date"
|
||||||
|
modelKey="ikramiyeTeslimTarihi"
|
||||||
|
v-model="piyangoStore.lotteryData.ikramiyeTeslimTarihi"
|
||||||
|
label="İkramiyelerin Son Teslim Tarihi"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.ikramiyeTeslimTarihi"
|
||||||
|
@change="OnKeyup"
|
||||||
|
:disabled="piyangoValidationStore.ikramiyeTeslimDisabled"
|
||||||
|
:min="piyangoValidationStore.ikramiyeTeslimMin"
|
||||||
|
:max="piyangoValidationStore.ikramiyeTeslimMax" />
|
||||||
|
|
||||||
|
<form-input
|
||||||
|
modelKey="ilanEdilecekGazete"
|
||||||
|
v-model="piyangoStore.lotteryData.ilanEdilecekGazete"
|
||||||
|
required
|
||||||
|
label="İlan Edilecek Gazete"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.ilanEdilecekGazete"
|
||||||
|
@keyup="OnKeyup" />
|
||||||
|
<form-select
|
||||||
|
label="Çekiliş Yapılacak İl"
|
||||||
|
half
|
||||||
|
:listData="globalDataStore.ilList"
|
||||||
|
listText="ad"
|
||||||
|
listVal="id"
|
||||||
|
v-model="piyangoStore.lotteryData.ilId"
|
||||||
|
required
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.ilId"
|
||||||
|
@change="ChangeIl" />
|
||||||
|
<form-select
|
||||||
|
half
|
||||||
|
label="Çekiliş Yapılacak İlçe"
|
||||||
|
:listData="ilceList"
|
||||||
|
listText="ad"
|
||||||
|
listVal="id"
|
||||||
|
v-model="piyangoStore.lotteryData.ilceId"
|
||||||
|
required
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.ilceId"
|
||||||
|
:disabled="ilceDisabled"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
<form-textarea
|
||||||
|
v-model="piyangoStore.lotteryData.adres"
|
||||||
|
required
|
||||||
|
label="Çekiliş Adresi"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.adres"
|
||||||
|
@keyup="OnKeyup" />
|
||||||
|
<template v-if="!piyangoStore.CheckForYardimAmacli()">
|
||||||
|
<form-textarea
|
||||||
|
v-model="piyangoStore.lotteryData.katilimListesi"
|
||||||
|
required
|
||||||
|
label="Katılımcı Listesinin İçeriği ve Hazırlanma Şekli"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.katilimListesi"
|
||||||
|
@keyup="OnKeyup" />
|
||||||
|
<form-radio
|
||||||
|
:listData="piyangoDataStore.katilimciTeslimYontemi"
|
||||||
|
listVal="id"
|
||||||
|
listText="deger"
|
||||||
|
title="Katılım Listesi Teslim Yöntemi"
|
||||||
|
v-model="piyangoStore.lotteryData.katilimciListesiTeslimYontemiId"
|
||||||
|
:invalidText="
|
||||||
|
piyangoValidationStore.invalidTexts.katilimciListesiTeslimYontemiId
|
||||||
|
"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
</template>
|
||||||
|
<div class="form-item">
|
||||||
|
<span class="form-item-title">Çekiliş Yöntemi</span>
|
||||||
|
<template v-for="(yontem, i) in piyangoDataStore.cekilisYontemi">
|
||||||
|
<form-radio
|
||||||
|
group="cekilisyontemi"
|
||||||
|
:val="yontem.id"
|
||||||
|
:label="yontem.deger"
|
||||||
|
title="Çekiliş Yöntemi"
|
||||||
|
v-model="piyangoStore.lotteryData.cekilisYontemiId"
|
||||||
|
:invalidText="piyangoValidationStore.invalidTexts.cekilisYontemiId"
|
||||||
|
@change="OnKeyup" />
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="form-item" v-if="piyangoStore.lotteryData.cekilisYontemiId === 1">
|
||||||
|
<ul>
|
||||||
|
<template v-if="piyangoStore.lotteryData.amacpiyangoId === 2">
|
||||||
|
<li v-for="txt in piyangoDataStore.fizikselYardimMessage">{{ txt }}</li>
|
||||||
|
</template>
|
||||||
|
<template v-if="piyangoStore.lotteryData.amacpiyangoId === 1">
|
||||||
|
<li v-for="txt in piyangoDataStore.fizikselTicariMessage">{{ txt }}</li>
|
||||||
|
</template>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<form-textarea
|
||||||
|
v-model="piyangoStore.lotteryData.digerHususlar"
|
||||||
|
label="Diğer Hususlar"
|
||||||
|
@keyup="OnKeyup" />
|
||||||
|
<div class="form-item">
|
||||||
|
<ul>
|
||||||
|
<template v-if="piyangoStore.isLotteryForCharity">
|
||||||
|
<li v-for="txty in piyangoDataStore.digerHusularYardimAmacliTexts">
|
||||||
|
{{ txty }}
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<li v-for="txt in piyangoDataStore.digerHusularTexts">
|
||||||
|
{{ txt }}
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div class="form-item" v-if="formChanged && !piyangoStore.isNew">
|
||||||
|
<button class="button-c button-save" @click="SaveData">Kaydet</button>
|
||||||
|
<button class="button-c button-cancel" @click="CancelSave">Vazgeç</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-part form-title" v-if="piyangoStore.isNew">
|
||||||
|
<div class="form-title-buttons">
|
||||||
|
<div class="button-c button-save" @click="SaveData">Başvur</div>
|
||||||
|
<router-link class="button-c button-cancel" to="/piyangolar/piyango-listesi">
|
||||||
|
Vazgeç
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<panel-wrapper
|
||||||
|
wide
|
||||||
|
v-if="previewPanel"
|
||||||
|
v-model="previewPanel"
|
||||||
|
panel-title="Piyango Bilgileri Önizleme">
|
||||||
|
<template #panelContent>
|
||||||
|
<panel-piyango-yardim-amacli-onizleme
|
||||||
|
v-model:id="previewId"
|
||||||
|
v-if="piyangoStore.lotteryData.amacpiyangoId === 2" />
|
||||||
|
<panel-piyango-onizleme v-model:id="previewId" v-else />
|
||||||
|
</template>
|
||||||
|
<template #footerButton>
|
||||||
|
<div class="button-c button-save" @click="DownloadPDF">PDF İndir</div>
|
||||||
|
<div class="button-c button-save" @click="PrintContent">Yazdır</div>
|
||||||
|
</template>
|
||||||
|
</panel-wrapper>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive, onBeforeMount, computed, nextTick } from 'vue'
|
||||||
|
import { usePDF } from 'vue3-pdfmake'
|
||||||
|
|
||||||
|
import PanelPiyangoOnizleme from '../panel/PanelPiyangoOnizleme.vue'
|
||||||
|
import PanelPiyangoYardimAmacliOnizleme from '../panel/PanelPiyangoYardimAmacliOnizleme.vue'
|
||||||
|
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||||
|
import LotteryStates from '../content/LotteryStates.vue'
|
||||||
|
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
const route = useRoute()
|
||||||
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
const usersStore = useUsersStore()
|
||||||
|
import { useGlobalDataStore } from '@/stores/globalDataStore'
|
||||||
|
const globalDataStore = useGlobalDataStore()
|
||||||
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
|
const validationStore = useValidationStore()
|
||||||
|
import { usePreviewStore } from '@/stores/previewStore'
|
||||||
|
const previewStore = usePreviewStore()
|
||||||
|
import { usePiyangoStore } from '../../stores/piyangoStore'
|
||||||
|
const piyangoStore = usePiyangoStore()
|
||||||
|
import { usePiyangoValidationStore } from '../../validation/piyangoValidationStore'
|
||||||
|
const piyangoValidationStore = usePiyangoValidationStore()
|
||||||
|
|
||||||
|
import { usePiyangoDataStore } from '../../stores/piyangoDataStore'
|
||||||
|
const piyangoDataStore = usePiyangoDataStore()
|
||||||
|
import { usePiyangoServices } from '../../service/piyangoServices'
|
||||||
|
const piyangoServices = usePiyangoServices()
|
||||||
|
|
||||||
|
import router from '@/router'
|
||||||
|
|
||||||
|
if (route.name === 'PiyangoDetay') piyangoStore.isNew = false
|
||||||
|
|
||||||
|
const loaded = ref<boolean>(false)
|
||||||
|
const formChanged = ref<boolean>(false)
|
||||||
|
const amacRefresh = ref<boolean>(false)
|
||||||
|
|
||||||
|
const previewPanel = ref<boolean>(false)
|
||||||
|
const previewId = ref<number>(0)
|
||||||
|
|
||||||
|
interface IIl {
|
||||||
|
[key: string]: any
|
||||||
|
ad: string
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const childUsers = ref<Record<string, any>[]>([])
|
||||||
|
const ilceList = ref<IIl[]>([])
|
||||||
|
|
||||||
|
const piyangoAmaclariSafe = ref<Record<string, any>[]>([])
|
||||||
|
const piyangoAmaclari = ref<Record<string, any>[]>([])
|
||||||
|
|
||||||
|
const ilceDisabled = computed<boolean>(() => {
|
||||||
|
return piyangoStore.lotteryData.ilId === null || ilceList.value.length === 0
|
||||||
|
})
|
||||||
|
|
||||||
|
const ChangeIl = (e: Event, v: string | number, d: Record<string, any>) => {
|
||||||
|
piyangoStore.lotteryData.ilceId = ''
|
||||||
|
ilceList.value = d.ilceler
|
||||||
|
formChanged.value = true
|
||||||
|
}
|
||||||
|
const OnKeyup = () => {
|
||||||
|
formChanged.value = true
|
||||||
|
}
|
||||||
|
const OnAmacChange = (e: Event, d: any) => {
|
||||||
|
formChanged.value = true
|
||||||
|
piyangoStore.lotteryPurposeId = d
|
||||||
|
}
|
||||||
|
const OnKeyupDate = () => {
|
||||||
|
formChanged.value = true
|
||||||
|
piyangoValidationStore.dateChanged = true
|
||||||
|
}
|
||||||
|
const GetData = async () => {
|
||||||
|
piyangoStore.ResetLotteryContent()
|
||||||
|
|
||||||
|
let data = await dataStore.dataGet(
|
||||||
|
'CekilisBilgi/Cekilis/' + piyangoStore.selectedLottery
|
||||||
|
)
|
||||||
|
|
||||||
|
if (data !== 'errorfalse') {
|
||||||
|
Object.assign(piyangoStore.lotteryData, data)
|
||||||
|
|
||||||
|
if (
|
||||||
|
piyangoStore.lotteryData.ilceId !== undefined &&
|
||||||
|
piyangoStore.lotteryData.ilceId !== null &&
|
||||||
|
piyangoStore.lotteryData.ilceId !== ''
|
||||||
|
) {
|
||||||
|
let ilO = globalDataStore.ilList.filter((v: Record<string, any>) => {
|
||||||
|
return v.id === piyangoStore.lotteryData.ilId
|
||||||
|
})
|
||||||
|
if (ilO.length !== 0)
|
||||||
|
ilceList.value.splice(0, ilceList.value.length, ...(ilO[0]['ilceler'] as IIl[]))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (piyangoStore.lotteryData.amacpiyangoId === 2) {
|
||||||
|
piyangoStore.subCustomerType = 22
|
||||||
|
piyangoAmaclari.value.splice(
|
||||||
|
0,
|
||||||
|
piyangoAmaclari.value.length,
|
||||||
|
...piyangoAmaclariSafe.value
|
||||||
|
)
|
||||||
|
|
||||||
|
piyangoStore.lotteryIlanTarihi = piyangoStore.lotteryData.ilantarihi
|
||||||
|
piyangoStore.lotteryCreationDate = piyangoStore.lotteryData.olusturmaTarihi
|
||||||
|
}
|
||||||
|
|
||||||
|
await SetAraciFirmaSelect()
|
||||||
|
if (piyangoStore.lotteryData.baglisirketId !== null) await GetAraciUye()
|
||||||
|
|
||||||
|
Object.assign(piyangoStore.safeLotteryData, piyangoStore.lotteryData)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
loaded.value = true
|
||||||
|
}, 30)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const SaveData = async () => {
|
||||||
|
if (piyangoValidationStore.FormCheck()) {
|
||||||
|
let form: any
|
||||||
|
if (piyangoStore.CheckForYardimAmacli())
|
||||||
|
piyangoStore.lotteryData.katilimListesi = ''
|
||||||
|
|
||||||
|
if (piyangoStore.isNew) {
|
||||||
|
let inData = Object.assign({}, piyangoStore.lotteryData)
|
||||||
|
inData.amac = ''
|
||||||
|
delete inData.baslik
|
||||||
|
delete inData.duzenleyenId
|
||||||
|
delete inData.amacpiyangoId
|
||||||
|
delete inData.baglisirketId
|
||||||
|
|
||||||
|
form = await dataStore.dataPost('Cekilis/', {
|
||||||
|
data: {
|
||||||
|
baslik: piyangoStore.lotteryData.baslik,
|
||||||
|
duzenleyenId: piyangoStore.lotteryData.duzenleyenId,
|
||||||
|
amacpiyangoId: piyangoStore.lotteryData.amacpiyangoId,
|
||||||
|
baglisirketId: piyangoStore.lotteryData.baglisirketId,
|
||||||
|
cekilisBilgiler: [inData]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
let inData = Object.assign({}, piyangoStore.lotteryData)
|
||||||
|
inData.amac = ''
|
||||||
|
form = await dataStore.dataPut('Cekilis/' + piyangoStore.selectedLottery, {
|
||||||
|
data: inData
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (form !== 'errorfalse') {
|
||||||
|
formChanged.value = false
|
||||||
|
piyangoValidationStore.dateChanged = false
|
||||||
|
loaded.value = false
|
||||||
|
if (piyangoStore.isNew) {
|
||||||
|
piyangoStore.selectedLottery = form.id
|
||||||
|
piyangoStore.lotteryApprove = 0
|
||||||
|
piyangoStore.isNew = false
|
||||||
|
piyangoStore.ResetLotteryData()
|
||||||
|
router.push('/piyangolar/detay/' + form.id)
|
||||||
|
} else {
|
||||||
|
GetData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
piyangoValidationStore.isFormValid = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const CancelSave = () => {
|
||||||
|
Object.assign(piyangoStore.lotteryData, piyangoStore.safeLotteryData)
|
||||||
|
formChanged.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const OnAraciFirmaChange = (e: Event, val: any, item: Record<string, any>) => {
|
||||||
|
piyangoStore.subCustomerType = item.basvuruTipId
|
||||||
|
piyangoStore.customerApproved = item.islemTipId === 4
|
||||||
|
|
||||||
|
Object.assign(piyangoStore.duzenleyenData, item)
|
||||||
|
AmacList()
|
||||||
|
formChanged.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const RemoveAmac = () => {
|
||||||
|
let amacInd = piyangoAmaclari.value.findIndex((p) => p.id === 2)
|
||||||
|
if (amacInd >= 0) piyangoAmaclari.value.splice(amacInd, 1)
|
||||||
|
}
|
||||||
|
const GetDuzenleyen = (id: number) => {
|
||||||
|
var duzenleyen = childUsers.value.filter((p) => {
|
||||||
|
return p.id === id
|
||||||
|
})[0]
|
||||||
|
|
||||||
|
Object.assign(piyangoStore.duzenleyenData, duzenleyen)
|
||||||
|
}
|
||||||
|
|
||||||
|
const GetAraciUye = async () => {
|
||||||
|
let data = await dataStore.dataGet(
|
||||||
|
'Auth/userbyuserid/' + piyangoStore.lotteryData.duzenleyenId
|
||||||
|
)
|
||||||
|
if (data !== 'errorfalse') {
|
||||||
|
Object.assign(piyangoStore.araciUyeData, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const AmacList = () => {
|
||||||
|
amacRefresh.value = false
|
||||||
|
if (piyangoStore.CheckForYardimAmacli()) {
|
||||||
|
piyangoAmaclari.value.splice(
|
||||||
|
0,
|
||||||
|
piyangoAmaclari.value.length,
|
||||||
|
...piyangoAmaclariSafe.value
|
||||||
|
)
|
||||||
|
|
||||||
|
piyangoStore.lotteryData.amacpiyangoId = 2
|
||||||
|
} else {
|
||||||
|
RemoveAmac()
|
||||||
|
if (piyangoStore.lotteryData.amacpiyangoId === 2)
|
||||||
|
piyangoStore.lotteryData.amacpiyangoId = null
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
amacRefresh.value = true
|
||||||
|
}, 30)
|
||||||
|
}
|
||||||
|
|
||||||
|
const OpenPreviewPanel = () => {
|
||||||
|
previewPanel.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const pdfmake = usePDF()
|
||||||
|
const DownloadPDF = async () => {
|
||||||
|
var pdfData: string = document.querySelector('.pdf-content')?.outerHTML || ''
|
||||||
|
previewStore.CreatePdfFromHtml(pdfmake, pdfData)
|
||||||
|
}
|
||||||
|
|
||||||
|
const PrintContent = () => {
|
||||||
|
previewStore.PrintContent(previewId.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const SetAraciFirmaSelect = async () => {
|
||||||
|
if (usersStore.isAraciFirma) {
|
||||||
|
let id = piyangoStore.isNew
|
||||||
|
? usersStore.userId
|
||||||
|
: piyangoStore.lotteryData.baglisirketId
|
||||||
|
|
||||||
|
let list = await dataStore.dataGet('Auth/userbyuserChildList/' + id)
|
||||||
|
|
||||||
|
childUsers.value = list.data.filter((p:Record<string,any>) => {
|
||||||
|
return p.islemTipId === 4 || p.islemTipi === 'Üyelik Onaylandı'
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!piyangoStore.isNew) {
|
||||||
|
await GetDuzenleyen(piyangoStore.lotteryData.duzenleyenId)
|
||||||
|
piyangoStore.customerApproved = piyangoStore.duzenleyenData.islemTipi === 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
if (route.name === 'PiyangoYeni') piyangoStore.isNew = true
|
||||||
|
|
||||||
|
await dataStore.GetIlList()
|
||||||
|
await piyangoServices.GetKatilimciTeslimYontemiList()
|
||||||
|
await piyangoServices.GetCekilisYontemiList()
|
||||||
|
await dataStore.GetCustomerTipList()
|
||||||
|
|
||||||
|
const amaclar = await dataStore.dataGet('PiyangoAmac')
|
||||||
|
|
||||||
|
piyangoAmaclari.value.splice(0, piyangoAmaclari.value.length, ...amaclar)
|
||||||
|
piyangoAmaclariSafe.value.splice(0, piyangoAmaclariSafe.value.length, ...amaclar)
|
||||||
|
AmacList()
|
||||||
|
|
||||||
|
if (piyangoStore.isNew) {
|
||||||
|
SetAraciFirmaSelect()
|
||||||
|
piyangoStore.ResetLotteryData()
|
||||||
|
|
||||||
|
piyangoStore.lotteryData.duzenleyenId = usersStore.isAraciFirma
|
||||||
|
? null
|
||||||
|
: usersStore.userId
|
||||||
|
|
||||||
|
piyangoStore.lotteryData.baglisirketId = usersStore.isAraciFirma
|
||||||
|
? usersStore.userId
|
||||||
|
: null
|
||||||
|
|
||||||
|
if (usersStore.isVakifDernek) piyangoStore.lotteryData.amacpiyangoId = 2
|
||||||
|
loaded.value = true
|
||||||
|
} else {
|
||||||
|
await GetData()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
53
src/module/cekilisler/service/piyangoDosyaKapamaService.ts
Normal file
53
src/module/cekilisler/service/piyangoDosyaKapamaService.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
|
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||||
|
import { usePiyangoDosyaKapamaStore } from '../stores/piyangoDosyaKapamaStore'
|
||||||
|
import { usePiyangoDosyaKapamaValidationStore } from '../validation/piyangoDosyaKapamaValidationStore'
|
||||||
|
|
||||||
|
export const usePiyangoDosyaKapamaService = defineStore(
|
||||||
|
'piyangoDosyaKapamaService',
|
||||||
|
() => {
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
const piyangoStore = usePiyangoStore()
|
||||||
|
const piyangoDosyaKapamaStore = usePiyangoDosyaKapamaStore()
|
||||||
|
const piyangoDosyaKapamaValidationStore = usePiyangoDosyaKapamaValidationStore()
|
||||||
|
|
||||||
|
const GetDosyaKapama = async () => {
|
||||||
|
let data: Record<string, any> | any = await dataStore.dataGet(
|
||||||
|
'Mecra/Cekilis/' + piyangoStore.selectedLottery
|
||||||
|
)
|
||||||
|
|
||||||
|
if (data !== 'errorfalse') {
|
||||||
|
Object.assign(piyangoDosyaKapamaStore.dosyaKapamaData, data.data)
|
||||||
|
Object.assign(piyangoDosyaKapamaStore.safeDosyaKapamaata, data.data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const SaveDosyaKapama = async () => {
|
||||||
|
if (piyangoDosyaKapamaValidationStore.FormCheck()) {
|
||||||
|
let dt: any
|
||||||
|
dataStore.panelData.yayinlanacagiTarih = new Date(
|
||||||
|
dataStore.panelData.yayinlanacagiTarih
|
||||||
|
)
|
||||||
|
if (!piyangoDosyaKapamaStore.isUpdate) {
|
||||||
|
piyangoMecraStore.piyangoMecraForm.cekilisId = piyangoStore.selectedLottery
|
||||||
|
dt = await dataStore.dataPost('Mecra', {
|
||||||
|
data: piyangoMecraStore.piyangoMecraForm
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
dt = await dataStore.dataPut('Mecra/' + piyangoMecraStore.piyangoMecraForm.id, {
|
||||||
|
data: piyangoMecraStore.piyangoMecraForm
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (dt !== 'errorfalse') {
|
||||||
|
piyangoDosyaKapamaStore.isUpdate = false
|
||||||
|
await GetDosyaKapama()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
piyangoDosyaKapamaValidationStore.isFormValid = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { GetDosyaKapama, SaveDosyaKapama }
|
||||||
|
}
|
||||||
|
)
|
||||||
37
src/module/cekilisler/stores/piyangoDosyaKapamaStore.ts
Normal file
37
src/module/cekilisler/stores/piyangoDosyaKapamaStore.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useGlobalStore } from '@/stores/globalStore'
|
||||||
|
|
||||||
|
export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore', () => {
|
||||||
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
|
const baseDosyaKapamaData = reactive<Record<string, any>>({
|
||||||
|
adSoyad: '',
|
||||||
|
telefonNumarasi: '',
|
||||||
|
faksNumarasi: '',
|
||||||
|
eposta: '',
|
||||||
|
unvan: ''
|
||||||
|
})
|
||||||
|
const dosyaKapamaData = reactive<Record<string, any>>({})
|
||||||
|
const safeDosyaKapamaata = reactive<Record<string, any>>({})
|
||||||
|
const isUpdate = ref<boolean>(false)
|
||||||
|
|
||||||
|
const ResetFormData = () => {
|
||||||
|
globalStore.ResetObject(dosyaKapamaData, baseDosyaKapamaData)
|
||||||
|
Object.assign(dosyaKapamaData, baseDosyaKapamaData)
|
||||||
|
}
|
||||||
|
|
||||||
|
const RestoreFormData = () => {
|
||||||
|
globalStore.ResetObject(dosyaKapamaData, baseDosyaKapamaData)
|
||||||
|
Object.assign(dosyaKapamaData, safeDosyaKapamaata)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
baseDosyaKapamaData,
|
||||||
|
dosyaKapamaData,
|
||||||
|
safeDosyaKapamaata,
|
||||||
|
isUpdate,
|
||||||
|
ResetFormData,
|
||||||
|
RestoreFormData
|
||||||
|
}
|
||||||
|
})
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
|
import { usePiyangoDosyaKapamaStore } from '../stores/piyangoDosyaKapamaStore'
|
||||||
|
|
||||||
|
export const usePiyangoMecraValidationStore = defineStore(
|
||||||
|
'piyangoMecraValidationStore',
|
||||||
|
() => {
|
||||||
|
const piyangoDosyaKapamaStore = usePiyangoDosyaKapamaStore()
|
||||||
|
const validationStore = useValidationStore()
|
||||||
|
|
||||||
|
const formChanged = ref<boolean>(false)
|
||||||
|
const isFormValid = ref<boolean>(true)
|
||||||
|
const invalidTexts = reactive<Record<string, any>>({})
|
||||||
|
|
||||||
|
const FormCheck = (): boolean => {
|
||||||
|
Object.assign(invalidTexts, {})
|
||||||
|
|
||||||
|
validationStore.IsFieldEmpty(
|
||||||
|
piyangoDosyaKapamaStore.dosyaKapamaData,
|
||||||
|
invalidTexts,
|
||||||
|
'mecraAdi',
|
||||||
|
'Yayınlanacak mecranın adını yazınız.'
|
||||||
|
)
|
||||||
|
|
||||||
|
isFormValid.value = Object.keys(invalidTexts).length === 0
|
||||||
|
return isFormValid.value
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
formChanged,
|
||||||
|
isFormValid,
|
||||||
|
invalidTexts,
|
||||||
|
FormCheck
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
@ -26,6 +26,9 @@
|
|||||||
<template #teminatlistesi>
|
<template #teminatlistesi>
|
||||||
<tab-piyango-teminat-durumu />
|
<tab-piyango-teminat-durumu />
|
||||||
</template>
|
</template>
|
||||||
|
<template #dosyakapama>
|
||||||
|
<tab-piyango-teminat-durumu />
|
||||||
|
</template>
|
||||||
</tabs>
|
</tabs>
|
||||||
</AdminLayout>
|
</AdminLayout>
|
||||||
</template>
|
</template>
|
||||||
@ -85,6 +88,10 @@
|
|||||||
if (piyangoStore.lotteryApprove !== 0) {
|
if (piyangoStore.lotteryApprove !== 0) {
|
||||||
tabList.value.push({ text: 'Teminat Listesi', id: 'teminatlistesi' })
|
tabList.value.push({ text: 'Teminat Listesi', id: 'teminatlistesi' })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (usersStore.isPanelUser && piyangoStore.lotteryDrawState) {
|
||||||
|
tabList.value.push({ text: 'Dossya Kapama', id: 'dosyakapama' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user