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

@@ -710,12 +710,28 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
pageW, _ := pdf.GetPageSize()
marginL := 10.0
y := 8.0
shorten := func(s string, max int) string {
r := []rune(strings.TrimSpace(s))
if len(r) <= max {
return string(r)
}
if max < 3 {
return string(r[:max])
}
return string(r[:max-3]) + "..."
}
/* ----------------------------------------------------
1) LOGO
---------------------------------------------------- */
if logoPath, err := resolvePdfImagePath("Baggi-Tekstil-A.s-Logolu.jpeg"); err == nil {
pdf.ImageOptions(logoPath, marginL, y, 32, 0, false, gofpdf.ImageOptions{}, 0, "")
} else {
pdf.SetFont("dejavu", "B", 12)
pdf.SetTextColor(149, 113, 22)
pdf.SetXY(marginL, y+6)
pdf.CellFormat(32, 6, "BAGGI", "", 0, "L", false, 0, "")
pdf.SetTextColor(0, 0, 0)
}
/* ----------------------------------------------------
@@ -737,19 +753,19 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
3) SAĞ TARAF BİLGİ KUTUSU
---------------------------------------------------- */
boxW := 78.0
boxH := 30.0
boxX := pageW - marginL - boxW
boxY := y - 2
pdf.SetDrawColor(180, 180, 180)
pdf.Rect(boxX, boxY, boxW, boxH, "")
pdf.SetFont("dejavu", "B", 9)
pdf.SetTextColor(149, 113, 22)
rep := strings.TrimSpace(h.CustomerRep)
if rep == "" {
rep = strings.TrimSpace(h.CreatedUser)
}
desc := strings.TrimSpace(h.Description)
if desc == "" {
desc = strings.TrimSpace(h.InternalDesc)
}
info := []string{
"Formun Basılma Tarihi: " + time.Now().Format("02.01.2006"),
@@ -759,12 +775,24 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
"Cari Kod: " + h.CurrAccCode,
"Müşteri: " + h.CurrAccName,
}
if desc != "" {
info = append(info, "Sipariş Açıklaması: "+shorten(desc, 52))
}
lineH := 4.5
boxH := float64(len(info))*lineH + 3
if boxH < 30 {
boxH = 30
}
pdf.SetDrawColor(180, 180, 180)
pdf.Rect(boxX, boxY, boxW, boxH, "")
iy := boxY + 3
for _, line := range info {
pdf.SetXY(boxX+3, iy)
pdf.CellFormat(boxW-6, 4.5, line, "", 0, "L", false, 0, "")
iy += 4.5
pdf.CellFormat(boxW-6, lineH, line, "", 0, "L", false, 0, "")
iy += lineH
}
/* ----------------------------------------------------
@@ -780,10 +808,6 @@ func drawOrderHeader(pdf *gofpdf.Fpdf, h *OrderHeader, showDesc bool) float64 {
/* ----------------------------------------------------
5) AÇIKLAMA (Varsa)
---------------------------------------------------- */
desc := strings.TrimSpace(h.Description)
if desc == "" {
desc = strings.TrimSpace(h.InternalDesc)
}
if showDesc && desc != "" {
text := desc

View File

@@ -1,125 +0,0 @@
/* eslint-disable */
/**
* THIS FILE IS GENERATED AUTOMATICALLY.
* 1. DO NOT edit this file directly as it won't do anything.
* 2. EDIT the original quasar.config file INSTEAD.
* 3. DO NOT git commit this file. It should be ignored.
*
* This file is still here because there was an error in
* the original quasar.config file and this allows you to
* investigate the Node.js stack error.
*
* After you fix the original file, this file will be
* deleted automatically.
**/
// quasar.config.js
import { defineConfig } from "@quasar/app-webpack/wrappers";
var quasar_config_default = defineConfig(() => {
const apiBaseUrl = (process.env.VITE_API_BASE_URL || "/api").trim();
return {
/* =====================================================
APP INFO
===================================================== */
productName: "Baggi BSS",
productDescription: "Baggi Tekstil Business Support System",
/* =====================================================
BOOT FILES
===================================================== */
boot: ["dayjs"],
/* =====================================================
GLOBAL CSS
===================================================== */
css: ["app.css"],
/* =====================================================
ICONS / FONTS
===================================================== */
extras: [
"roboto-font",
"material-icons"
],
/* =====================================================
BUILD (PRODUCTION)
===================================================== */
build: {
vueRouterMode: "hash",
env: {
VITE_API_BASE_URL: apiBaseUrl
},
esbuildTarget: {
browser: ["es2022", "firefox115", "chrome115", "safari14"],
node: "node20"
},
// Cache & performance
gzip: true,
preloadChunks: true
},
/* =====================================================
DEV SERVER (LOCAL)
===================================================== */
devServer: {
server: { type: "http" },
port: 9e3,
open: true,
// DEV proxy (CORS'suz)
proxy: [
{
context: ["/api"],
target: "http://localhost:8080",
changeOrigin: true,
secure: false
}
]
},
/* =====================================================
QUASAR FRAMEWORK
===================================================== */
framework: {
config: {
notify: {
position: "top",
timeout: 2500
}
},
lang: "tr",
plugins: [
"Loading",
"Dialog",
"Notify"
]
},
animations: [],
/* =====================================================
SSR / PWA (DISABLED)
===================================================== */
ssr: {
prodPort: 3e3,
middlewares: ["render"],
pwa: false
},
pwa: {
workboxMode: "GenerateSW"
},
/* =====================================================
MOBILE / DESKTOP
===================================================== */
capacitor: {
hideSplashscreen: true
},
electron: {
preloadScripts: ["electron-preload"],
inspectPort: 5858,
bundler: "packager",
builder: {
appId: "baggisowtfaresystem"
}
},
bex: {
extraScripts: []
}
};
});
export {
quasar_config_default as default
};

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'
}