|
@@ -12,7 +12,7 @@ const SyncClient = ({ customer, client }) => {
|
|
|
const dispatch = useDispatch()
|
|
const dispatch = useDispatch()
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
visible: false,
|
|
visible: false,
|
|
|
- disable: false,
|
|
|
|
|
|
|
+ loading: false,
|
|
|
selectedKeys: null,
|
|
selectedKeys: null,
|
|
|
checkValues: ['district', 'address']
|
|
checkValues: ['district', 'address']
|
|
|
})
|
|
})
|
|
@@ -40,7 +40,7 @@ const SyncClient = ({ customer, client }) => {
|
|
|
const { code = -1 } = await syncToClient(params)
|
|
const { code = -1 } = await syncToClient(params)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
refreshCompany()
|
|
refreshCompany()
|
|
|
- setState({ ...state, visible: false })
|
|
|
|
|
|
|
+ setState({ ...state, visible: false, loading: false })
|
|
|
return message.success('同步成功')
|
|
return message.success('同步成功')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -103,15 +103,15 @@ const SyncClient = ({ customer, client }) => {
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
- const { checkValues, visible, disable } = state
|
|
|
|
|
|
|
+ const { checkValues, visible, loading } = state
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<Button
|
|
<Button
|
|
|
size="small"
|
|
size="small"
|
|
|
ghost
|
|
ghost
|
|
|
type="primary"
|
|
type="primary"
|
|
|
- disabled={disable}
|
|
|
|
|
- onClick={() => setState({ ...state, visible: true, disable: true })}>
|
|
|
|
|
|
|
+ loading={loading}
|
|
|
|
|
+ onClick={() => setState({ ...state, visible: true, loading: true })}>
|
|
|
<Copy theme="two-tone" fill={['#333', '#886ab5']} />
|
|
<Copy theme="two-tone" fill={['#333', '#886ab5']} />
|
|
|
<span className="ml-1">同步地址信息</span>
|
|
<span className="ml-1">同步地址信息</span>
|
|
|
{/* <div className="flex items-center justify-center">
|
|
{/* <div className="flex items-center justify-center">
|
|
@@ -121,9 +121,9 @@ const SyncClient = ({ customer, client }) => {
|
|
|
zIndex={1003}
|
|
zIndex={1003}
|
|
|
width="70%"
|
|
width="70%"
|
|
|
title={`同步 ${customer.companyName} 信息`}
|
|
title={`同步 ${customer.companyName} 信息`}
|
|
|
- getContainer={false}
|
|
|
|
|
|
|
+ // getContainer={false}
|
|
|
visible={visible}
|
|
visible={visible}
|
|
|
- onCancel={() => setState({ ...state, visible: false, disable: false })}
|
|
|
|
|
|
|
+ onCancel={() => setState({ ...state, visible: false, loading: false })}
|
|
|
onOk={handleOnConfirm}>
|
|
onOk={handleOnConfirm}>
|
|
|
<div className="rounded-3 p-4 mb-2 pt-0">
|
|
<div className="rounded-3 p-4 mb-2 pt-0">
|
|
|
<Checkbox.Group
|
|
<Checkbox.Group
|
|
@@ -164,12 +164,14 @@ const SyncClient = ({ customer, client }) => {
|
|
|
<div className={styles.tableCont}>
|
|
<div className={styles.tableCont}>
|
|
|
<Table
|
|
<Table
|
|
|
virtualized
|
|
virtualized
|
|
|
|
|
+ rowKey="id"
|
|
|
scroll={{ y: 400 }}
|
|
scroll={{ y: 400 }}
|
|
|
border={false}
|
|
border={false}
|
|
|
columns={columns}
|
|
columns={columns}
|
|
|
data={client}
|
|
data={client}
|
|
|
pagination={false}
|
|
pagination={false}
|
|
|
rowSelection={{
|
|
rowSelection={{
|
|
|
|
|
+ pureKeys: true,
|
|
|
onChange: selectedRowKeys => setState({ ...state, selectedKeys: selectedRowKeys })
|
|
onChange: selectedRowKeys => setState({ ...state, selectedKeys: selectedRowKeys })
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|