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
6d04b3cf
Commit
6d04b3cf
authored
Apr 21, 2022
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: [22887] 中标明细增加金额
parent
02bc8edf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
index.tsx
.../components/detail/components/tableCommonLayout/index.tsx
+17
-4
No files found.
src/pages/transaction/purchaseAbility/components/detail/components/tableCommonLayout/index.tsx
View file @
6d04b3cf
import
React
,
{
useRef
}
from
'react'
;
import
React
,
{
useRef
,
useState
,
useMemo
}
from
'react'
;
import
StandardTable
from
'@/components/StandardTable'
;
import
{
priceFormat
}
from
'@/utils/numberFomat'
;
...
...
@@ -26,6 +26,13 @@ const transforType = {
const
TableCommonLayout
:
React
.
FC
<
TableCommonLayoutProps
>
=
(
props
:
any
)
=>
{
const
{
layoutId
,
layoutTitle
,
id
,
number
,
fetch
}
=
props
;
const
currentRef
=
useRef
({});
const
[
tableData
,
setTableData
]
=
useState
<
any
[]
>
([]);
const
_totalPrice
=
useMemo
(()
=>
{
let
_val
=
0
;
tableData
?.
forEach
((
item
)
=>
{
return
_val
=
_val
+
item
.
price
});
return
_val
;
},
[
tableData
])
const
columns
=
[
{
...
...
@@ -80,19 +87,25 @@ const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => {
title
:
intl
.
formatMessage
({
id
:
'detail.purchase.taxUnitPrice'
}),
key
:
'unitPrice'
,
dataIndex
:
'unitPrice'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Text
type=
'secondary'
>
{
intl
.
formatMessage
({
id
:
'common.money'
})
}{
priceFormat
(
text
)
}
</
Text
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Text
type=
'secondary'
>
{
intl
.
formatMessage
({
id
:
'common.money'
})
}{
priceFormat
(
text
)
}
</
Text
>
},
{
title
:
intl
.
formatMessage
({
id
:
'detail.purchase.taxPrice'
}),
title
:
(
<>
<
p
>
{
intl
.
formatMessage
({
id
:
'detail.purchase.taxPrice'
})
}
</
p
>
{
_totalPrice
&&
<
p
>
(
{
intl
.
formatMessage
({
id
:
'common.money'
})
}{
priceFormat
(
_totalPrice
)
}
)
</
p
>
}
</>
),
key
:
'price'
,
dataIndex
:
'price'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
Text
type=
'secondary'
>
{
intl
.
formatMessage
({
id
:
'common.money'
})
}{
priceFormat
(
text
)
}
</
Text
>
render
:
(
text
:
any
,
record
:
any
)
=>
<
Text
type=
'secondary'
>
{
intl
.
formatMessage
({
id
:
'common.money'
})
}{
priceFormat
(
text
)
}
</
Text
>
},
];
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
(
resolve
=>
{
fetch
&&
fetch
({
id
,
number
,
...
params
}).
then
((
res
:
any
)
=>
{
setTableData
(
res
.
data
.
data
)
resolve
(
res
.
data
)
})
})
...
...
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