Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user