salary-management-front/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js

84 lines
2.3 KiB
JavaScript

/*
* Author: 黎永顺
* Description: 核算弹框
* Date: 2022-04-21 15:16:18
* LastEditTime: 2022-04-21 16:54:59
*/
import React, { Component } from "react";
import { Button, Form, Input } from "antd";
import { WeaDatePicker, WeaDialog, WeaSelect } from "ecCom";
const createForm = Form.create;
const FormItem = Form.Item;
class Accountdialog extends Component {
constructor(props) {
super(props);
this.state = {};
}
handleSubmit = (e) => {
const { onOk } = this.props;
e.preventDefault();
this.props.form.validateFields((errors, values) => {
if (!!errors) {
return;
}
onOk(values);
});
};
render() {
const { getFieldProps } = this.props.form;
const formItemLayout = {
labelCol: { span: 7 },
wrapperCol: { span: 12 },
};
return (
<WeaDialog
{...this.props}
style={{ maxHeight: 400 }}
buttons={[
<Button
type="primary"
onClick={this.handleSubmit}
loading={this.props.loading}>
保存并进入核算
</Button>,
]}>
<Form horizontal form={this.props.form} style={{ marginTop: 16 }}>
<FormItem {...formItemLayout} label="账单月份" required>
<WeaDatePicker
style={{ width: "100%" }}
format="YYYY-MM"
{...getFieldProps("billMonth", {
initialValue: new Date(),
rules: [{ required: true, message: "请选择日期" }],
})}
/>
</FormItem>
{
this.props.isAdmin && <FormItem {...formItemLayout} label="个税扣缴义务人">
<WeaSelect
style={{ width: "100%" }}
options={this.props.options}
{...getFieldProps("paymentOrganization", {
initialValue: "",
rules: [{ required: true, message: "请选择个税扣缴义务人" }],
})}
/>
</FormItem>
}
<FormItem {...formItemLayout} label="备注">
<Input
type="textarea"
{...getFieldProps("remarks", { initialValue: "" })}
/>
</FormItem>
</Form>
</WeaDialog>
);
}
}
export default createForm()(Accountdialog);