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

View File

@ -145,15 +145,11 @@
import { import {
connectToHub, connectToHub,
onProgress, onProgress,
onInsertProgress, onCompleted
onCompleted,
onError
} from '../service/signalrService' } from '../service/signalrService'
const uploadProgressValue = ref(0) const uploadProgressValue = ref(0)
const uploadProgressPanel = ref(false) const uploadProgressPanel = ref(false)
const today = ref<Date>(new Date())
const ilanTarihi = ref<Date>(new Date(piyangoStore.lotteryIlanTarihi!))
const tableHeader = ref<Record<string, any>[]>([ const tableHeader = ref<Record<string, any>[]>([
{ {

View File

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

View File

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

View File

@ -4,7 +4,7 @@
<h4>Piyango Bilgileri</h4> <h4>Piyango Bilgileri</h4>
<div class="form-part-title-buttons" v-if="!isPreview"> <div class="form-part-title-buttons" v-if="!isPreview">
<button <button
@click="BasvuruBedeliMuhasebelestir" @click="BasvuruBedeliDialog"
v-if=" v-if="
(piyangoStore.lotteryApprove === 1 || piyangoStore.lotteryApprove === 4) && (piyangoStore.lotteryApprove === 1 || piyangoStore.lotteryApprove === 4) &&
(!piyangoStore.lotteryBasvuruBedeliStatus || (!piyangoStore.lotteryBasvuruBedeliStatus ||
@ -44,14 +44,41 @@
<label>Oran Seçiniz:</label> <label>Oran Seçiniz:</label>
<select @change="OnOranChange" class="form-select"> <select @change="OnOranChange" class="form-select">
<option value="">Lütfen bir oran seçiniz</option> <option value="">Lütfen bir oran seçiniz</option>
<option <option v-for="oran in izinBedelOranlari" :key="oran.id" :value="oran.id">
v-for="oran in izinBedelOranlari"
:key="oran.id"
:value="oran.id">
{{ oran.oran }}% - {{ oran.adi }} {{ oran.oran }}% - {{ oran.adi }}
</option> </option>
</select> </select>
</div> </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>
<div class="modal-footer"> <div class="modal-footer">
<button class="button-c button-cancel" @click="CloseIzinBedeliModal"> <button class="button-c button-cancel" @click="CloseIzinBedeliModal">
@ -67,10 +94,16 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onBeforeMount } from 'vue' import { ref, onBeforeMount, computed } from 'vue'
import { useToastStore } from '@/components/global/toastStore' import { useToastStore } from '@/components/global/toastStore'
const toastStore = useToastStore() 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 { export interface Props {
isPreview?: boolean isPreview?: boolean
@ -85,16 +118,20 @@
import { useDataStore } from '@/stores/dataStore' import { useDataStore } from '@/stores/dataStore'
const dataStore = useDataStore() const dataStore = useDataStore()
import { usePreviewStore } from '@/stores/previewStore'
const previewStore = usePreviewStore()
import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore' import { usePiyangoStore } from '@/module/cekilisler/stores/piyangoStore'
const piyangoStore = usePiyangoStore() const piyangoStore = usePiyangoStore()
import { useMuhasebeSettingsStore } from '@/module/muhasebe/store/muhasebeSettingsStore'
const muhasebeSettingsStore = useMuhasebeSettingsStore()
const loaded = ref<boolean>(false) const loaded = ref<boolean>(false)
const showIzinBedeliModal = ref<boolean>(false) const showIzinBedeliModal = ref<boolean>(false)
const selectedOran = ref<number | null>(null) const selectedOran = ref<number | null>(null)
const izinBedelOranlari = ref<Record<string, any>[]>([]) const izinBedelOranlari = ref<Record<string, any>[]>([])
const selectedOranId = ref<number | null>(null) const selectedOranId = ref<number | null>(null)
const calculatedKdv = ref<number>(0)
const calculatedBasvuruKdv = computed<number>(
() => (Number(muhasebeSettingsStore.muhasebeSettingsForm.basvuruBedeli) * 20) / 100
)
const GetData = async () => { const GetData = async () => {
let data = await dataStore.dataGet( let data = await dataStore.dataGet(
@ -140,12 +177,55 @@
izinBedelOranlari.value = data 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 () => { const BasvuruBedeliMuhasebelestir = async () => {
let data = await dataStore.dataGet( let data = await dataStore.dataGet(
'MuhasebeSettings/BasvuruBedeli/' + piyangoStore.selectedLottery 'MuhasebeSettings/BasvuruBedeli/' + piyangoStore.selectedLottery
) )
if (data !== 'errorfalse') { 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 loaded.value = false
await GetData() await GetData()
piyangoStore.lotteryBasvuruBedeliStatus = true piyangoStore.lotteryBasvuruBedeliStatus = true
@ -172,7 +252,9 @@
const OnOranChange = (event: Event) => { const OnOranChange = (event: Event) => {
const target = event.target as HTMLSelectElement const target = event.target as HTMLSelectElement
const selectedId = parseInt(target.value) 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) { if (selectedOranData) {
selectedOranId.value = selectedOranData.id selectedOranId.value = selectedOranData.id
@ -181,6 +263,9 @@
selectedOranId.value = null selectedOranId.value = null
selectedOran.value = null selectedOran.value = null
} }
calculatedKdv.value =
(Number(piyangoIkramiyeStore.totalIkramiyeValues) * Number(selectedOran!)) / 100
} }
const IzinBedeliMuhasebelestir = async () => { const IzinBedeliMuhasebelestir = async () => {
@ -190,10 +275,17 @@
} }
let data = await dataStore.dataGet( let data = await dataStore.dataGet(
'MuhasebeSettings/IzinBasvuruBedeli/' + piyangoStore.selectedLottery + '/' + selectedOranId.value 'MuhasebeSettings/IzinBasvuruBedeli/' +
piyangoStore.selectedLottery +
'/' +
selectedOranId.value
) )
if (data !== 'errorfalse') { 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 loaded.value = false
await GetData() await GetData()
piyangoStore.lotteryIzinBedeliStatus = true piyangoStore.lotteryIzinBedeliStatus = true
@ -213,7 +305,7 @@
</script> </script>
<style scoped> <style scoped>
.modal-overlay { .modal-overlay {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
@ -224,9 +316,9 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 9999; z-index: 9999;
} }
.modal-content { .modal-content {
background: white; background: white;
border-radius: 8px; border-radius: 8px;
padding: 0; padding: 0;
@ -235,24 +327,24 @@
max-height: 90vh; max-height: 90vh;
overflow-y: auto; overflow-y: auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
} }
.modal-header { .modal-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 20px 24px; padding: 20px 24px;
border-bottom: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb;
} }
.modal-header h3 { .modal-header h3 {
margin: 0; margin: 0;
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #1f2937; color: #1f2937;
} }
.modal-close { .modal-close {
background: none; background: none;
border: none; border: none;
font-size: 24px; font-size: 24px;
@ -266,28 +358,28 @@
justify-content: center; justify-content: center;
border-radius: 4px; border-radius: 4px;
transition: background-color 0.2s; transition: background-color 0.2s;
} }
.modal-close:hover { .modal-close:hover {
background-color: #f3f4f6; background-color: #f3f4f6;
} }
.modal-body { .modal-body {
padding: 24px; padding: 24px;
} }
.form-group { .form-group {
margin-bottom: 16px; margin-bottom: 16px;
} }
.form-group label { .form-group label {
display: block; display: block;
margin-bottom: 8px; margin-bottom: 8px;
font-weight: 500; font-weight: 500;
color: #374151; color: #374151;
} }
.form-select { .form-select {
width: 100%; width: 100%;
padding: 12px; padding: 12px;
border: 1px solid #d1d5db; border: 1px solid #d1d5db;
@ -295,15 +387,15 @@
font-size: 14px; font-size: 14px;
background-color: white; background-color: white;
transition: border-color 0.2s; transition: border-color 0.2s;
} }
.form-select:focus { .form-select:focus {
outline: none; outline: none;
border-color: #3b82f6; border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
} }
.modal-footer { .modal-footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 12px; gap: 12px;
@ -311,9 +403,9 @@
border-top: 1px solid #e5e7eb; border-top: 1px solid #e5e7eb;
background-color: #f9fafb; background-color: #f9fafb;
border-radius: 0 0 8px 8px; border-radius: 0 0 8px 8px;
} }
.button-c { .button-c {
padding: 10px 20px; padding: 10px 20px;
border: none; border: none;
border-radius: 6px; border-radius: 6px;
@ -321,23 +413,30 @@
font-weight: 500; font-weight: 500;
cursor: pointer; cursor: pointer;
transition: all 0.2s; transition: all 0.2s;
} }
.button-cancel { .button-cancel {
background-color: #6b7280; background-color: #6b7280;
color: white; color: white;
} }
.button-cancel:hover { .button-cancel:hover {
background-color: #4b5563; background-color: #4b5563;
} }
.button-save { .button-save {
background-color: #3b82f6; background-color: #3b82f6;
color: white; color: white;
} }
.button-save:hover { .button-save:hover {
background-color: #2563eb; background-color: #2563eb;
} }
.table-bordered {
width: 100%;
}
.table-bordered tr td {
border-bottom: 1px solid #d8d8d8;
padding: 8px;
}
</style> </style>