|
@@ -10,15 +10,8 @@ import { Up, Down } from '@icon-park/react'
|
|
|
import { FlipOverEnum, useFlipOver } from '@/hooks/web/useFlipOver'
|
|
import { FlipOverEnum, useFlipOver } from '@/hooks/web/useFlipOver'
|
|
|
|
|
|
|
|
const CompanyDetail = props => {
|
|
const CompanyDetail = props => {
|
|
|
- const {
|
|
|
|
|
- dispatch,
|
|
|
|
|
- shouldUpdate,
|
|
|
|
|
- visible,
|
|
|
|
|
- dataId = '',
|
|
|
|
|
- orderIds = []
|
|
|
|
|
- // departments = [],
|
|
|
|
|
- // departmentsMap = {}
|
|
|
|
|
- } = props
|
|
|
|
|
|
|
+ const { dispatch, updateKey = 'company', refresh, visible, dataId = '', orderIds = [] } = props
|
|
|
|
|
+ const shouldUpdate = refresh[updateKey] || false
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
loading: false,
|
|
loading: false,
|
|
|
customer: {},
|
|
customer: {},
|
|
@@ -37,7 +30,7 @@ const CompanyDetail = props => {
|
|
|
if (shouldUpdate) {
|
|
if (shouldUpdate) {
|
|
|
dispatch({
|
|
dispatch({
|
|
|
type: 'refresh/commitAction',
|
|
type: 'refresh/commitAction',
|
|
|
- payload: 'company'
|
|
|
|
|
|
|
+ payload: updateKey
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
setState({ ...state, customer, log, serviceLog, software, loading: false, client })
|
|
setState({ ...state, customer, log, serviceLog, software, loading: false, client })
|
|
@@ -82,7 +75,7 @@ const CompanyDetail = props => {
|
|
|
) : null}
|
|
) : null}
|
|
|
|
|
|
|
|
<div className="sheet-left-panel pr-4">
|
|
<div className="sheet-left-panel pr-4">
|
|
|
- <CompanyForm customer={state.customer} />
|
|
|
|
|
|
|
+ <CompanyForm customer={state.customer} updateKey={updateKey} />
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span={12} flex={{ flexDirection: 'column' }} className="sheet-box-right">
|
|
<Col span={12} flex={{ flexDirection: 'column' }} className="sheet-box-right">
|
|
@@ -92,7 +85,6 @@ const CompanyDetail = props => {
|
|
|
software={state.software}
|
|
software={state.software}
|
|
|
client={state.client}
|
|
client={state.client}
|
|
|
customer={state.customer}
|
|
customer={state.customer}
|
|
|
- // departmentsMap={departmentsMap}
|
|
|
|
|
/>
|
|
/>
|
|
|
<CompanyLowerList log={state.log} servicelist={state.serviceLog} />
|
|
<CompanyLowerList log={state.log} servicelist={state.serviceLog} />
|
|
|
</Col>
|
|
</Col>
|
|
@@ -104,7 +96,7 @@ const CompanyDetail = props => {
|
|
|
|
|
|
|
|
// export default index
|
|
// export default index
|
|
|
export default connect(({ refresh, single }) => ({
|
|
export default connect(({ refresh, single }) => ({
|
|
|
- shouldUpdate: refresh.company,
|
|
|
|
|
|
|
+ refresh,
|
|
|
visible: single.drawer.visible
|
|
visible: single.drawer.visible
|
|
|
// departments: staff.departments,
|
|
// departments: staff.departments,
|
|
|
// departmentsMap: staff.departmentsMap
|
|
// departmentsMap: staff.departmentsMap
|