Commit 0b6b068c authored by XieZhiXiong's avatar XieZhiXiong

chore: 修改 批量审核逻辑

parent 49d30985
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 18:01:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-03 20:41:39
* @LastEditTime: 2021-06-04 09:50:59
* @Description: 待审核入库(一级)
*/
import React, { useState, useRef } from 'react';
......@@ -28,8 +28,7 @@ const formActions = createFormActions();
const MemberPrVerifyComing1: React.FC<{}> = props => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComing1/verify?validateId=${record.validateId}`);
......@@ -54,9 +53,8 @@ const MemberPrVerifyComing1: React.FC<{}> = props => {
const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
const rowSelection = {
onChange: (keys: any, rows: {}[]) => {
onChange: (keys: number[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -81,7 +79,7 @@ const MemberPrVerifyComing1: React.FC<{}> = props => {
};
const handleBatch = () => {
if (!selectedList.length) {
if (!selectedRowKeys.length) {
message.warning('未选择任何会员');
return;
}
......@@ -90,9 +88,10 @@ const MemberPrVerifyComing1: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberDepositGradeOneBatch(members)
PublicApi.postMemberDepositGradeOneBatch({
validateIds: selectedRowKeys,
})
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......
......@@ -28,8 +28,7 @@ const formActions = createFormActions();
const MemberPrVerifyComing2: React.FC<{}> = props => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComing2/verify?validateId=${record.validateId}`);
......@@ -54,9 +53,8 @@ const MemberPrVerifyComing2: React.FC<{}> = props => {
const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
const rowSelection = {
onChange: (keys: any, rows: {}[]) => {
onChange: (keys: number[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -81,7 +79,7 @@ const MemberPrVerifyComing2: React.FC<{}> = props => {
};
const handleBatch = () => {
if (!selectedList.length) {
if (!selectedRowKeys.length) {
message.warning('未选择任何会员');
return;
}
......@@ -90,9 +88,10 @@ const MemberPrVerifyComing2: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberDepositGradeTwoBatch(members)
PublicApi.postMemberDepositGradeTwoBatch({
validateIds: selectedRowKeys,
})
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-05-25 18:01:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-03 20:40:42
* @LastEditTime: 2021-06-04 09:48:47
* @Description: 待确认入库
*/
import React, { useState, useRef } from 'react';
......@@ -28,8 +28,7 @@ const formActions = createFormActions();
const MemberPrVerifyComingConfirm: React.FC<{}> = props => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingConfirm/verify?validateId=${record.validateId}`);
......@@ -54,9 +53,8 @@ const MemberPrVerifyComingConfirm: React.FC<{}> = props => {
const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
const rowSelection = {
onChange: (keys: any, rows: {}[]) => {
onChange: (keys: number[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -81,7 +79,7 @@ const MemberPrVerifyComingConfirm: React.FC<{}> = props => {
};
const handleBatch = () => {
if (!selectedList.length) {
if (!selectedRowKeys.length) {
message.warning('未选择任何会员');
return;
}
......@@ -90,9 +88,10 @@ const MemberPrVerifyComingConfirm: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberDepositConfirmBatch(members)
PublicApi.postMemberDepositConfirmBatch({
validateIds: selectedRowKeys,
})
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......@@ -155,9 +154,6 @@ const MemberPrVerifyComingConfirm: React.FC<{}> = props => {
return (
<Card>
<Button onClick={handleBatch}>
批量审核通过
</Button>
<StandardTable
tableProps={{
rowKey: 'validateId',
......
......@@ -28,8 +28,7 @@ const formActions = createFormActions();
const MemberPrVerifyComingData: React.FC<{}> = props => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingData/verify?validateId=${record.validateId}`);
......@@ -54,9 +53,8 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
const rowSelection = {
onChange: (keys: any, rows: {}[]) => {
onChange: (keys: number[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -81,7 +79,7 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
};
const handleBatch = () => {
if (!selectedList.length) {
if (!selectedRowKeys.length) {
message.warning('未选择任何会员');
return;
}
......@@ -90,9 +88,10 @@ const MemberPrVerifyComingData: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map((item) => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberDepositVerifyBatch(members)
PublicApi.postMemberDepositVerifyBatch({
validateIds: selectedRowKeys,
})
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......
......@@ -28,8 +28,7 @@ const formActions = createFormActions();
const memberPrVerifyComingQualifications: React.FC<{}> = props => {
const ref = useRef<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
const handleJumpAudit = record => {
history.push(`/memberCenter/memberAbility/manage/memberPrVerifyComingQualifications/verify?validateId=${record.validateId}`);
......@@ -54,9 +53,8 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
const [columns, columnsHandle] = useSpliceArray<ColumnType<any>>(defaultColumns);
const rowSelection = {
onChange: (keys: any, rows: {}[]) => {
onChange: (keys: number[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -81,7 +79,7 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
};
const handleBatch = () => {
if (!selectedList.length) {
if (!selectedRowKeys.length) {
message.warning('未选择任何会员');
return;
}
......@@ -90,9 +88,10 @@ const memberPrVerifyComingQualifications: React.FC<{}> = props => {
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map((item) => item.validateId);
return new Promise<void>((resolve, reject) => {
PublicApi.postMemberDepositQualifyBatch(members)
PublicApi.postMemberDepositQualifyBatch({
validateIds: selectedRowKeys,
})
.then(res => {
if (res.code === 1000) {
ref.current.reload();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment