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
2828487e
Commit
2828487e
authored
Jan 20, 2022
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 对账单请款核销逻辑修改
parent
d76dae0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
add.tsx
src/pages/balance/businessRequestFunds/admin/add.tsx
+3
-3
index.tsx
src/pages/balance/components/WriteOffDrawer/index.tsx
+7
-4
No files found.
src/pages/balance/businessRequestFunds/admin/add.tsx
View file @
2828487e
...
...
@@ -214,9 +214,9 @@ const Add = () => {
const
_i
=
_tabelSource
.
findIndex
((
item
)
=>
item
.
billId
===
writeOffData
.
billId
);
let
_item
=
{
...
_tabelSource
[
_i
]
};
_item
.
writeOffRecords
=
rows
;
const
_
currentMoney
=
rows
.
map
((
item
)
=>
item
.
currentMoney
).
reduce
((
p
,
r
)
=>
p
+
r
,
0
)
_item
.
writeOffAmount
=
_
currentMoney
;
_item
.
applyPayment
=
_item
.
reconciliationAmount
-
_
currentMoney
;
const
_
writeOffAmount
=
rows
.
map
((
item
)
=>
item
?.
writeOffAmount
??
0
).
reduce
((
p
,
r
)
=>
p
+
r
,
0
)
_item
.
writeOffAmount
=
_
writeOffAmount
;
_item
.
applyPayment
=
_item
.
reconciliationAmount
-
_
writeOffAmount
;
_tabelSource
[
_i
]
=
_item
;
setTabelSource
(
_tabelSource
);
setWriteOffDrawer
(
false
);
...
...
src/pages/balance/components/WriteOffDrawer/index.tsx
View file @
2828487e
...
...
@@ -40,7 +40,7 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp
let
_dataSource
=
[...
tabelSource
];
const
_i
=
_dataSource
.
findIndex
((
item
)
=>
item
.
id
===
record
.
id
);
let
_item
=
{
...
_dataSource
[
_i
]
};
_item
.
currentMoney
=
Number
(
_val
);
_item
.
writeOffAmount
=
_item
.
currentMoney
=
Number
(
_val
);
_dataSource
[
_i
]
=
_item
;
setTabelSource
(
_dataSource
);
}
...
...
@@ -112,15 +112,18 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp
const
editColumns
:
ColumnType
<
any
>
[]
=
columns
.
concat
([{
title
:
'本次核销金额'
,
key
:
'c
anWriteAmount
'
,
dataIndex
:
'c
anWriteAmount
'
,
key
:
'c
urrentMoney
'
,
dataIndex
:
'c
urrentMoney
'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Form
.
Item
name=
{
`c
anWriteAmount
_${record.id}_${record.applyRowId}`
}
name=
{
`c
urrentMoney
_${record.id}_${record.applyRowId}`
}
style=
{
{
margin
:
0
}
}
rules=
{
[
{
validator
:
(
_
,
value
)
=>
{
if
(
!
value
&&
value
!==
0
)
{
return
Promise
.
resolve
()
}
if
(
!
reg
.
test
(
value
))
{
return
Promise
.
reject
(
new
Error
(
'本次核销金额需要大于0'
))
}
...
...
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