<template>
  <strong
    style="
      display: inline-block;
      width: 100%;
      font-size: 14pt;
      margin-bottom: 12px;
      text-align: center;
    ">
    ÜYE FORMU
  </strong>
  <br />
  <br />
  <table
    cellspacing="0"
    class="table-no-line"
    data-pdfmake="{'widths': [ '50%', '50%'],'layout':'pdfTableLayoutNoLine'}">
    <tbody>
      <tr>
        <td colspan="2">
          <strong style="font-size: 10pt; margin-bottom: 12px">Üye Bilgileri</strong>
        </td>
      </tr>
    </tbody>
  </table>
  <table
    v-if="loaded"
    cellspacing="0"
    data-pdfmake="{'widths': [ '50%', '50%'],'layout':'pdfTableLayout'}"
    style="margin-bottom: 12px; font-size: 10pt">
    <tbody>
      <tr>
        <td colspan="2">
          <strong>Üye Tipi:</strong>
          {{ customerStore.customerForm.basvuruTipi }}
        </td>
      </tr>
      <tr>
        <td>
          <strong>E-posta adresi:</strong>
          {{ customerStore.customerForm.email }}
        </td>
        <td>
          <strong>Telefon Numarası:</strong>
          {{ customerStore.customerForm.telefonNumarasi }}
        </td>
      </tr>
      <template v-if="customerStore.customerForm.basvuruTipId === 18">
        <tr>
          <td>
            <strong>Adı:</strong>
            {{ customerStore.customerForm.gercekAdi }}
          </td>
          <td>
            <strong>Soyadı:</strong>
            {{ customerStore.customerForm.gercekSoyadi }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>TCKN:</strong>
            {{ customerStore.customerForm.gercekTCKN }}
          </td>
          <td>
            <strong>Vergi Dairesi:</strong>
            {{ customerStore.customerForm.gercekVergiDairesi }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>Vergi No:</strong>
            {{ customerStore.customerForm.gercekVergiNo }}
          </td>
          <td>
            <strong>Oda Kayıt No/ Ticaret Sicil No:</strong>
            {{ customerStore.customerForm.gercekOdaKayitNo }}
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <strong>Ticari Ünvan:</strong>
            {{ customerStore.customerForm.gercekTicariUnvan }}
          </td>
        </tr>
      </template>
      <template v-if="customerStore.customerForm.basvuruTipId === 21">
        <tr>
          <td colspan="2">
            <strong>Ünvan:</strong>
            {{ customerStore.customerForm.tuzelUnvan }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>Vergi Dairesi:</strong>
            {{ customerStore.customerForm.tuzelVergiDairesi }}
          </td>
          <td>
            <strong>Vergi No:</strong>
            {{ customerStore.customerForm.tuzelVergiNo }}
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <strong>Sicil No:</strong>
            {{ customerStore.customerForm.tuzelSicilNo }}
          </td>
        </tr>
      </template>
      <template v-if="customerStore.customerForm.basvuruTipId === 22">
        <tr>
          <td colspan="2">
            <strong>Ünvan:</strong>
            {{ customerStore.customerForm.dernekUnvan }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>Vergi Dairesi:</strong>
            {{ customerStore.customerForm.dernekVergiDairesi }}
          </td>
          <td>
            <strong>Vergi No:</strong>
            {{ customerStore.customerForm.dernekVergiNo }}
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <strong>Sicil No:</strong>
            {{ customerStore.customerForm.dernekSicilNo }}
          </td>
        </tr>
      </template>
      <template v-if="customerStore.customerForm.basvuruTipId === 23">
        <tr>
          <td colspan="2">
            <strong>Ünvan:</strong>
            {{ customerStore.customerForm.sirketUnvan }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>Vergi Dairesi:</strong>
            {{ customerStore.customerForm.sirketVergiDairesi }}
          </td>
          <td>
            <strong>Vergi No:</strong>
            {{ customerStore.customerForm.sirketVergiNo }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>Sicil No:</strong>
            {{ customerStore.customerForm.sirketSicilNo }}
          </td>
          <td>
            <strong>Mersis No:</strong>
            {{ customerStore.customerForm.sirketMersis }}
          </td>
        </tr>
      </template>
      <template v-if="customerStore.customerForm.basvuruTipId === 26">
        <tr>
          <td colspan="2">
            <strong>Ünvan:</strong>
            {{ customerStore.customerForm.kamuUnvan }}
          </td>
        </tr>
        <tr>
          <td>
            <strong>Vergi Dairesi:</strong>
            {{ customerStore.customerForm.kamuVergiDairesi }}
          </td>
          <td>
            <strong>Vergi No:</strong>
            {{ customerStore.customerForm.kamuVergiNo }}
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <strong>Sicil No:</strong>
            {{ customerStore.customerForm.kamuSicilNo }}
          </td>
        </tr>
      </template>
      <tr>
        <td>
          <strong>İl:</strong>
          {{ customerStore.customerForm.il }}
        </td>
        <td>
          <strong>İlçe:</strong>
          {{ customerStore.customerForm.ilce }}
        </td>
      </tr>
      <tr>
        <td>
          <strong>Mahalle:</strong>
          {{ customerStore.customerForm.mahalle }}
        </td>
        <td>
          <strong>Posta Kodu:</strong>
          {{ customerStore.customerForm.postaKodu }}
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <strong>İnternet Sitesi:</strong>
          {{ customerStore.customerForm.internetSitesi }}
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <strong>Adres:</strong>
          {{ customerStore.customerForm.adres }}
        </td>
      </tr>
    </tbody>
  </table>
  <table
    cellspacing="0"
    class="table-no-line"
    data-pdfmake="{'widths': [ '50%', '50%'],'layout':'pdfTableLayoutNoLine'}">
    <tbody>
      <tr>
        <td colspan="2">
          <strong style="font-size: 10pt; margin-bottom: 12px">
            Üye İrtibat Bilgileri
          </strong>
        </td>
      </tr>
    </tbody>
  </table>
  <table
    v-if="loaded"
    cellspacing="0"
    data-pdfmake="{'widths': [ '50%', '50%'],'layout':'pdfTableLayout'}"
    style="margin-bottom: 12px; font-size: 10pt">
    <tbody>
      <tr>
        <td>
          <strong>Adı:</strong>
          {{ customerIrtibatStore.customerIrtibatForm.firstName }}
        </td>
        <td>
          <strong>Soyadı:</strong>
          {{ customerIrtibatStore.customerIrtibatForm.lastName }}
        </td>
      </tr>
      <tr>
        <td>
          <strong>E-Posta:</strong>
          {{ customerIrtibatStore.customerIrtibatForm.email }}
        </td>
        <td>
          <strong>Telefon:</strong>
          {{ customerIrtibatStore.customerIrtibatForm.phone }}
        </td>
      </tr>
    </tbody>
  </table>
</template>
<script setup lang="ts">
  import { ref } from 'vue'
  import { onBeforeMount } from 'vue'
  import { useCustomerStore } from '../../stores/customerStore'
  const customerStore = useCustomerStore()
  import { useCustomerService } from '../../service/customerService'
  const customerService = useCustomerService()
  import { useCustomerIrtibatStore } from '../../stores/customerIrtibatStore'
  const customerIrtibatStore = useCustomerIrtibatStore()
  import { useCustomerIrtibatService } from '../../service/customerIrtibatService'
  const customerIrtibatService = useCustomerIrtibatService()

  const loaded = ref<boolean>(false)

  onBeforeMount(async () => {
    await customerService.GetCustomerData()
    await customerIrtibatService.GetIrtibat()
    loaded.value = true
  })
</script>
