salary-management-front/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js

76 lines
2.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { Component } from "react";
import { Button } from "antd";
import { WeaHelpfulTip, WeaInputSearch, WeaTop } from "ecCom";
import { getQueryString } from "../../../../util/url";
class RegTop extends Component {
constructor(props) {
super(props);
this.state = {
name: ""
};
}
renderTopBtns = () => {
const { name } = this.state;
const { onChange, selectKey, type: regtopType } = this.props;
const type = getQueryString("type");
let dom = [
<WeaHelpfulTip
title={
<div>
<div>提示</div>
<div>个人合计=社保个人合计+公积金个人合计+其他福利个人合计</div>
<div>单位合计=社保单位合计+公积金单位合计+其他福利单位合计</div>
<div>社保合计=社保个人合计+社保单位合计</div>
<div>公积金合计=公积金个人合计+公积金单位合计</div>
<div>其他福利合计=其他福利个人合计+其他福利单位合计</div>
<div>合计=社保合计+公积金合计+其他福利合计</div>
</div>
}
placement="bottomRight"
width={250}
/>,
<Button type="primary" size="small" onClick={() => onChange("export")}>
<span className="icon-coms02-coms2-export" title="导出全部"></span>
</Button>,
<WeaInputSearch
value={name}
style={{ width: 250 }}
placeholder="请输入员工姓名"
onChange={name => this.setState({ name })}
onSearch={() => onChange("search")}
/>
];
if (!type) {
const [dom1, ...extra] = dom;
const domBtn = regtopType === "regression" ?
<Button type="primary" size="small" onClick={() => onChange("add")}>
<span className="icon-coms-Add-to-hot" title="添加"></span>
</Button> :
<Button type="primary" size="small" onClick={() => onChange("import")}>
<span className="icon-coms02-Import" title="导入"></span>
</Button>;
dom = [
dom1,
<Button type="primary" size="small" disabled={_.isEmpty(selectKey)} onClick={() => onChange("delete")}>
<span className="icon-coms-form-delete-hot" title="删除"></span>
</Button>, domBtn, ...extra
];
}
return dom;
};
render() {
const { billMonth } = this.props;
return (
<WeaTop
title={<span><span style={{ paddingRight: 10 }}>账单月份</span><span>{billMonth}</span></span>}
buttons={this.renderTopBtns()}
/>
);
}
}
export default RegTop;