Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
f54c772d
Commit
f54c772d
authored
Jan 28, 2021
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理采购下单支付比例校验问题
parent
bf83b7f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
16 deletions
+19
-16
index.tsx
...eOrder/orderCollect/components/payInfoTableCell/index.tsx
+19
-16
No files found.
src/pages/transaction/purchaseOrder/orderCollect/components/payInfoTableCell/index.tsx
View file @
f54c772d
...
...
@@ -49,21 +49,6 @@ export const EditableRow: React.FC<any> = (props) => {
);
};
const
validatorNumber
=
(
rule
,
value
,
callback
)
=>
{
try
{
let
n
=
Number
(
value
);
if
(
isNaN
(
n
))
{
throw
new
Error
(
'请正确输入支付比例'
);
}
else
if
(
n
<
0
||
!
Number
.
isInteger
(
n
))
{
throw
new
Error
(
'支付比例为大于0的整数'
);
}
else
{
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
export
const
PayInfoCell
:
React
.
FC
<
PayInfoCellProps
>
=
({
title
,
editable
,
...
...
@@ -93,6 +78,24 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
}
}
const
validatorNumber
=
(
rule
,
value
,
callback
)
=>
{
try
{
if
(
formItem
!==
'input'
)
{
callback
()
}
let
n
=
Number
(
value
);
if
(
isNaN
(
n
))
{
throw
new
Error
(
'请正确输入支付比例'
);
}
else
if
(
n
<
0
||
!
Number
.
isInteger
(
n
))
{
throw
new
Error
(
'支付比例为大于0的整数'
);
}
else
{
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
const
save
=
async
e
=>
{
try
{
const
values
=
await
form
.
validateFields
();
...
...
@@ -159,7 +162,7 @@ export const PayInfoCell:React.FC<PayInfoCellProps> = ({
message
:
`${title}必须填写`
,
},
// 支付比例大于0
formItem
===
'input'
&&
{
{
validator
:
validatorNumber
}
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment