Commit 77c93b5c authored by XieZhiXiong's avatar XieZhiXiong

fibux、对接批量审核接口

parent 86121090
......@@ -33,15 +33,20 @@ const CustomAddArray = (props) => {
const onAdd = () => mutators.push(schema.items.getEmptyValue())
const onRemove = index => mutators.remove(index)
return <div>
{ toArr(value).map((item, index, arr) => {
return <RowStyleLayout {...componentProps} key={index}>
<SchemaField path={FormPath.parse(path).concat(index)} onlyRenderProperties/>
<Button onClick={onAdd.bind(null, index)} type='primary'>+</Button>
{ index !== 0 && <Button onClick={onRemove.bind(null, index)}>-</Button>}
</RowStyleLayout>
}) }
</div>
return (
<div>
{toArr(value).map((item, index, arr) => (
<RowStyleLayout {...componentProps} key={index}>
<SchemaField path={FormPath.parse(path).concat(index)} onlyRenderProperties/>
<Button onClick={onAdd.bind(null, index)} type='primary'>+</Button>
<Button onClick={onRemove.bind(null, index)}>-</Button>
</RowStyleLayout>
))}
{(!value || !value.length) && (
<Button onClick={onAdd} type='primary'>+</Button>
)}
</div>
)
}
CustomAddArray.isFieldComponent = true
......
......@@ -191,4 +191,8 @@
}
}
.ant-badge-count {
z-index: 1;
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -322,11 +322,8 @@ export const initDetailSchema = (props: any) => {
areas: {
type: 'array',
title: '代理城市',
required: true,
'x-component': 'CustomAddArray',
default: [
{ pcode: undefined, ccode: undefined },
],
default: [],
items: {
type: 'object',
properties: {
......
......@@ -35,7 +35,7 @@ interface QueryProps {
}
const MemberQueryDetailed: React.FC<QueryProps> = props => {
const { MemberStore, children } = props;
const { MemberStore, location, children } = props;
const { id, validateId } = usePageStatus();
const [basicInfo, setBasicInfo] = useState<GetMemberAbilityMaintenanceDetailBasicResponse>(null);
const [infoLoading, setInfoLoading] = useState(false);
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { Card, Space, Button, Badge, Popconfirm } from 'antd';
import { ClockCircleOutlined } from '@ant-design/icons';
import { Card, Space, Button, Badge, Modal, message } from 'antd';
import { ClockCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
......@@ -20,12 +20,12 @@ import {
import { coverColFiltersItem } from '../utils';
import StatusTag from '../components/StatusTag';
const { confirm } = Modal;
const formActions = createFormActions();
const MemberPr1: React.FC<{}> = props => {
const ref = useRef<any>({});
const [searchItems, setSearchItems] = useState<any>({});
const [filteredInfo, setFilteredInfo] = useState<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
......@@ -122,13 +122,9 @@ const MemberPr1: React.FC<{}> = props => {
const [columns, setColumns] = useState<any[]>(defaultColumns);
const rowSelection = {
onChange: (selectedRowKeys: any, selectedRows: any) => {
let result = selectedRows.map(v => ({
memberId: v.memberId,
validateId: v.validateId,
}));
setSelectedRowKeys(selectedRowKeys);
setSelectList(result);
onChange: (keys: any, rows: {}[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -139,7 +135,32 @@ const MemberPr1: React.FC<{}> = props => {
};
const handleBatch = () => {
console.log('批量')
if (!selectedList.length) {
message.warning('未选择任何会员');
return;
}
confirm({
title: '提示',
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
return new Promise((resolve, reject) => {
PublicApi.postMemberAbilityValidateStep1Batch(members)
.then(res => {
if (res.code === 1000) {
ref.current.reload();
setSelectedRowKeys([]);
resolve();
}
reject();
})
.catch(() => {
reject();
});
});
},
});
};
// 初始化高级筛选选项
......@@ -192,17 +213,9 @@ const MemberPr1: React.FC<{}> = props => {
const controllerBtns = (
<Space>
<Popconfirm
title="是否继续操作 ?"
placement="bottom"
onConfirm={handleBatch}
okText="是"
cancelText="否"
>
<Button>
批量提交审核
</Button>
</Popconfirm>
<Button onClick={handleBatch}>
批量审核通过
</Button>
</Space>
);
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { Card, Space, Button, Badge, Popconfirm } from 'antd';
import { ClockCircleOutlined } from '@ant-design/icons';
import { Card, Space, Button, Badge, Modal, message } from 'antd';
import { ClockCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
......@@ -20,12 +20,12 @@ import {
import { coverColFiltersItem } from '../utils';
import StatusTag from '../components/StatusTag';
const { confirm } = Modal;
const formActions = createFormActions();
const MemberPr2: React.FC<{}> = props => {
const ref = useRef<any>({});
const [searchItems, setSearchItems] = useState<any>({});
const [filteredInfo, setFilteredInfo] = useState<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
......@@ -122,13 +122,9 @@ const MemberPr2: React.FC<{}> = props => {
const [columns, setColumns] = useState<any[]>(defaultColumns);
const rowSelection = {
onChange: (selectedRowKeys: any, selectedRows: any) => {
let result = selectedRows.map(v => ({
memberId: v.memberId,
validateId: v.validateId,
}));
setSelectedRowKeys(selectedRowKeys);
setSelectList(result);
onChange: (keys: any, rows: {}[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -139,7 +135,32 @@ const MemberPr2: React.FC<{}> = props => {
};
const handleBatch = () => {
console.log('批量')
if (!selectedList.length) {
message.warning('未选择任何会员');
return;
}
confirm({
title: '提示',
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
return new Promise((resolve, reject) => {
PublicApi.postMemberAbilityValidateStep2Batch(members)
.then(res => {
if (res.code === 1000) {
ref.current.reload();
setSelectedRowKeys([]);
resolve();
}
reject();
})
.catch(() => {
reject();
});
});
},
});
};
// 初始化高级筛选选项
......@@ -192,17 +213,9 @@ const MemberPr2: React.FC<{}> = props => {
const controllerBtns = (
<Space>
<Popconfirm
title="是否继续操作 ?"
placement="bottom"
onConfirm={handleBatch}
okText="是"
cancelText="否"
>
<Button>
批量提交审核
</Button>
</Popconfirm>
<Button onClick={handleBatch}>
批量审核通过
</Button>
</Space>
);
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { Card, Space, Button, Badge, Popconfirm } from 'antd';
import { ClockCircleOutlined } from '@ant-design/icons';
import { Card, Space, Button, Badge, Modal, message } from 'antd';
import { ClockCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
......@@ -20,12 +20,12 @@ import {
import { coverColFiltersItem } from '../utils';
import StatusTag from '../components/StatusTag';
const { confirm } = Modal;
const formActions = createFormActions();
const MemberPrConfirm: React.FC<{}> = props => {
const ref = useRef<any>({});
const [searchItems, setSearchItems] = useState<any>({});
const [filteredInfo, setFilteredInfo] = useState<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
......@@ -122,13 +122,9 @@ const MemberPrConfirm: React.FC<{}> = props => {
const [columns, setColumns] = useState<any[]>(defaultColumns);
const rowSelection = {
onChange: (selectedRowKeys: any, selectedRows: any) => {
let result = selectedRows.map(v => ({
memberId: v.memberId,
validateId: v.validateId,
}));
setSelectedRowKeys(selectedRowKeys);
setSelectList(result);
onChange: (keys: any, rows: {}[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -139,7 +135,32 @@ const MemberPrConfirm: React.FC<{}> = props => {
};
const handleBatch = () => {
console.log('批量')
if (!selectedList.length) {
message.warning('未选择任何会员');
return;
}
confirm({
title: '提示',
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
return new Promise((resolve, reject) => {
PublicApi.postMemberAbilityValidateConfirmBatch(members)
.then(res => {
if (res.code === 1000) {
ref.current.reload();
setSelectedRowKeys([]);
resolve();
}
reject();
})
.catch(() => {
reject();
});
});
},
});
};
// 初始化高级筛选选项
......@@ -192,17 +213,9 @@ const MemberPrConfirm: React.FC<{}> = props => {
const controllerBtns = (
<Space>
<Popconfirm
title="是否继续操作 ?"
placement="bottom"
onConfirm={handleBatch}
okText="是"
cancelText="否"
>
<Button>
批量提交审核
</Button>
</Popconfirm>
<Button onClick={handleBatch}>
批量确认审核通过
</Button>
</Space>
);
......
import React, { useState, useEffect, useRef } from 'react';
import { history } from 'umi';
import { Card, Space, Button, Badge, Popconfirm } from 'antd';
import { ClockCircleOutlined } from '@ant-design/icons';
import { Card, Space, Button, Badge, Modal, message } from 'antd';
import { ClockCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { createFormActions } from '@formily/antd';
......@@ -20,12 +20,12 @@ import {
import { coverColFiltersItem } from '../utils';
import StatusTag from '../components/StatusTag';
const { confirm } = Modal;
const formActions = createFormActions();
const MemberPrSubmit: React.FC<{}> = props => {
const ref = useRef<any>({});
const [searchItems, setSearchItems] = useState<any>({});
const [filteredInfo, setFilteredInfo] = useState<any>({});
const [selectedRowKeys, setSelectedRowKeys] = useState<Array<string>>([]);
const [selectedList, setSelectList] = useState<any>([]);
......@@ -122,13 +122,9 @@ const MemberPrSubmit: React.FC<{}> = props => {
const [columns, setColumns] = useState<any[]>(defaultColumns);
const rowSelection = {
onChange: (selectedRowKeys: any, selectedRows: any) => {
let result = selectedRows.map(v => ({
memberId: v.memberId,
validateId: v.validateId,
}));
setSelectedRowKeys(selectedRowKeys);
setSelectList(result);
onChange: (keys: any, rows: {}[]) => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
};
......@@ -139,7 +135,32 @@ const MemberPrSubmit: React.FC<{}> = props => {
};
const handleBatch = () => {
console.log('批量')
if (!selectedList.length) {
message.warning('未选择任何会员');
return;
}
confirm({
title: '提示',
icon: <QuestionCircleOutlined />,
content: '确定要审核通过选中的会员吗?',
onOk() {
const members = selectedList.map(item => ({ memberId: item.memberId, validateId: item.validateId }));
return new Promise((resolve, reject) => {
PublicApi.postMemberAbilityValidateCommitBatch(members)
.then(res => {
if (res.code === 1000) {
ref.current.reload();
setSelectedRowKeys([]);
resolve();
}
reject();
})
.catch(() => {
reject();
});
});
},
});
};
// 初始化高级筛选选项
......@@ -192,17 +213,9 @@ const MemberPrSubmit: React.FC<{}> = props => {
const controllerBtns = (
<Space>
<Popconfirm
title="是否继续操作 ?"
placement="bottom"
onConfirm={handleBatch}
okText="是"
cancelText="否"
>
<Button>
批量提交审核
</Button>
</Popconfirm>
<Button onClick={handleBatch}>
批量审核通过
</Button>
</Space>
);
......@@ -210,7 +223,7 @@ const MemberPrSubmit: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'memberId',
}}
columns={columns}
currentRef={ref}
......
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