Commit f94d3062 authored by 武广's avatar 武广

fix: 修改库存格式化问题

parent 8f5d7a8a
import React from 'react'; import React from 'react';
import { Select, Form, InputNumber, Input, Button, Popover } from 'antd'; import { Select, Form, InputNumber, Input, Button, Popover } from 'antd';
import commonStyle from '../common.less'; import commonStyle from '../common.less';
import { debounce } from '@/utils/utils';
export const WrapperContainer = props => ( export const WrapperContainer = props => (
<div className={commonStyle.container}>{props.children}</div> <div className={commonStyle.container}>{props.children}</div>
...@@ -78,7 +77,6 @@ export const CreateFormInput = props => { ...@@ -78,7 +77,6 @@ export const CreateFormInput = props => {
type, type,
batchProps, batchProps,
disabeldRender, disabeldRender,
onChange,
...options ...options
} = props; } = props;
...@@ -89,11 +87,7 @@ export const CreateFormInput = props => { ...@@ -89,11 +87,7 @@ export const CreateFormInput = props => {
{...options} {...options}
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder={`请输入${title}`} placeholder={`请输入${title}`}
// onBlur={e => onBlurEvent(e.target.value, dataIndex, rowIndex)} onBlur={e => onBlurEvent(e.target.value, dataIndex, rowIndex)}
onChange={e => {
onChange(e);
onBlurEvent(e.target.value, dataIndex, rowIndex);
}}
/> />
); );
} }
...@@ -136,22 +130,18 @@ export const CreateFormInput = props => { ...@@ -136,22 +130,18 @@ export const CreateFormInput = props => {
</> </>
); );
} }
// console.log('options :>> ', options);
return ( return (
<InputNumber <InputNumber
{...roleProps} {...roleProps}
{...options} {...options}
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder={`请输入${title}`} placeholder={`请输入${title}`}
// onBlur={e => { onBlur={e => {
// const v = e.target.value; const inputTarget = e.target;
// console.log('v :>> ', v); setTimeout(() => {
// onBlurEvent(+e.target.value || 0, dataIndex, rowIndex); onBlurEvent(inputTarget.value, dataIndex, rowIndex);
// }} }, 10);
onChange={debounce(e => { }}
onChange(e);
onBlurEvent(e, dataIndex, rowIndex);
}, 300)}
/> />
); );
}; };
...@@ -137,6 +137,10 @@ export const StaticColumns = customer => [ ...@@ -137,6 +137,10 @@ export const StaticColumns = customer => [
precision: 2, precision: 2,
min: 0, min: 0,
}, },
batchProps: {
precision: 2,
min: 0,
},
roleRules: { required: true }, roleRules: { required: true },
disabeldRender: () => customer.isDisabled, disabeldRender: () => customer.isDisabled,
}, },
...@@ -148,8 +152,10 @@ export const StaticColumns = customer => [ ...@@ -148,8 +152,10 @@ export const StaticColumns = customer => [
roleRules: { required: false }, roleRules: { required: false },
roleProps: { roleProps: {
min: 0, min: 0,
// max: 100,
}, },
// batchProps: {
// min: 0,
// },
}, },
{ {
title: '市场价', title: '市场价',
...@@ -160,6 +166,10 @@ export const StaticColumns = customer => [ ...@@ -160,6 +166,10 @@ export const StaticColumns = customer => [
precision: 2, precision: 2,
min: 0, min: 0,
}, },
batchProps: {
precision: 2,
min: 0,
},
roleRules: { required: true }, roleRules: { required: true },
disabeldRender: () => customer.isDisabled, disabeldRender: () => customer.isDisabled,
}, },
...@@ -174,6 +184,10 @@ export const StaticColumns = customer => [ ...@@ -174,6 +184,10 @@ export const StaticColumns = customer => [
precision: 2, precision: 2,
min: 0, min: 0,
}, },
batchProps: {
precision: 2,
min: 0,
},
disabeldRender: () => customer.isDisabled, disabeldRender: () => customer.isDisabled,
}, },
{ {
...@@ -208,6 +222,8 @@ export const StaticColumns = customer => [ ...@@ -208,6 +222,8 @@ export const StaticColumns = customer => [
}, },
roleProps: { roleProps: {
min: 0, min: 0,
step: 1,
precision: 0,
}, },
roleRules: { required: true }, roleRules: { required: true },
disabeldRender: record => { disabeldRender: record => {
...@@ -226,6 +242,11 @@ export const StaticColumns = customer => [ ...@@ -226,6 +242,11 @@ export const StaticColumns = customer => [
precision: 0, precision: 0,
maxLength: 5, maxLength: 5,
}, },
batchProps: {
min: 0,
precision: 0,
maxLength: 5,
},
disabeldRender: () => customer.isDisabled, disabeldRender: () => customer.isDisabled,
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment