zhaoy 10 months ago
parent
commit
ff3859139d
1 changed files with 26 additions and 3 deletions
  1. +26
    -3
      src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx

+ 26
- 3
src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx View File

@@ -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) => {
<div>
<span style={{ marginRight: 10 }}> <Tag color="blue" style={{ fontSize: 14, fontWeight: 600 }}>{item.attributeName}</Tag>:</span>
<span>
<Radio.Group name={"radiogroup" + index} buttonStyle="solid" onChange={onChangevalue} defaultValue={item.defalutvalue}>
<Radio.Group name={"radiogroup" + index} buttonStyle="solid" onChange={onChangevalue} value={item.defalutvalue}>
{
item.goodsAttributeValueList.map((x, index) => {
return (
<Radio.Button key={index} name={index} defaultChecked={x.check} value={x.goodsAttributeValuId} style={{ marginRight: 22, marginTop: 10 }}>{x.attributeValue}</Radio.Button>
<Radio.Button key={index} name={index} defaultChecked={x.check} checked={x.check} value={x.goodsAttributeValuId} style={{ marginRight: 22, marginTop: 10 }}>{x.attributeValue}</Radio.Button>
)
})
}


Loading…
Cancel
Save