Commit f057b1b1 authored by alwayOnlie's avatar alwayOnlie

修改bug

parent 30769d21
......@@ -83,7 +83,7 @@ const FormList = (props: any) => {
},
{
title: '付款金额', dataIndex: 'payAmount', align: 'left',
render: (_, item, index) =>
render: (text, item, index) =>
<div className={styles.flex}>
<span></span>
<Input
......@@ -91,7 +91,9 @@ const FormList = (props: any) => {
width: 130,
}}
placeholder=""
value={Number(item.payAmount).toFixed(2)}
value={text}
onBlur={(e) => onblurkey(e, 'payAmount', index)}
onChange={(e) => onSelectChange(e, 'payAmount', index)}
/>
</div>
......@@ -182,7 +184,16 @@ const FormList = (props: any) => {
setPlanList(List)
setoptions(optionsData)
};
const onblurkey = (e, name, idx) => {
let item = [...PlanList];
console.log(item[idx], 1231321)
switch (name) {
case 'payAmount':
item[idx].payAmount = Number(item[idx].payAmount).toFixed(2);
break;
}
setPlanList(item)
}
/* 选中设置值 */
const onSelectChange = (e, name, idx) => {
let item = [...PlanList];
......@@ -207,15 +218,14 @@ const FormList = (props: any) => {
break;
case 'payAmount':
if (Price != 0) {
item[idx].payRatio = e.target.value / Price * 100;
item[idx].payRatio = Number(e.target.value / Price * 100).toFixed(2);
}
item[idx].payAmount = e.target.value;
item[idx].payAmount = e.target.value
break;
case 'payParam':
item[idx].payParam = e;
break;
}
console.log(item[idx])
setPlanList(item)
}
useEffect(() => {
......
......@@ -22,6 +22,15 @@ const FormList = (props: any) => {
const [PlanList, setPlanList] = useState<any>([
]);
const onblurkey = (e, name, idx) => {
let item = [...PlanList];
switch (name) {
case 'payAmount':
item[idx].payAmount = Number(item[idx].payAmount).toFixed(2);
break;
}
setPlanList(item)
}
/* 显示模态框 */
const tabcolumns: any = [
{
......@@ -65,6 +74,7 @@ const FormList = (props: any) => {
// defaultValue={text}
value={text}
placeholder=""
onBlur={(e) => onblurkey(e, 'payAmount', index)}
onChange={(e) => onSelectChange(e, 'payRatio', index)}
/>
<span>%</span>
......
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