|
|
@@ -1,6 +1,7 @@ |
|
|
|
import React, { useState, useEffect, useRef } from 'react'; |
|
|
|
import { Modal, Form, Input, Button, Select, Switch, InputNumbe, Divider, Space } from 'antd'; |
|
|
|
import { Modal, Form, Input, Button, Select, Switch, InputNumbe, Divider, Space,message } from 'antd'; |
|
|
|
import { PlusOutlined } from '@ant-design/icons'; |
|
|
|
import { AddBomType } from '../services'; |
|
|
|
|
|
|
|
const UpdateBom = (props) => { |
|
|
|
const { Option, OptGroup } = Select; |
|
|
@@ -14,23 +15,22 @@ const UpdateBom = (props) => { |
|
|
|
|
|
|
|
const addItem = (e) => { |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
if (typename == 0) { |
|
|
|
message.error("请输入名称"); |
|
|
|
if (typename.length == 0) { |
|
|
|
message.error("请输入名称"); |
|
|
|
} else { |
|
|
|
var parm = { name: typename } |
|
|
|
AddBomType(parm).then((r) => { |
|
|
|
if (r.succeeded) { |
|
|
|
message.success('添加成功'); |
|
|
|
props.initTypeList(); |
|
|
|
settypename(''); |
|
|
|
} else { |
|
|
|
message.error(r.errors); |
|
|
|
} |
|
|
|
}) |
|
|
|
var parm = { name: typename } |
|
|
|
AddBomType(parm).then((r) => { |
|
|
|
if (r.succeeded) { |
|
|
|
message.success('添加成功'); |
|
|
|
props.initTypeList(); |
|
|
|
settypename(''); |
|
|
|
} else { |
|
|
|
message.error(r.errors); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const headleOk = () => { |
|
|
|
props.onUpdateBomSave() |
|
|
|