Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-02-25 10:40:07 +03:00
parent 47848fc14d
commit 15e51e9c39
21 changed files with 1526 additions and 618 deletions

View File

@@ -724,6 +724,13 @@
:disable="isClosedRow || isViewOnly || !canMutateRows"
/>
<q-btn
v-if="canMutateRows"
color="secondary"
label="Kaydet ve Diğer Renge Geç"
@click="onSaveAndNextColor"
:disable="isClosedRow || isViewOnly || !canMutateRows"
/>
<q-btn
v-if="isEditing && canMutateRows"
color="negative"
@@ -2831,6 +2838,76 @@ const onSaveOrUpdateRow = async () => {
showEditor.value = false
}
function normalizeColorValue(val) {
return String(val || '').trim().toUpperCase()
}
function getNextColorValue() {
const options = Array.isArray(renkOptions.value) ? renkOptions.value : []
if (!options.length) return null
const current = normalizeColorValue(form.renk)
const idx = options.findIndex(o => normalizeColorValue(o.value) === current)
if (idx === -1) return null
const next = options[idx + 1]
return next ? next.value : null
}
const onSaveAndNextColor = async () => {
if (!hasRowMutationPermission()) {
notifyNoPermission(
isEditMode.value
? 'Siparis satiri guncelleme yetkiniz yok'
: 'Siparis satiri kaydetme yetkiniz yok'
)
return
}
if (!form.model) {
$q.notify({ type: 'warning', message: 'Model seçiniz' })
return
}
if (!form.renk) {
$q.notify({ type: 'warning', message: 'Renk seçiniz' })
return
}
const ok = await orderStore.saveOrUpdateRowUnified({
form,
recalcVat: typeof recalcVat === 'function' ? recalcVat : null,
resetEditor: () => {},
stockMap,
$q
})
if (!ok) return
// Edit state temizle: renk değişimi combo delete tetiklemesin
orderStore.editingKey = null
orderStore.selected = null
const nextColor = getNextColorValue()
if (!nextColor) {
$q.notify({
type: 'warning',
message: 'Son renktesiniz. Lütfen farklı bir renk seçin.',
position: 'top-right'
})
return
}
form.renk2 = ''
await onColorChange(nextColor)
$q.notify({
type: 'info',
message: 'Satır kaydedildi. Bir sonraki renge geçildi.',
position: 'top-right'
})
}