- Başvuru bedeli muhasebeleştir, izin bedeli muhasebeleştir popuplar bedel, kdv, toplam değerlr eklendi

- Dialog komponentine html içerik için ek alan
- Dosya kapama datasına evrak:cekilisId eklendi
This commit is contained in:
M. Bestami
2025-09-22 18:07:46 +03:00
parent 76523182da
commit b31b075e1f
5 changed files with 245 additions and 146 deletions

View File

@ -13,6 +13,10 @@
v-if="localData.content !== undefined && localData.content !== ''">
{{ localData.content }}
</div>
<div
class="dialog-content"
v-if="localData.contentHtml !== undefined && localData.contentHtml !== ''"
v-html="localData.contentHtml"></div>
<div class="dialog-footer">
<template
v-if="localData.buttons !== undefined && localData.buttons.length > 0"
@ -49,6 +53,7 @@
const localData = reactive({
title: '',
content: '',
contentHtml: '',
showClose: true,
closeText: 'Kapat',
closeFunction: () => {

View File

@ -145,15 +145,11 @@
import {
connectToHub,
onProgress,
onInsertProgress,
onCompleted,
onError
onCompleted
} 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>[]>([
{

View File

@ -26,7 +26,7 @@
</template>
</template>
<script setup lang="ts">
import { ref, reactive, onBeforeMount, watch } from 'vue'
import { ref, onBeforeMount, watch } from 'vue'
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { usePiyangoStore } from '../../stores/piyangoStore'
@ -36,8 +36,6 @@
import { usePiyangoIkramiyeStore } from '../../stores/piyangoIkramiyeStore'
const piyangoIkramiyeStore = usePiyangoIkramiyeStore()
import { usePiyangoIkramiyeService } from '../../service/piyangoIkramiyeService'
const piyangoIkramiyeService = usePiyangoIkramiyeService()
export interface Props {
isPreview?: boolean
@ -45,8 +43,6 @@
const props = withDefaults(defineProps<Props>(), { isPreview: false })
const loaded = ref<boolean>(false)
const ikramiyeTableHeader = ref<Record<string, any>>([
{
name: 'cinsi',

View File

@ -1,9 +1,11 @@
import { defineStore } from 'pinia'
import { ref, reactive } from 'vue'
import { useGlobalStore } from '@/stores/globalStore'
import { usePiyangoStore } from './piyangoStore'
export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore', () => {
const globalStore = useGlobalStore()
const piyangoStore = usePiyangoStore()
const baseDosyaKapamaData = reactive<Record<string, any>>({
katilimSekli: '',
@ -36,7 +38,8 @@ export const usePiyangoDosyaKapamaStore = defineStore('piyangoDosyaKapamaStore',
kuponAsli: false,
duyuruMateryali: false,
ikramiyelerinSonTeslimTarihi: '',
teminatIadeTarihi: ''
teminatIadeTarihi: '',
evrak: { cekilisId: piyangoStore.selectedLottery }
})
const baseDosyaKapamaIkramiyeData = reactive<Record<string, any>>({
taahhutEdilenIkramiye: '',

View File

@ -4,7 +4,7 @@
<h4>Piyango Bilgileri</h4>
<div class="form-part-title-buttons" v-if="!isPreview">
<button
@click="BasvuruBedeliMuhasebelestir"
@click="BasvuruBedeliDialog"
v-if="
(piyangoStore.lotteryApprove === 1 || piyangoStore.lotteryApprove === 4) &&
(!piyangoStore.lotteryBasvuruBedeliStatus ||
@ -30,7 +30,7 @@
</div>
</div>
<piyango-bilgileri-display-content v-if="loaded" :isPreview="isPreview" />
<!-- İzin Bedeli Modal -->
<teleport to="body">
<div v-if="showIzinBedeliModal" class="modal-overlay" @click="CloseIzinBedeliModal">
@ -39,20 +39,47 @@
<h3>İzin Bedeli Muhasebeleştir</h3>
<button class="modal-close" @click="CloseIzinBedeliModal">×</button>
</div>
<div class="modal-body">
<div class="form-group">
<label>Oran Seçiniz:</label>
<select @change="OnOranChange" class="form-select">
<option value="">Lütfen bir oran seçiniz</option>
<option
v-for="oran in izinBedelOranlari"
:key="oran.id"
:value="oran.id">
{{ oran.oran }}% - {{ oran.adi }}
</option>
</select>
</div>
</div>
<div class="modal-body">
<div class="form-group">
<label>Oran Seçiniz:</label>
<select @change="OnOranChange" class="form-select">
<option value="">Lütfen bir oran seçiniz</option>
<option v-for="oran in izinBedelOranlari" :key="oran.id" :value="oran.id">
{{ oran.oran }}% - {{ oran.adi }}
</option>
</select>
</div>
<div class="">
<table class="table-bordered">
<tbody>
<tr>
<td>Toplam İkramiye Bedeli:</td>
<td>
{{
globalStore.toTrLocale(piyangoIkramiyeStore.totalIkramiyeValues)
}}
</td>
</tr>
<tr>
<td>KDV:</td>
<td>
{{ globalStore.toTrLocale(calculatedKdv) }}
</td>
</tr>
<tr>
<td>Toplam Bedel:</td>
<td>
{{
globalStore.toTrLocale(
Number(piyangoIkramiyeStore.totalIkramiyeValues) + calculatedKdv
)
}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button class="button-c button-cancel" @click="CloseIzinBedeliModal">
İptal
@ -67,10 +94,16 @@
</div>
</template>
<script setup lang="ts">
import { ref, onBeforeMount } from 'vue'
import { ref, onBeforeMount, computed } from 'vue'
import { useToastStore } from '@/components/global/toastStore'
const toastStore = useToastStore()
import { usePiyangoIkramiyeStore } from '@/module/cekilisler/stores/piyangoIkramiyeStore'
const piyangoIkramiyeStore = usePiyangoIkramiyeStore()
import { useGlobalStore } from '@/stores/globalStore'
const globalStore = useGlobalStore()
import { useDialogStore } from '@/components/global/dialogStore'
const dialogStore = useDialogStore()
export interface Props {
isPreview?: boolean
@ -85,16 +118,20 @@
import { useDataStore } from '@/stores/dataStore'
const dataStore = useDataStore()
import { usePreviewStore } from '@/stores/previewStore'
const previewStore = usePreviewStore()
import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore'
const piyangoStore = usePiyangoStore()
import { useMuhasebeSettingsStore } from '@/module/muhasebe/store/muhasebeSettingsStore'
const muhasebeSettingsStore = useMuhasebeSettingsStore()
const loaded = ref<boolean>(false)
const showIzinBedeliModal = ref<boolean>(false)
const selectedOran = ref<number | null>(null)
const izinBedelOranlari = ref<Record<string, any>[]>([])
const selectedOranId = ref<number | null>(null)
const calculatedKdv = ref<number>(0)
const calculatedBasvuruKdv = computed<number>(
() => (Number(muhasebeSettingsStore.muhasebeSettingsForm.basvuruBedeli) * 20) / 100
)
const GetData = async () => {
let data = await dataStore.dataGet(
@ -140,12 +177,55 @@
izinBedelOranlari.value = data
}
}
const BasvuruBedeliDialog = () => {
dialogStore.CreateDialog({
title: 'Başvuru Bedelini Muhasebeleştir',
id: 'basvurubedelimuhasebelestir',
contentHtml: `<table class="table-bordered">
<tbody>
<tr>
<td>Başvuru Bedeli:</td>
<td>${globalStore.toTrLocale(
muhasebeSettingsStore.muhasebeSettingsForm.basvuruBedeli
)} </td>
</tr>
<tr>
<td>KDV %20):</td>
<td>
${globalStore.toTrLocale(calculatedBasvuruKdv.value)}
</td>
</tr>
<tr>
<td>Toplam Bedel:</td>
<td>
${globalStore.toTrLocale(
Number(muhasebeSettingsStore.muhasebeSettingsForm.basvuruBedeli) +
calculatedBasvuruKdv.value
)}
</td>
</tr>
</tbody>
</table>`,
closeText: 'Vazgeç',
buttons: [
{
label: 'Başvuru Bedelini Muhasebeleştir',
type: 'alert',
function: () => BasvuruBedeliMuhasebelestir
}
]
})
}
const BasvuruBedeliMuhasebelestir = async () => {
let data = await dataStore.dataGet(
'MuhasebeSettings/BasvuruBedeli/' + piyangoStore.selectedLottery
)
if (data !== 'errorfalse') {
toastStore.AddToast('Başvuru bedeli başarıyla muhasebeleştirildi. Fatura No: '+data.belgeNo, 'success', 30000)
toastStore.AddToast(
'Başvuru bedeli başarıyla muhasebeleştirildi. Fatura No: ' + data.belgeNo,
'success',
30000
)
loaded.value = false
await GetData()
piyangoStore.lotteryBasvuruBedeliStatus = true
@ -172,8 +252,10 @@
const OnOranChange = (event: Event) => {
const target = event.target as HTMLSelectElement
const selectedId = parseInt(target.value)
const selectedOranData = izinBedelOranlari.value.find(item => item.id === selectedId)
const selectedOranData = izinBedelOranlari.value.find(
(item) => item.id === selectedId
)
if (selectedOranData) {
selectedOranId.value = selectedOranData.id
selectedOran.value = selectedOranData.oran
@ -181,6 +263,9 @@
selectedOranId.value = null
selectedOran.value = null
}
calculatedKdv.value =
(Number(piyangoIkramiyeStore.totalIkramiyeValues) * Number(selectedOran!)) / 100
}
const IzinBedeliMuhasebelestir = async () => {
@ -190,10 +275,17 @@
}
let data = await dataStore.dataGet(
'MuhasebeSettings/IzinBasvuruBedeli/' + piyangoStore.selectedLottery + '/' + selectedOranId.value
'MuhasebeSettings/IzinBasvuruBedeli/' +
piyangoStore.selectedLottery +
'/' +
selectedOranId.value
)
if (data !== 'errorfalse') {
toastStore.AddToast('İzin bedeli başarıyla muhasebeleştirildi. Fatura No: '+data.izinBelgeNo , 'success', 30000)
toastStore.AddToast(
'İzin bedeli başarıyla muhasebeleştirildi. Fatura No: ' + data.izinBelgeNo,
'success',
30000
)
loaded.value = false
await GetData()
piyangoStore.lotteryIzinBedeliStatus = true
@ -213,131 +305,138 @@
</script>
<style scoped>
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.modal-content {
background: white;
border-radius: 8px;
padding: 0;
max-width: 500px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.modal-content {
background: white;
border-radius: 8px;
padding: 0;
max-width: 500px;
width: 90%;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 24px;
border-bottom: 1px solid #e5e7eb;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 24px;
border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #1f2937;
}
.modal-header h3 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #1f2937;
}
.modal-close {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #6b7280;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: background-color 0.2s;
}
.modal-close {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: #6b7280;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: background-color 0.2s;
}
.modal-close:hover {
background-color: #f3f4f6;
}
.modal-close:hover {
background-color: #f3f4f6;
}
.modal-body {
padding: 24px;
}
.modal-body {
padding: 24px;
}
.form-group {
margin-bottom: 16px;
}
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: #374151;
}
.form-group label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: #374151;
}
.form-select {
width: 100%;
padding: 12px;
border: 1px solid #d1d5db;
border-radius: 6px;
font-size: 14px;
background-color: white;
transition: border-color 0.2s;
}
.form-select {
width: 100%;
padding: 12px;
border: 1px solid #d1d5db;
border-radius: 6px;
font-size: 14px;
background-color: white;
transition: border-color 0.2s;
}
.form-select:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-select:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
padding: 20px 24px;
border-top: 1px solid #e5e7eb;
background-color: #f9fafb;
border-radius: 0 0 8px 8px;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 12px;
padding: 20px 24px;
border-top: 1px solid #e5e7eb;
background-color: #f9fafb;
border-radius: 0 0 8px 8px;
}
.button-c {
padding: 10px 20px;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.button-c {
padding: 10px 20px;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.button-cancel {
background-color: #6b7280;
color: white;
}
.button-cancel {
background-color: #6b7280;
color: white;
}
.button-cancel:hover {
background-color: #4b5563;
}
.button-cancel:hover {
background-color: #4b5563;
}
.button-save {
background-color: #3b82f6;
color: white;
}
.button-save {
background-color: #3b82f6;
color: white;
}
.button-save:hover {
background-color: #2563eb;
}
.button-save:hover {
background-color: #2563eb;
}
.table-bordered {
width: 100%;
}
.table-bordered tr td {
border-bottom: 1px solid #d8d8d8;
padding: 8px;
}
</style>