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
XieZhiXiong
jinfa-platform
Commits
5ac4aff5
Commit
5ac4aff5
authored
Aug 02, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接优惠券执行相关
parent
f1e1f2b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
49 deletions
+154
-49
index.tsx
...ngAbility/merchantCoupon/components/RunningInfo/index.tsx
+131
-19
schema.tsx
...gAbility/merchantCoupon/components/RunningInfo/schema.tsx
+9
-16
index.tsx
...ngAbility/merchantCoupon/merchantCouponAnalysis/index.tsx
+14
-14
No files found.
src/pages/transaction/marketingAbility/merchantCoupon/components/RunningInfo/index.tsx
View file @
5ac4aff5
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-28 18:06:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-29 14:08:23
* @LastEditTime: 2021-0
8-02 11:16:15
* @Description: 执行明细
*/
import
React
,
{
useRef
,
}
from
'react'
;
...
...
@@ -12,10 +12,12 @@ import { StandardTable } from 'god';
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
MellowCard
,
{
MellowCardProps
}
from
'@/components/MellowCard'
;
import
{
querySchema
}
from
'./schema'
;
import
moment
from
'moment'
;
const
formActions
=
createFormActions
();
...
...
@@ -50,8 +52,70 @@ export type ListItemDataType = {
price
:
number
,
}
export
type
FetchParams
=
{
/**
* 当前页
*/
current
:
number
,
/**
* 每页行数
*/
pageSize
:
number
,
}
export
type
FetchExtraParams
=
{
/**
* 客户名称
*/
memberName
:
string
,
/**
* 券码
*/
code
:
string
,
/**
* 券状态
*/
status
:
number
,
/**
* 领(发)劵起始时间
*/
createTimeStart
:
string
,
/**
* 领(发)劵截止时间
*/
createTimeEnd
:
string
,
/**
* 客户ID
*/
memberId
:
string
,
/**
* 适用用户
*/
suitableMemberType
:
number
,
/**
* 下单(使用)起始时间
*/
useTimeStart
:
string
,
/**
* 下单(使用)截止时间
*/
useTimeEnd
:
string
,
/**
* 关联订单号
*/
orderNo
:
string
,
/**
* 商城
*/
shopId
:
number
,
}
interface
IProps
extends
MellowCardProps
{
/**
* 优惠券id
*/
couponId
:
number
,
/**
* 数据
*/
dataSource
?:
ListItemDataType
[];
...
...
@@ -59,52 +123,71 @@ interface IProps extends MellowCardProps {
const
RunningInfo
:
React
.
FC
<
IProps
>
=
(
props
)
=>
{
const
{
couponId
,
dataSource
,
...
rest
}
=
props
;
const
ref
=
useRef
<
any
>
({});
const
fetchData
=
async
(
params
:
any
)
=>
{
let
res
=
await
PublicApi
.
getMemberAbilityMaintenancePage
(
params
);
return
res
.
data
;
const
fetchData
=
async
(
params
:
FetchParams
&
FetchExtraParams
)
=>
{
if
(
!
couponId
)
{
return
{
data
:
[],
totalCount
:
0
};
}
const
res
=
await
PublicApi
.
getMarketingCouponWaiteExecuteDetailPage
({
...
params
,
current
:
`
${
params
.
current
}
`
,
pageSize
:
`
${
params
.
pageSize
}
`
,
status
:
params
.
status
?
`
${
params
.
status
}
`
:
undefined
,
suitableMemberType
:
params
.
suitableMemberType
?
`
${
params
.
suitableMemberType
}
`
:
undefined
,
shopId
:
params
.
shopId
?
`
${
params
.
shopId
}
`
:
undefined
,
createTimeStart
:
params
.
createTimeStart
?
`
${
moment
(
params
.
createTimeStart
).
valueOf
()}
`
:
undefined
,
createTimeEnd
:
params
.
createTimeEnd
?
`
${
moment
(
params
.
createTimeEnd
).
valueOf
()}
`
:
undefined
,
useTimeStart
:
params
.
useTimeStart
?
`
${
moment
(
params
.
useTimeStart
).
valueOf
()}
`
:
undefined
,
useTimeEnd
:
params
.
useTimeEnd
?
`
${
moment
(
params
.
useTimeEnd
).
valueOf
()}
`
:
undefined
,
couponId
:
`
${
couponId
}
`
,
});
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
{
data
:
[],
totalCount
:
0
};
};
const
columns
:
ColumnType
<
ListItemDataType
>
[]
=
[
{
title
:
'券码'
,
dataIndex
:
'
productId
'
,
dataIndex
:
'
code
'
,
align
:
'center'
,
},
{
title
:
'券状态'
,
dataIndex
:
'
productImg
'
,
dataIndex
:
'
statusName
'
,
align
:
'center'
,
},
{
title
:
'客户ID'
,
dataIndex
:
'
productName
'
,
dataIndex
:
'
subMemberId
'
,
ellipsis
:
true
,
},
{
title
:
'客户名称'
,
dataIndex
:
'
category
'
,
dataIndex
:
'
subMemberName
'
,
},
{
title
:
'适用用户'
,
dataIndex
:
'brand'
,
dataIndex
:
'bran
suitableMemberTypeName
d'
,
},
{
title
:
'领(发)放劵时间'
,
dataIndex
:
'
uni
t'
,
dataIndex
:
'
createTimeStar
t'
,
},
{
title
:
'劵有效期起始时间'
,
dataIndex
:
'
unit2
'
,
dataIndex
:
'
effectiveTimeStart
'
,
},
{
title
:
'券有效期截止时间'
,
dataIndex
:
'
unit2
'
,
dataIndex
:
'
effectiveTimeEnd
'
,
},
{
title
:
'关联订单'
,
...
...
@@ -112,23 +195,48 @@ const RunningInfo: React.FC<IProps> = (props) => {
},
{
title
:
'下单(使用)时间'
,
dataIndex
:
'
order
Time'
,
dataIndex
:
'
use
Time'
,
},
{
title
:
'商城'
,
dataIndex
:
'
orderTi
me'
,
dataIndex
:
'
shopNa
me'
,
},
{
title
:
'订单金额'
,
dataIndex
:
'
price
'
,
dataIndex
:
'
amount
'
,
render
:
(
text
)
=>
`¥
${
text
||
''
}
`
,
},
{
title
:
'订单状态'
,
dataIndex
:
'
price2
'
,
dataIndex
:
'
orderStatusName
'
,
},
];
// 初始化高级筛选选项
const
fetchTypeEnums
=
async
()
=>
{
if
(
!
couponId
)
{
return
{};
}
const
res
=
await
PublicApi
.
getMarketingCouponWaiteExecuteDetailPageCondition
({
id
:
`
${
couponId
}
`
,
});
if
(
res
.
code
===
1000
)
{
const
{
statusList
=
[],
suitableMemberTypeList
=
[],
shopList
=
[],
}
=
res
.
data
;
return
{
status
:
statusList
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
value
})),
suitableMemberType
:
suitableMemberTypeList
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
value
})),
shopId
:
shopList
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
value
})),
};
}
return
{};
};
return
(
<
MellowCard
title=
"执行明细"
...
...
@@ -136,11 +244,11 @@ const RunningInfo: React.FC<IProps> = (props) => {
>
<
StandardTable
tableProps=
{
{
rowKey
:
'
validateI
d'
,
rowKey
:
'
i
d'
,
}
}
columns=
{
columns
}
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
fetchTableData=
{
(
params
:
FetchParams
&
FetchExtraParams
)
=>
fetchData
(
params
)
}
controlRender=
{
<
NiceForm
actions=
{
formActions
}
...
...
@@ -152,9 +260,13 @@ const RunningInfo: React.FC<IProps> = (props) => {
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'
n
ame'
,
'
memberN
ame'
,
FORM_FILTER_PATH
,
);
useAsyncInitSelect
(
[
'status'
,
'suitableMemberType'
,
'shopId'
],
fetchTypeEnums
,
);
}
}
schema=
{
querySchema
}
/>
...
...
src/pages/transaction/marketingAbility/merchantCoupon/components/RunningInfo/schema.tsx
View file @
5ac4aff5
...
...
@@ -11,13 +11,13 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
export
const
querySchema
:
ISchema
=
{
type
:
'object'
,
properties
:
{
n
ame
:
{
memberN
ame
:
{
type
:
'string'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
align
:
'flex-start'
,
tip
:
'输入
优惠劵
名称 进行搜索'
,
tip
:
'输入
客户
名称 进行搜索'
,
},
},
[
FORM_FILTER_PATH
]:
{
...
...
@@ -30,7 +30,7 @@ export const querySchema: ISchema = {
columns
:
4
,
},
properties
:
{
id
:
{
code
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'劵码'
,
...
...
@@ -46,7 +46,7 @@ export const querySchema: ISchema = {
allowClear
:
true
,
},
},
'[
startTime, endTime
]'
:
{
'[
createTimeStart, createTimeEnd
]'
:
{
type
:
'string'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
...
...
@@ -54,21 +54,14 @@ export const querySchema: ISchema = {
showTime
:
true
,
},
},
us
erId
:
{
memb
erId
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'客户ID'
,
allowClear
:
true
,
},
},
userName
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'客户名称'
,
allowClear
:
true
,
},
},
applicable
:
{
suitableMemberType
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
...
...
@@ -77,7 +70,7 @@ export const querySchema: ISchema = {
allowClear
:
true
,
},
},
'[
startTime2, endTime2
]'
:
{
'[
useTimeStart, useTimeEnd
]'
:
{
type
:
'string'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
...
...
@@ -92,12 +85,12 @@ export const querySchema: ISchema = {
allowClear
:
true
,
},
},
shop
:
{
shop
Id
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'
适用用户
'
,
placeholder
:
'
商城
'
,
allowClear
:
true
,
},
},
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponAnalysis/index.tsx
View file @
5ac4aff5
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-22 11:10:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
7-06 11:37:25
* @LastEditTime: 2021-0
8-02 10:41:37
* @Description: 商家优惠劵执行
*/
import
React
,
{
useRef
}
from
'react'
;
...
...
@@ -121,19 +121,19 @@ const MerchantCouponAnalysis: React.FC = () => {
const
[
columns
,
columnsHandle
]
=
useSpliceArray
<
ColumnType
<
any
>>
(
defaultColumns
);
// 初始化高级筛选选项
const
fetchTypeEnums
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMarketingCouponTypeList
();
if
(
res
.
code
===
1000
)
{
const
{
data
=
[]
}
=
res
;
return
{
type
:
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
value
})),
};
}
return
{};
};
// 初始化高级筛选选项
const
fetchTypeEnums
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMarketingCouponTypeList
();
if
(
res
.
code
===
1000
)
{
const
{
data
=
[]
}
=
res
;
return
{
type
:
data
.
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
value
})),
};
}
return
{};
};
const
ControllerBtns
=
()
=>
(
<
Space
size=
{
16
}
>
...
...
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