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
3987c76a
Commit
3987c76a
authored
Jun 22, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 业务员管理修复部分bug
parent
e73879ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
18 deletions
+34
-18
CustomRelevance.tsx
src/components/NiceForm/components/CustomRelevance.tsx
+0
-1
detail.tsx
src/pages/channel/memberList/detail.tsx
+34
-17
No files found.
src/components/NiceForm/components/CustomRelevance.tsx
View file @
3987c76a
...
...
@@ -80,7 +80,6 @@ const Relevance = props => {
}
setVisible
(
true
);
};
return
(
<
RowStyleLayout
>
<
Input
...
...
src/pages/channel/memberList/detail.tsx
View file @
3987c76a
...
...
@@ -81,6 +81,7 @@ const MemberDetail: React.FC<{}> = () => {
const
[
memberVisible
,
setMemberVisible
]
=
useState
(
false
)
const
{
pageStatus
,
id
}
=
usePageStatus
()
const
[
tableData
,
setTableData
]
=
useState
<
any
[]
>
([])
const
[
keywordName
,
setKeywordName
]
=
useState
<
string
>
(
''
)
const
fetchMemberSaleChannel
=
async
(
params
)
=>
{
const
userInfo
=
formAction
.
getFieldValue
(
'userId'
)
if
(
userInfo
&&
userInfo
.
length
>
0
)
{
...
...
@@ -97,27 +98,33 @@ const MemberDetail: React.FC<{}> = () => {
return
[]
}
}
useEffect
(()
=>
{
if
(
id
)
{
PublicApi
.
getMemberAbilitySalesGet
({
userId
:
id
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
formAction
.
setFieldValue
(
'userId'
,
[
res
.
data
])
}
})
fetchSaleChannel
()
}
},
[
id
])
const
fetchSaleChannel
=
async
()
=>
{
PublicApi
.
getMemberAbilitySalesChannel
({
userId
:
id
,
current
:
'1'
,
pageSize
:
'20'
,
name
:
keywordName
,
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
formAction
.
setFieldValue
(
'userId'
,
[
res
.
data
])
setTableData
(
res
.
data
.
data
)
}
})
}
useEffect
(()
=>
{
if
(
tableData
.
length
>
0
)
{
rowCtl
.
setSelectedRowKeys
(
tableData
.
map
(
v
=>
v
.
memberId
))
}
rowCtl
.
setSelectedRowKeys
(
tableData
.
map
(
v
=>
v
.
memberId
))
rowCtl
.
setSelectRow
([...
tableData
])
},
[
tableData
])
const
cacelConnect
=
(
record
)
=>
{
unBindMember
(
record
.
member
Id
)
unBindMember
(
record
.
relation
Id
)
}
const
abilityColumns
:
any
[]
=
[
...
...
@@ -260,21 +267,31 @@ const MemberDetail: React.FC<{}> = () => {
return
userInfo
&&
userInfo
.
length
>
0
}
const
unBindMember
=
async
(
id
?)
=>
{
const
unBindMember
=
async
(
relationId
?)
=>
{
if
(
pageStatus
===
PageStatus
.
ADD
)
{
// 新增则无需调用接口 直接删除
if
(
relationId
)
{
setTableData
(
d
=>
d
.
filter
(
v
=>
v
.
relationId
!==
relationId
))
}
else
{
setTableData
(
d
=>
{
return
d
.
filter
(
v
=>
!
realRowCtl
.
selectedRowKeys
.
includes
(
v
.
relationId
))
})
}
return
false
}
if
(
validateMember
())
{
const
userInfo
=
formAction
.
getFieldValue
(
'userId'
)
const
userId
=
userInfo
[
0
].
userId
const
{
code
}
=
await
PublicApi
.
postMemberAbilitySalesChannelUnbind
({
userId
,
relationIds
:
id
?
[
i
d
]
:
realRowCtl
.
selectedRowKeys
relationIds
:
relationId
?
[
relationI
d
]
:
realRowCtl
.
selectedRowKeys
})
if
(
code
===
1000
)
{
setTableData
(
d
=>
{
return
d
.
filter
(
v
=>
!
realRowCtl
.
selectedRowKeys
.
includes
(
v
.
member
Id
))
return
d
.
filter
(
v
=>
relationId
?
v
.
relationId
!==
relationId
!
:
realRowCtl
.
selectedRowKeys
.
includes
(
v
.
relation
Id
))
})
message
.
success
(
'解绑成功'
)
}
}
else
{
message
.
error
(
'请先选择业务员'
)
...
...
@@ -441,7 +458,7 @@ const MemberDetail: React.FC<{}> = () => {
<
Button
type=
'default'
onClick=
{
()
=>
unBindMember
()
}
>
批量解除绑定关系
</
Button
>
</
Col
>
<
Col
style=
{
{
display
:
'flex'
}
}
>
<
Input
.
Search
/>
<
Input
.
Search
value=
{
keywordName
}
onChange=
{
e
=>
setKeywordName
(
e
.
target
.
value
)
}
onPressEnter=
{
fetchSaleChannel
}
/>
<
Button
type=
'default'
style=
{
{
marginLeft
:
20
}
}
>
重置
</
Button
>
</
Col
>
</
Row
>
...
...
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