|
@@ -1,8 +1,8 @@
|
|
|
import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
|
|
import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
|
|
|
import CompanyDetail from '@/pages/customer/Company/components/CompanyDetail'
|
|
import CompanyDetail from '@/pages/customer/Company/components/CompanyDetail'
|
|
|
-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, Tooltip } from 'antd'
|
|
|
|
|
|
|
+import { Input, Button, message, Tooltip, Space, Select } 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'
|
|
@@ -20,6 +20,7 @@ import { useTableScroll } from '@/hooks/useAutoTable'
|
|
|
import { apiAddClient, queryContact } from '@/services/customer'
|
|
import { apiAddClient, queryContact } from '@/services/customer'
|
|
|
import { apiBatchLink } from '@/services/customer'
|
|
import { apiBatchLink } from '@/services/customer'
|
|
|
import styles from './index.less'
|
|
import styles from './index.less'
|
|
|
|
|
+import { getPermDataList } from '@/utils/auth'
|
|
|
|
|
|
|
|
const Contact = props => {
|
|
const Contact = props => {
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
@@ -87,7 +88,7 @@ const Contact = props => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
- params: {},
|
|
|
|
|
|
|
+ params: { dataPermission: 'oneself' },
|
|
|
id: '',
|
|
id: '',
|
|
|
orderIds: []
|
|
orderIds: []
|
|
|
})
|
|
})
|
|
@@ -568,11 +569,19 @@ const Contact = props => {
|
|
|
// search={false}
|
|
// search={false}
|
|
|
search={{ filterType: 'light' }}
|
|
search={{ filterType: 'light' }}
|
|
|
toolbar={{
|
|
toolbar={{
|
|
|
- search: {
|
|
|
|
|
- allowClear: true,
|
|
|
|
|
- onSearch: handleSearch,
|
|
|
|
|
- placeholder: '输入联系人、客户名称、电话邮箱等'
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ search: (
|
|
|
|
|
+ <Input.Search
|
|
|
|
|
+ style={{ width: '300px' }}
|
|
|
|
|
+ allowClear={true}
|
|
|
|
|
+ placeholder="输入联系人、客户名称、电话邮箱等"
|
|
|
|
|
+ onSearch={handleSearch}
|
|
|
|
|
+ />
|
|
|
|
|
+ ),
|
|
|
|
|
+ // search: {
|
|
|
|
|
+ // allowClear: true,
|
|
|
|
|
+ // onSearch: handleSearch,
|
|
|
|
|
+ // placeholder: '输入联系人、客户名称、电话邮箱等'
|
|
|
|
|
+ // },
|
|
|
actions: [
|
|
actions: [
|
|
|
<LazyCascader
|
|
<LazyCascader
|
|
|
key="lazyCascader"
|
|
key="lazyCascader"
|
|
@@ -581,16 +590,29 @@ const Contact = props => {
|
|
|
bordered={false}
|
|
bordered={false}
|
|
|
className="hover:bg-[rgba(0,0,0,0.1)]"
|
|
className="hover:bg-[rgba(0,0,0,0.1)]"
|
|
|
/>,
|
|
/>,
|
|
|
- <Addcontact onConfirm={handleAddClient} key="addContactBtn" />
|
|
|
|
|
|
|
+ <AddContact onConfirm={handleAddClient} key="addContactBtn" />
|
|
|
]
|
|
]
|
|
|
}}
|
|
}}
|
|
|
|
|
+ headerTitle={
|
|
|
|
|
+ <Space>
|
|
|
|
|
+ <span className="text-lg font-medium">联系人</span>
|
|
|
|
|
+ <Select
|
|
|
|
|
+ defaultValue="oneself"
|
|
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
|
|
+ bordered={false}
|
|
|
|
|
+ onChange={e => {
|
|
|
|
|
+ setState({ ...state, params: { ...state.params, dataPermission: e } })
|
|
|
|
|
+ }}
|
|
|
|
|
+ options={getPermDataList()?.customer || []}
|
|
|
|
|
+ />
|
|
|
|
|
+ </Space>
|
|
|
|
|
+ }
|
|
|
onLoadingChange={loadingStatus => {
|
|
onLoadingChange={loadingStatus => {
|
|
|
loadingStatus && redoHeight()
|
|
loadingStatus && redoHeight()
|
|
|
}}
|
|
}}
|
|
|
scroll={getScrollRef}
|
|
scroll={getScrollRef}
|
|
|
columnsStateMap={columnsStateMap}
|
|
columnsStateMap={columnsStateMap}
|
|
|
onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
|
- headerTitle="联系人"
|
|
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|