Commit b0d1be16 authored by xixinzhao's avatar xixinzhao

Bug-1467

parent 7bd365f5
......@@ -18,31 +18,21 @@ class EditableCell extends Component {
handleChange = e => {
debugger
const { num } = this.state;
const value = e.target.value;
if(value && !AmosValidate.isNum(value)) {
if (value && !AmosValidate.isNum(value)) {
AmosAlert.warning('提示', '只能输入数字');
return null;
}else{
if(value>num){
} else {
if (Number(value) > Number(num)){
AmosAlert.warning('提示', '不能大于剩余数量!');
}else{
} else {
this.setState({ value });
if (this.props.onChange) {
this.props.onChange(value);
}
}
}
};
check = () => {
......
......@@ -68,9 +68,8 @@ const fireEquipmentTableColumns = self => {
dataIndex: 'single',
key: 'single',
width: '10%',
render: (text, record,index) => record.single === 0 ? '' : (
render: (text, record,index) =>
<EditableCell value={text} num={record.amount} onChange={(text) => self.onCellChange(record, text,index)} />
)
}
];
};
......
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