Add PiyangoDetay component "Çekiliş Tutanağı" tab. Import new TabPiyangoCekilisTutanagi component and enhance tab list structure for improved user navigation.
This commit is contained in:
@ -0,0 +1,19 @@
|
|||||||
|
<template>
|
||||||
|
<form-piyango-cekilis-tutanagi-display
|
||||||
|
v-if="
|
||||||
|
usersStore.isPanelUser ||
|
||||||
|
(piyangoStore.lotteryApprove !== 0 &&
|
||||||
|
piyangoStore.lotteryApprove !== 3 &&
|
||||||
|
piyangoStore.lotteryApprove !== 8)
|
||||||
|
" />
|
||||||
|
<form-piyango-cekilis-tutanagi v-else />
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
const usersStore = useUsersStore()
|
||||||
|
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||||
|
const piyangoStore = usePiyangoStore()
|
||||||
|
import FormPiyangoCekilisTutanagi from './form/FormPiyangoCekilisTutanagi.vue'
|
||||||
|
import FormPiyangoCekilisTutanagiDisplay from './display/FormPiyangoCekilisTutanagiDisplay.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<div class="form-part">
|
||||||
|
<div class="form-part-title">
|
||||||
|
<h4>Çekiliş Tutanağı</h4>
|
||||||
|
<div class="form-part-title-buttons">
|
||||||
|
<icon-button
|
||||||
|
v-if="usersStore.isPanelUser"
|
||||||
|
icon="plus"
|
||||||
|
class="ico-section ico-section-header-btn"
|
||||||
|
@click="AddNewDocument" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-part-content" v-if="cekilisTutanagiStore.loaded">
|
||||||
|
<template v-if="cekilisTutanagiStore.cekilisTutanagiList.length > 0">
|
||||||
|
<template v-for="(file, i) in cekilisTutanagiStore.cekilisTutanagiList">
|
||||||
|
<file-list-item
|
||||||
|
:editable="false"
|
||||||
|
:data="file"
|
||||||
|
title="dokumanAdi"
|
||||||
|
:filePath="file.url">
|
||||||
|
<template #actionButtons v-if="usersStore.isPanelUser">
|
||||||
|
<i
|
||||||
|
class="ico-c ico-btn ico-section back-grad-alert"
|
||||||
|
@click.stop="DeleteDocumentPop(file)">
|
||||||
|
<svg><use href="/src/assets/images/icons.svg#trash"></use></svg>
|
||||||
|
</i>
|
||||||
|
</template>
|
||||||
|
</file-list-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="form-inner-comment" v-if="usersStore.isPanelUser">
|
||||||
|
Eklenmiş dosya bulunamadı.
|
||||||
|
</div>
|
||||||
|
<div class="form-inner-comment" v-else>
|
||||||
|
Eklenmiş dosya bulunamadı.
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<panel-wrapper
|
||||||
|
v-if="cekilisTutanagiStore.documentPanel"
|
||||||
|
v-model="cekilisTutanagiStore.documentPanel"
|
||||||
|
panel-title="Doküman Ekle">
|
||||||
|
<template #panelContent>
|
||||||
|
<panel-piyango-cekilis-tutanagi />
|
||||||
|
</template>
|
||||||
|
<template #footerButton>
|
||||||
|
<div class="button-c button-save" @click="cekilisTutanagiService.SaveDocument">
|
||||||
|
Ekle
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</panel-wrapper>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onBeforeMount } from 'vue'
|
||||||
|
|
||||||
|
import PanelPiyangoCekilisTutanagi from '../panel/PanelPiyangoCekilisTutanagi.vue'
|
||||||
|
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||||
|
|
||||||
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
const usersStore = useUsersStore()
|
||||||
|
import { usePiyangoCekilisTutanagiStore } from '../../stores/piyangoCekilisTutanagiStore'
|
||||||
|
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
|
||||||
|
import { usePiyangoCekilisTutanagiService } from '../../service/piyangoCekilisTutanagiService'
|
||||||
|
const cekilisTutanagiService = usePiyangoCekilisTutanagiService()
|
||||||
|
import { useDialogStore } from '@/components/global/dialogStore'
|
||||||
|
const dialogStore = useDialogStore()
|
||||||
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
|
||||||
|
const AddNewDocument = () => {
|
||||||
|
cekilisTutanagiStore.ResetForm()
|
||||||
|
cekilisTutanagiStore.isUpdate = false
|
||||||
|
cekilisTutanagiStore.documentPanel = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const DeleteDocumentPop = (data: Record<string, any>) => {
|
||||||
|
dialogStore.CreateDialog({
|
||||||
|
title: 'Doküman Sil',
|
||||||
|
id: 'deletedoc',
|
||||||
|
content: 'Dokümanı silmek istediğinize emin misiniz? Bu işlem geri alınamaz.',
|
||||||
|
closeText: 'Vazgeç',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
label: 'Doküman Sil',
|
||||||
|
type: 'alert',
|
||||||
|
function: () => DeleteDocument(data.id)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const DeleteDocument = async (id: number | string) => {
|
||||||
|
var dt = await dataStore.dataDelete('CekilisTutanak/' + id)
|
||||||
|
|
||||||
|
if (dt !== 'errorfalse') {
|
||||||
|
dialogStore.CloseDialog('deletedoc')
|
||||||
|
await cekilisTutanagiService.GetDocumentList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
await cekilisTutanagiService.GetDocumentList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<div class="form-part">
|
||||||
|
<div class="form-part-title">
|
||||||
|
<h4>Çekiliş Tutanağı</h4>
|
||||||
|
<div class="form-part-title-buttons">
|
||||||
|
<icon-button
|
||||||
|
v-if="!usersStore.isPanelUser"
|
||||||
|
icon="plus"
|
||||||
|
class="ico-section ico-section-header-btn"
|
||||||
|
@click="AddNewDocument" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-part-content" v-if="cekilisTutanagiStore.loaded">
|
||||||
|
<template v-if="cekilisTutanagiStore.cekilisTutanagiList.length > 0">
|
||||||
|
<template v-for="(file, i) in cekilisTutanagiStore.cekilisTutanagiList">
|
||||||
|
<file-list-item
|
||||||
|
:data="file"
|
||||||
|
title="dokumanAdi"
|
||||||
|
:filePath="file.url"
|
||||||
|
:editable="false" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="form-inner-comment">
|
||||||
|
<span>
|
||||||
|
Eklenmiş dosya bulunamadı. Üstteki butonu kullanarak dosya ekleyebilirsiniz.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<panel-wrapper
|
||||||
|
v-if="cekilisTutanagiStore.documentPanel"
|
||||||
|
v-model="cekilisTutanagiStore.documentPanel"
|
||||||
|
panel-title="Doküman Ekle">
|
||||||
|
<template #panelContent>
|
||||||
|
<panel-piyango-cekilis-tutanagi />
|
||||||
|
</template>
|
||||||
|
<template #footerButton>
|
||||||
|
<div class="button-c button-save" @click="cekilisTutanagiService.SaveDocument">
|
||||||
|
Ekle
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</panel-wrapper>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onBeforeMount } from 'vue'
|
||||||
|
|
||||||
|
import PanelPiyangoCekilisTutanagi from '../panel/PanelPiyangoCekilisTutanagi.vue'
|
||||||
|
import PanelWrapper from '@/components/PanelWrapper.vue'
|
||||||
|
|
||||||
|
import { useUsersStore } from '@/stores/usersStore'
|
||||||
|
const usersStore = useUsersStore()
|
||||||
|
import { usePiyangoStore } from '../../stores/piyangoStore'
|
||||||
|
const piyangoStore = usePiyangoStore()
|
||||||
|
import { usePiyangoCekilisTutanagiStore } from '../../stores/piyangoCekilisTutanagiStore'
|
||||||
|
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
|
||||||
|
import { usePiyangoCekilisTutanagiService } from '../../service/piyangoCekilisTutanagiService'
|
||||||
|
const cekilisTutanagiService = usePiyangoCekilisTutanagiService()
|
||||||
|
|
||||||
|
const AddNewDocument = () => {
|
||||||
|
cekilisTutanagiStore.ResetForm()
|
||||||
|
cekilisTutanagiStore.isUpdate = false
|
||||||
|
cekilisTutanagiStore.documentPanel = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
await cekilisTutanagiService.GetDocumentList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<form-input
|
||||||
|
v-model="cekilisTutanagiStore.cekilisTutanagiForm.dokumanAdi"
|
||||||
|
label="Dosya Başlığı"
|
||||||
|
modelKey="dokumanAdi"
|
||||||
|
minlength="2"
|
||||||
|
:invalidText="cekilisTutanagiValidationStore.invalidTexts.dokumanAdi" />
|
||||||
|
<form-file
|
||||||
|
v-model="cekilisTutanagiStore.cekilisTutanagiForm.dosya"
|
||||||
|
elclass="panel-documents-item"
|
||||||
|
:invalidText="cekilisTutanagiValidationStore.invalidTexts.dosya" />
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
|
const validationStore = useValidationStore()
|
||||||
|
import { usePiyangoCekilisTutanagiStore } from '../../stores/piyangoCekilisTutanagiStore'
|
||||||
|
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
|
||||||
|
import { usePiyangoCekilisTutanagiValidationStore } from '../../validation/piyangoCekilisTutanagiValidationStore'
|
||||||
|
const cekilisTutanagiValidationStore = usePiyangoCekilisTutanagiValidationStore()
|
||||||
|
</script>
|
||||||
|
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { useDataStore } from '@/stores/dataStore'
|
||||||
|
import { usePiyangoStore } from '../stores/piyangoStore'
|
||||||
|
import { usePiyangoCekilisTutanagiStore } from '../stores/piyangoCekilisTutanagiStore'
|
||||||
|
import { usePiyangoCekilisTutanagiValidationStore } from '../validation/piyangoCekilisTutanagiValidationStore'
|
||||||
|
|
||||||
|
export const usePiyangoCekilisTutanagiService = defineStore('piyangoCekilisTutanagiService', () => {
|
||||||
|
const dataStore = useDataStore()
|
||||||
|
const piyangoStore = usePiyangoStore()
|
||||||
|
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
|
||||||
|
const cekilisTutanagiValidationStore = usePiyangoCekilisTutanagiValidationStore()
|
||||||
|
|
||||||
|
const GetDocumentList = async () => {
|
||||||
|
cekilisTutanagiStore.cekilisTutanagiList.splice(
|
||||||
|
0,
|
||||||
|
cekilisTutanagiStore.cekilisTutanagiList.length
|
||||||
|
)
|
||||||
|
|
||||||
|
let dt = await dataStore.dataGet('CekilisTutanak/Cekilis/' + piyangoStore.selectedLottery, {
|
||||||
|
params: {
|
||||||
|
pageSize: 50
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (dt !== 'errorfalse') {
|
||||||
|
const dataList = Array.isArray(dt) ? dt : (dt.data || [])
|
||||||
|
cekilisTutanagiStore.cekilisTutanagiList.splice(
|
||||||
|
0,
|
||||||
|
cekilisTutanagiStore.cekilisTutanagiList.length,
|
||||||
|
...dataList
|
||||||
|
)
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
cekilisTutanagiStore.loaded = true
|
||||||
|
}, 30)
|
||||||
|
}
|
||||||
|
|
||||||
|
const SaveDocument = async () => {
|
||||||
|
if (cekilisTutanagiValidationStore.FormCheck()) {
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('dosya', cekilisTutanagiStore.cekilisTutanagiForm.dosya)
|
||||||
|
formData.append('dokumanAdi', cekilisTutanagiStore.cekilisTutanagiForm.dokumanAdi)
|
||||||
|
formData.append('cekilisId', String(piyangoStore.selectedLottery))
|
||||||
|
let dt: any
|
||||||
|
|
||||||
|
if (!cekilisTutanagiStore.isUpdate) {
|
||||||
|
dt = await dataStore.dataPost('CekilisTutanak', {
|
||||||
|
data: formData,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' }
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
dt = await dataStore.dataPut(
|
||||||
|
'CekilisTutanak/' + cekilisTutanagiStore.cekilisTutanagiForm.id,
|
||||||
|
{
|
||||||
|
data: formData,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (dt !== 'errorfalse') {
|
||||||
|
await GetDocumentList()
|
||||||
|
cekilisTutanagiStore.documentPanel = false
|
||||||
|
cekilisTutanagiStore.isUpdate = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cekilisTutanagiValidationStore.isFormValid = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { GetDocumentList, SaveDocument }
|
||||||
|
})
|
||||||
|
|
||||||
37
src/module/cekilisler/stores/piyangoCekilisTutanagiStore.ts
Normal file
37
src/module/cekilisler/stores/piyangoCekilisTutanagiStore.ts
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { usePiyangoStore } from './piyangoStore'
|
||||||
|
|
||||||
|
export const usePiyangoCekilisTutanagiStore = defineStore('piyangoCekilisTutanagiStore', () => {
|
||||||
|
const piyangoStore = usePiyangoStore()
|
||||||
|
|
||||||
|
const cekilisTutanagiList = ref<Record<string, any>[]>([])
|
||||||
|
const cekilisTutanagiBaseForm = reactive<Record<string, any>>({
|
||||||
|
dosya: null,
|
||||||
|
cekilisId: piyangoStore.selectedLottery,
|
||||||
|
dokumanAdi: ''
|
||||||
|
})
|
||||||
|
const cekilisTutanagiForm = reactive<Record<string, any>>({})
|
||||||
|
const cekilisTutanagiSafeForm = reactive<Record<string, any>>({})
|
||||||
|
const isUpdate = ref<boolean>(false)
|
||||||
|
const refreshList = ref<boolean>(false)
|
||||||
|
const documentPanel = ref<boolean>(false)
|
||||||
|
const loaded = ref<boolean>(false)
|
||||||
|
|
||||||
|
const ResetForm = () => {
|
||||||
|
Object.assign(cekilisTutanagiForm, cekilisTutanagiBaseForm)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
cekilisTutanagiList,
|
||||||
|
cekilisTutanagiBaseForm,
|
||||||
|
cekilisTutanagiForm,
|
||||||
|
cekilisTutanagiSafeForm,
|
||||||
|
isUpdate,
|
||||||
|
refreshList,
|
||||||
|
documentPanel,
|
||||||
|
loaded,
|
||||||
|
ResetForm
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import { ref, reactive } from 'vue'
|
||||||
|
import { useValidationStore } from '@/stores/validationStore'
|
||||||
|
import { usePiyangoCekilisTutanagiStore } from '../stores/piyangoCekilisTutanagiStore'
|
||||||
|
|
||||||
|
export const usePiyangoCekilisTutanagiValidationStore = defineStore(
|
||||||
|
'piyangoCekilisTutanagiValidationStore',
|
||||||
|
() => {
|
||||||
|
const cekilisTutanagiStore = usePiyangoCekilisTutanagiStore()
|
||||||
|
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(
|
||||||
|
cekilisTutanagiStore.cekilisTutanagiForm,
|
||||||
|
invalidTexts,
|
||||||
|
'dokumanAdi',
|
||||||
|
'Döküman için bir başlık belirtmelisiniz.'
|
||||||
|
)
|
||||||
|
|
||||||
|
validationStore.IsFieldEmpty(
|
||||||
|
cekilisTutanagiStore.cekilisTutanagiForm,
|
||||||
|
invalidTexts,
|
||||||
|
'dosya',
|
||||||
|
'Bir döküman eklemelisiniz.'
|
||||||
|
)
|
||||||
|
|
||||||
|
isFormValid.value = Object.keys(invalidTexts).length === 0
|
||||||
|
return isFormValid.value
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
formChanged,
|
||||||
|
isFormValid,
|
||||||
|
invalidTexts,
|
||||||
|
FormCheck
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<tab-piyango-bilgileri v-else />
|
<tab-piyango-bilgileri v-else />
|
||||||
</template>
|
</template>
|
||||||
<template #katilim-listesi><tab-piyango-katilimci-listesi /></template>
|
<template #katilim-listesi><tab-piyango-katilimci-listesi /></template>
|
||||||
<template #cekilis-tutanagi><tab-piyango-talihli-listesi /></template>
|
<template #cekilis-tutanagi><tab-piyango-cekilis-tutanagi /></template>
|
||||||
<template #talihliler><tab-piyango-talihli-listesi /></template>
|
<template #talihliler><tab-piyango-talihli-listesi /></template>
|
||||||
<template #itiraz-sikayet><tab-piyango-itiraz /></template>
|
<template #itiraz-sikayet><tab-piyango-itiraz /></template>
|
||||||
<template #piyango-loglari><tab-piyango-loglari /></template>
|
<template #piyango-loglari><tab-piyango-loglari /></template>
|
||||||
@ -55,6 +55,7 @@
|
|||||||
import TabPiyangoLoglari from '@/module/cekilisler/components/TabPiyangoLoglari.vue'
|
import TabPiyangoLoglari from '@/module/cekilisler/components/TabPiyangoLoglari.vue'
|
||||||
import TabPiyangoKatilimciListesi from '@/module/cekilisler/components/TabPiyangoKatilimciListesi.vue'
|
import TabPiyangoKatilimciListesi from '@/module/cekilisler/components/TabPiyangoKatilimciListesi.vue'
|
||||||
import TabPiyangoTalihliListesi from '@/module/cekilisler/components/TabPiyangoTalihliListesi.vue'
|
import TabPiyangoTalihliListesi from '@/module/cekilisler/components/TabPiyangoTalihliListesi.vue'
|
||||||
|
import TabPiyangoCekilisTutanagi from '@/module/cekilisler/components/TabPiyangoCekilisTutanagi.vue'
|
||||||
import TabPiyangoBilgileri from '@/module/cekilisler/components/TabPiyangoBilgileri.vue'
|
import TabPiyangoBilgileri from '@/module/cekilisler/components/TabPiyangoBilgileri.vue'
|
||||||
import TabPiyangoBilgileriDisplay from '../components/TabPiyangoBilgileriDisplay.vue'
|
import TabPiyangoBilgileriDisplay from '../components/TabPiyangoBilgileriDisplay.vue'
|
||||||
import TabPiyangoItiraz from '@/module/cekilisler/components/TabPiyangoItiraz.vue'
|
import TabPiyangoItiraz from '@/module/cekilisler/components/TabPiyangoItiraz.vue'
|
||||||
@ -79,9 +80,12 @@
|
|||||||
|
|
||||||
tabList.value.push(
|
tabList.value.push(
|
||||||
{ text: 'Katılım Listesi', id: 'katilim-listesi' },
|
{ text: 'Katılım Listesi', id: 'katilim-listesi' },
|
||||||
|
{ text: 'Çekiliş Tutanağı', id: 'cekilis-tutanagi' },
|
||||||
{ text: 'Talihliler', id: 'talihliler' },
|
{ text: 'Talihliler', id: 'talihliler' },
|
||||||
{ text: 'İtiraz/Şikayet', id: 'itiraz-sikayet' }
|
{ text: 'İtiraz/Şikayet', id: 'itiraz-sikayet' }
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
tabList.value.push({ text: 'Çekiliş Tutanağı', id: 'cekilis-tutanagi' })
|
||||||
}
|
}
|
||||||
if (usersStore.isPanelUser) {
|
if (usersStore.isPanelUser) {
|
||||||
tabList.value.push(
|
tabList.value.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user