Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -521,6 +521,7 @@ const serverFilterLastQuery = ref({})
|
||||
const filterSearch = ref({ productCode: '', urunIlkGrubu: '', urunAnaGrubu: '' })
|
||||
const imageCache = new Map()
|
||||
const imageListCache = new Map()
|
||||
const variantCodeCollator = new Intl.Collator('tr', { numeric: true, sensitivity: 'base' })
|
||||
const mainTableRef = ref(null)
|
||||
const topScrollRef = ref(null)
|
||||
let syncingScroll = false
|
||||
@@ -648,7 +649,7 @@ function buildRows (products, variants) {
|
||||
out.push(row)
|
||||
continue
|
||||
}
|
||||
list.sort((a, b) => toText(a?.variant_code).localeCompare(toText(b?.variant_code), 'tr'))
|
||||
list.sort((a, b) => variantCodeCollator.compare(toText(a?.variant_code), toText(b?.variant_code)))
|
||||
for (const v of list) {
|
||||
const d1 = Number(v?.dim1 || 0)
|
||||
const d3 = v?.dim3 == null ? 0 : Number(v?.dim3 || 0)
|
||||
@@ -991,17 +992,17 @@ const allColumns = [
|
||||
col('brandGroupSelection', 'MARKA GRUBU', 'brandGroupSelection', 86, { classes: 'ps-col sticky-col' }),
|
||||
col('marka', 'MARKA', 'marka', 72, { sortable: true, classes: 'ps-col sticky-col' }),
|
||||
col('productCode', 'URUN KODU', 'productCode', 112, { sortable: true, classes: 'ps-col product-code-col sticky-col' }),
|
||||
col('variantCodes', 'VARYANT', 'variantCodes', 128, { classes: 'ps-col variant-col sticky-col' }),
|
||||
col('variantStocks', 'STOK', 'stockQty', 72, { align: 'right', sortable: true, classes: 'ps-col variant-stock-col sticky-col' }),
|
||||
col('campaignLabel', 'KAMPANYA', 'campaignLabel', 150, { classes: 'ps-col campaign-col sticky-col' }),
|
||||
col('campaignRate', 'IND %', 'campaignRate', 64, { align: 'right', classes: 'ps-col campaign-rate-col sticky-col' }),
|
||||
col('askiliYan', 'ASKILI YAN', 'askiliYan', 72, { sortable: true, classes: 'ps-col' }),
|
||||
col('kategori', 'KATEGORI', 'kategori', 82, { sortable: true, classes: 'ps-col' }),
|
||||
col('urunIlkGrubu', 'URUN ILK GRUBU', 'urunIlkGrubu', 88, { sortable: true, classes: 'ps-col' }),
|
||||
col('urunAnaGrubu', 'URUN ANA GRUBU', 'urunAnaGrubu', 96, { sortable: true, classes: 'ps-col' }),
|
||||
col('urunAltGrubu', 'URUN ALT GRUBU', 'urunAltGrubu', 96, { sortable: true, classes: 'ps-col' }),
|
||||
col('icerik', 'ICERIK', 'icerik', 112, { sortable: true, classes: 'ps-col' }),
|
||||
col('karisim', 'KARISIM', 'karisim', 96, { sortable: true, classes: 'ps-col' }),
|
||||
col('variantCodes', 'VARYANT', 'variantCodes', 82, { align: 'center', classes: 'ps-col variant-col sticky-col center-col' }),
|
||||
col('variantStocks', 'STOK', 'stockQty', 64, { align: 'center', sortable: true, classes: 'ps-col variant-stock-col sticky-col center-col' }),
|
||||
col('campaignLabel', 'KAMPANYA', 'campaignLabel', 118, { align: 'center', classes: 'ps-col campaign-col sticky-col center-col' }),
|
||||
col('campaignRate', 'IND %', 'campaignRate', 56, { align: 'center', classes: 'ps-col campaign-rate-col sticky-col center-col' }),
|
||||
col('askiliYan', 'ASKILI YAN', 'askiliYan', 58, { sortable: true, classes: 'ps-col center-col' }),
|
||||
col('kategori', 'KATEGORI', 'kategori', 72, { sortable: true, classes: 'ps-col center-col' }),
|
||||
col('urunIlkGrubu', 'URUN ILK GRUBU', 'urunIlkGrubu', 72, { sortable: true, classes: 'ps-col center-col' }),
|
||||
col('urunAnaGrubu', 'URUN ANA GRUBU', 'urunAnaGrubu', 84, { sortable: true, classes: 'ps-col center-col' }),
|
||||
col('urunAltGrubu', 'URUN ALT GRUBU', 'urunAltGrubu', 84, { sortable: true, classes: 'ps-col center-col' }),
|
||||
col('icerik', 'ICERIK', 'icerik', 92, { sortable: true, classes: 'ps-col' }),
|
||||
col('karisim', 'KARISIM', 'karisim', 88, { sortable: true, classes: 'ps-col karisim-wrap-col' }),
|
||||
...campaignPairs.flatMap((p) => [
|
||||
col(p.base, p.base.toUpperCase().replace(/([A-Z]+)(\d)/, '$1 $2'), p.base, 78, { align: 'right', classes: `${p.base.slice(0, 3)}-col` }),
|
||||
col(p.derived, `${p.base.toUpperCase().replace(/([A-Z]+)(\d)/, '$1 $2')} KMP`, p.derived, 88, { align: 'right', classes: `${p.base.slice(0, 3)}-col campaign-price-col` })
|
||||
@@ -1131,6 +1132,7 @@ function exportVisibleExcel () {
|
||||
a.click()
|
||||
a.remove()
|
||||
URL.revokeObjectURL(url)
|
||||
void notifyExportTaken('excel')
|
||||
}
|
||||
|
||||
function printVisibleRows () {
|
||||
@@ -1154,6 +1156,24 @@ function printVisibleRows () {
|
||||
win.document.open()
|
||||
win.document.write(html)
|
||||
win.document.close()
|
||||
void notifyExportTaken('pdf')
|
||||
}
|
||||
|
||||
async function notifyExportTaken (format) {
|
||||
try {
|
||||
await api.post('/order/price-list/export-notify', {
|
||||
format,
|
||||
row_count: filteredRows.value.length,
|
||||
price_fields: [...selectedPriceOptions.value],
|
||||
product_codes: [...selectedProductCodes.value],
|
||||
campaign_labels: [...selectedCampaignLabels.value],
|
||||
first_groups: Array.from(new Set(filteredRows.value.map((row) => toText(row.urunIlkGrubu)).filter(Boolean))).sort((a, b) => a.localeCompare(b, 'tr')),
|
||||
urun_ilk_grubu: topUrunIlkGrubu.value || '',
|
||||
urun_ana_grubu: topUrunAnaGrubu.value || ''
|
||||
}, { timeout: 30000 })
|
||||
} catch (err) {
|
||||
console.warn('[order-price-list][ui] export notify failed', err?.response?.data || err?.message || err)
|
||||
}
|
||||
}
|
||||
|
||||
function getTableMiddleEl () {
|
||||
@@ -1435,6 +1455,36 @@ onMounted(() => {
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
.pricing-table :deep(td.center-col) {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.pricing-table :deep(td.center-col .q-badge) {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.pricing-table :deep(td.karisim-wrap-col) {
|
||||
white-space: normal !important;
|
||||
text-overflow: clip !important;
|
||||
word-break: break-word;
|
||||
overflow-wrap: anywhere;
|
||||
vertical-align: top !important;
|
||||
text-align: left !important;
|
||||
font-size: 9px;
|
||||
line-height: 1.15;
|
||||
padding: 6px 4px !important;
|
||||
align-content: flex-start;
|
||||
}
|
||||
|
||||
.pricing-table :deep(td.karisim-wrap-col .q-td__content),
|
||||
.pricing-table :deep(td.karisim-wrap-col > div) {
|
||||
align-items: flex-start !important;
|
||||
justify-content: flex-start !important;
|
||||
white-space: normal !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.order-price-list-table :deep(.campaign-price-col) {
|
||||
background: #f6fbf7;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user