import React from 'react'; import { inject, observer} from 'mobx-react'; import {WeaAlertPage,WeaTools,WeaTab,WeaTop,WeaSearchGroup,WeaFormItem,WeaRightMenu} from 'ecCom'; import { Tabs,Button,Table,Form, Modal,message,Row,Col, Spin} from 'antd'; import {WeaSwitch} from 'comsMobx'; import * as mobx from 'mobx'; import isEmpty from 'lodash/isEmpty'; const toJS = mobx.toJS; import * as PublicFunc from '../util/pulic-func'; window.openFullWindowForXtable = PublicFunc.openFullWindowForXtable; import moment from 'moment'; import {WeaTableNew} from 'comsMobx'; const WeaTable = WeaTableNew.WeaTable; import cloneDeep from 'lodash/cloneDeep' import {i18n} from '../public/i18n'; import '../style/financeExpand.less'; import AlertPage from '../public/components/AlertPage.js'; import VerifyResourceID from './financeExpand/VerifyResourceID.js'; @inject('hrmFinance') @inject('hrmCard') @observer class HrmFinance extends React.Component { componentWillReceiveProps(nextProps) { if (this.props.location.key !== nextProps.location.key) { this.showDialog(); } } componentDidMount() { this.showDialog((token) => { const {hrmCard} = this.props; hrmCard.setTopButtons(this.getTopButtons.bind(this)); hrmCard.setTopRightMenus(this.getRightMenu.bind(this)); hrmCard.setTopShowDropIcon(true); this.init(token); }); } showDialog = (cb)=>{ const { hrmFinance } = this.props, { financeExpand } = hrmFinance; if (window.doCheckSecondaryVerify4ec) { window.doCheckSecondaryVerify4ec({mouldCode: 'HRM', itemCode: 'SALARY'}, res => { if (res.status == "1") { cb && cb(res.token); } financeExpand.loading = false; financeExpand.isNeedSecondPwdVerify = false; }) } else { financeExpand.fetchSecondPwdVerifyInfo().then(isNeedSecondPwdVerify => { isNeedSecondPwdVerify && financeExpand.openDialog(); cb && cb(); }); } } init(token) { const {hrmFinance} = this.props; const hrmId = this.props.params.hrmId || ''; hrmFinance.hrmId = hrmId; hrmFinance.init(token); hrmFinance.getTabInfo(); } componentWillUnmount() { const { financeExpand } = this.props.hrmFinance, { resetParams } = financeExpand; resetParams(); } render(){ const { hrmFinance } = this.props; let {title,form,tabDatas,table,formFields,tabkey,isEditor} = hrmFinance; let qname = ''; const {query} = this.props.location; const formParams = form.getFormParams(); const { financeExpand } = hrmFinance, { isNeedSecondPwdVerify, dialogStore, loading, } = financeExpand, { visible } = dialogStore; if (isNeedSecondPwdVerify) { return (