import React from 'react'; import { inject, observer } from 'mobx-react'; import { CenterSpin } from '../../public/valhalla/components/index.js'; import { WeaLocaleProvider, WeaTop, WeaTextarea, WeaRightMenu, } from 'ecCom'; import {Button} from 'antd'; import Detail from './Detail.js'; import AlertPage from '../../public/components/AlertPage.js'; import VerifyResourceID from '../financeExpand/VerifyResourceID.js'; import {Dialog} from '../../public/valhalla/components/index.js'; import {addContentPath} from '../../util/index.js' import '../../style/payrollDetail.less'; const getLabel = WeaLocaleProvider.getLabel; @inject('hrmPayrollDetailStore') @observer export default class PayrollDetail extends React.Component { componentWillMount() { this.props.hrmPayrollDetailStore.setTargetId(this.props.params); } componentDidMount() { this.showDialog(); } showDialog = () => { const { hrmPayrollDetailStore } = this.props, { financeExpand, init } = hrmPayrollDetailStore; if (window.doCheckSecondaryVerify4ec) { window.doCheckSecondaryVerify4ec && window.doCheckSecondaryVerify4ec({mouldCode: 'HRM', itemCode: 'SALARY'}, res => { if (res.status == "1") { init(); financeExpand.isNeedSecondPwdVerify = false; } financeExpand.loading = false; }) }else{ financeExpand.fetchSecondPwdVerifyInfo().then(isNeedSecondPwdVerify => { if (isNeedSecondPwdVerify) { financeExpand.openDialog(); }else{ init(); } }); } } getButtons = () => { const { hrmPayrollDetailStore: { confirm, confirmdata, remark, remarkdata, loading, confirmRecord, feedback } } = this.props; let btns = [], menus = []; if (confirm == '1' && !confirmdata) { const label = getLabel('826','确定') btns.push() menus.push({ key: "1", disabled: loading, icon: , content: label, onClick: confirmRecord }) } if (remark == '1' && !remarkdata) { const label = getLabel('524278','反馈信息') btns.push() menus.push({ key: "2", disabled: loading, icon: , content: label, onClick: feedback }) } return { buttons: btns, dropMenuDatas: menus } } render() { const { hrmPayrollDetailStore } = this.props, { loading, imgId, data, displayType, financeExpand, defaultImg, title, hasPayrollDetail, notAuth, fbDialogStore, handleTextareaChange, } = hrmPayrollDetailStore, { isNeedSecondPwdVerify, dialogStore, } = financeExpand, { visible } = dialogStore; if(notAuth){ return (