Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-02-21 21:47:10 +03:00
parent f9a6457fca
commit ac299e2138
4 changed files with 202 additions and 179 deletions

View File

@@ -1,11 +1,8 @@
<template>
<q-page class="q-pa-md">
<div class="row items-center justify-between">
<q-page class="q-pa-md full-width order-prod-page">
<div class="row items-center justify-between page-header">
<div>
<div class="text-h6 text-weight-bold">Uretime Verilen Urunleri Guncelle</div>
<div class="text-caption text-grey-7 q-mt-xs">
OrderHeaderID: {{ orderHeaderID || '-' }}
</div>
</div>
<q-btn
color="primary"
@@ -16,7 +13,7 @@
/>
</div>
<div class="filter-bar row q-col-gutter-md q-mt-md">
<div class="filter-bar row q-col-gutter-md">
<div class="col-5">
<q-input
:model-value="cariLabel"
@@ -64,20 +61,21 @@
</div>
</div>
<q-table
class="q-mt-md"
flat
bordered
dense
separator="cell"
row-key="RowKey"
:rows="filteredRows"
:columns="columns"
:loading="store.loading"
no-data-label="Uretime verilecek urun bulunamadi"
:rows-per-page-options="[0]"
hide-bottom
>
<div class="table-wrap">
<q-table
class="q-mt-md prod-table"
flat
bordered
dense
separator="cell"
row-key="RowKey"
:rows="filteredRows"
:columns="columns"
:loading="store.loading"
no-data-label="Uretime verilecek urun bulunamadi"
:rows-per-page-options="[0]"
hide-bottom
>
<template #body-cell-actions="props">
<q-td :props="props" class="text-center">
<q-btn
@@ -171,16 +169,19 @@
</template>
<template #body-cell-NewDesc="props">
<q-td :props="props">
<q-td :props="props" class="cell-new">
<q-input
v-model="props.row.NewDesc"
dense
filled
type="textarea"
autogrow
label="Yeni Aciklama"
/>
</q-td>
</template>
</q-table>
</div>
<q-banner v-if="store.error" class="bg-red text-white q-mt-sm">
Hata: {{ store.error }}
@@ -215,16 +216,16 @@ const productSearch = ref('')
const rowSavingId = ref('')
const columns = [
{ name: 'OldItemCode', label: 'Eski Urun Kodu', field: 'OldItemCode', align: 'left', sortable: true, style: 'min-width:140px;white-space:nowrap', headerStyle: 'min-width:140px;white-space:nowrap' },
{ name: 'OldColor', label: 'Eski Urun Rengi', field: 'OldColor', align: 'left', sortable: true, style: 'min-width:120px;white-space:nowrap', headerStyle: 'min-width:120px;white-space:nowrap' },
{ name: 'OldDim2', label: 'Eski 2. Renk', field: 'OldDim2', align: 'left', sortable: true, style: 'min-width:110px;white-space:nowrap', headerStyle: 'min-width:110px;white-space:nowrap' },
{ name: 'OldDesc', label: 'Eski Aciklama', field: 'OldDesc', align: 'left', sortable: false, style: 'min-width:180px;white-space:nowrap', headerStyle: 'min-width:180px;white-space:nowrap' },
{ name: 'OldSizes', label: 'Bedenler', field: 'OldSizesLabel', align: 'left', sortable: false, style: 'min-width:160px;white-space:nowrap', headerStyle: 'min-width:160px;white-space:nowrap' },
{ name: 'NewItemCode', label: 'Yeni Urun Kodu', field: 'NewItemCode', align: 'left', sortable: false, style: 'min-width:190px;', headerStyle: 'min-width:190px;' },
{ name: 'NewColor', label: 'Yeni Urun Rengi', field: 'NewColor', align: 'left', sortable: false, style: 'min-width:160px;', headerStyle: 'min-width:160px;' },
{ name: 'NewDim2', label: 'Yeni 2. Renk', field: 'NewDim2', align: 'left', sortable: false, style: 'min-width:160px;', headerStyle: 'min-width:160px;' },
{ name: 'NewDesc', label: 'Yeni Aciklama', field: 'NewDesc', align: 'left', sortable: false, style: 'min-width:220px;', headerStyle: 'min-width:220px;' },
{ name: 'actions', label: '', field: 'actions', align: 'center', sortable: false, style: 'width:60px;', headerStyle: 'width:60px;' }
{ name: 'OldItemCode', label: 'Eski Urun Kodu', field: 'OldItemCode', align: 'left', sortable: true, style: 'min-width:120px;white-space:nowrap', headerStyle: 'min-width:120px;white-space:nowrap', headerClasses: 'col-old', classes: 'col-old' },
{ name: 'OldColor', label: 'Eski Urun Rengi', field: 'OldColor', align: 'left', sortable: true, style: 'min-width:100px;white-space:nowrap', headerStyle: 'min-width:100px;white-space:nowrap', headerClasses: 'col-old', classes: 'col-old' },
{ name: 'OldDim2', label: 'Eski 2. Renk', field: 'OldDim2', align: 'left', sortable: true, style: 'min-width:90px;white-space:nowrap', headerStyle: 'min-width:90px;white-space:nowrap', headerClasses: 'col-old', classes: 'col-old' },
{ name: 'OldDesc', label: 'Eski Aciklama', field: 'OldDesc', align: 'left', sortable: false, style: 'min-width:160px;', headerStyle: 'min-width:160px;', headerClasses: 'col-old col-desc', classes: 'col-old col-desc' },
{ name: 'OldSizes', label: 'Bedenler', field: 'OldSizesLabel', align: 'left', sortable: false, style: 'min-width:130px;', headerStyle: 'min-width:130px;', headerClasses: 'col-old col-wrap', classes: 'col-old col-wrap' },
{ name: 'NewItemCode', label: 'Yeni Urun Kodu', field: 'NewItemCode', align: 'left', sortable: false, style: 'min-width:160px;', headerStyle: 'min-width:160px;', headerClasses: 'col-new col-new-first', classes: 'col-new col-new-first' },
{ name: 'NewColor', label: 'Yeni Urun Rengi', field: 'NewColor', align: 'left', sortable: false, style: 'min-width:120px;', headerStyle: 'min-width:120px;', headerClasses: 'col-new', classes: 'col-new' },
{ name: 'NewDim2', label: 'Yeni 2. Renk', field: 'NewDim2', align: 'left', sortable: false, style: 'min-width:120px;', headerStyle: 'min-width:120px;', headerClasses: 'col-new', classes: 'col-new' },
{ name: 'NewDesc', label: 'Yeni Aciklama', field: 'NewDesc', align: 'left', sortable: false, style: 'min-width:200px;', headerStyle: 'min-width:200px;', headerClasses: 'col-new col-desc', classes: 'col-new col-desc' },
{ name: 'actions', label: '', field: 'actions', align: 'center', sortable: false, style: 'width:50px;', headerStyle: 'width:50px;' }
]
onMounted(async () => {
@@ -238,7 +239,7 @@ watch(orderHeaderID, async (id) => {
watch(
() => store.items,
(items) => {
rows.value = groupItems(items || [])
rows.value = groupItems(items || [], rows.value)
},
{ immediate: true }
)
@@ -342,12 +343,18 @@ function formatSizes (sizeMap) {
return { list: entries.map(([k]) => k), label }
}
function groupItems (items) {
function groupItems (items, prevRows = []) {
const prevMap = new Map()
for (const r of prevRows || []) {
if (r?.RowKey) prevMap.set(r.RowKey, String(r.NewDesc || '').trim())
}
const map = new Map()
for (const it of items) {
const key = buildGroupKey(it)
if (!map.has(key)) {
const prevDesc = prevMap.get(key) || ''
const fallbackDesc = String((it?.NewDesc || it?.OldDesc) || '').trim()
map.set(key, {
RowKey: key,
OrderHeaderID: it.OrderHeaderID,
@@ -362,7 +369,7 @@ function groupItems (items) {
NewItemCode: '',
NewColor: '',
NewDim2: '',
NewDesc: '',
NewDesc: prevDesc || fallbackDesc,
IsVariantMissing: !!it.IsVariantMissing
})
}
@@ -397,7 +404,7 @@ function buildPayloadLines () {
NewItemCode: String(r.NewItemCode || '').trim(),
NewColor: String(r.NewColor || '').trim(),
NewDim2: String(r.NewDim2 || '').trim(),
NewDesc: String(r.NewDesc || '').trim()
NewDesc: String((r.NewDesc || r.OldDesc) || '').trim()
}))
)
}
@@ -413,7 +420,7 @@ async function onRowSubmit (row) {
NewItemCode: String(row.NewItemCode || '').trim(),
NewColor: String(row.NewColor || '').trim(),
NewDim2: String(row.NewDim2 || '').trim(),
NewDesc: String(row.NewDesc || '').trim()
NewDesc: String((row.NewDesc || row.OldDesc) || '').trim()
}
if (!baseLine.NewItemCode || !baseLine.NewColor) {
@@ -461,3 +468,119 @@ async function onRowSubmit (row) {
}
}
</script>
<style scoped>
.prod-table :deep(th) {
font-weight: 700;
letter-spacing: 0.2px;
}
.prod-table :deep(td) {
vertical-align: middle;
}
.prod-table :deep(.q-table__container) {
width: 100%;
}
.prod-table :deep(.q-table) {
font-size: 11px;
}
.order-prod-page {
--header-height: 56px;
--filter-bar-height: 72px;
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
}
.page-header {
position: sticky;
top: 0;
z-index: 8;
background: #fff;
margin-top: -8px;
margin-bottom: 8px;
padding-top: 4px;
padding-bottom: 6px;
}
.filter-bar {
position: sticky;
top: var(--header-height);
z-index: 7;
background: #fff;
padding-top: 4px;
padding-bottom: 8px;
}
.table-wrap {
flex: 1;
min-height: 0;
display: flex;
}
.prod-table :deep(.q-table__middle) {
max-height: calc(100vh - var(--header-height) - var(--filter-bar-height) - 140px);
overflow: auto;
}
.prod-table :deep(.q-table__container) {
height: 100%;
display: flex;
flex-direction: column;
}
.prod-table :deep(.q-table thead tr th) {
position: sticky;
top: 0;
z-index: 6;
background: #fff;
}
.prod-table :deep(th.col-old),
.prod-table :deep(td.col-old) {
background: #fff0d9;
}
.prod-table :deep(th.col-new),
.prod-table :deep(td.col-new) {
background: #e3f3ff;
}
.prod-table :deep(th.col-old) {
color: #8a5a00;
}
.prod-table :deep(th.col-new) {
color: #0d4f7a;
}
.prod-table :deep(td.col-old) {
border-left: 4px solid #f0a500;
}
.prod-table :deep(td.col-new) {
border-left: 4px solid #2d9cdb;
}
.prod-table :deep(th.col-new-first),
.prod-table :deep(td.col-new-first) {
border-left: 6px solid #1b7cc8;
}
.prod-table :deep(td.cell-new) {
background: #e3f3ff;
}
.prod-table :deep(td.col-desc),
.prod-table :deep(th.col-desc),
.prod-table :deep(td.col-wrap),
.prod-table :deep(th.col-wrap) {
white-space: normal;
word-break: break-word;
line-height: 1.2;
}
</style>

View File

@@ -2775,9 +2775,12 @@ export const useOrderEntryStore = defineStore('orderentry', {
this.markAsSaved?.()
/* =======================================================
🧹 KRİTİK: NEW → EDIT geçişinde TÜM SNAPSHOT TEMİZLENİR
🧹 KRİTİK: NEW → EDIT geçişinde TÜM SNAPSHOT + NEW DRAFT temizlenir
======================================================= */
this.clearAllOrderSnapshots()
if (isNew) {
this.clearNewDraft()
}
$q.notify({
type: 'positive',
@@ -3439,6 +3442,11 @@ export function detectBedenGroup(bedenList, urunAnaGrubu = '', urunKategori = ''
? bedenList.map(v => (v || '').toString().trim().toUpperCase())
: [' ']
// 🔸 Harfli beden varsa doğrudan "gom" (gömlek/üst giyim)
// STD/ONE SIZE aksbir için saklı kalsın.
const harfliBedenler = ['XS','S','M','L','XL','2XL','3XL','4XL','5XL','6XL','7XL']
if (list.some(b => harfliBedenler.includes(b))) return 'gom'
const ana = (urunAnaGrubu || '')
.toUpperCase()
.trim()
@@ -3472,13 +3480,6 @@ export function detectBedenGroup(bedenList, urunAnaGrubu = '', urunKategori = ''
// 🔸 Yaş grubu (çocuk/garson)
if (kat.includes('GARSON') || kat.includes('ÇOCUK')) return 'yas'
// 🔸 Harfli beden varsa doğrudan "gom" (gömlek, üst giyim)
const harfliBedenler = ['XS','S','M','L','XL','XXL','3XL','4XL']
if (list.some(b => harfliBedenler.includes(b))) return 'gom'
// 🔸 Varsayılan: takım elbise
return 'tak'
}