|
@@ -9,15 +9,15 @@ import { apiStaffDetail } from '@/services/staff'
|
|
|
|
|
|
|
|
const EmployeeDetail = props => {
|
|
const EmployeeDetail = props => {
|
|
|
const { dispatch, shouldUpdate, visible, dataId = '' } = props
|
|
const { dispatch, shouldUpdate, visible, dataId = '' } = props
|
|
|
- console.log(dataId)
|
|
|
|
|
|
|
+ // console.log(dataId)
|
|
|
const [state, setState] = useState({
|
|
const [state, setState] = useState({
|
|
|
loading: false,
|
|
loading: false,
|
|
|
- data: {}
|
|
|
|
|
|
|
+ staff: {}
|
|
|
})
|
|
})
|
|
|
const initData = async id => {
|
|
const initData = async id => {
|
|
|
setState({ ...state, loading: true })
|
|
setState({ ...state, loading: true })
|
|
|
const {
|
|
const {
|
|
|
- data: { data = {} },
|
|
|
|
|
|
|
+ data: { staff = {} },
|
|
|
code = -1
|
|
code = -1
|
|
|
} = await apiStaffDetail(id)
|
|
} = await apiStaffDetail(id)
|
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
if (code === consts.RET_CODE.SUCCESS) {
|
|
@@ -27,7 +27,8 @@ const EmployeeDetail = props => {
|
|
|
payload: 'contact'
|
|
payload: 'contact'
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- setState({ ...state, data, loading: false })
|
|
|
|
|
|
|
+ setState({ ...state, staff, loading: false })
|
|
|
|
|
+ // console.log(staff)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -41,7 +42,7 @@ const EmployeeDetail = props => {
|
|
|
<Row>
|
|
<Row>
|
|
|
<Col span={12} className="sheet-box-left">
|
|
<Col span={12} className="sheet-box-left">
|
|
|
<div className="sheet-left-panel zh-pd-right-15">
|
|
<div className="sheet-left-panel zh-pd-right-15">
|
|
|
- <EmployeeForm data={state.data} />
|
|
|
|
|
|
|
+ <EmployeeForm staff={state.staff} />
|
|
|
</div>
|
|
</div>
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col span={12} className="sheet-box-right">
|
|
<Col span={12} className="sheet-box-right">
|