@@ -1,12 +1,12 @@
< template >
< q-page v-if = "canReadOrder" class= "ol-page">
< ! - - 🠔 Sticky Filter - - >
< q-page class = "ol-page" >
<!-- 🔍 Sticky Filter -- >
< div class = "ol-filter-bar" >
<!-- 🠔 ¹ TEK SATIR FLEX -- >
<!-- 🔹 TEK SATIR FLEX -- >
< div class = "ol-filter-row" >
<!-- 🠔 Arama -- >
<!-- 🔍 Arama -- >
< q-input
class = "ol-filter-input ol-search"
dense
@@ -21,7 +21,7 @@
< / template >
< / q-input >
<!-- 🠧 ¾ Cari Kodu -- >
<!-- 🧾 Cari Kodu -- >
< q-input
class = "ol-filter-input"
dense
@@ -31,7 +31,7 @@
clearable
/ >
<!-- 🠓 … Sipariş Tarihi -- >
<!-- 📅 Sipariş Tarihi -- >
< q-input
class = "ol-filter-input"
dense
@@ -41,11 +41,10 @@
type = "date"
/ >
<!-- 🠔 ˜ Butonlar -- >
<!-- 🔘 Butonlar -- >
< div class = "ol-filter-actions" >
< q-btn
v-if = "canReadOrder"
label = "Temizle"
icon = "clear"
color = "grey-7"
@@ -59,7 +58,6 @@
< / q-btn >
< q-btn
v-if = "canReadOrder"
label = "Yenile"
color = "primary"
icon = "refresh"
@@ -68,7 +66,6 @@
/ >
< q-btn
v-if = "canExportOrder"
label = "Excel'e Aktar"
icon = "download"
color = "primary"
@@ -80,7 +77,7 @@
< / div >
<!-- 🠒 ° Toplam -- >
<!-- 💰 Toplam -- >
< div class = "ol-filter-total" >
Toplam Görünen Sipariş Tutarı ( USD ) :
< strong >
@@ -94,7 +91,7 @@
< / div >
<!-- 🠓 ‹ ORDER LIST TABLE -- >
<!-- 📋 ORDER LIST TABLE -- >
< q-table
title = "Mevcut Siparişler"
class = "ol-table"
@@ -106,18 +103,16 @@
:rows = "store.filteredOrders"
:columns = "columns"
:loading = "store.loading"
:table-style = "tableStyle"
no -data -label = " Sipariş bulunamadı "
:rows-per-page-options = "[0]"
hide -bottom
>
<!-- 🠓 „ PDF + DURUM -- >
<!-- 📄 PDF + DURUM -- >
< template # body -cell -IsCreditableConfirmed = " props " >
< q-td :props = "props" class = "text-center q-gutter-sm" >
< q-btn
v-if = "canExportOrder"
icon = "picture_as_pdf"
color = "red"
flat
@@ -141,7 +136,7 @@
< / q-td >
< / template >
<!-- 🠓 … Tarih -- >
<!-- 📅 Tarih -- >
< template # body -cell -OrderDate = " props " >
< q-td :props = "props" class = "text-center" >
{ { formatDate ( props . row . OrderDate ) } }
@@ -154,7 +149,7 @@
< / q-td >
< / template >
<!-- 🠧 ¾ Cari Adı â € ” 2 SatÄ ± r -- >
<!-- 🧾 Cari Adı — 2 Satı r -- >
< template # body -cell -CurrAccDescription = " props " >
< q-td :props = "props" class = "ol-col-cari ol-col-multiline" >
{ { props . value } }
@@ -164,7 +159,7 @@
< / q-td >
< / template >
<!-- 🠓 Açı klama â € ” 5 SatÄ ± r -- >
<!-- 📝 Açı klama — 5 Satı r -- >
< template # body -cell -Description = " props " >
< q-td :props = "props" class = "ol-col-desc ol-col-multiline" >
{ { props . value } }
@@ -174,11 +169,10 @@
< / q-td >
< / template >
<!-- 🠔 — a ç -- >
<!-- 🔗 A ç -- >
< template # body -cell -select = " props " >
< q-td :props = "props" class = "text-center" >
< q-btn
v-if = "canUpdateOrder"
icon = "open_in_new"
color = "primary"
flat
@@ -186,7 +180,7 @@
dense
@click ="selectOrder(props.row)"
>
< q-tooltip > Siparişi a ç< / q-tooltip >
< q-tooltip > Siparişi A ç< / q-tooltip >
< / q-btn >
< / q-td >
< / template >
@@ -199,16 +193,10 @@
< / q -banner >
< / q-page >
< q-page v-else class = "q-pa-md flex flex-center" >
< div class = "text-negative text-subtitle1" >
Bu module erisim yetkiniz yok .
< / div >
< / q-page >
< / template >
< script setup >
import { computed , onMounted, watch } from 'vue'
import { onMounted , watch } from 'vue'
import { useRouter } from 'vue-router'
import { useQuasar } from 'quasar'
@@ -216,12 +204,11 @@ import { useOrderListStore } from 'src/stores/OrdernewListStore'
import { useAuthStore } from 'src/stores/authStore'
import { usePermission } from 'src/composables/usePermission'
const { canRead , canWrite , canUpdate , canExport } = usePermission ( )
const { canRead , canWrite , canUpdate } = usePermission ( )
const canReadOrder = canRead ( 'order' )
const canWriteOrder = canWrite ( 'order' )
const canUpdateOrder = canUpdate ( 'order' )
const canExportOrder = canExport ( 'order' )
/* =========================
INIT
@@ -230,13 +217,9 @@ const canExportOrder = canExport('order')
const router = useRouter ( )
const $q = useQuasar ( )
// âš ï¸ Ã– NCE store tanı mlanı r
// ⚠️ Ö NCE store tanı mlanı r
const store = useOrderListStore ( )
const tableStyle = computed ( ( ) => ( {
minWidth : $q . screen . lt . lg ? '1280px' : '100%'
} ) )
/* =========================
SEARCH DEBOUNCE
========================= */
@@ -258,15 +241,14 @@ watch(
HELPERS
========================= */
function exportExcel ( ) {
if ( ! canExportOrder . value ) {
$q . notify ( { type : 'negative' , message : 'Excel export yetkiniz yok' , position : 'top-right' } )
return
}
const auth = useAuthStore ( )
if ( ! auth ? . token ) {
$q . notify ( { type : 'negative' , message : 'Oturum bulunamadı ' , position : 'top-right' } )
$q . notify ( {
type : 'negative' ,
message : 'Oturum bulunamadı ' ,
position : 'top-right'
} )
return
}
@@ -279,43 +261,19 @@ function exportExcel () {
const url = ` http://localhost:8080/api/orders/export? ${ params . toString ( ) } `
fetch ( url , {
method : 'GET' ,
headers : { Authorization : ` Bearer ${ auth . token } ` }
headers : {
Authorization : ` Bearer ${ auth . token } `
}
} )
. then ( async res => {
// ✅ 200 değilse EXCEL İNDİRME
if ( ! res . ok ) {
const text = await res . text ( )
throw new Error ( ` HTTP ${ res . status } - ${ text } ` )
}
// ✅ Content-Type kontrol (debug için)
const ct = res . headers . get ( 'content-type' ) || ''
if ( ! ct . includes ( 'spreadsheetml.sheet' ) ) {
const text = await res . text ( )
throw new Error ( ` Beklenmeyen Content-Type: ${ ct } | Body: ${ text } ` )
}
return res . blob ( )
} )
. then ( res => res . blob ( ) )
. then ( blob => {
const link = document . createElement ( 'a' )
link . href = URL . createObjectURL ( blob )
link . download = 'siparis_listesi.xlsx'
link . click ( )
} )
. catch ( err => {
$q . notify ( {
type : 'negative' ,
message : 'Excel export hatası : ' + ( err ? . message || err ) ,
position : 'top-right' ,
timeout : 8000
} )
console . error ( err )
} )
}
function formatDate ( s ) {
if ( ! s ) return ''
const [ y , m , d ] = s . split ( '-' )
@@ -327,18 +285,12 @@ function formatDate (s) {
========================= */
const columns = [
{
name : 'select' ,
label : '' ,
field : 'select' ,
align : 'center' ,
sortable : false ,
style : 'width:42px; min-width:42px; max-width:42px; padding:2px 4px;' ,
headerStyle : 'width:42px; min-width:42px; max-width:42px; padding:2px 4px;'
} ,
{ name : 'OrderNumber' , label : 'Sipariş No' , field : 'OrderNumber' , align : 'left' , sortable : true , style : 'width:108px; min-width:108px;' , headerStyle : 'width:108px; min-width:108px;' } ,
{ name : 'OrderDate' , label : 'Tarih' , field : 'OrderDate' , align : 'center' , sortable : true , style : 'width:78px; min-width:78px;' , headerStyle : 'width:78px; min-width:78px;' } ,
{ name : 'CurrAccCode' , label : 'Cari Kod' , field : 'CurrAccCode' , align : 'left' , sortable : true , style : 'width:78px; min-width:78px;' , headerStyle : 'width:78px; min-width:78px;' } ,
{ name : 'select' , label : '' , field : 'select' , align : 'center' , sortable : false } ,
{ name : 'OrderNumber' , label : 'Sipariş No' , field : 'OrderNumber' , align : 'left' , sortable : true } ,
{ name : 'OrderDate' , label : 'Tarih' , field : 'OrderDate' , align : 'center' , sortable : true } ,
{ name : 'CurrAccCode' , label : 'Cari Kod' , field : 'CurrAccCode' , align : 'left' , sortable : true } ,
{
name : 'CurrAccDescription' ,
@@ -348,13 +300,14 @@ const columns = [
sortable : true ,
classes : 'ol-col-cari' ,
headerClasses : 'ol-col-cari' ,
style : 'width:130px; min-width:130px; max-width:13 0px; ' ,
headerStyle : 'width:130px; min-width:130px; max-width:130px;'
style : 'max-width:20 0px'
} ,
{ name : 'MusteriTemsilcisi' , label : 'Temsilci' , field : 'MusteriTemsilcisi' , align : 'left' , sortable : true , style : 'width:78px; min-width:78px;' , headerStyle : 'width:78px; min-width:78px;' } ,
{ name : 'Piyasa ' , label : 'Piyasa ' , field : 'Piyasa ' , align : 'left' , sortable : true , style : 'width:74px; min-width:74px;' , headerStyle : 'width:74px; min-width:74px;' } ,
{ name : 'CreditableConfirmedDate ' , label : 'Onay ' , field : 'CreditableConfirmedDate ' , align : 'center ' , sortable : true , style : 'width:82px; min-width:82px;' , headerStyle : 'width:82px; min-width:82px;' } ,
{ name : 'DocCurrencyCode' , label : 'PB' , field : 'DocCurrencyCode' , align : 'center' , sortable : true , style : 'width:46px; min-width:46px;' , headerStyle : 'width:46px; min-width:46px;' } ,
{ name : 'MusteriTemsilcisi ' , label : 'Temsilci ' , field : 'MusteriTemsilcisi ' , align : 'left' , sortable : true } ,
{ name : 'Piyasa ' , label : 'Piyasa ' , field : 'Piyasa ' , align : 'left ' , sortable : true } ,
{ name : 'CreditableConfirmedDate' , label : 'Onay' , field : 'CreditableConfirmedDate' , align : 'center' , sortable : true } ,
{ name : 'DocCurrencyCode' , label : 'PB' , field : 'DocCurrencyCode' , align : 'center' , sortable : true } ,
{
name : 'TotalAmount' ,
@@ -362,8 +315,6 @@ const columns = [
field : 'TotalAmount' ,
align : 'right' ,
sortable : true ,
style : 'width:94px; min-width:94px;' ,
headerStyle : 'width:94px; min-width:94px;' ,
format : ( val , row ) =>
Number ( val || 0 ) . toLocaleString ( 'tr-TR' , { minimumFractionDigits : 2 } ) +
' ' + row . DocCurrencyCode
@@ -375,49 +326,11 @@ const columns = [
field : 'TotalAmountUSD' ,
align : 'right' ,
sortable : true ,
style : 'width:96px; min-width:96px;' ,
headerStyle : 'width:96px; min-width:96px;' ,
format : val =>
Number ( val || 0 ) . toLocaleString ( 'tr-TR' , { minimumFractionDigits : 2 } ) + ' USD'
} ,
{
name : 'PackedAmount' ,
label : 'Paket Tutar' ,
field : 'PackedAmount' ,
align : 'right' ,
sortable : true ,
style : 'width:98px; min-width:98px;' ,
headerStyle : 'width:98px; min-width:98px;' ,
format : ( val , row ) =>
Number ( val || 0 ) . toLocaleString ( 'tr-TR' , { minimumFractionDigits : 2 } ) +
' ' + ( row . DocCurrencyCode || '' )
} ,
{
name : 'PackedUSD' ,
label : 'Paket USD' ,
field : 'PackedUSD' ,
align : 'right' ,
sortable : true ,
style : 'width:96px; min-width:96px;' ,
headerStyle : 'width:96px; min-width:96px;' ,
format : val =>
Number ( val || 0 ) . toLocaleString ( 'tr-TR' , { minimumFractionDigits : 2 } ) + ' USD'
} ,
{
name : 'PackedRatePct' ,
label : 'Paket %' ,
field : 'PackedRatePct' ,
align : 'right' ,
sortable : true ,
style : 'width:72px; min-width:72px;' ,
headerStyle : 'width:72px; min-width:72px;' ,
format : val =>
Number ( val || 0 ) . toLocaleString ( 'tr-TR' , { minimumFractionDigits : 2 } ) + ' %'
} ,
{ name : 'IsCreditableConfirmed' , label : 'Durum' , field : 'IsCreditableConfirmed' , align : 'center' , sortable : true , style : 'width:66px; min-width:66px;' , headerStyle : 'width:66px; min-width:66px;' } ,
{ name : 'IsCreditableConfirmed' , label : 'Durum' , field : 'IsCreditableConfirmed' , align : 'center' , sortable : true } ,
{
name : 'Description' ,
@@ -427,10 +340,10 @@ const columns = [
sortable : false ,
classes : 'ol-col-desc' ,
headerClasses : 'ol-col-desc' ,
style : 'width:130px; min-width:130px; max-width:13 0px; ' ,
headerStyle : 'width:130px; min-width:130px; max-width:130px;'
style : 'max-width:22 0px'
} ,
{ name : 'pdf' , label : 'PDF' , field : 'pdf' , align : 'center' , sortable : false , style : 'width:44px; min-width:44px;' , headerStyle : 'width:44px; min-width:44px;' }
{ name : 'pdf' , label : 'PDF' , field : 'pdf' , align : 'center' , sortable : false }
]
/* =========================
@@ -438,11 +351,6 @@ const columns = [
========================= */
function selectOrder ( row ) {
if ( ! canUpdateOrder . value ) {
$q . notify ( { type : 'negative' , message : 'Siparis guncelleme yetkiniz yok' } )
return
}
if ( ! row ? . OrderHeaderID ) {
$q . notify ( { type : 'warning' , message : 'OrderHeaderID bulunamadı ' } )
return
@@ -456,11 +364,6 @@ function selectOrder (row) {
}
async function printPDF ( row ) {
if ( ! canExportOrder . value ) {
$q . notify ( { type : 'negative' , message : 'PDF export yetkiniz yok' } )
return
}
if ( ! row ? . OrderHeaderID ) return
const token = useAuthStore ( ) . token
@@ -499,48 +402,7 @@ function clearFilters () {
========================= */
onMounted ( ( ) => {
if ( canRead Order. value ) {
store . fetchOrders ( )
}
store . fetch Orders ( )
} )
< / script >
< style scoped >
. ol - page {
padding : 8 px ;
}
. ol - table : deep ( . q - table thead th ) {
font - size : 11 px ;
line - height : 1.1 ;
font - weight : 700 ;
padding : 3 px 6 px ;
white - space : nowrap ;
}
. ol - table : deep ( . q - table tbody td ) {
font - size : 11 px ;
line - height : 1.15 ;
padding : 2 px 6 px ;
white - space : nowrap ;
}
. ol - col - multiline {
white - space : normal ! important ;
word - break : break - word ;
line - height : 1.1 ;
display : - webkit - box ;
- webkit - line - clamp : 2 ;
- webkit - box - orient : vertical ;
overflow : hidden ;
}
@ media ( max - width : 1600 px ) {
. ol - table : deep ( . q - table thead th ) ,
. ol - table : deep ( . q - table tbody td ) {
font - size : 10 px ;
padding : 2 px 4 px ;
}
}
< / style >