|
|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useState, useEffect, useMemo } from 'react'
|
|
|
+import React, { useState, useEffect } from 'react'
|
|
|
import { Row, Col, Spin, Tooltip } from 'antd'
|
|
|
import consts from '@/consts'
|
|
|
import { apiCompanyDetail } from '@/services/company'
|
|
|
@@ -14,7 +14,7 @@ const Index = props => {
|
|
|
dispatch,
|
|
|
shouldUpdate,
|
|
|
visible,
|
|
|
- id = '',
|
|
|
+ dataId = '',
|
|
|
orderIds = [],
|
|
|
departments = [],
|
|
|
departmentsMap = {}
|
|
|
@@ -26,12 +26,12 @@ const Index = props => {
|
|
|
software: {},
|
|
|
client: {}
|
|
|
})
|
|
|
- const initData = async dataId => {
|
|
|
+ const initData = async id => {
|
|
|
setState({ ...state, loading: true })
|
|
|
const {
|
|
|
data: { customer = {}, log = [], software = {}, client = {} },
|
|
|
code = -1
|
|
|
- } = await apiCompanyDetail(dataId)
|
|
|
+ } = await apiCompanyDetail(id)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
|
if (shouldUpdate) {
|
|
|
dispatch({
|
|
|
@@ -42,12 +42,12 @@ const Index = props => {
|
|
|
setState({ ...state, customer, log, software, loading: false, client })
|
|
|
}
|
|
|
}
|
|
|
- const { flipFn, flipConsts } = useFlipOver(initData, id, orderIds)
|
|
|
+ const { flipFn, flipConsts } = useFlipOver(initData, dataId, orderIds)
|
|
|
useEffect(() => {
|
|
|
- shouldUpdate && initData(id)
|
|
|
+ shouldUpdate && initData(dataId)
|
|
|
}, [shouldUpdate])
|
|
|
useEffect(() => {
|
|
|
- visible && initData(id)
|
|
|
+ visible && initData(dataId)
|
|
|
if (!departments.length) {
|
|
|
dispatch({
|
|
|
type: 'staff/fetchDepartments'
|