Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-04-03 14:16:05 +03:00
parent 67ef80936a
commit e1064010f3
6 changed files with 133 additions and 9 deletions

View File

@@ -50,6 +50,7 @@ export const useOrderProductionItemStore = defineStore('orderproductionitems', {
secondColorRequestsByKey: {},
newSecondColorRequestsByKey: {},
productAttributesByItemType: {},
productItemAttributesByKey: {},
cdItemLookups: null,
cdItemDraftsByCode: {},
productAttributeDraftsByCode: {},
@@ -272,6 +273,24 @@ export const useOrderProductionItemStore = defineStore('orderproductionitems', {
return []
}
},
async fetchProductItemAttributes (itemCode, itemTypeCode = 1, force = false) {
const code = String(itemCode || '').trim().toUpperCase()
const itc = Number(itemTypeCode || 1)
if (!code) return []
const key = `${itc}|${code}`
if (!force && this.productItemAttributesByKey[key]) {
return this.productItemAttributesByKey[key]
}
try {
const res = await api.get('/product-item-attributes', { params: { itemTypeCode: itc, itemCode: code } })
const list = Array.isArray(res?.data) ? res.data : []
this.productItemAttributesByKey[key] = list
return list
} catch (err) {
this.error = err?.response?.data || err?.message || 'Urunun mevcut ozellikleri alinamadi'
return []
}
},
async fetchCdItemLookups (force = false) {
if (this.cdItemLookups && !force) return this.cdItemLookups
try {