|
|
@@ -1,10 +1,11 @@ |
|
|
|
import {Modal } from 'antd'; |
|
|
|
import {Modal,message } from 'antd'; |
|
|
|
import React, { useState} from 'react'; |
|
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
|
import { GetBOMs } from '../service'; |
|
|
|
const CreateForm = (props) => { |
|
|
|
|
|
|
|
const [selectedRowsState, setSelectedRows] = useState([]); |
|
|
|
const [Boms, setBoms] = useState([]); |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: '配方id', |
|
|
@@ -26,7 +27,15 @@ const CreateForm = (props) => { |
|
|
|
title="选择配方" |
|
|
|
visible={props.modalVisible} |
|
|
|
onCancel={() => props.onCancel()} |
|
|
|
onOk={() => props.onSubmit(selectedRowsState)} |
|
|
|
onOk={() => { |
|
|
|
|
|
|
|
if(Boms.length>100){ |
|
|
|
message.error('配方必须少于100个'); |
|
|
|
}else{ |
|
|
|
props.onSubmit(selectedRowsState) |
|
|
|
} |
|
|
|
|
|
|
|
}} |
|
|
|
maskClosable={false} |
|
|
|
> |
|
|
|
<ProTable |
|
|
@@ -45,6 +54,7 @@ const CreateForm = (props) => { |
|
|
|
params.pertains=[2]; |
|
|
|
await GetBOMs(params).then((r) => { |
|
|
|
Data = r.data.data; |
|
|
|
setBoms(r.data.data); |
|
|
|
total = 1; |
|
|
|
}); |
|
|
|
return { |
|
|
|