/** * Created by FANGlh on 2018/11/26 12:41. * Desc: */ import React,{Component} from 'react'; import './Approvel.css'; import icon_out from '../../../style/imgs/out_img.png'; import icon_res from '../../../style/imgs/res_img.png'; import icon_trip from '../../../style/imgs/trip_img.png'; import icon_leave from '../../../style/imgs/leave_img.png'; import {Link} from 'react-router-dom'; import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common"; export default class ApprovelItem extends Component{ constructor(props){ super(props); this.state={ itemdata:this.props.itemdata, isMyApply:this.props.isMyApply, approveId:this.props.itemdata.approveId } } componentDidMount(){ this.setState({ itemdata:this.props.itemdata, isMyApply:this.props.isMyApply, approveId:this.props.itemdata.approveId },function () { console.log('itemdata',this.state.itemdata) }) } render(){ const {itemdata,isMyApply,approveId} = this.state return(
{itemdata.approveType == 1 ? '出差申请' : (itemdata.approveType == 2 ? '用品申请' : '请假申请' )}
{this.props.itemdata.creatDate}
{itemdata.approveStatus == 1 ? "待审批" :"已审批"}
) } ItemClick =(isMyApply,data)=>{ // console.log('type,data',type+'--'+data); return if(isMyApply){ this.props.clickApplyItem(data) } else { this.props.clickApprovelItem(data) } } }