|
@@ -7,10 +7,11 @@ import { formatValues } from '@/components/LazyCascader'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
import { queryContact } from '@/services/contact'
|
|
import { queryContact } from '@/services/contact'
|
|
|
|
|
+// import { useScroll } from '_ahooks@2.10.2@ahooks'
|
|
|
|
|
|
|
|
const CompanyTabList = ({ initData, customerId, software }) => {
|
|
const CompanyTabList = ({ initData, customerId, software }) => {
|
|
|
const { TabPane } = Tabs
|
|
const { TabPane } = Tabs
|
|
|
- const tRef = useRef()
|
|
|
|
|
|
|
+ const tRef = useRef(null)
|
|
|
const columns = [
|
|
const columns = [
|
|
|
{
|
|
{
|
|
|
title: '所有部门',
|
|
title: '所有部门',
|
|
@@ -57,8 +58,19 @@ const CompanyTabList = ({ initData, customerId, software }) => {
|
|
|
visible: false
|
|
visible: false
|
|
|
})
|
|
})
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- setState({ ...state, params: { ...state.params, customerId } })
|
|
|
|
|
- }, [customerId])
|
|
|
|
|
|
|
+ const fetchClients = async () => {
|
|
|
|
|
+ const { code = -1, data: { client = [] } = { client: [], total: 0 } } = await queryContact({
|
|
|
|
|
+ customerId,
|
|
|
|
|
+ current: 1,
|
|
|
|
|
+ pageSize: consts.MAX_PAGE_SIZE
|
|
|
|
|
+ })
|
|
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
|
|
+ setDataSource(client)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ fetchClients()
|
|
|
|
|
+ }, [])
|
|
|
|
|
+
|
|
|
const handleAddClient = async values => {
|
|
const handleAddClient = async values => {
|
|
|
// 客户id
|
|
// 客户id
|
|
|
const payload = formatValues({ ...values, customerId })
|
|
const payload = formatValues({ ...values, customerId })
|
|
@@ -73,28 +85,17 @@ const CompanyTabList = ({ initData, customerId, software }) => {
|
|
|
<div className="zh-pd-left-15">
|
|
<div className="zh-pd-left-15">
|
|
|
<Tabs>
|
|
<Tabs>
|
|
|
<TabPane tab="联系人" key="联系人">
|
|
<TabPane tab="联系人" key="联系人">
|
|
|
- <div className="sheet-right-panel">
|
|
|
|
|
|
|
+ <div className="sheet-right-panel" ref={tRef}>
|
|
|
<ProTable
|
|
<ProTable
|
|
|
|
|
+ size="small"
|
|
|
columns={columns}
|
|
columns={columns}
|
|
|
search={false}
|
|
search={false}
|
|
|
|
|
+ dataSource={dataSource}
|
|
|
toolBarRender={false}
|
|
toolBarRender={false}
|
|
|
- params={state.params}
|
|
|
|
|
- actionRef={tRef}
|
|
|
|
|
rowKey={record => record.id}
|
|
rowKey={record => record.id}
|
|
|
- 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
|
|
|
|
|
- }
|
|
|
|
|
- }}
|
|
|
|
|
- // pagination={false}
|
|
|
|
|
|
|
+ pagination={false}
|
|
|
/>
|
|
/>
|
|
|
- {/* <Table columns={curingcolumns} dataSource={curinglist} pagination={false} /> */}
|
|
|
|
|
|
|
+ {/* <Table columns={columns} dataSource={state.dataSource} pagination={false} /> */}
|
|
|
</div>
|
|
</div>
|
|
|
</TabPane>
|
|
</TabPane>
|
|
|
<TabPane tab="软件锁" key="软件锁">
|
|
<TabPane tab="软件锁" key="软件锁">
|