diff --git a/src/pages/database/goods/goodsbom/components/CreateBom.jsx b/src/pages/database/goods/goodsbom/components/CreateBom.jsx
index dd289f3..81d7f06 100644
--- a/src/pages/database/goods/goodsbom/components/CreateBom.jsx
+++ b/src/pages/database/goods/goodsbom/components/CreateBom.jsx
@@ -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 (
-