diff --git a/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx b/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx index 142a05d..4d542b5 100644 --- a/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx +++ b/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx @@ -144,6 +144,7 @@ const goodstechnologymaken = (props) => { names = names + bs; if (index < updatedValues.length - 1) { names = names + "-" + } } @@ -151,9 +152,12 @@ const goodstechnologymaken = (props) => { item.goodsAttributeValueList.forEach(x=>{ if(value==x.goodsAttributeValuId){ x.check=true; + item.defalutvalue=value } }) + }) + console.log("goodsinfo",goodsinfo) setAttrvalue(names) setCheckvalue(updatedValues) } @@ -165,7 +169,22 @@ const goodstechnologymaken = (props) => { setdefaultValue(item.deviceId) setddevideId(item.deviceId) GetGoodsTechnologyvalue(item.deviceId,"edit",item) - + var gg=goodsinfo.goodsAttributeList.map(x => { + x.goodsAttributeValueList.forEach(t=>{ + var da=item.goodsAttributeId.split(',') + var df=da.find(g=>g==t.goodsAttributeValuId) + if(df){ + t.check=true; + x.defalutvalue=t.goodsAttributeValuId + } + + }) + return x + }) + const nextItems = {...goodsinfo,goodsAttributeList:gg}; + var goodsinfos=nextItems + console.log("goods",goodsinfos) + setGoodsinfo(goodsinfos) //console.log("attr", attr) setUpdataStatus("update") @@ -213,10 +232,14 @@ const goodstechnologymaken = (props) => { console.log("va",va) console.log("value",value) console.log("item",item) + console.log("goodsinfo.goodsAttributeList",goodsinfo.goodsAttributeList) + if(item){ GetwarehousetemplateData(item.deviceId) setWarehousrTemplateId(item.warehousrTemplateId) setdefaulttemplateValue(item.warehousrTemplateId) + + } @@ -453,11 +476,11 @@ const goodstechnologymaken = (props) => {