zhaoy 9 months ago
parent
commit
146bd57bf7
6 changed files with 95 additions and 65 deletions
  1. +1
    -1
      config/proxy.js
  2. +30
    -20
      src/pages/database/basic/batching/components/CreateForm.jsx
  3. +16
    -10
      src/pages/database/goods/goodsInfo/components/CreateBom.jsx
  4. +16
    -10
      src/pages/database/goods/goodsInfo/components/UpdateBom.jsx
  5. +15
    -10
      src/pages/database/goods/goodsInfo/index.jsx
  6. +17
    -14
      src/pages/device/deviceInfo/components/CreateForm.jsx

+ 1
- 1
config/proxy.js View File

@@ -9,7 +9,7 @@
export default { export default {
dev: { dev: {
'/saasbase/': { '/saasbase/': {
target: 'http://10.2.1.26:21995/saasbase/',
target: 'http://localhost:5006/',
changeOrigin: true, changeOrigin: true,
secure: false, //关闭证书验证 secure: false, //关闭证书验证
pathRewrite: { pathRewrite: {


+ 30
- 20
src/pages/database/basic/batching/components/CreateForm.jsx View File

@@ -124,29 +124,39 @@ const CreateForm = (props) => {
} }
const addItem = (e) => { const addItem = (e) => {
e.preventDefault(); e.preventDefault();
setName('');
var parm={name:name}
api.addbatchingtype(parm).then((res)=>{
if(res.succeeded){
message.success('添加成功');
props.initTypeList()
}else{
message.error(res.errors);
}
})
if(name.length==0){
message.error("请输入名称");
}else{
var parm={name:name}
api.addbatchingtype(parm).then((res)=>{
if(res.succeeded){
message.success('添加成功');
props.initTypeList();
setName('');
}else{
message.error(res.errors);
}
})
}
}; };
const addItemuity = (e) => { const addItemuity = (e) => {
e.preventDefault(); e.preventDefault();
setuityname('');
var parm={name:uityname}
api.addbatchinguint(parm).then((res)=>{
if(res.succeeded){
props.initUintList()
message.success('添加成功');
}else{
message.error(res.errors);
}
})
if(uityname.length==0){
message.error("请输入名称");
}else{
var parm={name:uityname}
api.addbatchinguint(parm).then((res)=>{
if(res.succeeded){
props.initUintList()
setuityname('');
message.success('添加成功');
}else{
message.error(res.errors);
}
})
}
}; };
return ( return (
<Modal <Modal


+ 16
- 10
src/pages/database/goods/goodsInfo/components/CreateBom.jsx View File

@@ -19,16 +19,22 @@ const GoodsbomFrom = (props) => {
} }
const addItem=(e)=>{ const addItem=(e)=>{
e.preventDefault(); e.preventDefault();
settypename('');
var parm={name:typename}
AddBomType(parm).then((r)=>{
if(r.succeeded){
message.success('添加成功');
props.initTypeList()
}else{
message.error(r.errors);
}
})
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);
}
})
}
} }
useEffect(() => { useEffect(() => {
console.log("111111111") console.log("111111111")


+ 16
- 10
src/pages/database/goods/goodsInfo/components/UpdateBom.jsx View File

@@ -25,16 +25,22 @@ const UpdateBom = (props) => {
} }
const addItem=(e)=>{ const addItem=(e)=>{
e.preventDefault(); e.preventDefault();
settypename('');
var parm={name:typename}
AddBomType(parm).then((r)=>{
if(r.succeeded){
message.success('添加成功');
props.initTypeList()
}else{
message.error(r.errors);
}
})
if(typename==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);
}
})
}
} }
const headleOk=()=>{ const headleOk=()=>{
props.onUpdateBomSave(form) props.onUpdateBomSave(form)


+ 15
- 10
src/pages/database/goods/goodsInfo/index.jsx View File

@@ -204,16 +204,21 @@ const Advanced = (props) => {
}; };
const addItem = (e) => { const addItem = (e) => {
e.preventDefault(); e.preventDefault();
setunitname('');
var parm={name:unitname}
addunit(parm).then((r)=>{
if(r.succeeded){
message.success('添加成功');
initGoodsUnit()
}else{
message.error(r.errors);
}
})
if(unitname.length==0){
message.error("请输入名称");
}else{
var parm={name:unitname}
addunit(parm).then((r)=>{
if(r.succeeded){
message.success('添加成功');
initGoodsUnit();
setunitname('');
}else{
message.error(r.errors);
}
})
}
}; };
const operationTabList = [ const operationTabList = [
{ {


+ 17
- 14
src/pages/device/deviceInfo/components/CreateForm.jsx View File

@@ -32,16 +32,20 @@ const CreateForm = (props) => {
}; };
const addItem=(e)=>{ const addItem=(e)=>{
e.preventDefault(); e.preventDefault();
setdeviceTypename('');
var parm={name:deviceTypename}
AddDeviceType(parm).then((r)=>{
if(r.succeeded){
message.success('添加成功');
props.initDeviceType()
}else{
message.error(r.errors);
}
})
if(deviceTypename.length==0){
message.error("请输入名称");
}else{
var parm={name:deviceTypename}
AddDeviceType(parm).then((r)=>{
if(r.succeeded){
message.success('添加成功');
props.initDeviceType()
setdeviceTypename('');
}else{
message.error(r.errors);
}
})
}
} }
return ( return (
<Modal <Modal
@@ -66,10 +70,6 @@ const CreateForm = (props) => {
<Input /> <Input />
</Form.Item> </Form.Item>


<Form.Item label={'设备名称'} name="deviceName" rules={[{ required: true, max: 50 }]}>
<Input />
</Form.Item>

<Form.Item label={'所属产品'} name="productId" rules={[{ required: true }]}> <Form.Item label={'所属产品'} name="productId" rules={[{ required: true }]}>
<Select onChange={handleChange}> <Select onChange={handleChange}>
{props.dicData.map((item, index) => { {props.dicData.map((item, index) => {
@@ -92,6 +92,9 @@ const CreateForm = (props) => {
})} })}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item label={'设备名称'} name="deviceName" rules={[{ required: true, max: 50 }]}>
<Input />
</Form.Item>
<Form.Item label={'设备标签'} name="deviceTypeId" rules={[{ required: false }]}> <Form.Item label={'设备标签'} name="deviceTypeId" rules={[{ required: false }]}>
<Select <Select
style={{width: '100%'}} style={{width: '100%'}}


Loading…
Cancel
Save