import React from "react"; import { WeaDatePicker, WeaDialog, WeaError, WeaFormItem, WeaHelpfulTip, WeaSelect } from "ecCom"; import { Button } from "antd"; import { inject, observer } from "mobx-react"; import "./index.less"; @inject("declareStore", "taxAgentStore") @observer export default class GenerateModal extends React.Component { constructor(props) { super(props); this.state = { date: "", taxAgentId: "" }; } // 生成申报表 handleGenerate() { const { declareStore: { saveDeclare } } = this.props; const { date, taxAgentId } = this.state; if (_.isEmpty(date) && _.isEmpty(taxAgentId)) { this.refs.weaError.showError(); this.refs.weaError1.showError(); return; } if (_.isEmpty(date)) { this.refs.weaError.showError(); return; } if (_.isEmpty(taxAgentId)) { this.refs.weaError1.showError(); return; } saveDeclare({ salaryMonthStr: date, taxAgentId }).then(() => { this.props.onGenerate(); }); } render() { const { taxAgentStore: { taxAgentAdminOption }, declareStore: { loading } } = this.props; return ( this.props.onCancel()} initLoadCss className="generateWapper" title={ 申报 } buttons={ [] }>
{ if (_.isEmpty(value)) this.refs.weaError.showError(); this.setState({ date: value }); }} /> { if (_.isEmpty(taxAgentId)) this.refs.weaError1.showError(); this.setState({ taxAgentId }); }} />
); } }