|
@@ -69,7 +69,7 @@ const final = () => { |
|
|
const [lineProcessDevList, setLineProcessDevList] = useState<any[]>([]) |
|
|
const [lineProcessDevList, setLineProcessDevList] = useState<any[]>([]) |
|
|
const [selectDev, setSelectDev] = useState(0) |
|
|
const [selectDev, setSelectDev] = useState(0) |
|
|
const [isConfigDevOpen, setisConfigDevOpen] = useState<boolean>(false); |
|
|
const [isConfigDevOpen, setisConfigDevOpen] = useState<boolean>(false); |
|
|
const [m_device,setM_device] = useState<any[]>([]) |
|
|
|
|
|
|
|
|
const [m_device, setM_device] = useState<any[]>([]) |
|
|
const [isSetpModalOpen, setIsSetpModalOpen] = useState(false); |
|
|
const [isSetpModalOpen, setIsSetpModalOpen] = useState(false); |
|
|
const [isSchemaModalOpen, setIsSchemaModalOpen] = useState(false); |
|
|
const [isSchemaModalOpen, setIsSchemaModalOpen] = useState(false); |
|
|
const [deviceParm, setDeviceParm] = useState<any>([]); |
|
|
const [deviceParm, setDeviceParm] = useState<any>([]); |
|
@@ -227,7 +227,7 @@ const final = () => { |
|
|
console.log(res.data); |
|
|
console.log(res.data); |
|
|
|
|
|
|
|
|
setFinalLineList(res.data) |
|
|
setFinalLineList(res.data) |
|
|
UpdateGY(res.data[0].key,record?.id!) |
|
|
|
|
|
|
|
|
UpdateGY(res.data[0].key, record?.id!) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
const copyFormData = JSON.parse(JSON.stringify(record)); |
|
|
const copyFormData = JSON.parse(JSON.stringify(record)); |
|
@@ -292,7 +292,7 @@ const final = () => { |
|
|
const [formula, setformula] = useState([]) |
|
|
const [formula, setformula] = useState([]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const UpdateGY = (lineId:string,finalId:string)=>{ |
|
|
|
|
|
|
|
|
const UpdateGY = (lineId: string, finalId: string) => { |
|
|
productlineInfoStepsAPI.List({ lineId: lineId, finalId: finalId }).then((res: MyResponse.Content) => { |
|
|
productlineInfoStepsAPI.List({ lineId: lineId, finalId: finalId }).then((res: MyResponse.Content) => { |
|
|
if (res.statusCode === 200) { |
|
|
if (res.statusCode === 200) { |
|
|
setLineProcessList(res.data); |
|
|
setLineProcessList(res.data); |
|
@@ -368,9 +368,30 @@ const final = () => { |
|
|
]} |
|
|
]} |
|
|
/> |
|
|
/> |
|
|
: |
|
|
: |
|
|
<Card size="default" title={'当前配置成品工艺: ' + selectRowItem?.name} styles={{ header: { textAlign: 'center', margin: 'auto', fontSize: '22px' } }} extra={<Button style={{ position: 'absolute', top: '20px', right: '20px' }} icon={<LeftCircleOutlined />} type='primary' size='small' onClick={() => { |
|
|
|
|
|
setIsLineStepOpen(false) |
|
|
|
|
|
}}>返回</Button>}> |
|
|
|
|
|
|
|
|
<Card size="default" title={'当前配置成品工艺: ' + selectRowItem?.name} styles={{ header: { textAlign: 'center', margin: 'auto', fontSize: '22px' } }} extra={ |
|
|
|
|
|
currentproductionline && lineProcessList.length>0 ? |
|
|
|
|
|
<Popconfirm title="确定要保存当前配置?" onConfirm={(i) => { |
|
|
|
|
|
|
|
|
|
|
|
finalInfoAPI.Saveconfigstatus({ LineId: currentproductionline.key, finalId: selectRowItem.id }).then((res: MyResponse.Content) => { |
|
|
|
|
|
if (res.statusCode === 200) { |
|
|
|
|
|
message.success('保存成功!'); |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
setIsLineStepOpen(false); |
|
|
|
|
|
}, 1000); |
|
|
|
|
|
} else { |
|
|
|
|
|
message.error(res.errors || res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}} onCancel={() => { |
|
|
|
|
|
message.info('未保存配置'); |
|
|
|
|
|
setIsLineStepOpen(false); |
|
|
|
|
|
}} > <Button style={{ position: 'absolute', top: '20px', right: '20px' }} icon={<LeftCircleOutlined />} type='primary' size='small'>返回</Button> |
|
|
|
|
|
</Popconfirm> : <Button |
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
setIsLineStepOpen(false); |
|
|
|
|
|
}} |
|
|
|
|
|
style={{ position: 'absolute', top: '20px', right: '20px' }} icon={<LeftCircleOutlined />} type='primary' size='small'>返回</Button> |
|
|
|
|
|
}> |
|
|
<Divider /> |
|
|
<Divider /> |
|
|
|
|
|
|
|
|
<Card title={'选择产线'}> |
|
|
<Card title={'选择产线'}> |
|
@@ -422,64 +443,64 @@ const final = () => { |
|
|
{/* <Button type='primary' danger>取消配置</Button> */} |
|
|
{/* <Button type='primary' danger>取消配置</Button> */} |
|
|
</Space> |
|
|
</Space> |
|
|
}> |
|
|
}> |
|
|
|
|
|
|
|
|
<CheckCard.Group onChange={() => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<CheckCard.Group onChange={() => { |
|
|
|
|
|
|
|
|
}} > |
|
|
}} > |
|
|
<div className={styles.gongyi_tag}> |
|
|
<div className={styles.gongyi_tag}> |
|
|
<Flex wrap gap="small"> |
|
|
|
|
|
|
|
|
|
|
|
{lineProcessList.map((item, index) => ( |
|
|
|
|
|
<div className={styles.gongyi_tag_box} key={index} > |
|
|
|
|
|
<div |
|
|
|
|
|
|
|
|
|
|
|
className={`${styles.gongyi_tag_item} ${index === selectProcess ? styles.gongyi_tag_item_activeItem : ''}`}> |
|
|
|
|
|
<Space size="middle"> |
|
|
|
|
|
<div color="#2db7f5" style={{ fontSize: '22px' }}> 0{index + 1}-{item.processName}</div> |
|
|
|
|
|
</Space> |
|
|
|
|
|
<div className={index === selectProcess ? styles.gongyi_tag_item_active : ''}></div> |
|
|
|
|
|
|
|
|
<Flex wrap gap="small"> |
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<Card title='所属设备' size="small" bordered={false} style={{ height: '200px', overflowY: 'auto', overflowX: 'hidden' }} className={styles.gongyi_tag_device}> |
|
|
|
|
|
{ |
|
|
|
|
|
item.devicesInfo.length>0? |
|
|
|
|
|
<Space title='设备' direction="vertical"> |
|
|
|
|
|
{item.devicesInfo.map((devicesItem: any, devicesIndex: number) => ( |
|
|
|
|
|
<Badge.Ribbon text={devicesItem.status == '0' ? '未配置' : '已配置'} color={devicesItem.status == '0' ? '' : 'pink'}> |
|
|
|
|
|
<CheckCard onClick={(v) => { |
|
|
|
|
|
setcurrentproductionProcess(item) |
|
|
|
|
|
setcurrentproductionDev(devicesItem.code) |
|
|
|
|
|
setStepTitle(item.processName + '-' + devicesItem.name + '[' + devicesItem.code + ']') |
|
|
|
|
|
setIsEditModalOpen(true) |
|
|
|
|
|
const jsondata = { |
|
|
|
|
|
lineId: currentproductionline.key, |
|
|
|
|
|
deviceId: devicesItem.code, |
|
|
|
|
|
finalId: selectRowItem.id, |
|
|
|
|
|
productLineStepsId: item.id |
|
|
|
|
|
} |
|
|
|
|
|
setStepparams(jsondata) |
|
|
|
|
|
}} size='small' title={devicesItem.name} value={devicesItem.id} /> |
|
|
|
|
|
</Badge.Ribbon> |
|
|
|
|
|
))} |
|
|
|
|
|
|
|
|
{lineProcessList.map((item, index) => ( |
|
|
|
|
|
<div className={styles.gongyi_tag_box} key={index} > |
|
|
|
|
|
<div |
|
|
|
|
|
|
|
|
|
|
|
className={`${styles.gongyi_tag_item} ${index === selectProcess ? styles.gongyi_tag_item_activeItem : ''}`}> |
|
|
|
|
|
<Space size="middle"> |
|
|
|
|
|
<div color="#2db7f5" style={{ fontSize: '22px' }}> 0{index + 1}-{item.processName}</div> |
|
|
</Space> |
|
|
</Space> |
|
|
: <Empty /> |
|
|
|
|
|
} |
|
|
|
|
|
</Card> |
|
|
|
|
|
{/* <Card title='备注' size="small" style={{ height: '150px' }}> |
|
|
|
|
|
|
|
|
<div className={index === selectProcess ? styles.gongyi_tag_item_active : ''}></div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<Card title='所属设备' size="small" bordered={false} style={{ height: '200px', overflowY: 'auto', overflowX: 'hidden' }} className={styles.gongyi_tag_device}> |
|
|
|
|
|
{ |
|
|
|
|
|
item.devicesInfo.length > 0 ? |
|
|
|
|
|
<Space title='设备' direction="vertical"> |
|
|
|
|
|
{item.devicesInfo.map((devicesItem: any, devicesIndex: number) => ( |
|
|
|
|
|
<Badge.Ribbon text={devicesItem.status == '0' ? '未设置' : '已设置'} color={devicesItem.status == '0' ? '' : 'pink'}> |
|
|
|
|
|
<CheckCard onClick={(v) => { |
|
|
|
|
|
setcurrentproductionProcess(item) |
|
|
|
|
|
setcurrentproductionDev(devicesItem.code) |
|
|
|
|
|
setStepTitle(item.processName + '-' + devicesItem.name + '[' + devicesItem.code + ']') |
|
|
|
|
|
setIsEditModalOpen(true) |
|
|
|
|
|
const jsondata = { |
|
|
|
|
|
lineId: currentproductionline.key, |
|
|
|
|
|
deviceId: devicesItem.code, |
|
|
|
|
|
finalId: selectRowItem.id, |
|
|
|
|
|
productLineStepsId: item.id |
|
|
|
|
|
} |
|
|
|
|
|
setStepparams(jsondata) |
|
|
|
|
|
}} size='small' title={devicesItem.name} value={devicesItem.id} /> |
|
|
|
|
|
</Badge.Ribbon> |
|
|
|
|
|
))} |
|
|
|
|
|
</Space> |
|
|
|
|
|
: <Empty description='未绑定设备' /> |
|
|
|
|
|
} |
|
|
|
|
|
</Card> |
|
|
|
|
|
{/* <Card title='备注' size="small" style={{ height: '150px' }}> |
|
|
<Input aria-label='备注' /> |
|
|
<Input aria-label='备注' /> |
|
|
</Card> */} |
|
|
</Card> */} |
|
|
|
|
|
|
|
|
<Divider/> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
))} |
|
|
|
|
|
</Flex> |
|
|
|
|
|
|
|
|
<Divider /> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
))} |
|
|
|
|
|
</Flex> |
|
|
</div> |
|
|
</div> |
|
|
</CheckCard.Group> |
|
|
</CheckCard.Group> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Card> |
|
|
</Card> |
|
|
: <Empty />} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
: <Empty description='未配置工序路线' />} |
|
|
|
|
|
|
|
|
</Card> |
|
|
</Card> |
|
|
} |
|
|
} |
|
|
<Modal maskClosable={false} open={isEditModalOpen} |
|
|
<Modal maskClosable={false} open={isEditModalOpen} |
|
@@ -487,9 +508,9 @@ const final = () => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// title={<Tag color='#0960bd' bordered style={{fontSize:'18px',borderRadius:'0px'}}>{stepTitle}</Tag>} |
|
|
// title={<Tag color='#0960bd' bordered style={{fontSize:'18px',borderRadius:'0px'}}>{stepTitle}</Tag>} |
|
|
onCancel={() =>{ |
|
|
|
|
|
|
|
|
onCancel={() => { |
|
|
setIsEditModalOpen(false) |
|
|
setIsEditModalOpen(false) |
|
|
UpdateGY(currentproductionline.key,selectRowItem.id) |
|
|
|
|
|
|
|
|
UpdateGY(currentproductionline.key, selectRowItem.id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
onOk={() => setIsEditModalOpen(false)} |
|
|
onOk={() => setIsEditModalOpen(false)} |
|
@@ -527,10 +548,10 @@ const final = () => { |
|
|
danger |
|
|
danger |
|
|
disabled={selectDev < 0} |
|
|
disabled={selectDev < 0} |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
console.log('sss',currentproductionProcess?.devicesInfo); |
|
|
|
|
|
|
|
|
console.log('sss', currentproductionProcess?.devicesInfo); |
|
|
const b = JSON.stringify(currentproductionProcess?.devicesInfo); |
|
|
const b = JSON.stringify(currentproductionProcess?.devicesInfo); |
|
|
const c:any[] = JSON.parse(b); |
|
|
|
|
|
const d = c.filter(x=>x.code!=currentproductionDev); |
|
|
|
|
|
|
|
|
const c: any[] = JSON.parse(b); |
|
|
|
|
|
const d = c.filter(x => x.code != currentproductionDev); |
|
|
setM_device(d); |
|
|
setM_device(d); |
|
|
setisConfigDevOpen(true) |
|
|
setisConfigDevOpen(true) |
|
|
}} |
|
|
}} |
|
@@ -596,20 +617,19 @@ const final = () => { |
|
|
deviceFunParams?.map((item: any, index: number) => { |
|
|
deviceFunParams?.map((item: any, index: number) => { |
|
|
Object.keys(deviceStepParms).forEach((citem, cindex) => { |
|
|
Object.keys(deviceStepParms).forEach((citem, cindex) => { |
|
|
if (item.paramCode == citem) { |
|
|
if (item.paramCode == citem) { |
|
|
if (item.paramType==1) { |
|
|
|
|
|
let wl:string=''; |
|
|
|
|
|
deviceStepParms[citem]?.map( |
|
|
|
|
|
(s:any)=> |
|
|
|
|
|
{ |
|
|
|
|
|
if (wl=='') { |
|
|
|
|
|
wl = materialParmList.find((x:any)=>x.value==s).label |
|
|
|
|
|
}else{ |
|
|
|
|
|
wl = wl+','+materialParmList.find((x:any)=>x.value==s).label |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (item.paramType == 1) { |
|
|
|
|
|
let wl: string = ''; |
|
|
|
|
|
deviceStepParms[citem]?.map( |
|
|
|
|
|
(s: any) => { |
|
|
|
|
|
if (wl == '') { |
|
|
|
|
|
wl = materialParmList.find((x: any) => x.value == s).label |
|
|
|
|
|
} else { |
|
|
|
|
|
wl = wl + ',' + materialParmList.find((x: any) => x.value == s).label |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
) |
|
|
) |
|
|
newParms.push({ name: item.paramName + ':' + wl! }) |
|
|
newParms.push({ name: item.paramName + ':' + wl! }) |
|
|
}else{ |
|
|
|
|
|
|
|
|
} else { |
|
|
newParms.push({ name: item.paramName + ':' + deviceStepParms[citem] + item.paramUnit }) |
|
|
newParms.push({ name: item.paramName + ':' + deviceStepParms[citem] + item.paramUnit }) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -1242,15 +1262,15 @@ const final = () => { |
|
|
}} |
|
|
}} |
|
|
footer={false} |
|
|
footer={false} |
|
|
> |
|
|
> |
|
|
<ProForm onFinish={(value:any)=>{ |
|
|
|
|
|
|
|
|
<ProForm onFinish={(value: any) => { |
|
|
finalCraftStepsAPI.Copyfinalcraftsteps({ |
|
|
finalCraftStepsAPI.Copyfinalcraftsteps({ |
|
|
finalId: selectRowItem?.id, |
|
|
finalId: selectRowItem?.id, |
|
|
lineId: currentproductionline.key, |
|
|
lineId: currentproductionline.key, |
|
|
copyDeviceId: value.deviceId, |
|
|
copyDeviceId: value.deviceId, |
|
|
productLineStepsId: currentproductionProcess.id, |
|
|
productLineStepsId: currentproductionProcess.id, |
|
|
toDeviceId: currentproductionDev |
|
|
toDeviceId: currentproductionDev |
|
|
}).then((res:MyResponse.Content)=>{ |
|
|
|
|
|
if (res.statusCode===200) { |
|
|
|
|
|
|
|
|
}).then((res: MyResponse.Content) => { |
|
|
|
|
|
if (res.statusCode === 200) { |
|
|
message.success('同步成功!'); |
|
|
message.success('同步成功!'); |
|
|
setisConfigDevOpen(false); |
|
|
setisConfigDevOpen(false); |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
@@ -1263,11 +1283,11 @@ const final = () => { |
|
|
setStepparams(jsondata) |
|
|
setStepparams(jsondata) |
|
|
sortActionRef.current?.reload(); |
|
|
sortActionRef.current?.reload(); |
|
|
}, 2000); |
|
|
}, 2000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}}> |
|
|
}}> |
|
|
<Form.Item label="设备" name="deviceId" rules={[{ required: true, message: '此项为必填项!' }]}> |
|
|
<Form.Item label="设备" name="deviceId" rules={[{ required: true, message: '此项为必填项!' }]}> |
|
|
<Select onChange={(v: processType.output) => { |
|
|
<Select onChange={(v: processType.output) => { |
|
@@ -1275,8 +1295,8 @@ const final = () => { |
|
|
{ |
|
|
{ |
|
|
m_device?.map((item: any) => { |
|
|
m_device?.map((item: any) => { |
|
|
return <Select.Option value={item.code} key={item.code}> |
|
|
return <Select.Option value={item.code} key={item.code}> |
|
|
<span>{item.name+'['+item.code+']'}</span> |
|
|
|
|
|
</Select.Option> |
|
|
|
|
|
|
|
|
<span>{item.name + '[' + item.code + ']'}</span> |
|
|
|
|
|
</Select.Option> |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
</Select> |
|
|
</Select> |
|
|