|
@@ -4,11 +4,7 @@ import React, { useEffect, useState, useRef, useMemo } from 'react'
|
|
|
import consts from '@/consts'
|
|
import consts from '@/consts'
|
|
|
import LazyCascader, { formatValues } from '@/components/LazyCascader'
|
|
import LazyCascader, { formatValues } from '@/components/LazyCascader'
|
|
|
import PersonLabel from '../Company/components/PersonLabel'
|
|
import PersonLabel from '../Company/components/PersonLabel'
|
|
|
-import {
|
|
|
|
|
- TagTypeEnum,
|
|
|
|
|
- TagDataTypeEnum,
|
|
|
|
|
- LabelModeType
|
|
|
|
|
-} from '../Company/components/PersonLabel/const'
|
|
|
|
|
|
|
+import { TagTypeEnum, TagDataTypeEnum, LabelModeType } from '../Company/components/PersonLabel/const'
|
|
|
import { Add, Down, Check } from '@icon-park/react'
|
|
import { Add, Down, Check } from '@icon-park/react'
|
|
|
import { apiAddClient, queryClient } from '@/services/customer'
|
|
import { apiAddClient, queryClient } from '@/services/customer'
|
|
|
import { apiBatchLink } from '@/services/customer'
|
|
import { apiBatchLink } from '@/services/customer'
|
|
@@ -21,16 +17,8 @@ import { useModal } from '@/components/ModalStore'
|
|
|
import { Plus } from '@icon-park/react'
|
|
import { Plus } from '@icon-park/react'
|
|
|
const Client = props => {
|
|
const Client = props => {
|
|
|
const dispatchModal = useModal()
|
|
const dispatchModal = useModal()
|
|
|
- const {
|
|
|
|
|
- personTagColorMap,
|
|
|
|
|
- teamTagColorMap,
|
|
|
|
|
- personTags,
|
|
|
|
|
- teamTags,
|
|
|
|
|
- dispatch,
|
|
|
|
|
- shouldUpdate,
|
|
|
|
|
- loading,
|
|
|
|
|
- sourceList
|
|
|
|
|
- } = props
|
|
|
|
|
|
|
+ const { personTagColorMap, teamTagColorMap, personTags, teamTags, dispatch, shouldUpdate, loading, sourceList } =
|
|
|
|
|
+ props
|
|
|
|
|
|
|
|
const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
|
|
const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
|
|
|
const hasAddPerm = useAccess()?.validatePermByType('client_add') || false
|
|
const hasAddPerm = useAccess()?.validatePermByType('client_add') || false
|
|
@@ -70,10 +58,7 @@ const Client = props => {
|
|
|
teamTagMap[item.id] = {
|
|
teamTagMap[item.id] = {
|
|
|
text: (
|
|
text: (
|
|
|
<>
|
|
<>
|
|
|
- <span
|
|
|
|
|
- className="w-12px h-12px inline-block mr-3px"
|
|
|
|
|
- style={{ backgroundColor: teamTagColorMap[item.id] }}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <span className="w-12px h-12px inline-block mr-3px" style={{ backgroundColor: teamTagColorMap[item.id] }} />
|
|
|
<span>{item.name}</span>
|
|
<span>{item.name}</span>
|
|
|
</>
|
|
</>
|
|
|
)
|
|
)
|
|
@@ -142,10 +127,9 @@ const Client = props => {
|
|
|
fixed: 'left',
|
|
fixed: 'left',
|
|
|
render: (clientName, record) => (
|
|
render: (clientName, record) => (
|
|
|
<span
|
|
<span
|
|
|
- onClick={() =>
|
|
|
|
|
- dispatchModal('D_CLIENT_DETAIL', { dataId: record.id, orderIds: state.orderIds })
|
|
|
|
|
- }
|
|
|
|
|
- className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
|
|
|
|
+ onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: record.id, orderIds: state.orderIds })}
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-[#967bbd]"
|
|
|
|
|
+ >
|
|
|
{clientName}
|
|
{clientName}
|
|
|
</span>
|
|
</span>
|
|
|
),
|
|
),
|
|
@@ -168,7 +152,8 @@ const Client = props => {
|
|
|
orderIds: state.orderIds
|
|
orderIds: state.orderIds
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- className="text-primary cursor-pointer hover:text-[#967bbd]">
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
+ >
|
|
|
{companyName}
|
|
{companyName}
|
|
|
</span>
|
|
</span>
|
|
|
) : (
|
|
) : (
|
|
@@ -274,7 +259,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={refreshData}
|
|
checkCallBack={refreshData}
|
|
|
- modeType={LabelModeType.column}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.column}
|
|
|
|
|
+ >
|
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
|
</PersonLabel>
|
|
</PersonLabel>
|
|
|
</div>
|
|
</div>
|
|
@@ -311,7 +297,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={refreshData}
|
|
checkCallBack={refreshData}
|
|
|
- modeType={LabelModeType.column}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.column}
|
|
|
|
|
+ >
|
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
<Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
|
|
|
</PersonLabel>
|
|
</PersonLabel>
|
|
|
</div>
|
|
</div>
|
|
@@ -478,7 +465,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
tagType={TagTypeEnum.PERSONTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={toolbarOptionsChange}
|
|
checkCallBack={toolbarOptionsChange}
|
|
|
- modeType={LabelModeType.toolbar}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.toolbar}
|
|
|
|
|
+ >
|
|
|
{tagState.tagIds.length ? (
|
|
{tagState.tagIds.length ? (
|
|
|
<Button>
|
|
<Button>
|
|
|
{tagState.tagIds.map(item => (
|
|
{tagState.tagIds.map(item => (
|
|
@@ -503,7 +491,8 @@ const Client = props => {
|
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
tagType={TagTypeEnum.TEAMTAG}
|
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
tagColumn={TagDataTypeEnum.CLIENT}
|
|
|
checkCallBack={toolbarOptionsChange}
|
|
checkCallBack={toolbarOptionsChange}
|
|
|
- modeType={LabelModeType.toolbar}>
|
|
|
|
|
|
|
+ modeType={LabelModeType.toolbar}
|
|
|
|
|
+ >
|
|
|
{tagState.tagCooperationIds.length ? (
|
|
{tagState.tagCooperationIds.length ? (
|
|
|
<Button>
|
|
<Button>
|
|
|
{tagState.tagCooperationIds.map(item => (
|
|
{tagState.tagCooperationIds.map(item => (
|
|
@@ -566,9 +555,7 @@ const Client = props => {
|
|
|
style={{ width: '250px' }}
|
|
style={{ width: '250px' }}
|
|
|
allowClear={true}
|
|
allowClear={true}
|
|
|
placeholder={`在${
|
|
placeholder={`在${
|
|
|
- permData[PermDataTypeEunm.CUSTOMER]?.find(
|
|
|
|
|
- item => item.value === defaultPermAuthCache
|
|
|
|
|
- )?.label
|
|
|
|
|
|
|
+ permData[PermDataTypeEunm.CUSTOMER]?.find(item => item.value === defaultPermAuthCache)?.label
|
|
|
}下搜索`}
|
|
}下搜索`}
|
|
|
onSearch={handleSearch}
|
|
onSearch={handleSearch}
|
|
|
/>
|
|
/>
|
|
@@ -593,7 +580,8 @@ const Client = props => {
|
|
|
onConfirm: handleAddClient,
|
|
onConfirm: handleAddClient,
|
|
|
reload: () => tRef.current?.reload()
|
|
reload: () => tRef.current?.reload()
|
|
|
})
|
|
})
|
|
|
- }>
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ >
|
|
|
<Plus className="mr-1" />
|
|
<Plus className="mr-1" />
|
|
|
客户
|
|
客户
|
|
|
</Button>
|
|
</Button>
|