|
|
@@ -56,21 +56,19 @@ const goodstechnologymaken = (props) => { |
|
|
|
const [defaulttemplateValue, setdefaulttemplateValue] = useState('') |
|
|
|
//控制复制按钮 |
|
|
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false) |
|
|
|
const [reloadProTable, setReloadProTable] = useState(false); |
|
|
|
//新建/分布式弹窗 |
|
|
|
const [showPopup, setShowPopup] = useState(false) |
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
|
const handleCancel = () => { |
|
|
|
setShowPopup(false); |
|
|
|
setIsModalOpen(false); |
|
|
|
setReloadProTable(false); |
|
|
|
}; |
|
|
|
const actionRef = useRef(); |
|
|
|
//打开弹窗 |
|
|
|
const handleButtonClick = () => { |
|
|
|
setShowPopup(true); |
|
|
|
setIsModalOpen(true); |
|
|
|
setReloadProTable(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
@@ -205,27 +203,28 @@ const goodstechnologymaken = (props) => { |
|
|
|
setddevideId(item.deviceId) |
|
|
|
GetGoodsTechnologyvalue(item.deviceId, "edit", item) |
|
|
|
var atrid = [] |
|
|
|
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 |
|
|
|
atrid.push(t.goodsAttributeValuId) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
return x |
|
|
|
}) |
|
|
|
const nextItems = { ...goodsinfo, goodsAttributeList: gg }; |
|
|
|
var goodsinfos = nextItems |
|
|
|
// 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 |
|
|
|
// atrid.push(t.goodsAttributeValuId) |
|
|
|
|
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
// return x |
|
|
|
// }) |
|
|
|
// const nextItems = { ...goodsinfo, goodsAttributeList: gg }; |
|
|
|
// var goodsinfos = nextItems |
|
|
|
setCheckvalue(atrid) |
|
|
|
console.log("checkvalue", atrid) |
|
|
|
setCheckvalue(atrid) |
|
|
|
setGoodsinfo(goodsinfos) |
|
|
|
//setGoodsinfo(goodsinfos) |
|
|
|
setGoodsinfo(goodsinfo) |
|
|
|
//console.log("attr", attr) |
|
|
|
|
|
|
|
setUpdataStatus("update") |
|
|
@@ -313,9 +312,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
} |
|
|
|
//删除设备工艺 |
|
|
|
const onClickDevicedele = (e, devideId, goodsAttributeId, action) => { |
|
|
|
if (goodstechnologydata.length > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
if (goodstechnologydata.length > 0) { |
|
|
|
setgoodstechnologydata([]) |
|
|
|
} |
|
|
|
if (fromdata.length > 0) { |
|
|
@@ -327,17 +324,18 @@ const goodstechnologymaken = (props) => { |
|
|
|
setdefaulttemplateValue() |
|
|
|
} |
|
|
|
if (checkvalue.find(x => goodsAttributeId.includes(x))) { |
|
|
|
var gg = goodsinfo.goodsAttributeList.map(x => { |
|
|
|
x.goodsAttributeValueList.forEach(t => { |
|
|
|
t.check = false; |
|
|
|
x.defalutvalue = "" |
|
|
|
setCheckvalue([]) |
|
|
|
}) |
|
|
|
return x |
|
|
|
}) |
|
|
|
const nextItems = { ...goodsinfo, goodsAttributeList: gg }; |
|
|
|
var goodsinfos = nextItems |
|
|
|
setGoodsinfo(goodsinfos) |
|
|
|
// var gg = goodsinfo.goodsAttributeList.map(x => { |
|
|
|
// x.goodsAttributeValueList.forEach(t => { |
|
|
|
// t.check = false; |
|
|
|
// x.defalutvalue = "" |
|
|
|
// setCheckvalue([]) |
|
|
|
// }) |
|
|
|
// return x |
|
|
|
// }) |
|
|
|
// const nextItems = { ...goodsinfo, goodsAttributeList: gg }; |
|
|
|
// var goodsinfos = nextItems |
|
|
|
// setGoodsinfo(goodsinfos) |
|
|
|
setGoodsinfo(goodsinfo) |
|
|
|
setCheckvalue([]) |
|
|
|
} |
|
|
|
//console.log(goodstechnologydata) |
|
|
@@ -496,16 +494,17 @@ const goodstechnologymaken = (props) => { |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
var gg = goodsinfo.goodsAttributeList.map(x => { |
|
|
|
x.goodsAttributeValueList.forEach(t => { |
|
|
|
t.check = false; |
|
|
|
x.defalutvalue = "" |
|
|
|
}) |
|
|
|
return x |
|
|
|
}) |
|
|
|
const nextItems = { ...goodsinfo, goodsAttributeList: gg }; |
|
|
|
var goodsinfos = nextItems |
|
|
|
setGoodsinfo(goodsinfos) |
|
|
|
// var gg = goodsinfo.goodsAttributeList.map(x => { |
|
|
|
// x.goodsAttributeValueList.forEach(t => { |
|
|
|
// t.check = false; |
|
|
|
// x.defalutvalue = "" |
|
|
|
// }) |
|
|
|
// return x |
|
|
|
// }) |
|
|
|
// const nextItems = { ...goodsinfo, goodsAttributeList: gg }; |
|
|
|
// var goodsinfos = nextItems |
|
|
|
// setGoodsinfo(goodsinfos) |
|
|
|
setGoodsinfo(goodsinfo) |
|
|
|
setCheckvalue([]) |
|
|
|
setUpdataStatus("view") |
|
|
|
setdisabled(false) |
|
|
|