salary-management-front/pc4mobx/hrmSalary/pages/payroll/copyModal.js

44 lines
1.3 KiB
JavaScript

import React from 'react'
import { notNull } from '../../util/validate'
import { Modal, Button, Row, Col, message } from 'antd';
import { WeaInput } from "ecCom"
import RequiredLabelTip from '../../components/requiredLabelTip';
export default class CopyModal extends React.Component {
constructor(props) {
super(props)
this.state = {
name: ''
}
}
handleChange(value) {
this.setState({name: value})
}
handleSave() {
if(!notNull(this.state.name)) {
message.warning("工资单名称不能为空")
}
this.props.onSave && this.props.onSave(this.state.name)
}
render(){
const { name } = this.state;
return (
<Modal width={600} title="复制工资单" visible={this.props.visible} onCancel={() => {
this.props.onCancel()
}} footer={
<Button type="primary" onClick={() => {
this.handleSave()
}}>保存</Button>
}>
<Row>
<Col span={6}>工资单名称<RequiredLabelTip /></Col>
<Col span={18}>
<WeaInput value={name}
onChange={(value) => {
this.handleChange(value)
}}/>
</Col>
</Row>
</Modal>
)
}
}