import React from 'react' import { Modal, Row, Col, Button, message } from 'antd' import { WeaInput } from 'ecCom' import { inject, observer } from 'mobx-react'; import RequiredLabelTip from '../../../components/requiredLabelTip'; import { notNull } from '../../../util/validate'; @inject('ledgerStore') @observer export default class ValidRuleEditModal extends React.Component { constructor(props) { super(props); this.state = { name: "", formulaId: "", description: "" } } validateForm() { const { name, formulaId} = this.state; if(!notNull(name)) { message.warning("规则名称不能为空") return false; } // if(!notNull(formulaId)) { // message.warning("校验规则不能为空") // return false; // } return true; } handleSave() { if(!this.validateForm()) { return; } const { ledgerStore: {saveLedgerRule}} = this.props; saveLedgerRule({ name: this.state.name, formulaId: this.state.formulaId, description: this.state.description }) this.props.onCancel(); } render() { return ( {this.props.onCancel()}} width={800} title="添加校验规则" footer={
薪资核算时,不符合校验规则将反馈为异常
} >
规则名称 {this.setState({name: value})}}/> 校验规则 {this.setState({formulaId: value})}}/> 备注 {this.setState({description: value})}}/>
) } }