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
d922d3bd
Commit
d922d3bd
authored
Sep 02, 2020
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接中
parent
fe5903e5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
293 additions
and
535 deletions
+293
-535
index.ts
src/constants/index.ts
+16
-0
index.tsx
src/pages/member/components/AuditProcess/index.tsx
+17
-9
index.tsx
src/pages/member/components/BasicInfo/index.tsx
+85
-87
index.tsx
src/pages/member/components/FlowRecords/index.tsx
+38
-37
index.tsx
src/pages/member/components/HeadInfo/index.tsx
+1
-1
constant.tsx
src/pages/member/constant.tsx
+8
-0
addMember.tsx
src/pages/member/memberImport/addMember.tsx
+46
-46
index.tsx
src/pages/member/memberImport/index.tsx
+0
-2
addMember.tsx
src/pages/member/memberMaintain/addMember.tsx
+0
-184
index.tsx
src/pages/member/memberMaintain/index.tsx
+33
-149
maintainDetail.tsx
src/pages/member/memberMaintain/maintainDetail.tsx
+41
-13
index.tsx
src/pages/member/memberMaintain/schema/index.tsx
+8
-7
No files found.
src/constants/index.ts
View file @
d922d3bd
...
@@ -122,6 +122,22 @@ export const VIP_RULE_COMMENT = 3; // 评论
...
@@ -122,6 +122,22 @@ export const VIP_RULE_COMMENT = 3; // 评论
// 会员状态
// 会员状态
export
const
MEMBER_STATUS_NORMAL
=
1
;
// 正常的
export
const
MEMBER_STATUS_NORMAL
=
1
;
// 正常的
export
const
MEMBER_STATUS_FROZEN
=
2
;
// 冻结的
export
const
MEMBER_STATUS_FROZEN
=
2
;
// 冻结的
export
const
MEMBER_STATUS
=
{
[
MEMBER_STATUS_NORMAL
]:
'正常'
,
[
MEMBER_STATUS_FROZEN
]:
'冻结'
,
};
// 会员类型
export
const
MEMBER_TYPE_CORPORATE
=
1
;
// 企业会员
export
const
MEMBER_TYPE_INDIVIDUAL
=
2
;
// 个人会员
export
const
MEMBER_TYPE_CHANNEL_CORPORATE
=
3
;
// 渠道企业会员
export
const
MEMBER_TYPE_CHANNEL_INDIVIDUAL
=
4
;
// 渠道个人会员
export
const
MEMBER_TYPE
=
{
[
MEMBER_TYPE_CORPORATE
]:
'企业会员'
,
[
MEMBER_TYPE_INDIVIDUAL
]:
'个人会员'
,
[
MEMBER_TYPE_CHANNEL_CORPORATE
]:
'渠道企业会员'
,
[
MEMBER_TYPE_CHANNEL_INDIVIDUAL
]:
'渠道个人会员'
,
};
export
const
ORDER_TYPE
=
[
''
,
export
const
ORDER_TYPE
=
[
''
,
'询价采购'
,
'询价采购'
,
...
...
src/pages/member/components/AuditProcess/index.tsx
View file @
d922d3bd
...
@@ -7,25 +7,33 @@ import MellowCard from '@/components/MellowCard';
...
@@ -7,25 +7,33 @@ import MellowCard from '@/components/MellowCard';
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
interface
AuditProcessProp
{
interface
AuditProcessProp
{
single
?:
string
outerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
}[];
innerVerifySteps
?:
{
step
:
number
,
stepName
:
string
,
roleName
:
string
}[];
};
};
const
AuditProcess
:
React
.
FC
<
{}
>
=
(
)
=>
(
const
AuditProcess
:
React
.
FC
<
AuditProcessProp
>
=
({
outerVerifySteps
=
[],
innerVerifySteps
=
[]
}
)
=>
(
<
MellowCard
>
<
MellowCard
>
<
Tabs
onChange=
{
()
=>
{}
}
>
<
Tabs
onChange=
{
()
=>
{}
}
>
<
Tabs
.
TabPane
tab=
"外部审核流程"
key=
"1"
>
<
Tabs
.
TabPane
tab=
"外部审核流程"
key=
"1"
>
<
Steps
style=
{
{
marginTop
:
30
}
}
progressDot
current=
{
2
}
>
<
Steps
style=
{
{
marginTop
:
30
}
}
progressDot
current=
{
2
}
>
<
Steps
.
Step
title=
"会员"
description=
"申请注册"
/>
{
outerVerifySteps
.
map
(
item
=>
(
<
Steps
.
Step
title=
"平台"
description=
"审核会员"
/>
<
Steps
.
Step
<
Steps
.
Step
title=
"完成"
description=
""
/>
key=
{
item
.
step
}
title=
{
item
.
stepName
}
description=
{
item
.
roleName
}
/>
))
}
</
Steps
>
</
Steps
>
</
Tabs
.
TabPane
>
</
Tabs
.
TabPane
>
<
Tabs
.
TabPane
tab=
"内部审核流程"
key=
"2"
>
<
Tabs
.
TabPane
tab=
"内部审核流程"
key=
"2"
>
<
Steps
style=
{
{
marginTop
:
30
}
}
progressDot
current=
{
2
}
>
<
Steps
style=
{
{
marginTop
:
30
}
}
progressDot
current=
{
2
}
>
<
Steps
.
Step
title=
"提交审核会员"
description=
"运营经理"
/>
{
innerVerifySteps
.
map
(
item
=>
(
<
Steps
.
Step
title=
"审核会员"
description=
"运营经理"
/>
<
Steps
.
Step
<
Steps
.
Step
title=
"审核会员"
description=
"副总经理"
/>
key=
{
item
.
step
}
<
Steps
.
Step
title=
"确认会员审核结果"
description=
"运营人员"
/>
title=
{
item
.
roleName
}
description=
{
item
.
stepName
}
/>
))
}
</
Steps
>
</
Steps
>
</
Tabs
.
TabPane
>
</
Tabs
.
TabPane
>
</
Tabs
>
</
Tabs
>
...
...
src/pages/member/components/BasicInfo/index.tsx
View file @
d922d3bd
This diff is collapsed.
Click to expand it.
src/pages/member/components/FlowRecords/index.tsx
View file @
d922d3bd
...
@@ -10,11 +10,32 @@ import MellowCard from '@/components/MellowCard';
...
@@ -10,11 +10,32 @@ import MellowCard from '@/components/MellowCard';
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
interface
FlowRecordsProps
{
export
interface
InnerHistoryItem
{
createTime
?:
string
,
id
?:
number
;
operatorName
?:
string
;
operatorOrgName
?:
string
;
operatorJobTitle
?:
string
;
operation
?:
string
;
innerStatusName
?:
string
;
remark
?:
string
;
};
export
interface
OuterHistoryItem
{
createTime
?:
string
,
id
?:
number
;
operation
?:
string
;
operatorRoleName
?:
string
;
remark
?:
string
;
statusDescription
?:
string
;
};
interface
FlowRecordsProps
{
outerHistory
?:
OuterHistoryItem
[];
innerHistory
?:
InnerHistoryItem
[];
};
};
const
FlowRecords
:
React
.
FC
<
{}
>
=
(
)
=>
{
const
FlowRecords
:
React
.
FC
<
FlowRecordsProps
>
=
({
outerHistory
=
[],
innerHistory
=
[]
}
)
=>
{
const
columns
:
EditableColumns
[]
=
[
const
columns
:
EditableColumns
[]
=
[
{
{
...
@@ -25,29 +46,29 @@ const FlowRecords: React.FC<{}> = () => {
...
@@ -25,29 +46,29 @@ const FlowRecords: React.FC<{}> = () => {
},
},
{
{
title
:
'操作角色'
,
title
:
'操作角色'
,
dataIndex
:
'
rol
e'
,
dataIndex
:
'
operatorRoleNam
e'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'状态'
,
title
:
'状态'
,
dataIndex
:
'status'
,
dataIndex
:
'status
Description
'
,
align
:
'center'
,
align
:
'center'
,
render
:
text
=>
<
Badge
color=
{
STATUS_COLOR_MAP
[
text
]
}
text=
{
STATUS_COLOR_TXT
[
text
]
}
/>,
render
:
text
=>
<
Badge
color=
{
STATUS_COLOR_MAP
[
text
]
}
text=
{
STATUS_COLOR_TXT
[
text
]
}
/>,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'
ac
tion'
,
dataIndex
:
'
opera
tion'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'操作时间'
,
title
:
'操作时间'
,
dataIndex
:
'create
d
'
,
dataIndex
:
'create
Time
'
,
align
:
'center'
,
align
:
'center'
,
ellipsis
:
true
,
ellipsis
:
true
,
},
},
{
{
title
:
'审核意见'
,
title
:
'审核意见'
,
dataIndex
:
'
opinion
'
,
dataIndex
:
'
remark
'
,
align
:
'center'
,
align
:
'center'
,
ellipsis
:
true
,
ellipsis
:
true
,
},
},
...
@@ -62,39 +83,39 @@ const FlowRecords: React.FC<{}> = () => {
...
@@ -62,39 +83,39 @@ const FlowRecords: React.FC<{}> = () => {
},
},
{
{
title
:
'操作人'
,
title
:
'操作人'
,
dataIndex
:
'operator'
,
dataIndex
:
'operator
Name
'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'部门'
,
title
:
'部门'
,
dataIndex
:
'
department
'
,
dataIndex
:
'
operatorOrgName
'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'职位'
,
title
:
'职位'
,
dataIndex
:
'
job
'
,
dataIndex
:
'
operatorJobTitle
'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'状态'
,
title
:
'状态'
,
dataIndex
:
'
status
'
,
dataIndex
:
'
innerStatusName
'
,
align
:
'center'
,
align
:
'center'
,
render
:
text
=>
<
Badge
color=
{
STATUS_COLOR_MAP
[
text
]
}
text=
{
STATUS_COLOR_TXT
[
text
]
}
/>,
render
:
text
=>
<
Badge
color=
{
STATUS_COLOR_MAP
[
text
]
}
text=
{
text
}
/>,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'
ac
tion'
,
dataIndex
:
'
opera
tion'
,
align
:
'center'
,
align
:
'center'
,
},
},
{
{
title
:
'操作时间'
,
title
:
'操作时间'
,
dataIndex
:
'create
d
'
,
dataIndex
:
'create
Time
'
,
align
:
'center'
,
align
:
'center'
,
ellipsis
:
true
,
ellipsis
:
true
,
},
},
{
{
title
:
'审核意见'
,
title
:
'审核意见'
,
dataIndex
:
'
opinion
'
,
dataIndex
:
'
remark
'
,
align
:
'center'
,
align
:
'center'
,
ellipsis
:
true
,
ellipsis
:
true
,
},
},
...
@@ -105,16 +126,7 @@ const FlowRecords: React.FC<{}> = () => {
...
@@ -105,16 +126,7 @@ const FlowRecords: React.FC<{}> = () => {
<
Tabs
onChange=
{
()
=>
{}
}
>
<
Tabs
onChange=
{
()
=>
{}
}
>
<
Tabs
.
TabPane
tab=
"流转记录"
key=
"1"
>
<
Tabs
.
TabPane
tab=
"流转记录"
key=
"1"
>
<
PolymericTable
<
PolymericTable
dataSource=
{
[
dataSource=
{
outerHistory
}
{
id
:
1
,
role
:
'供应商'
,
status
:
0
,
action
:
'申请注册'
,
created
:
'2020-05-12 08:08'
,
opinion
:
'同意'
,
},
]
}
columns=
{
columns
}
columns=
{
columns
}
loading=
{
false
}
loading=
{
false
}
pagination=
{
null
}
pagination=
{
null
}
...
@@ -122,18 +134,7 @@ const FlowRecords: React.FC<{}> = () => {
...
@@ -122,18 +134,7 @@ const FlowRecords: React.FC<{}> = () => {
</
Tabs
.
TabPane
>
</
Tabs
.
TabPane
>
<
Tabs
.
TabPane
tab=
"内部单据流转记录"
key=
"2"
>
<
Tabs
.
TabPane
tab=
"内部单据流转记录"
key=
"2"
>
<
PolymericTable
<
PolymericTable
dataSource=
{
[
dataSource=
{
innerHistory
}
{
id
:
1
,
operator
:
'供应商'
,
department
:
'运营部'
,
job
:
'运营人员'
,
status
:
0
,
action
:
'提交审核会员'
,
created
:
'2020-05-12 08:08'
,
opinion
:
'同意'
,
},
]
}
columns=
{
columns2
}
columns=
{
columns2
}
loading=
{
false
}
loading=
{
false
}
pagination=
{
null
}
pagination=
{
null
}
...
...
src/pages/member/components/HeadInfo/index.tsx
View file @
d922d3bd
...
@@ -13,7 +13,7 @@ export interface HeadInfoProps {
...
@@ -13,7 +13,7 @@ export interface HeadInfoProps {
const
HeadInfo
:
React
.
FC
<
HeadInfoProps
>
=
({
info
,
extra
})
=>
(
const
HeadInfo
:
React
.
FC
<
HeadInfoProps
>
=
({
info
,
extra
})
=>
(
<
div
className=
{
styles
.
head
}
>
<
div
className=
{
styles
.
head
}
>
<
div
className=
{
styles
[
'head-prefix'
]
}
>
<
div
className=
{
styles
[
'head-prefix'
]
}
>
{
info
&&
info
.
name
.
length
?
info
.
name
[
0
]
:
''
}
{
info
&&
info
.
name
&&
info
.
name
.
length
?
info
.
name
[
0
]
:
''
}
</
div
>
</
div
>
<
div
className=
{
styles
[
'head-name'
]
}
>
<
div
className=
{
styles
[
'head-name'
]
}
>
{
info
.
name
||
''
}
{
info
.
name
||
''
}
...
...
src/pages/member/constant.tsx
View file @
d922d3bd
import
{
MEMBER_STATUS_NORMAL
,
MEMBER_STATUS_FROZEN
}
from
'@/constants'
;
export
const
STATUS_COLOR_MAP
=
{
export
const
STATUS_COLOR_MAP
=
{
0
:
'#669EDE'
,
0
:
'#669EDE'
,
1
:
'#41CC9E'
,
1
:
'#41CC9E'
,
...
@@ -9,3 +11,8 @@ export const STATUS_COLOR_TXT = {
...
@@ -9,3 +11,8 @@ export const STATUS_COLOR_TXT = {
1
:
'审核通过'
,
1
:
'审核通过'
,
2
:
'冻结'
,
2
:
'冻结'
,
};
};
export
const
MEMBER_STATUS_TAG_MAP
=
{
MEMBER_STATUS_NORMAL
:
'default'
,
MEMBER_STATUS_FROZEN
:
'success'
};
\ No newline at end of file
src/pages/member/memberImport/addMember.tsx
View file @
d922d3bd
...
@@ -18,7 +18,14 @@ import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi';
...
@@ -18,7 +18,14 @@ import { GetMemberAbilitySubGetResponse } from '@/services/MemberApi';
import
{
initDetailSchema
}
from
'./schema'
;
import
{
initDetailSchema
}
from
'./schema'
;
const
formActions
=
createFormActions
();
const
formActions
=
createFormActions
();
const
{
onFormInit$
,
onFieldValueChange$
,
onFieldInit$
}
=
FormEffectHooks
;
const
{
onFormInit$
,
onFormInitialValueChange$
,
onFieldValueChange$
,
onFieldInit$
,
onFieldInputChange$
,
onFieldInitialValueChange$
,
}
=
FormEffectHooks
;
const
addMember
:
React
.
FC
<
any
>
=
props
=>
{
const
addMember
:
React
.
FC
<
any
>
=
props
=>
{
const
{
id
,
validateId
}
=
usePageStatus
();
const
{
id
,
validateId
}
=
usePageStatus
();
...
@@ -39,12 +46,28 @@ const addMember: React.FC<any> = props => {
...
@@ -39,12 +46,28 @@ const addMember: React.FC<any> = props => {
}
}
const
{
const
{
memberTypeEnum
,
memberTypeEnum
,
groups
,
groups
=
[],
areaCodes
,
...
rest
...
rest
}:
any
=
(
res
.
data
||
{});
}:
any
=
(
res
.
data
||
{});
// 注册资料处理
const
detail
=
{};
for
(
let
i
=
0
;
i
<
groups
.
length
;
i
++
)
{
const
item
=
groups
[
i
];
if
(
item
.
elements
)
{
for
(
let
j
=
0
;
j
<
item
.
elements
.
length
;
j
++
)
{
const
ele
=
item
.
elements
[
j
];
detail
[
ele
.
fieldName
]
=
ele
.
fieldValue
;
}
}
}
setMemberInfo
({
setMemberInfo
({
memberTypeId
:
memberTypeEnum
,
memberTypeId
:
memberTypeEnum
,
...
rest
,
...
rest
,
areas
:
areaCodes
,
...
detail
,
});
});
}).
finally
(()
=>
{
}).
finally
(()
=>
{
setInfoLoading
(
false
);
setInfoLoading
(
false
);
...
@@ -116,52 +139,25 @@ const addMember: React.FC<any> = props => {
...
@@ -116,52 +139,25 @@ const addMember: React.FC<any> = props => {
return
{};
return
{};
};
};
// 获取会员等级下拉框
const
getPageitemsRole
=
(
id
:
string
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getMemberAbilitySubPageitemsRole
({
memberTypeId
:
id
,
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
{
data
=
[]
}:
any
=
res
;
resolve
(
data
.
map
(
item
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})));
}
resolve
([]);
}).
catch
(
err
=>
{
reject
(
err
);
});
});
};
const
beforeUpload
=
(
file
:
any
)
=>
{
const
isJpgOrPng
=
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
||
file
.
type
===
'image/jpg'
;
if
(
!
isJpgOrPng
)
{
message
.
error
(
'仅支持上传JPEG/JPG/PNG文件!'
);
}
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
message
.
error
(
'上传图片不超过2MB!'
);
}
return
isJpgOrPng
&&
isLt2M
;
};
const
useAsyncLinkageEffect
=
()
=>
{
const
useAsyncLinkageEffect
=
()
=>
{
const
linkage
=
useLinkageUtils
();
const
linkage
=
useLinkageUtils
();
let
areasData
=
[];
let
areasData
=
[];
// 手动触发改变的话重置角色、等级下拉框
onFieldInputChange$
(
'memberTypeId'
).
subscribe
(()
=>
{
console
.
log
(
'onFieldInputChange'
)
linkage
.
value
(
'roleId'
,
undefined
);
linkage
.
enum
(
'roleId'
,
[]);
linkage
.
value
(
'levelId'
,
undefined
);
linkage
.
enum
(
'levelId'
,
[]);
});
// 根据会员类型
// 根据会员类型
onFieldValueChange$
(
'memberTypeId'
).
subscribe
(
fieldState
=>
{
onFieldValueChange$
(
'memberTypeId'
).
subscribe
(
fieldState
=>
{
if
(
!
fieldState
.
value
)
{
if
(
!
fieldState
.
value
)
{
return
;
return
;
}
}
// 查询角色下拉
// 查询角色下拉
linkage
.
value
(
'roleId'
,
undefined
);
linkage
.
enum
(
'roleId'
,
[]);
linkage
.
value
(
'levelId'
,
undefined
);
linkage
.
enum
(
'levelId'
,
[]);
linkage
.
loading
(
'roleId'
);
linkage
.
loading
(
'roleId'
);
PublicApi
.
getMemberAbilitySubPageitemsRole
({
PublicApi
.
getMemberAbilitySubPageitemsRole
({
memberTypeId
:
fieldState
.
value
,
memberTypeId
:
fieldState
.
value
,
...
@@ -200,15 +196,15 @@ const addMember: React.FC<any> = props => {
...
@@ -200,15 +196,15 @@ const addMember: React.FC<any> = props => {
const
channelType
=
channelTypes
.
map
(
item
=>
({
label
:
item
.
channelTypeName
,
value
:
item
.
channelTypeId
}))
const
channelType
=
channelTypes
.
map
(
item
=>
({
label
:
item
.
channelTypeName
,
value
:
item
.
channelTypeId
}))
if
(
areasOptions
.
length
)
{
if
(
areasOptions
.
length
)
{
formActions
.
setFieldState
(
'
tabs.tab-2.MEGA_LAYOUT1.
areas.*.pcode'
,
state
=>
{
formActions
.
setFieldState
(
'areas.*.pcode'
,
state
=>
{
FormPath
.
setIn
(
state
,
'props.enum'
,
areasOptions
);
FormPath
.
setIn
(
state
,
'props.enum'
,
areasOptions
);
});
});
}
}
formActions
.
setFieldState
(
'
tabs.tab-2.MEGA_LAYOUT1.
channelLevel'
,
state
=>
{
formActions
.
setFieldState
(
'channelLevel'
,
state
=>
{
FormPath
.
setIn
(
state
,
'value'
,
channelLevelTag
);
FormPath
.
setIn
(
state
,
'value'
,
channelLevelTag
);
});
});
formActions
.
setFieldState
(
'
tabs.tab-2.MEGA_LAYOUT1.
channelTypeId'
,
state
=>
{
formActions
.
setFieldState
(
'channelTypeId'
,
state
=>
{
FormPath
.
setIn
(
state
,
'props.enum'
,
channelType
);
FormPath
.
setIn
(
state
,
'props.enum'
,
channelType
);
});
});
...
@@ -231,6 +227,12 @@ const addMember: React.FC<any> = props => {
...
@@ -231,6 +227,12 @@ const addMember: React.FC<any> = props => {
});
});
});
});
// 手动触发改变的话重置等级下拉框
onFieldInputChange$
(
'*(memberTypeId,roleId)'
).
subscribe
(()
=>
{
linkage
.
value
(
'levelId'
,
undefined
);
linkage
.
enum
(
'levelId'
,
[]);
});
// 根据会员类型和角色,查询等级下拉
// 根据会员类型和角色,查询等级下拉
onFieldValueChange$
(
'*(memberTypeId,roleId)'
).
subscribe
(
fieldState
=>
{
onFieldValueChange$
(
'*(memberTypeId,roleId)'
).
subscribe
(
fieldState
=>
{
const
selfName
=
fieldState
.
name
;
const
selfName
=
fieldState
.
name
;
...
@@ -239,8 +241,6 @@ const addMember: React.FC<any> = props => {
...
@@ -239,8 +241,6 @@ const addMember: React.FC<any> = props => {
const
otherValue
=
formActions
.
getFieldState
(
otherName
,
state
=>
state
.
value
);
const
otherValue
=
formActions
.
getFieldState
(
otherName
,
state
=>
state
.
value
);
if
(
selfValue
&&
otherValue
)
{
if
(
selfValue
&&
otherValue
)
{
linkage
.
value
(
'levelId'
,
undefined
);
linkage
.
enum
(
'levelId'
,
[]);
linkage
.
loading
(
'levelId'
);
linkage
.
loading
(
'levelId'
);
PublicApi
.
getMemberAbilitySubPageitemsLevel
({
PublicApi
.
getMemberAbilitySubPageitemsLevel
({
...
@@ -259,14 +259,14 @@ const addMember: React.FC<any> = props => {
...
@@ -259,14 +259,14 @@ const addMember: React.FC<any> = props => {
});
});
// 渠道信息省级变化,筛选出对应的市级数据
// 渠道信息省级变化,筛选出对应的市级数据
onFieldValueChange$
(
'
tabs.tab-2.MEGA_LAYOUT1.
areas.*.pcode'
).
subscribe
(
fieldState
=>
{
onFieldValueChange$
(
'areas.*.pcode'
).
subscribe
(
fieldState
=>
{
const
province
=
areasData
.
find
(
item
=>
item
.
code
===
fieldState
.
value
);
const
province
=
areasData
.
find
(
item
=>
item
.
code
===
fieldState
.
value
);
if
(
!
province
)
{
if
(
!
province
)
{
return
;
return
;
}
}
const
city
=
(
province
.
children
||
[]).
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
code
}));
const
city
=
(
province
.
children
||
[]).
map
(
item
=>
({
label
:
item
.
name
,
value
:
item
.
code
}));
formActions
.
setFieldState
(
formActions
.
setFieldState
(
FormPath
.
transform
(
fieldState
.
name
,
/
\d
/
,
$1
=>
`
tabs.tab-2.MEGA_LAYOUT1.
areas.
${
$1
}
.ccode`
),
FormPath
.
transform
(
fieldState
.
name
,
/
\d
/
,
$1
=>
`areas.
${
$1
}
.ccode`
),
state
=>
{
state
=>
{
FormPath
.
setIn
(
state
,
'value'
,
undefined
);
FormPath
.
setIn
(
state
,
'value'
,
undefined
);
FormPath
.
setIn
(
state
,
'props.enum'
,
city
);
FormPath
.
setIn
(
state
,
'props.enum'
,
city
);
...
@@ -297,7 +297,7 @@ const addMember: React.FC<any> = props => {
...
@@ -297,7 +297,7 @@ const addMember: React.FC<any> = props => {
<
NiceForm
<
NiceForm
onSubmit=
{
handleSubmit
}
onSubmit=
{
handleSubmit
}
actions=
{
formActions
}
actions=
{
formActions
}
initialValues=
{
memberInfo
}
initialValues=
{
memberInfo
||
{}
}
effects=
{
(
$
,
actions
)
=>
{
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
useStateFilterSearchLinkageEffect
(
$
,
$
,
...
...
src/pages/member/memberImport/index.tsx
View file @
d922d3bd
...
@@ -135,7 +135,6 @@ const memberMaintain: React.FC<[]> = () => {
...
@@ -135,7 +135,6 @@ const memberMaintain: React.FC<[]> = () => {
) : (
) : (
''
''
)} */
}
)} */
}
{
record
.
outerStatusName
===
'待审核'
?
(
<>
<>
<
Button
<
Button
type=
"link"
type=
"link"
...
@@ -149,7 +148,6 @@ const memberMaintain: React.FC<[]> = () => {
...
@@ -149,7 +148,6 @@ const memberMaintain: React.FC<[]> = () => {
<
Button
type=
"link"
>
删除
</
Button
>
<
Button
type=
"link"
>
删除
</
Button
>
</
Popconfirm
>
</
Popconfirm
>
</>
</>
)
:
null
}
</>
</>
),
),
},
},
...
...
src/pages/member/memberMaintain/addMember.tsx
deleted
100644 → 0
View file @
fe5903e5
import
React
,
{
useState
,
useEffect
,
useRef
,
ReactNode
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
Badge
,
Button
,
Card
,
message
}
from
'antd'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
ColumnType
}
from
'antd/lib/table/interface'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
useStateFilterSearchLinkageEffect
}
from
'@/formSchema/effects/useFilterSearch'
;
import
{
FORM_FILTER_PATH
}
from
'@/formSchema/const'
;
import
{
initDetailSchema
}
from
'./schema'
;
import
{
useAsyncSelect
}
from
'@/formSchema/effects/useAsyncSelect'
;
import
{
useAsyncInitSelect
}
from
'@/formSchema/effects/useAsyncInitSelect'
;
import
{
PublicApi
}
from
'@/services/api'
;
const
formActions
=
createFormActions
();
const
addMember
:
React
.
FC
<
any
>
=
props
=>
{
const
ref
=
useRef
<
any
>
({});
const
[
memberItems
,
setMemberItems
]
=
useState
<
any
>
({});
const
data
=
[
{
key
:
'1'
,
sn
:
'1'
,
roleName
:
'供应商'
,
status
:
'1'
,
operation
:
'申请注册'
,
useTime
:
'2020-05-12 08:08'
,
result
:
'无'
,
},
];
const
columns
:
ColumnType
<
any
>
[]
=
[
{
title
:
'序号'
,
dataIndex
:
'sn'
,
align
:
'center'
,
key
:
'sn'
,
},
{
title
:
'操作角色'
,
dataIndex
:
'roleName'
,
align
:
'center'
,
key
:
'roleName'
,
},
{
title
:
'状态'
,
dataIndex
:
'status'
,
align
:
'center'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
{
let
component
:
ReactNode
=
null
;
component
=
<
Badge
color=
"#FFC400"
text=
"待审核"
/>;
return
component
;
},
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
align
:
'center'
,
key
:
'operation'
,
},
{
title
:
'操作时间'
,
dataIndex
:
'useTime'
,
align
:
'center'
,
key
:
'useTime'
,
},
{
title
:
'审核意见'
,
dataIndex
:
'result'
,
align
:
'center'
,
key
:
'result'
,
},
];
useEffect
(()
=>
{
PublicApi
.
getMemberMaintenanceAddpageitems
().
then
(
res
=>
{
setMemberItems
(
res
.
data
);
});
},
[]);
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
queryResult
=
data
.
find
(
v
=>
v
.
key
===
params
.
keywords
);
setTimeout
(()
=>
{
resolve
({
code
:
200
,
message
:
''
,
data
:
queryResult
?
[
queryResult
]
:
data
,
});
},
1000
);
});
};
const
handleSubmit
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
};
// 会员类型、会员角色、会员等级选项
const
fetchSelectOptions
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getMemberMaintenanceAddpageitems
();
return
{
memberTypeId
:
fetchSomeOptions
(
data
.
memberTypes
),
roleId
:
fetchSomeOptions
(
data
.
memberRoles
),
level
:
fetchSomeOptions
(
data
.
memberLevels
),
};
};
// 获取手机code
const
fetchTelCode
=
async
()
=>
{
const
{
data
}
=
await
PublicApi
.
getManageGetTelCode
();
return
data
;
};
const
fetchSomeOptions
=
data
=>
{
return
data
.
map
(
v
=>
({
label
:
v
.
text
,
value
:
v
.
id
}));
};
const
beforeUpload
=
(
file
:
any
)
=>
{
const
isJpgOrPng
=
file
.
type
===
'image/jpeg'
||
file
.
type
===
'image/png'
||
file
.
type
===
'image/jpg'
;
if
(
!
isJpgOrPng
)
{
message
.
error
(
'仅支持上传JPEG/JPG/PNG文件!'
);
}
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
if
(
!
isLt2M
)
{
message
.
error
(
'上传图片不超过2MB!'
);
}
return
isJpgOrPng
&&
isLt2M
;
};
return
(
<
PageHeaderWrapper
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
description=
"返回"
/>
}
title=
{
props
.
location
.
query
.
type
===
'add'
?
'新建会员'
:
props
.
location
.
query
.
type
===
'change'
?
'编辑会员'
:
'查看会员'
}
extra=
{
[
<
Button
key=
"1"
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
onClick=
{
()
=>
formActions
.
submit
()
}
>
保存
</
Button
>,
]
}
>
<
Card
>
<
NiceForm
onSubmit=
{
handleSubmit
}
actions=
{
formActions
}
effects=
{
(
$
,
actions
)
=>
{
useStateFilterSearchLinkageEffect
(
$
,
actions
,
'name'
,
FORM_FILTER_PATH
,
);
useAsyncInitSelect
(
[
'memberTypeId'
,
'roleId'
,
'level'
],
fetchSelectOptions
,
);
useAsyncSelect
(
'telCode'
,
fetchTelCode
);
}
}
schema=
{
initDetailSchema
(
memberItems
)
}
/>
</
Card
>
</
PageHeaderWrapper
>
);
};
export
default
addMember
;
src/pages/member/memberMaintain/index.tsx
View file @
d922d3bd
This diff is collapsed.
Click to expand it.
src/pages/member/memberMaintain/maintainDetail.tsx
View file @
d922d3bd
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
history
}
from
'umi'
;
import
{
history
}
from
'umi'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PageHeader
,
Tag
,
Descriptions
,
Button
,
Modal
,
Spin
}
from
'antd'
;
import
{
PageHeader
,
Tag
,
Descriptions
,
Button
,
Modal
,
Badge
,
Spin
}
from
'antd'
;
import
{
SettingOutlined
,
StopOutlined
}
from
'@ant-design/icons'
;
import
{
SettingOutlined
,
StopOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
createFormActions
,
FormEffectHooks
}
from
'@formily/antd'
;
import
{
STATUS_COLOR_MAP
,
STATUS_COLOR_TXT
}
from
'../constant'
;
import
{
STATUS_COLOR_MAP
,
STATUS_COLOR_TXT
}
from
'../constant'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMemberAbilityMaintenanceDetailBasicResponse
}
from
'@/services/MemberApi'
;
import
{
GetMemberAbilityMaintenanceDetailBasicResponse
}
from
'@/services/MemberApi'
;
import
{
MEMBER_STATUS_NORMAL
,
MEMBER_STATUS_FROZEN
}
from
'@/constants'
;
import
{
MEMBER_STATUS_NORMAL
,
MEMBER_STATUS_FROZEN
,
MEMBER_TYPE_CHANNEL_CORPORATE
,
MEMBER_TYPE_CHANNEL_INDIVIDUAL
,
}
from
'@/constants'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
{
auditModalSchema
}
from
'./schema'
;
import
{
auditModalSchema
}
from
'./schema'
;
import
HeadInfo
from
'../components/HeadInfo'
;
import
HeadInfo
from
'../components/HeadInfo'
;
...
@@ -34,7 +39,7 @@ const maintainDetail: React.FC<{}> = () => {
...
@@ -34,7 +39,7 @@ const maintainDetail: React.FC<{}> = () => {
memberId
:
id
,
memberId
:
id
,
validateId
,
validateId
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
100
)
{
if
(
res
.
code
===
100
0
)
{
setDetailed
(
res
.
data
);
setDetailed
(
res
.
data
);
}
}
}).
finally
(()
=>
{
}).
finally
(()
=>
{
...
@@ -51,7 +56,7 @@ const maintainDetail: React.FC<{}> = () => {
...
@@ -51,7 +56,7 @@ const maintainDetail: React.FC<{}> = () => {
return
PublicApi
.
postMemberMaintenanceStatus
({
return
PublicApi
.
postMemberMaintenanceStatus
({
memberId
:
id
,
memberId
:
id
,
validateId
:
validateId
,
validateId
:
validateId
,
status
:
detailed
.
status
===
MEMBER_STATUS_NORMAL
?
MEMBER_STATUS_FROZEN
:
MEMBER_STATUS_NORMAL
,
status
:
detailed
&&
detailed
.
status
===
MEMBER_STATUS_NORMAL
?
MEMBER_STATUS_FROZEN
:
MEMBER_STATUS_NORMAL
,
remark
:
values
.
remark
||
''
,
remark
:
values
.
remark
||
''
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
...
@@ -71,14 +76,14 @@ const maintainDetail: React.FC<{}> = () => {
...
@@ -71,14 +76,14 @@ const maintainDetail: React.FC<{}> = () => {
title=
{
title=
{
<
HeadInfo
<
HeadInfo
info=
{
{
info=
{
{
name
:
'广州市极致皮具有限公司'
,
name
:
detailed
?.
name
,
level
:
1
,
level
:
1
,
}
}
}
}
/>
/>
}
}
extra=
{
(
extra=
{
(
<>
<>
{
detailed
.
status
===
MEMBER_STATUS_NORMAL
?
(
{
detailed
&&
detailed
.
status
===
MEMBER_STATUS_NORMAL
?
(
<
Button
<
Button
icon=
{
<
StopOutlined
/>
}
icon=
{
<
StopOutlined
/>
}
onClick=
{
()
=>
{}
}
onClick=
{
()
=>
{}
}
...
@@ -104,14 +109,17 @@ const maintainDetail: React.FC<{}> = () => {
...
@@ -104,14 +109,17 @@ const maintainDetail: React.FC<{}> = () => {
padding
:
'0 32px'
,
padding
:
'0 32px'
,
}
}
}
}
>
>
<
Descriptions
.
Item
label=
"会员类型"
>
{
123
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"会员类型"
>
{
detailed
?.
memberTypeName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"会员角色"
span=
{
2
}
>
{
123
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"会员角色"
span=
{
2
}
>
{
detailed
?.
roleName
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"会员状态"
>
<
Descriptions
.
Item
label=
"会员状态"
>
{
/* <Tag color={STATUS_COLOR_MAP[1]}>{STATUS_COLOR_TXT[1]}</Tag> */
}
{
/* <Tag color={STATUS_COLOR_MAP[1]}>{STATUS_COLOR_TXT[1]}</Tag> */
}
<
StatusTag
type=
"success"
title=
"正常"
/>
<
StatusTag
type=
"success"
title=
"正常"
/>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"外部状态"
>
<
Descriptions
.
Item
label=
"外部状态"
>
<
Tag
color=
{
STATUS_COLOR_MAP
[
2
]
}
>
{
STATUS_COLOR_TXT
[
2
]
}
</
Tag
>
<
StatusTag
type=
"success"
title=
{
detailed
?.
innerStatusName
}
/>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"内部状态"
>
<
Badge
color=
{
STATUS_COLOR_MAP
[
2
]
}
text=
{
detailed
?.
outerStatusName
}
/>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
</
Descriptions
>
</
Descriptions
>
</
PageHeader
>
</
PageHeader
>
...
@@ -123,13 +131,33 @@ const maintainDetail: React.FC<{}> = () => {
...
@@ -123,13 +131,33 @@ const maintainDetail: React.FC<{}> = () => {
marginBottom
:
24
,
marginBottom
:
24
,
}
}
}
}
>
>
<
AuditProcess
/>
<
AuditProcess
outerVerifySteps=
{
detailed
?.
outerVerifySteps
}
innerVerifySteps=
{
detailed
?.
innerVerifySteps
}
/>
</
div
>
</
div
>
<
BasicInfo
/>
<
BasicInfo
basic=
{
{
account
:
detailed
?.
account
,
phone
:
detailed
?.
phone
,
email
:
detailed
?.
email
,
created
:
detailed
?.
createTime
,
}
}
channel=
{
{
memberType
:
detailed
?.
memberTypeEnum
,
level
:
detailed
?.
channelLevelTag
,
type
:
detailed
?.
channelTypeName
,
areas
:
detailed
?.
areas
,
desc
:
detailed
?.
remark
,
}
}
extra=
{
detailed
?.
groups
}
outerHistory=
{
detailed
?.
outerHistory
}
innerHistory=
{
detailed
?.
innerHistory
}
/>
<
Modal
<
Modal
title=
{
detailed
.
status
===
1
?
'会员解冻'
:
'会员冻结'
}
title=
{
detailed
&&
detailed
.
status
===
1
?
'会员解冻'
:
'会员冻结'
}
visible=
{
modalVisible
}
visible=
{
modalVisible
}
onOk=
{
()
=>
formActions
.
submit
()
}
onOk=
{
()
=>
formActions
.
submit
()
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
onCancel=
{
()
=>
setModalVisible
(
false
)
}
...
@@ -140,7 +168,7 @@ const maintainDetail: React.FC<{}> = () => {
...
@@ -140,7 +168,7 @@ const maintainDetail: React.FC<{}> = () => {
effects=
{
(
$
,
{
setFieldState
})
=>
{
effects=
{
(
$
,
{
setFieldState
})
=>
{
FormEffectHooks
.
onFieldInit$
(
'remark'
).
subscribe
(
state
=>
{
FormEffectHooks
.
onFieldInit$
(
'remark'
).
subscribe
(
state
=>
{
setFieldState
(
'remark'
,
targetState
=>
{
setFieldState
(
'remark'
,
targetState
=>
{
targetState
.
props
.
title
=
`会员${detailed.status === 1 ? '解冻' : '冻结'}原因`
;
targetState
.
props
.
title
=
`会员${detailed
&& detailed
.status === 1 ? '解冻' : '冻结'}原因`
;
});
});
});
});
}
}
}
}
...
...
src/pages/member/memberMaintain/schema/index.tsx
View file @
d922d3bd
...
@@ -29,27 +29,27 @@ export const maintianSchema: ISchema = {
...
@@ -29,27 +29,27 @@ export const maintianSchema: ISchema = {
properties
:
{
properties
:
{
memberType
:
{
memberType
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'会员类型(全部)'
,
placeholder
:
'会员类型(全部)'
,
defaultValue
:
undefined
,
},
},
enum
:
[],
},
},
roleId
:
{
roleId
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'会员角色(全部)'
,
placeholder
:
'会员角色(全部)'
,
defaultValue
:
undefined
,
},
},
enum
:
[],
},
},
level
:
{
level
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'会员等级(全部)'
,
placeholder
:
'会员等级(全部)'
,
defaultValue
:
undefined
,
},
},
enum
:
[],
},
},
source
:
{
source
:
{
type
:
'string'
,
type
:
'string'
,
...
@@ -86,10 +86,11 @@ export const maintianSchema: ISchema = {
...
@@ -86,10 +86,11 @@ export const maintianSchema: ISchema = {
timeRange
:
{
timeRange
:
{
type
:
'string'
,
type
:
'string'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'
时间范围(全部)
'
,
placeholder
:
'
请选择
'
,
defaultValue
:
undefined
,
defaultValue
:
undefined
,
},
},
enum
:
[
enum
:
[
{
label
:
'时间范围(全部)'
,
value
:
0
},
{
label
:
'今天'
,
value
:
1
},
{
label
:
'今天'
,
value
:
1
},
{
label
:
'一周内'
,
value
:
2
},
{
label
:
'一周内'
,
value
:
2
},
{
label
:
'一个月内'
,
value
:
3
},
{
label
:
'一个月内'
,
value
:
3
},
...
...
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