|
@@ -36,6 +36,7 @@ const goodstechnologymaken = (props) => { |
|
|
const [technologyattralldata, setTechnologyattralldata] = useState([]); |
|
|
const [technologyattralldata, setTechnologyattralldata] = useState([]); |
|
|
const [goodsinfo, setGoodsinfo] = useState({}); |
|
|
const [goodsinfo, setGoodsinfo] = useState({}); |
|
|
const [cardcount, setCardcount] = useState([]); |
|
|
const [cardcount, setCardcount] = useState([]); |
|
|
|
|
|
//工艺值 |
|
|
const [goodstechnolog, setgoodstechnolog] = useState([]); |
|
|
const [goodstechnolog, setgoodstechnolog] = useState([]); |
|
|
const [maxsort, setmaxsort] = useState(1); |
|
|
const [maxsort, setmaxsort] = useState(1); |
|
|
const [batchingdata, setbatchingdata] = useState([]); |
|
|
const [batchingdata, setbatchingdata] = useState([]); |
|
@@ -58,28 +59,19 @@ const goodstechnologymaken = (props) => { |
|
|
//新建/分布式弹窗 |
|
|
//新建/分布式弹窗 |
|
|
const [showPopup, setShowPopup] = useState(false) |
|
|
const [showPopup, setShowPopup] = useState(false) |
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
const [title, setTitle] = useState('初始标题'); |
|
|
|
|
|
const handleCancel = () => { |
|
|
const handleCancel = () => { |
|
|
setShowPopup(false); |
|
|
setShowPopup(false); |
|
|
setIsModalOpen(false); |
|
|
setIsModalOpen(false); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const actionRef = useRef(); |
|
|
const actionRef = useRef(); |
|
|
|
|
|
|
|
|
|
|
|
//打开弹窗 |
|
|
const handleButtonClick = () => { |
|
|
const handleButtonClick = () => { |
|
|
setShowPopup(true); |
|
|
setShowPopup(true); |
|
|
setIsModalOpen(true); |
|
|
setIsModalOpen(true); |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOk = () => { |
|
|
|
|
|
showPopup(false); |
|
|
|
|
|
setIsModalOpen(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
interdata() |
|
|
interdata() |
|
@@ -105,7 +97,6 @@ const goodstechnologymaken = (props) => { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
console.log("商品属性", res.data) |
|
|
|
|
|
setGoodsinfo(res.data) |
|
|
setGoodsinfo(res.data) |
|
|
var it = [ |
|
|
var it = [ |
|
|
// {key:'1',label:'',children:(<div><img style={{width:100,height:100}} src={res.data.imgUrl}></img></div>)}, |
|
|
// {key:'1',label:'',children:(<div><img style={{width:100,height:100}} src={res.data.imgUrl}></img></div>)}, |
|
@@ -123,8 +114,10 @@ const goodstechnologymaken = (props) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetGoodsTechnologyAction(props.goodsid).then((r) => { |
|
|
GetGoodsTechnologyAction(props.goodsid).then((r) => { |
|
|
if (r.data.length > 0) { |
|
|
|
|
|
|
|
|
if (r.data.length > 0) |
|
|
|
|
|
{ |
|
|
setgoodstechnolog(r.data) |
|
|
setgoodstechnolog(r.data) |
|
|
|
|
|
|
|
|
// 查询最大值 |
|
|
// 查询最大值 |
|
|
var max = r.data.reduce(function (prev, current) { |
|
|
var max = r.data.reduce(function (prev, current) { |
|
|
return (prev.sort > current.sort) ? prev : current; |
|
|
return (prev.sort > current.sort) ? prev : current; |
|
@@ -147,7 +140,6 @@ const goodstechnologymaken = (props) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const onChangevalue = (e) => { |
|
|
const onChangevalue = (e) => { |
|
|
|
|
|
|
|
|
const { name, value } = e.target; |
|
|
const { name, value } = e.target; |
|
|
let names = ""; |
|
|
let names = ""; |
|
|
let updatedValues = [...checkvalue]; |
|
|
let updatedValues = [...checkvalue]; |
|
@@ -159,8 +151,6 @@ const goodstechnologymaken = (props) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let newId = null; |
|
|
let newId = null; |
|
|
goodsinfo.goodsAttributeList.forEach(item => { |
|
|
goodsinfo.goodsAttributeList.forEach(item => { |
|
|
for (let index = 0; index < updatedValues.length; index++) { |
|
|
for (let index = 0; index < updatedValues.length; index++) { |
|
@@ -382,9 +372,9 @@ const goodstechnologymaken = (props) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
//选择设备 |
|
|
//选择设备 |
|
|
const handleChange = (value) => { |
|
|
|
|
|
|
|
|
const handleChange = (value) => |
|
|
|
|
|
{ |
|
|
//判断多属性是都选择完成 |
|
|
//判断多属性是都选择完成 |
|
|
console.log(goodsinfo); |
|
|
|
|
|
let ischeck=false; |
|
|
let ischeck=false; |
|
|
goodsinfo.goodsAttributeList.forEach(x => |
|
|
goodsinfo.goodsAttributeList.forEach(x => |
|
|
{ |
|
|
{ |
|
@@ -567,6 +557,7 @@ const goodstechnologymaken = (props) => { |
|
|
OldgoodsId: record.goodsId, |
|
|
OldgoodsId: record.goodsId, |
|
|
goodsAttributeId: record.goodsAttributeId, |
|
|
goodsAttributeId: record.goodsAttributeId, |
|
|
NewgoodsId: props.goodsid, |
|
|
NewgoodsId: props.goodsid, |
|
|
|
|
|
DevideId:devideId, |
|
|
NewgoodsAttributeId: checkvalue.join(',') |
|
|
NewgoodsAttributeId: checkvalue.join(',') |
|
|
}; |
|
|
}; |
|
|
await CopyTechnologyaction(data).then((r) => { |
|
|
await CopyTechnologyaction(data).then((r) => { |
|
@@ -633,7 +624,7 @@ const goodstechnologymaken = (props) => { |
|
|
{ |
|
|
{ |
|
|
item.goodsAttributeValueList.map((x, index) => { |
|
|
item.goodsAttributeValueList.map((x, index) => { |
|
|
return ( |
|
|
return ( |
|
|
<Radio.Button key={index} name={index} checked={true} value={x.goodsAttributeValuId} style={{ marginRight: 22, marginTop: 10 }}>{x.attributeValue}</Radio.Button> |
|
|
|
|
|
|
|
|
<Radio.Button key={index} name={index} checked={false} value={x.goodsAttributeValuId} style={{ marginRight: 22, marginTop: 10 }}>{x.attributeValue}</Radio.Button> |
|
|
) |
|
|
) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@@ -703,7 +694,7 @@ const goodstechnologymaken = (props) => { |
|
|
] |
|
|
] |
|
|
}> |
|
|
}> |
|
|
<div style={{ textAlign: 'center', marginBottom: 10, color: 'brown' }}>{attrvalue}</div> |
|
|
<div style={{ textAlign: 'center', marginBottom: 10, color: 'brown' }}>{attrvalue}</div> |
|
|
<EditFrom devideId={devideId} disabled={disabled} fromdata={fromdata} maxsort={maxsort} UpdataStatus={UpdataStatus} onUpdataStatus={onUpdataStatus} onSaveClick={onSaveClick} goodstechnologydata={goodstechnologydata} technologyattralldata={technologyattralldata} batchingdata={batchingdata} /> |
|
|
|
|
|
|
|
|
<EditFrom devideId={devideId} goodsId={props.goodsid} goodsAttributeId={checkvalue.join(',')} disabled={disabled} fromdata={fromdata} maxsort={maxsort} UpdataStatus={UpdataStatus} onUpdataStatus={onUpdataStatus} onSaveClick={onSaveClick} goodstechnologydata={goodstechnologydata} technologyattralldata={technologyattralldata} batchingdata={batchingdata} /> |
|
|
</ProCard> |
|
|
</ProCard> |
|
|
<ProCard title="查看工艺" type='inner' headStyle={{ paddingLeft: '45%' }} bodyStyle={{ padding: 5, width: '1072px', 'overflow-x': 'scroll' }} headerBordered> |
|
|
<ProCard title="查看工艺" type='inner' headStyle={{ paddingLeft: '45%' }} bodyStyle={{ padding: 5, width: '1072px', 'overflow-x': 'scroll' }} headerBordered> |
|
|
<div style={{ width: 'max-content' }}> |
|
|
<div style={{ width: 'max-content' }}> |
|
@@ -775,12 +766,10 @@ const goodstechnologymaken = (props) => { |
|
|
<Modal title="工艺属性" open={isModalOpen} onCancel={handleCancel} width={1040} bodyStyle={{ padding: '32px 40px 1px 48px' }} visible={showPopup} footer={null}> |
|
|
<Modal title="工艺属性" open={isModalOpen} onCancel={handleCancel} width={1040} bodyStyle={{ padding: '32px 40px 1px 48px' }} visible={showPopup} footer={null}> |
|
|
{( |
|
|
{( |
|
|
<ProTable |
|
|
<ProTable |
|
|
actionRef={actionRef} |
|
|
|
|
|
pagination={false} |
|
|
pagination={false} |
|
|
request={async (params) => { |
|
|
request={async (params) => { |
|
|
var goodsData = []; |
|
|
var goodsData = []; |
|
|
params.deviceId=devideId; |
|
|
params.deviceId=devideId; |
|
|
debugger |
|
|
|
|
|
await GeDeviceTechnologyaction(params).then((r) => { |
|
|
await GeDeviceTechnologyaction(params).then((r) => { |
|
|
goodsData =r.data; |
|
|
goodsData =r.data; |
|
|
}); |
|
|
}); |
|
|