|
|
@@ -1,16 +1,17 @@
|
|
|
import { Row, Col, Spin, Tooltip } from 'antd'
|
|
|
-import React, { useState, useEffect } from 'react'
|
|
|
+import React, { useState, useEffect, useMemo } from 'react'
|
|
|
import Form from './Form'
|
|
|
import TabList from './TabList'
|
|
|
import LowerList from './LowerList'
|
|
|
import { getBusinessDetailById } from '@/services/customer'
|
|
|
import consts from '@/consts'
|
|
|
-import { connect } from 'umi'
|
|
|
+import { connect, useModel } from 'umi'
|
|
|
import { Up, Down } from '@icon-park/react'
|
|
|
import { FlipOverEnum, useFlipOver } from '@/hooks/web/useFlipOver'
|
|
|
import './index.less'
|
|
|
|
|
|
const Detail = props => {
|
|
|
+ const { initialState } = useModel('@@initialState')
|
|
|
const { dispatch, updateKey = 'business', refresh, visible, dataId = '', orderIds = [] } = props
|
|
|
const shouldUpdate = refresh[updateKey] || false
|
|
|
const [state, setState] = useState({
|
|
|
@@ -22,6 +23,11 @@ const Detail = props => {
|
|
|
linkClient: {} // 关联的客户
|
|
|
})
|
|
|
|
|
|
+ const isOwner = useMemo(() => {
|
|
|
+ const { staffId } = initialState.currentUser || {}
|
|
|
+ return state.business.staffId === staffId
|
|
|
+ }, [state.business.businessStatusId])
|
|
|
+
|
|
|
const initData = async id => {
|
|
|
setState({ ...state, loading: true })
|
|
|
const {
|
|
|
@@ -89,6 +95,7 @@ const Detail = props => {
|
|
|
) : null}
|
|
|
<div className="sheet-left-panel pr-15px">
|
|
|
<Form
|
|
|
+ isOwner={isOwner}
|
|
|
business={state.business}
|
|
|
groupStatus={state.groupStatus}
|
|
|
updateKey={updateKey}
|
|
|
@@ -96,7 +103,11 @@ const Detail = props => {
|
|
|
</div>
|
|
|
</Col>
|
|
|
<Col span={14} className="sheet-box-right">
|
|
|
- <TabList businessId={state.business.id} clientList={state.linkClient.client} />
|
|
|
+ <TabList
|
|
|
+ businessId={state.business.id}
|
|
|
+ clientList={state.linkClient.client}
|
|
|
+ isOwner={isOwner}
|
|
|
+ />
|
|
|
<LowerList log={state.log} serviceLog={state.serviceLog} />
|
|
|
</Col>
|
|
|
</Row>
|