|
|
@@ -45,39 +45,43 @@ const goodstechnologymaken = (props) => { |
|
|
|
interdata() |
|
|
|
}, []) |
|
|
|
const interdata = () => { |
|
|
|
getbyidgoods(props.goodsid).then((res) => { |
|
|
|
if (res.succeeded) { |
|
|
|
|
|
|
|
if (res.data.goodsAttributeList.length == 0) { |
|
|
|
setdisplay("none") |
|
|
|
}else{ |
|
|
|
res.data.goodsAttributeList.forEach(item=>{ |
|
|
|
item.defalutvalue=[]; |
|
|
|
item.goodsAttributeValueList.forEach(x=>{ |
|
|
|
if(item.attributeName=="默认属性"){ |
|
|
|
x.check=true; |
|
|
|
setAttrvalue(x.attributeValue) |
|
|
|
item.defalutvalue.push(x.goodsAttributeValuId) |
|
|
|
}else{ |
|
|
|
x.check=false; |
|
|
|
} |
|
|
|
console.log("props.goodsid",props.goodsid) |
|
|
|
if(props.goodsid!=undefined){ |
|
|
|
getbyidgoods(props.goodsid).then((res) => { |
|
|
|
if (res.succeeded) { |
|
|
|
|
|
|
|
if (res.data.goodsAttributeList.length == 0) { |
|
|
|
setdisplay("none") |
|
|
|
}else{ |
|
|
|
res.data.goodsAttributeList.forEach(item=>{ |
|
|
|
item.defalutvalue=[]; |
|
|
|
item.goodsAttributeValueList.forEach(x=>{ |
|
|
|
if(item.attributeName=="默认属性"){ |
|
|
|
x.check=true; |
|
|
|
setAttrvalue(x.attributeValue) |
|
|
|
item.defalutvalue.push(x.goodsAttributeValuId) |
|
|
|
}else{ |
|
|
|
x.check=false; |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log("商品属性",res.data) |
|
|
|
setGoodsinfo(res.data) |
|
|
|
var it = [ |
|
|
|
// {key:'1',label:'',children:(<div><img style={{width:100,height:100}} src={res.data.imgUrl}></img></div>)}, |
|
|
|
{ key: '1', label: '商品名称', children: res.data.name }, |
|
|
|
{ key: '2', label: '商品价格', children: res.data.price }, |
|
|
|
{ key: '3', label: '商品类型', children: res.data.goodsTypeName }, |
|
|
|
{ key: '4', label: '商品单位', children: res.data.goodsUintName }, |
|
|
|
] |
|
|
|
setItems(it) |
|
|
|
} else { |
|
|
|
message.error("查询商品信息失败"); |
|
|
|
} |
|
|
|
console.log("商品属性",res.data) |
|
|
|
setGoodsinfo(res.data) |
|
|
|
var it = [ |
|
|
|
// {key:'1',label:'',children:(<div><img style={{width:100,height:100}} src={res.data.imgUrl}></img></div>)}, |
|
|
|
{ key: '1', label: '商品名称', children: res.data.name }, |
|
|
|
{ key: '2', label: '商品价格', children: res.data.price }, |
|
|
|
{ key: '3', label: '商品类型', children: res.data.goodsTypeName }, |
|
|
|
{ key: '4', label: '商品单位', children: res.data.goodsUintName }, |
|
|
|
] |
|
|
|
setItems(it) |
|
|
|
} else { |
|
|
|
message.error("查询商品信息失败"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// GetGoodsTechnology().then((r) => { |
|
|
|
// var data = r.data; |
|
|
|
// var sd = [] |
|
|
@@ -157,7 +161,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
item.data.forEach(item => { |
|
|
|
const obj = {}; |
|
|
|
let propsdatanew = []; |
|
|
|
let propsdata = technologyattralldata.filter(x => x.goodstechnologyId == item.chnologyId) |
|
|
|
let propsdata = technologyattralldata.filter(x => x.productFunctionId == item.chnologyId) |
|
|
|
obj.stepName = item.stepName; |
|
|
|
obj.id = item.id; |
|
|
|
obj.chnologyId = item.chnologyId; |
|
|
@@ -170,7 +174,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
actionName: x.actionName, |
|
|
|
actionType: x.actionType, |
|
|
|
actionValue: x.actionValue, |
|
|
|
goodstechnologyId: x.goodstechnologyId, |
|
|
|
goodstechnologyId: x.productFunctionId, |
|
|
|
isBatch: x.isBatch, |
|
|
|
sort: x.sort, |
|
|
|
goddteid: item.id |
|
|
@@ -245,7 +249,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
if (sd) { |
|
|
|
if (sd.goodsTechnologyInfo.length > 0) { |
|
|
|
godata = sd.goodsTechnologyInfo.map(x => { |
|
|
|
return { value: x.goodsTechnologyId, label: x.name } |
|
|
|
return { value: x.deviceTechnologyId, label: x.name } |
|
|
|
}) |
|
|
|
|
|
|
|
setgoodstechnologydata(godata) |
|
|
|