From 820caf6a150d703fadad04de50ea001713bbbdce Mon Sep 17 00:00:00 2001 From: gwbvipvip Date: Thu, 22 Feb 2024 18:03:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/device/deviceVesion/index.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/device/deviceVesion/index.jsx b/src/pages/device/deviceVesion/index.jsx index 78fe8e2..f1a9d77 100644 --- a/src/pages/device/deviceVesion/index.jsx +++ b/src/pages/device/deviceVesion/index.jsx @@ -313,8 +313,10 @@ const GoodsTypeManage = () => { var success = false; if (value.id) { success = handleUpdate(value); + actionRef.current.reload(); } else { success = handleAdd(value); + actionRef.current.reload(); } if (success) { handleModalVisible(false); From c4eecb7332aefe9626b065c386c9dd553e0979b6 Mon Sep 17 00:00:00 2001 From: gwbvipvip Date: Thu, 22 Feb 2024 19:20:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../database/bom/components/UpdateBom.jsx | 32 +++++++++---------- src/pages/database/bom/index.jsx | 3 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/pages/database/bom/components/UpdateBom.jsx b/src/pages/database/bom/components/UpdateBom.jsx index 9d4b2e5..03526f5 100644 --- a/src/pages/database/bom/components/UpdateBom.jsx +++ b/src/pages/database/bom/components/UpdateBom.jsx @@ -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() diff --git a/src/pages/database/bom/index.jsx b/src/pages/database/bom/index.jsx index 3bd25f8..cefb3a7 100644 --- a/src/pages/database/bom/index.jsx +++ b/src/pages/database/bom/index.jsx @@ -170,7 +170,7 @@ const GoodsBomsManage = (props) => { .validateFields() .then((values) => { console.log(values) - var parm = { id: values.id, name: values.bomName, IsMain: values.bomType == '1' ? true : false, bomTypeIds: values.bomTypeList } + var parm = { id: values.id, name: values.name, IsMain: values.bomType == '1' ? true : false, bomTypeIds: values.bomTypeList } UpdateBomInfo(parm).then((r) => { if (r.data) { message.success('修改成功'); @@ -274,6 +274,7 @@ const GoodsBomsManage = (props) => { onUpdateBomSave={onUpdateBomSave} values={currentRow || {}} form={form2} + initTypeList={initTypeList} bomTypeData={bomTypeData} onFinish={async (value) => {