106 lines
3.1 KiB
JavaScript
106 lines
3.1 KiB
JavaScript
/*
|
|
* Author: 黎永顺
|
|
* name: 薪资核算详情
|
|
* Description:
|
|
* Date: 2023/9/13
|
|
*/
|
|
import React, { Component } from "react";
|
|
import { WeaLocaleProvider, WeaReqTop } from "ecCom";
|
|
import { Button, Dropdown, Menu } from "antd";
|
|
import Layout from "./layout";
|
|
import AdvanceInputBtn from "./components/advanceInputBtn";
|
|
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
|
|
import "./index.less";
|
|
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
|
|
|
class Index extends Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
selectedKey: "person"
|
|
};
|
|
}
|
|
|
|
componentDidMount() {
|
|
console.log(this.props);
|
|
}
|
|
|
|
handleButtonClick = () => {
|
|
console.log("核算所有人");
|
|
};
|
|
handleMenuClick = ({ key }) => {
|
|
console.log(key);
|
|
};
|
|
handleMoreMenuClick = ({ key }) => {
|
|
console.log(key);
|
|
};
|
|
renderReqBtns = () => {
|
|
const { selectedKey } = this.state;
|
|
let reqBtns = [];
|
|
switch (selectedKey) {
|
|
case "calc":
|
|
const menu = (
|
|
<Menu onClick={this.handleMenuClick}>
|
|
<Menu.Item key="calc_selected">{getLabel(543546, "核算所选人员")}</Menu.Item>
|
|
</Menu>
|
|
);
|
|
const moreMenu = (
|
|
<Menu onClick={this.handleMoreMenuClick}>
|
|
<Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>
|
|
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
|
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
|
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
|
</Menu>
|
|
);
|
|
reqBtns = [
|
|
<Dropdown.Button onClick={this.handleButtonClick} overlay={menu} type="primary">
|
|
{getLabel(543545, "核算所有人")}
|
|
</Dropdown.Button>,
|
|
<Dropdown overlay={moreMenu}><Button type="ghost">{getLabel(17499, "更多")}</Button></Dropdown>,
|
|
<AdvanceInputBtn/>
|
|
];
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
return reqBtns;
|
|
};
|
|
renderContent = () => {
|
|
const { selectedKey } = this.state;
|
|
let dom = null;
|
|
switch (selectedKey) {
|
|
case "person":
|
|
dom = <SalaryCalcPersonConfirm {...this.props}/>;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
return dom;
|
|
};
|
|
|
|
render() {
|
|
const tabs = [
|
|
{ key: "person", title: getLabel(543547, "人员确认") },
|
|
{ key: "calc", title: getLabel(538011, "薪资核算") }
|
|
];
|
|
const { selectedKey } = this.state;
|
|
return (
|
|
<Layout {...this.props}>
|
|
<div className="salary-calculate-do-calc">
|
|
<WeaReqTop
|
|
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
|
buttonSpace={10} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
|
onChange={key => this.setState({ selectedKey: key })}
|
|
buttons={this.renderReqBtns()}
|
|
>
|
|
<div className="salary-calculate-do-calc-content">{this.renderContent()}</div>
|
|
</WeaReqTop>
|
|
</div>
|
|
</Layout>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default Index;
|