|
@@ -1,7 +1,7 @@
|
|
|
import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
|
|
import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
|
|
|
import Addcontact from '@/pages/customer/Contact/components/AddContact'
|
|
import Addcontact from '@/pages/customer/Contact/components/AddContact'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
-import { Button, message } from 'antd'
|
|
|
|
|
|
|
+import { Button, Card, message } from 'antd'
|
|
|
import { connect } from 'dva'
|
|
import { connect } from 'dva'
|
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react'
|
|
import React, { useEffect, useState, useRef, useMemo } from 'react'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
@@ -16,6 +16,10 @@ import { useTableScroll } from '@/hooks/useAutoTable'
|
|
|
import { apiAddClient, queryContact } from '@/services/contact'
|
|
import { apiAddClient, queryContact } from '@/services/contact'
|
|
|
import { LabelModeType } from '../Company/components/PersonLabel'
|
|
import { LabelModeType } from '../Company/components/PersonLabel'
|
|
|
import { apiBatchLink } from '@/services/customer'
|
|
import { apiBatchLink } from '@/services/customer'
|
|
|
|
|
+import ProForm, {
|
|
|
|
|
+ LightFilter,
|
|
|
|
|
+ ProFormText
|
|
|
|
|
+} from '_@ant-design_pro-form@1.22.1@@ant-design/pro-form'
|
|
|
|
|
|
|
|
const Contact = props => {
|
|
const Contact = props => {
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
@@ -472,53 +476,61 @@ const Contact = props => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
return (
|
|
return (
|
|
|
- <ProTable
|
|
|
|
|
- bordered
|
|
|
|
|
- params={state.params}
|
|
|
|
|
- actionRef={tRef}
|
|
|
|
|
- rowKey={record => record.id}
|
|
|
|
|
- columns={columns}
|
|
|
|
|
- request={async (params, sort, filter) => {
|
|
|
|
|
- const {
|
|
|
|
|
- code = -1,
|
|
|
|
|
- data: { client = [], total = 0 }
|
|
|
|
|
- } = await queryContact({ ...params, ...sort, ...filter })
|
|
|
|
|
- return {
|
|
|
|
|
- data: client,
|
|
|
|
|
- success: code === consts.RET_CODE.SUCCESS,
|
|
|
|
|
- total
|
|
|
|
|
- }
|
|
|
|
|
- }}
|
|
|
|
|
- // summary={() => (
|
|
|
|
|
- // <ProTable.Summary.Row>
|
|
|
|
|
- // <ProTable.Summary.Cell>统计: 总数</ProTable.Summary.Cell>
|
|
|
|
|
- // <ProTable.Summary.Cell />
|
|
|
|
|
- // <ProTable.Summary.Cell>未填写: {state.tail.department}</ProTable.Summary.Cell>
|
|
|
|
|
- // <ProTable.Summary.Cell>未填写: {state.tail.telephone}</ProTable.Summary.Cell>
|
|
|
|
|
- // <ProTable.Summary.Cell>未填写: {state.tail.email}</ProTable.Summary.Cell>
|
|
|
|
|
- // </ProTable.Summary.Row>
|
|
|
|
|
- // )}
|
|
|
|
|
- tableAlertRender={renderTableAlert}
|
|
|
|
|
- rowSelection={{
|
|
|
|
|
- onChange: hanleRowSelectChange,
|
|
|
|
|
- type: 'checkbox'
|
|
|
|
|
- }}
|
|
|
|
|
- search={false}
|
|
|
|
|
- toolbar={{
|
|
|
|
|
- search: {
|
|
|
|
|
- allowClear: true,
|
|
|
|
|
- onSearch: handleSearch
|
|
|
|
|
- },
|
|
|
|
|
- actions: [
|
|
|
|
|
- <LazyCascader onChange={onDistrictChange} changeOnSelect={true} key="lazyCascader" />,
|
|
|
|
|
- <Addcontact onConfirm={handleAddClient} key="addContactBtn" />
|
|
|
|
|
- ]
|
|
|
|
|
- }}
|
|
|
|
|
- scroll={getScrollRef}
|
|
|
|
|
- columnsStateMap={columnsStateMap}
|
|
|
|
|
- onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
|
|
|
- headerTitle="联系人"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <Card>
|
|
|
|
|
+ <LightFilter bordered onFinish={async values => console.log(values)}>
|
|
|
|
|
+ <ProFormText name="name1" label="联系人" search={{ filterType: 'light' }} />
|
|
|
|
|
+ <ProFormText name="name" label="省/市/区" />
|
|
|
|
|
+ </LightFilter>
|
|
|
|
|
+ </Card>
|
|
|
|
|
+ <ProTable
|
|
|
|
|
+ bordered
|
|
|
|
|
+ params={state.params}
|
|
|
|
|
+ actionRef={tRef}
|
|
|
|
|
+ rowKey={record => record.id}
|
|
|
|
|
+ columns={columns}
|
|
|
|
|
+ request={async (params, sort, filter) => {
|
|
|
|
|
+ const {
|
|
|
|
|
+ code = -1,
|
|
|
|
|
+ data: { client = [], total = 0 }
|
|
|
|
|
+ } = await queryContact({ ...params, ...sort, ...filter })
|
|
|
|
|
+ return {
|
|
|
|
|
+ data: client,
|
|
|
|
|
+ success: code === consts.RET_CODE.SUCCESS,
|
|
|
|
|
+ total
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ // summary={() => (
|
|
|
|
|
+ // <ProTable.Summary.Row>
|
|
|
|
|
+ // <ProTable.Summary.Cell>统计: 总数</ProTable.Summary.Cell>
|
|
|
|
|
+ // <ProTable.Summary.Cell />
|
|
|
|
|
+ // <ProTable.Summary.Cell>未填写: {state.tail.department}</ProTable.Summary.Cell>
|
|
|
|
|
+ // <ProTable.Summary.Cell>未填写: {state.tail.telephone}</ProTable.Summary.Cell>
|
|
|
|
|
+ // <ProTable.Summary.Cell>未填写: {state.tail.email}</ProTable.Summary.Cell>
|
|
|
|
|
+ // </ProTable.Summary.Row>
|
|
|
|
|
+ // )}
|
|
|
|
|
+ tableAlertRender={renderTableAlert}
|
|
|
|
|
+ rowSelection={{
|
|
|
|
|
+ onChange: hanleRowSelectChange,
|
|
|
|
|
+ type: 'checkbox'
|
|
|
|
|
+ }}
|
|
|
|
|
+ search={false}
|
|
|
|
|
+ toolbar={{
|
|
|
|
|
+ search: {
|
|
|
|
|
+ allowClear: true,
|
|
|
|
|
+ onSearch: handleSearch
|
|
|
|
|
+ },
|
|
|
|
|
+ actions: [
|
|
|
|
|
+ <LazyCascader onChange={onDistrictChange} changeOnSelect={true} key="lazyCascader" />,
|
|
|
|
|
+ <Addcontact onConfirm={handleAddClient} key="addContactBtn" />
|
|
|
|
|
+ ]
|
|
|
|
|
+ }}
|
|
|
|
|
+ scroll={getScrollRef}
|
|
|
|
|
+ columnsStateMap={columnsStateMap}
|
|
|
|
|
+ onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
|
|
|
+ headerTitle="联系人"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|