|
@@ -1,5 +1,5 @@
|
|
|
import React, { useState, useEffect, useRef, useMemo } from 'react'
|
|
import React, { useState, useEffect, useRef, useMemo } from 'react'
|
|
|
-import { connect, useModel } from 'umi'
|
|
|
|
|
|
|
+import { connect, useAccess, useModel } from 'umi'
|
|
|
import { getBusinessList } from '@/services/customer'
|
|
import { getBusinessList } from '@/services/customer'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
import { Select, Tooltip, Input, Button } from 'antd'
|
|
import { Select, Tooltip, Input, Button } from 'antd'
|
|
@@ -13,6 +13,7 @@ import { useModal } from '@/components/ModalStore'
|
|
|
|
|
|
|
|
const Business = ({ dispatch, groupList, shouldUpdate, loading, refreshGroupList }) => {
|
|
const Business = ({ dispatch, groupList, shouldUpdate, loading, refreshGroupList }) => {
|
|
|
const [defaultPermAuthCache, defaultStaffIds] = getPermAuthCache(PermDataTypeEunm.CUSTOMER)
|
|
const [defaultPermAuthCache, defaultStaffIds] = getPermAuthCache(PermDataTypeEunm.CUSTOMER)
|
|
|
|
|
+ const hasAddPerm = useAccess()?.validatePermByType('business_add')
|
|
|
const dispatchModal = useModal()
|
|
const dispatchModal = useModal()
|
|
|
const tRef = useRef(null)
|
|
const tRef = useRef(null)
|
|
|
const defaultGroupId = getAuthCache(BUSINESS_GROUP_KEY) || null
|
|
const defaultGroupId = getAuthCache(BUSINESS_GROUP_KEY) || null
|
|
@@ -20,10 +21,6 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading, refreshGroupList
|
|
|
orderIds: [],
|
|
orderIds: [],
|
|
|
params: { businessGroupId: defaultGroupId },
|
|
params: { businessGroupId: defaultGroupId },
|
|
|
groupParams: { staffIds: defaultStaffIds, dataPermission: defaultPermAuthCache }
|
|
groupParams: { staffIds: defaultStaffIds, dataPermission: defaultPermAuthCache }
|
|
|
- // funnelData: groupList
|
|
|
|
|
- // ?.find(item => item.value === defaultGroupId)
|
|
|
|
|
- // ?.items?.filter(item => !item.endProcess)
|
|
|
|
|
- // ?.map(item => ({ ...item, percentage: parseInt(item.percentage, 10) }))
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const funnelData = useMemo(() => {
|
|
const funnelData = useMemo(() => {
|
|
@@ -82,7 +79,8 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading, refreshGroupList
|
|
|
group: groupList
|
|
group: groupList
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
+ >
|
|
|
{text}
|
|
{text}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -95,7 +93,8 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading, refreshGroupList
|
|
|
record.customerId && (
|
|
record.customerId && (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => dispatchModal('D_COMPANY_DETAIL', { dataId: record.customerId })}
|
|
onClick={() => dispatchModal('D_COMPANY_DETAIL', { dataId: record.customerId })}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
+ >
|
|
|
{text}
|
|
{text}
|
|
|
</span>
|
|
</span>
|
|
|
)
|
|
)
|
|
@@ -223,13 +222,16 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading, refreshGroupList
|
|
|
actions: [
|
|
actions: [
|
|
|
<Button
|
|
<Button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
|
|
+ key="add_business"
|
|
|
className="flex items-center"
|
|
className="flex items-center"
|
|
|
|
|
+ disabled={!hasAddPerm}
|
|
|
onClick={() =>
|
|
onClick={() =>
|
|
|
dispatchModal('M_BUSINESS_ADD', {
|
|
dispatchModal('M_BUSINESS_ADD', {
|
|
|
groupList: state.groupList,
|
|
groupList: state.groupList,
|
|
|
reload: () => tRef.current?.reload()
|
|
reload: () => tRef.current?.reload()
|
|
|
})
|
|
})
|
|
|
- }>
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ >
|
|
|
<Plus className="mr-1" />
|
|
<Plus className="mr-1" />
|
|
|
商机
|
|
商机
|
|
|
</Button>
|
|
</Button>
|