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
shenshaokai
jinfa-platform
Commits
2c0ea4bc
Commit
2c0ea4bc
authored
Jan 25, 2022
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into v2
parents
bea1dac7
9f50820b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
11 deletions
+82
-11
index.tsx
...ction/marketingAbility/platformexeCution/detail/index.tsx
+41
-6
index.tsx
...tion/marketingAbility/selfbuiltexeCution/detail/index.tsx
+41
-5
No files found.
src/pages/transaction/marketingAbility/platformexeCution/detail/index.tsx
View file @
2c0ea4bc
import
{
useIntl
}
from
'umi'
;
import
React
,
{
Fragment
,
useCallback
,
useMemo
,
useState
}
from
'react'
;
import
{
Badge
,
Button
,
Tag
,
Typography
,
Image
}
from
'antd'
;
import
{
Badge
,
Button
,
Tag
,
Typography
,
Image
,
Space
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
Context
}
from
'@/pages/transaction/components/detailLayout/components/context'
;
import
PeripheralLayout
from
'@/pages/transaction/components/detailLayout'
;
...
...
@@ -29,6 +29,12 @@ import { postManageWebShopWebAll } from '@/services/ManageV2Api';
import
{
GlobalConfig
}
from
'@/global/config'
;
const
{
onFormMount$
}
=
FormEffectHooks
;
/** 订单 */
const
ORDER_TYPE
=
1
;
/** 退货订单 */
const
REFUND_TYPE
=
2
;
const
DetialLayout
=
()
=>
{
const
intl
=
useIntl
();
const
{
query
:
{
id
}
}
=
history
.
location
;
...
...
@@ -45,6 +51,7 @@ const DetialLayout = () => {
const
[
collocation
,
setCollocation
]
=
useState
<
any
[]
>
([]);
const
[
listModalVisible
,
setListModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
tableModalVisible
,
setTableModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
idata
,
setIdata
]
=
useState
<
any
[]
>
([]);
const
[
param
,
setParam
]
=
useState
<
any
>
({});
...
...
@@ -236,6 +243,21 @@ const DetialLayout = () => {
return
taxText
}
const
hasQuantity
=
(
DATA
:
any
[],
name
?:
string
)
=>
{
let
buy_no
=
0
;
let
refund_no
=
0
;
if
(
!
isEmpty
(
DATA
))
{
DATA
.
forEach
(
item
=>
{
if
(
item
.
recordType
===
ORDER_TYPE
)
{
buy_no
+=
item
[
name
]
}
else
if
(
item
.
recordType
===
REFUND_TYPE
)
{
refund_no
+=
item
[
name
]
}
})
}
return
buy_no
-
refund_no
}
const
tableModalColumns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'单据号'
,
...
...
@@ -261,7 +283,7 @@ const DetialLayout = () => {
{
title
:
'客户名称'
,
key
:
'memberName'
,
dataIndex
:
'memberName'
dataIndex
:
'memberName'
,
},
{
title
:
'单据时间'
,
...
...
@@ -281,24 +303,36 @@ const DetialLayout = () => {
render
:
(
text
,
record
)
=>
`
${
isHasTax
(
text
)}
/
${
record
.
taxRate
}
%`
},
{
title
:
'购买数量'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
购买数量
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
{
hasQuantity
(
idata
,
'quantity'
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'quantity'
,
dataIndex
:
'quantity'
},
{
title
:
'应付金额'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
应付金额
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
¥
{
Number
(
hasQuantity
(
idata
,
'skuPrice'
)).
toFixed
(
2
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'skuPrice'
,
dataIndex
:
'skuPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'实付金额'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
实付金额
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
¥
{
Number
(
hasQuantity
(
idata
,
'amount'
)).
toFixed
(
2
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'amount'
,
dataIndex
:
'amount'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'优惠金额'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
优惠金额
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
¥
{
(
Number
(
hasQuantity
(
idata
,
'skuPrice'
))
-
Number
(
hasQuantity
(
idata
,
'amount'
))).
toFixed
(
2
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'discountPrice'
,
dataIndex
:
'discountPrice'
,
render
:
(
_text
,
record
)
=>
`¥
${(
record
.
skuPrice
-
record
.
amount
).
toFixed
(
2
)}
`
...
...
@@ -310,6 +344,7 @@ const DetialLayout = () => {
if
(
!
Array
.
isArray
(
fetch
))
{
getMarketingAbilityActivityExecutePlatformDetailGoodsExecuteDetailPage
({
...
params
,
...
param
}).
then
(
res
=>
{
resolve
(
res
.
data
)
setIdata
(
res
.
data
.
data
)
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
...
...
src/pages/transaction/marketingAbility/selfbuiltexeCution/detail/index.tsx
View file @
2c0ea4bc
import
{
useIntl
}
from
'umi'
;
import
React
,
{
Fragment
,
useCallback
,
useMemo
,
useState
}
from
'react'
;
import
{
Badge
,
Button
,
Typography
,
Image
}
from
'antd'
;
import
{
Badge
,
Button
,
Typography
,
Image
,
Space
}
from
'antd'
;
import
{
history
}
from
'umi'
;
import
{
Context
}
from
'@/pages/transaction/components/detailLayout/components/context'
;
import
PeripheralLayout
from
'@/pages/transaction/components/detailLayout'
;
...
...
@@ -29,6 +29,12 @@ import { postManageWebShopWebAll } from '@/services/ManageV2Api';
import
{
GlobalConfig
}
from
'@/global/config'
;
const
{
onFormMount$
}
=
FormEffectHooks
;
/** 订单 */
const
ORDER_TYPE
=
1
;
/** 退货订单 */
const
REFUND_TYPE
=
2
;
const
DetialLayout
=
()
=>
{
const
intl
=
useIntl
();
const
{
query
:
{
id
}
}
=
history
.
location
;
...
...
@@ -45,6 +51,7 @@ const DetialLayout = () => {
const
[
collocation
,
setCollocation
]
=
useState
<
any
[]
>
([]);
const
[
listModalVisible
,
setListModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
tableModalVisible
,
setTableModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
idata
,
setIdata
]
=
useState
<
any
[]
>
([]);
const
[
param
,
setParam
]
=
useState
<
any
>
({});
...
...
@@ -234,6 +241,22 @@ const DetialLayout = () => {
return
taxText
}
const
hasQuantity
=
(
DATA
:
any
[],
name
?:
string
)
=>
{
let
buy_no
=
0
;
let
refund_no
=
0
;
if
(
!
isEmpty
(
DATA
))
{
DATA
.
forEach
(
item
=>
{
if
(
item
.
recordType
===
ORDER_TYPE
)
{
buy_no
+=
item
[
name
]
}
else
if
(
item
.
recordType
===
REFUND_TYPE
)
{
refund_no
+=
item
[
name
]
}
})
}
return
buy_no
-
refund_no
}
const
tableModalColumns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'单据号'
,
...
...
@@ -279,24 +302,36 @@ const DetialLayout = () => {
render
:
(
text
,
record
)
=>
`
${
isHasTax
(
text
)}
/
${
record
.
taxRate
}
%`
},
{
title
:
'购买数量'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
购买数量
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
{
hasQuantity
(
idata
,
'quantity'
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'quantity'
,
dataIndex
:
'quantity'
},
{
title
:
'应付金额'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
应付金额
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
¥
{
Number
(
hasQuantity
(
idata
,
'skuPrice'
)).
toFixed
(
2
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'skuPrice'
,
dataIndex
:
'skuPrice'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'实付金额'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
实付金额
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
¥
{
Number
(
hasQuantity
(
idata
,
'amount'
)).
toFixed
(
2
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'amount'
,
dataIndex
:
'amount'
,
render
:
(
text
)
=>
`¥
${
Number
(
text
).
toFixed
(
2
)}
`
},
{
title
:
'优惠金额'
,
title
:
<
Space
direction=
'vertical'
size=
{
0
}
>
<
Typography
.
Text
>
优惠金额
</
Typography
.
Text
>
<
Typography
.
Text
type=
'secondary'
>
¥
{
(
Number
(
hasQuantity
(
idata
,
'skuPrice'
))
-
Number
(
hasQuantity
(
idata
,
'amount'
))).
toFixed
(
2
)
}
</
Typography
.
Text
>
</
Space
>,
key
:
'discountPrice'
,
dataIndex
:
'discountPrice'
,
render
:
(
_text
,
record
)
=>
`¥
${(
record
.
skuPrice
-
record
.
amount
).
toFixed
(
2
)}
`
...
...
@@ -308,6 +343,7 @@ const DetialLayout = () => {
if
(
!
Array
.
isArray
(
fetch
))
{
getMarketingAbilityActivityExecuteMerchantDetailGoodsExecuteDetailPage
({
...
params
,
...
param
}).
then
(
res
=>
{
resolve
(
res
.
data
)
setIdata
(
res
.
data
.
data
)
}).
catch
(
error
=>
{
console
.
warn
(
error
)
})
...
...
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