|
@@ -17,8 +17,16 @@ 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
|
|
@@ -58,7 +66,10 @@ 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>
|
|
|
</>
|
|
</>
|
|
|
)
|
|
)
|
|
@@ -128,8 +139,7 @@ const Client = props => {
|
|
|
render: (clientName, record) => (
|
|
render: (clientName, record) => (
|
|
|
<span
|
|
<span
|
|
|
onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: record.id, orderIds: state.orderIds })}
|
|
onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: record.id, orderIds: state.orderIds })}
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{clientName}
|
|
{clientName}
|
|
|
</span>
|
|
</span>
|
|
|
),
|
|
),
|
|
@@ -145,15 +155,16 @@ const Client = props => {
|
|
|
render: (companyName, record) =>
|
|
render: (companyName, record) =>
|
|
|
record.companyId !== consts.ENCRYPTION_ZERO ? (
|
|
record.companyId !== consts.ENCRYPTION_ZERO ? (
|
|
|
<span
|
|
<span
|
|
|
- onClick={() =>
|
|
|
|
|
- dispatchModal('D_COMPANY_DETAIL', {
|
|
|
|
|
- updateKey: 'client',
|
|
|
|
|
- dataId: record.companyId,
|
|
|
|
|
- orderIds: state.orderIds
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- className="text-primary cursor-pointer hover:text-hex-967bbd"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ if (record.companyId) {
|
|
|
|
|
+ dispatchModal('D_COMPANY_DETAIL', {
|
|
|
|
|
+ updateKey: 'client',
|
|
|
|
|
+ dataId: record.companyId,
|
|
|
|
|
+ orderIds: state.orderIds
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ className="text-primary cursor-pointer hover:text-hex-967bbd">
|
|
|
{companyName}
|
|
{companyName}
|
|
|
</span>
|
|
</span>
|
|
|
) : (
|
|
) : (
|
|
@@ -259,8 +270,7 @@ 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>
|
|
@@ -297,8 +307,7 @@ 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>
|
|
@@ -465,8 +474,7 @@ 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 => (
|
|
@@ -491,8 +499,7 @@ 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 => (
|
|
@@ -555,7 +562,8 @@ 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}
|
|
|
/>
|
|
/>
|
|
@@ -580,8 +588,7 @@ 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>
|