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
c97d3974
Commit
c97d3974
authored
Mar 31, 2022
by
前端-彭佳文
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2-220418' into 'v2-220418'
会员领取 See merge request linkseeks-design/pro-platform!94
parents
2e907e69
83544e8c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
25 deletions
+66
-25
member.ts
src/locales/zh-CN/member.ts
+1
-0
index.tsx
src/pages/member/memberAssigned/index.tsx
+65
-25
No files found.
src/locales/zh-CN/member.ts
View file @
c97d3974
...
...
@@ -970,6 +970,7 @@ export default {
'member.management.assigned.query.sourceName'
:
'申请来源'
,
'member.management.assigned.query.receive'
:
'领取'
,
'member.management.assigned.query.batchReceive'
:
'批量领取'
,
'member.management.assigned.query.bind.suc'
:
'会员领取成功!'
,
}
src/pages/member/memberAssigned/index.tsx
View file @
c97d3974
...
...
@@ -15,8 +15,11 @@ import NiceForm from '@/components/NiceForm';
import
LevelBrand
from
'@/components/LevelBrand'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
{
getMemberAbilityAssignedPage
,
getMemberAbilityAssignedPageitems
,
getMemberAbilityMaintenancePage
,
getMemberAbilityMaintenancePageitems
,
postMemberAbilityAssignedBind
,
postMemberDepositVerifyBatch
,
}
from
'@/services/MemberV2Api'
;
import
useSpliceArray
from
'@/hooks/useSpliceArray'
;
...
...
@@ -30,7 +33,13 @@ import styles from './index.less';
const
formActions
=
createFormActions
();
const
fetchData
=
async
(
params
:
any
)
=>
{
const
MemberMaintain
:
React
.
FC
<
[]
>
=
()
=>
{
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
number
[]
>
([]);
const
[
data
,
setData
]
=
useState
<
any
>
([])
const
fetchData
=
async
(
params
:
any
)
=>
{
const
{
startDate
=
null
,
endDate
=
null
}
=
params
;
const
payload
=
{
...
params
};
...
...
@@ -40,16 +49,14 @@ const fetchData = async (params: any) => {
if
(
endDate
)
{
payload
.
endDate
=
moment
(
+
endDate
).
format
(
'YYYY-MM-DD'
);
}
const
res
=
await
getMemberAbilityMaintenance
Page
(
payload
);
const
res
=
await
getMemberAbilityAssigned
Page
(
payload
);
if
(
res
.
code
===
1000
)
{
setData
(
res
.
data
.
data
)
return
res
.
data
;
}
return
{
data
:
[],
totalCount
:
0
};
};
const
MemberMaintain
:
React
.
FC
<
[]
>
=
()
=>
{
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
<
number
[]
>
([]);
};
const
ref
=
useRef
<
any
>
({});
const
intl
=
useIntl
();
...
...
@@ -63,6 +70,7 @@ const MemberMaintain: React.FC<[]> = () => {
id
:
'member.management.maintain.query.memberName'
,
})}
`
,
dataIndex
:
'memberId'
,
width
:
150
,
render
:
(
text
,
record
)
=>
(
<>
<
div
>
{
text
}
</
div
>
...
...
@@ -170,7 +178,7 @@ const MemberMaintain: React.FC<[]> = () => {
title
:
intl
.
formatMessage
({
id
:
'common.table.action'
}),
dataIndex
:
'option'
,
render
:
(
_
,
record
)
=>
(
<
Button
type=
"link"
onClick=
{
()
=>
handleReceive
(
record
.
memberId
)
}
>
<
Button
type=
"link"
onClick=
{
()
=>
handleReceive
(
record
.
memberId
,
record
.
roleId
)
}
>
{
intl
.
formatMessage
({
id
:
'member.management.assigned.query.receive'
,
})
}
...
...
@@ -185,7 +193,7 @@ const MemberMaintain: React.FC<[]> = () => {
// 初始化高级筛选选项
const
fetchSelectOptions
=
async
()
=>
{
const
res
=
await
getMemberAbility
Maintenance
Pageitems
();
const
res
=
await
getMemberAbility
Assigned
Pageitems
();
if
(
res
.
code
===
1000
)
{
const
{
data
=
{}
}:
any
=
res
;
...
...
@@ -269,10 +277,28 @@ const MemberMaintain: React.FC<[]> = () => {
selectedRowKeys
:
selectedRowKeys
,
};
const
handleReceive
=
id
=>
{
console
.
log
(
'lingqu'
,
id
);
const
handleReceive
=
(
memberId
,
roleId
)
=>
{
let
selectDataParam
=
[{
subMemberId
:
memberId
,
subRoleId
:
roleId
}]
postMemberAbilityAssignedBind
(
selectDataParam
,{
ctlType
:
'none'
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
message
.
success
(
intl
.
formatMessage
({
id
:
'member.management.assigned.query.bind.suc'
,
})
)
setTimeout
(()
=>
{
ref
.
current
.
reload
();
setSelectedRowKeys
([]);
},
200
);
}
})
.
catch
((
err
)
=>
{
message
.
error
(
err
.
message
)
});
};
const
handleBatch
=
()
=>
{
if
(
!
selectedRowKeys
.
length
)
{
message
.
warning
(
...
...
@@ -280,6 +306,18 @@ const MemberMaintain: React.FC<[]> = () => {
);
return
;
}
let
selectDataParam
=
[]
data
?.
length
&&
data
.
map
((
item
)
=>
{
selectedRowKeys
.
map
((
i
)
=>
{
if
(
item
.
validateId
===
i
){
selectDataParam
.
push
({
subMemberId
:
item
.
memberId
,
subRoleId
:
item
.
roleId
})
}
})
})
console
.
log
(
'选中data:'
,
selectDataParam
)
confirm
({
title
:
intl
.
formatMessage
({
id
:
'member.actions.verify-tip'
}),
icon
:
<
QuestionCircleOutlined
/>,
...
...
@@ -288,21 +326,23 @@ const MemberMaintain: React.FC<[]> = () => {
}),
onOk
()
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
console
.
log
(
'提交的会员idlist:'
,
selectedRowKeys
);
// postMemberDepositVerifyBatch({
// validateIds: selectedRowKeys,
// })
// .then(res => {
// if (res.code === 1000) {
// ref.current.reload();
// setSelectedRowKeys([]);
// resolve();
// }
// reject();
// })
// .catch(() => {
// reject();
// });
postMemberAbilityAssignedBind
(
selectDataParam
,{
ctlType
:
'none'
})
.
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
();
message
.
success
(
intl
.
formatMessage
({
id
:
'member.management.assigned.query.bind.suc'
,
})
)
setTimeout
(()
=>
{
ref
.
current
.
reload
();
setSelectedRowKeys
([]);
},
200
);
}
reject
();
})
.
catch
(()
=>
{
reject
();
});
});
},
});
...
...
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