|
|
@@ -19,6 +19,10 @@ const GoodsbomFrom = (props) => { |
|
|
|
const [arttue,setarttue]=useState(1); |
|
|
|
const [arttuename,setarttuename]=useState(""); |
|
|
|
const [arttuename11,setarttuename1]=useState(""); |
|
|
|
const [checked,setchecked]=useState(false); |
|
|
|
const [bomNameRules,setbomNameRules]=useState([]) |
|
|
|
const [bomTypeListRules,setbomTypeListRules]=useState([]) |
|
|
|
const [bomcheckRules,setbomcheckRules]=useState([]) |
|
|
|
const [recordCreatorProps,setrecordCreatorProps]=useState(false) |
|
|
|
const onNameChange=(event)=>{ |
|
|
|
settypename(event.target.value); |
|
|
@@ -46,7 +50,8 @@ const GoodsbomFrom = (props) => { |
|
|
|
console.log("props.Bomdata",props.Bomdata) |
|
|
|
console.log(props.goodsname) |
|
|
|
setdisaenumbled('block') |
|
|
|
setdisnewd("none") |
|
|
|
setdisnewd("none"); |
|
|
|
setbomcheckRules([{ required: true, message: '请选择配方' }]) |
|
|
|
// form.setFieldsValue({ |
|
|
|
// bomName: props.goodsname, |
|
|
|
// // bomType:1 |
|
|
@@ -133,7 +138,7 @@ const GoodsbomFrom = (props) => { |
|
|
|
data.bomName=values.bomName+"("+arttuename11+")" |
|
|
|
props.onFinish(data); |
|
|
|
setDataSource([]) |
|
|
|
setCheckvalue([]) |
|
|
|
//setCheckvalue([]) |
|
|
|
setarttuename("") |
|
|
|
} |
|
|
|
|
|
|
@@ -199,14 +204,20 @@ const GoodsbomFrom = (props) => { |
|
|
|
const onchagetype= (e) => { |
|
|
|
console.log(form) |
|
|
|
setarttue(e.target.value) |
|
|
|
setCheckvalue([]) |
|
|
|
//setCheckvalue([]) |
|
|
|
setDataSource([]) |
|
|
|
setchecked(false) |
|
|
|
if(e.target.value==1){//选择配方 |
|
|
|
setrecordCreatorProps(false); |
|
|
|
setdisaenumbled("block") |
|
|
|
setdisnewd("none") |
|
|
|
|
|
|
|
setbomcheckRules([{ required: true, message: '请选择配方' }]) |
|
|
|
setbomNameRules( [{ required: false}]) |
|
|
|
setbomTypeListRules([{ required: false}]) |
|
|
|
}else{ |
|
|
|
setbomcheckRules([{ required: false }]) |
|
|
|
setbomNameRules( [{ required: true, message: '请输入配方名称!' }]) |
|
|
|
setbomTypeListRules([{ required: true, message: '配方分类' }]) |
|
|
|
setrecordCreatorProps({ |
|
|
|
newRecordType: 'dataSource', |
|
|
|
record: () => ({ |
|
|
@@ -244,7 +255,7 @@ const GoodsbomFrom = (props) => { |
|
|
|
{ |
|
|
|
item.goodsAttributeValueList.map((item, index)=>{ |
|
|
|
return ( |
|
|
|
<Radio.Button name={index} value={item.goodsAttributeValuId} style={{marginRight: 22, marginTop: 16}}>{item.attributeValue}</Radio.Button> |
|
|
|
<Radio.Button name={index} value={item.goodsAttributeValuId} style={{marginRight: 22, marginTop: 16}}>{item.attributeValue}</Radio.Button> |
|
|
|
) |
|
|
|
}) |
|
|
|
} |
|
|
@@ -264,10 +275,9 @@ const GoodsbomFrom = (props) => { |
|
|
|
|
|
|
|
</Radio.Group> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item shouldUpdate style={{display:disaenumbled}} name="bomId" label="选择配方" rules={[{ required: false, message: '配方信息' }]}> |
|
|
|
<Form.Item shouldUpdate style={{display:disaenumbled}} name="bomId" label="选择配方" rules={bomcheckRules}> |
|
|
|
<Select |
|
|
|
showSearch |
|
|
|
style={{width:'90%'}} |
|
|
|
optionFilterProp="children" |
|
|
|
onChange={handleChange} |
|
|
|
placeholder="请选配方信息"> |
|
|
@@ -282,11 +292,11 @@ const GoodsbomFrom = (props) => { |
|
|
|
</Select> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
<Form.Item shouldUpdate style={{display:disnewd}} name="bomName" label="配方名称" rules={[{ required: false, message: '配方名称' }]}> |
|
|
|
<Input style={{width:'87%'}} placeholder="请输入配方名称"/> |
|
|
|
<Form.Item style={{display:disnewd}} label="配方名称" name="bomName" rules={bomNameRules} > |
|
|
|
<Input placeholder="请输入配方名称"/> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
<Form.Item shouldUpdate style={{display:disnewd}} name="bomTypeList" rules={[{ required: false, message: '配方分类' }]} label="配方分类" > |
|
|
|
<Form.Item style={{display:disnewd}} name="bomTypeList" rules={bomTypeListRules} label="配方分类" > |
|
|
|
<Select |
|
|
|
style={{width: '100%'}} |
|
|
|
mode="tags" |
|
|
|