Browse Source

Merge branch 'master' into kitchenmanage

tmp
zhaoy 10 months ago
parent
commit
a3a29ea111
1 changed files with 20 additions and 10 deletions
  1. +20
    -10
      src/pages/database/goods/goodsbom/components/CreateBom.jsx

+ 20
- 10
src/pages/database/goods/goodsbom/components/CreateBom.jsx View File

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


Loading…
Cancel
Save