import React from "react"; import { WeaDatePicker, WeaDialog, WeaError, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSelect, WeaTextarea } from "ecCom"; import { Button } from "antd"; import { inject, observer } from "mobx-react"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @inject("declareStore", "taxAgentStore") @observer export default class GenerateModal extends React.Component { constructor(props) { super(props); this.state = { date: "", taxAgentId: "", description: "", loading: false }; } // 生成申报表 handleGenerate = () => { const { declareStore: { saveDeclare } } = this.props; const { date, taxAgentId, description } = 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; } this.setState({ loading: true }); saveDeclare({ salaryMonthStr: date, taxAgentId, description }).then(() => { this.setState({ loading: false }); this.props.onGenerate(); }).catch(() => { this.setState({ loading: false }); }); }; render() { const { taxAgentStore: { taxAgentAdminOption } } = this.props; const { loading } = this.state; 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 }); }} /> this.setState({ description })} />
); } }