2023-10-09 13:17:54 +08:00
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* name: 薪资核算-重构页面
|
|
|
|
|
* Description:
|
|
|
|
|
* Date: 2023/10/9
|
|
|
|
|
*/
|
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import { inject, observer } from "mobx-react";
|
|
|
|
|
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
|
|
|
|
import { Button } from "antd";
|
|
|
|
|
import moment from "moment";
|
|
|
|
|
import CalculateQuery from "./components/calculateQuery";
|
|
|
|
|
import CalculateTablelist from "./components/calculateTablelist";
|
2023-10-09 17:48:45 +08:00
|
|
|
import CalculateDialog from "./components/calculateDialog";
|
2023-10-09 13:17:54 +08:00
|
|
|
import "./index.less";
|
|
|
|
|
|
|
|
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
|
|
|
|
|
|
|
|
|
@inject("calculateStore", "taxAgentStore")
|
|
|
|
|
@observer
|
|
|
|
|
class Calculate extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
queryParams: {
|
|
|
|
|
name: "",
|
|
|
|
|
dateRange: [
|
|
|
|
|
moment(new Date()).startOf("year").format("YYYY-MM"),
|
|
|
|
|
moment(new Date()).startOf("month").format("YYYY-MM")
|
|
|
|
|
]
|
2023-10-09 17:48:45 +08:00
|
|
|
},
|
|
|
|
|
isRefresh: false,
|
|
|
|
|
calcDaialog: { visible: false, title: "" }
|
2023-10-09 13:17:54 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
renderCalculateOpts = () => {
|
|
|
|
|
const { taxAgentStore: { showOperateBtn } } = this.props;
|
2023-10-09 17:48:45 +08:00
|
|
|
const { queryParams, isRefresh } = this.state;
|
2023-10-09 13:17:54 +08:00
|
|
|
let calculateOpts = [
|
2023-10-09 17:48:45 +08:00
|
|
|
<Button type="primary" onClick={() => this.setState({
|
|
|
|
|
calcDaialog: {
|
|
|
|
|
visible: true,
|
|
|
|
|
title: getLabel(538780, "核算")
|
|
|
|
|
}
|
|
|
|
|
})}>{getLabel(538780, "核算")}</Button>,
|
|
|
|
|
<CalculateQuery queryParams={queryParams} onChange={v => this.setState({
|
|
|
|
|
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
|
|
|
|
|
queryParams: { ...queryParams, ...v }
|
|
|
|
|
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
|
2023-10-09 13:17:54 +08:00
|
|
|
];
|
|
|
|
|
return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
2023-10-09 17:48:45 +08:00
|
|
|
const { queryParams, isRefresh, calcDaialog } = this.state;
|
2023-10-09 13:17:54 +08:00
|
|
|
return (
|
|
|
|
|
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
|
2023-10-09 15:15:59 +08:00
|
|
|
buttons={this.renderCalculateOpts()} className="calculate-main-layout"
|
2023-10-09 13:17:54 +08:00
|
|
|
>
|
|
|
|
|
<div className="calculate-body">
|
2023-10-09 17:48:45 +08:00
|
|
|
<CalculateTablelist queryParams={queryParams} isRefresh={isRefresh}/>
|
|
|
|
|
<CalculateDialog {...calcDaialog}
|
|
|
|
|
onCancel={(bool, id) => this.setState({
|
|
|
|
|
calcDaialog: { ...calcDaialog, visible: false },
|
|
|
|
|
isRefresh: bool === "refresh" ? !isRefresh : isRefresh
|
|
|
|
|
}, () => bool === "refresh" && window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/${id}`))}
|
|
|
|
|
/>
|
2023-10-09 13:17:54 +08:00
|
|
|
</div>
|
|
|
|
|
</WeaTop>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Calculate;
|