|
|
@@ -36,6 +36,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
const [technologyattralldata, setTechnologyattralldata] = useState([]); |
|
|
|
const [goodsinfo, setGoodsinfo] = useState({}); |
|
|
|
const [cardcount, setCardcount] = useState([]); |
|
|
|
//工艺值 |
|
|
|
const [goodstechnolog, setgoodstechnolog] = useState([]); |
|
|
|
const [maxsort, setmaxsort] = useState(1); |
|
|
|
const [batchingdata, setbatchingdata] = useState([]); |
|
|
@@ -58,28 +59,19 @@ const goodstechnologymaken = (props) => { |
|
|
|
//新建/分布式弹窗 |
|
|
|
const [showPopup, setShowPopup] = useState(false) |
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
|
const [title, setTitle] = useState('初始标题'); |
|
|
|
const handleCancel = () => { |
|
|
|
setShowPopup(false); |
|
|
|
setIsModalOpen(false); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const actionRef = useRef(); |
|
|
|
|
|
|
|
//打开弹窗 |
|
|
|
const handleButtonClick = () => { |
|
|
|
setShowPopup(true); |
|
|
|
setIsModalOpen(true); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleOk = () => { |
|
|
|
showPopup(false); |
|
|
|
setIsModalOpen(false); |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
interdata() |
|
|
@@ -105,7 +97,6 @@ const goodstechnologymaken = (props) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
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>)}, |
|
|
@@ -123,8 +114,10 @@ const goodstechnologymaken = (props) => { |
|
|
|
|
|
|
|
|
|
|
|
GetGoodsTechnologyAction(props.goodsid).then((r) => { |
|
|
|
if (r.data.length > 0) { |
|
|
|
if (r.data.length > 0) |
|
|
|
{ |
|
|
|
setgoodstechnolog(r.data) |
|
|
|
|
|
|
|
// 查询最大值 |
|
|
|
var max = r.data.reduce(function (prev, current) { |
|
|
|
return (prev.sort > current.sort) ? prev : current; |
|
|
@@ -147,7 +140,6 @@ const goodstechnologymaken = (props) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
const onChangevalue = (e) => { |
|
|
|
|
|
|
|
const { name, value } = e.target; |
|
|
|
let names = ""; |
|
|
|
let updatedValues = [...checkvalue]; |
|
|
@@ -159,8 +151,6 @@ const goodstechnologymaken = (props) => { |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let newId = null; |
|
|
|
goodsinfo.goodsAttributeList.forEach(item => { |
|
|
|
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; |
|
|
|
goodsinfo.goodsAttributeList.forEach(x => |
|
|
|
{ |
|
|
@@ -567,6 +557,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
OldgoodsId: record.goodsId, |
|
|
|
goodsAttributeId: record.goodsAttributeId, |
|
|
|
NewgoodsId: props.goodsid, |
|
|
|
DevideId:devideId, |
|
|
|
NewgoodsAttributeId: checkvalue.join(',') |
|
|
|
}; |
|
|
|
await CopyTechnologyaction(data).then((r) => { |
|
|
@@ -633,7 +624,7 @@ const goodstechnologymaken = (props) => { |
|
|
|
{ |
|
|
|
item.goodsAttributeValueList.map((x, index) => { |
|
|
|
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> |
|
|
|
<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 title="查看工艺" type='inner' headStyle={{ paddingLeft: '45%' }} bodyStyle={{ padding: 5, width: '1072px', 'overflow-x': 'scroll' }} headerBordered> |
|
|
|
<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}> |
|
|
|
{( |
|
|
|
<ProTable |
|
|
|
actionRef={actionRef} |
|
|
|
pagination={false} |
|
|
|
request={async (params) => { |
|
|
|
var goodsData = []; |
|
|
|
params.deviceId=devideId; |
|
|
|
debugger |
|
|
|
await GeDeviceTechnologyaction(params).then((r) => { |
|
|
|
goodsData =r.data; |
|
|
|
}); |
|
|
|