2022-08-04 17:07:09 +08:00
|
|
|
|
import React from "react";
|
2023-05-16 15:13:45 +08:00
|
|
|
|
import { toJS } from "mobx";
|
2022-08-04 17:07:09 +08:00
|
|
|
|
import CustomTab from "../../components/customTab";
|
|
|
|
|
|
import { Dropdown, Menu, message } from "antd";
|
2023-07-20 17:03:20 +08:00
|
|
|
|
import { WeaHelpfulTip, WeaInputSearch, WeaLocaleProvider, WeaSlideModal } from "ecCom";
|
2022-08-04 17:07:09 +08:00
|
|
|
|
import SlideModalTitle from "../../components/slideModalTitle";
|
|
|
|
|
|
import FileMergeDetail from "./fileMergeDetail";
|
2022-04-19 16:34:19 +08:00
|
|
|
|
import { getQueryString } from "../../util/url";
|
2022-08-04 17:07:09 +08:00
|
|
|
|
import { inject, observer } from "mobx-react";
|
2023-07-20 17:03:20 +08:00
|
|
|
|
import { getExportField } from "../../apis/calculate";
|
2023-01-16 11:39:49 +08:00
|
|
|
|
import "./index.less";
|
2023-07-20 17:03:20 +08:00
|
|
|
|
import CustomExportDialog from "./customExportDialog";
|
2022-03-17 12:30:37 +08:00
|
|
|
|
|
2023-07-20 17:03:20 +08:00
|
|
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
2022-08-04 17:07:09 +08:00
|
|
|
|
@inject("calculateStore")
|
2022-04-19 16:34:19 +08:00
|
|
|
|
@observer
|
2022-03-17 12:30:37 +08:00
|
|
|
|
export default class PlaceOnFileDetail extends React.Component {
|
2022-08-04 17:07:09 +08:00
|
|
|
|
constructor(props) {
|
|
|
|
|
|
super(props);
|
|
|
|
|
|
this.state = {
|
|
|
|
|
|
slideVisiable: false,
|
|
|
|
|
|
selectedRowKeys: [],
|
2023-05-16 15:13:45 +08:00
|
|
|
|
searchValue: "",
|
2023-07-20 17:03:20 +08:00
|
|
|
|
columnIndex: "",
|
|
|
|
|
|
customExportParams: {
|
|
|
|
|
|
visible: false, checkItems: [], itemsByGroup: []
|
|
|
|
|
|
}
|
2022-08-04 17:07:09 +08:00
|
|
|
|
};
|
|
|
|
|
|
this.id = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentWillMount() {
|
2023-01-16 11:39:49 +08:00
|
|
|
|
this.id = getQueryString("id");
|
|
|
|
|
|
const { calculateStore: { getSalarySobCycle } } = this.props;
|
|
|
|
|
|
getSalarySobCycle(this.id);
|
2022-08-04 17:07:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-01-16 11:39:49 +08:00
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
window.addEventListener("message", this.handleClick, false);
|
2022-08-04 17:07:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-01-16 11:39:49 +08:00
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
|
window.removeEventListener("message", this.handleClick, false);
|
2022-08-04 17:07:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-01-16 11:39:49 +08:00
|
|
|
|
handleClick = ({ data }) => {
|
|
|
|
|
|
const childFrameObj = document.getElementById("atdTable");
|
|
|
|
|
|
const salaryAcctRecordId = getQueryString("id");
|
2023-05-16 15:13:45 +08:00
|
|
|
|
const { type, data: { id, data: record, extraId = "" } = {} } = data;
|
2023-01-16 11:39:49 +08:00
|
|
|
|
if (type === "PR") {
|
|
|
|
|
|
if (id === "BATCHDELETE") {
|
|
|
|
|
|
this.setState({ selectedRowKeys: record });
|
2023-05-16 15:13:45 +08:00
|
|
|
|
} else if (id === "PAGEINFO") {
|
2023-02-08 10:46:16 +08:00
|
|
|
|
const { pageNum: current, size: pageSize } = record;
|
|
|
|
|
|
this.pageInfo = { current, pageSize };
|
|
|
|
|
|
const payload = {
|
|
|
|
|
|
type: "PR",
|
|
|
|
|
|
listType: "",
|
2023-02-14 16:21:48 +08:00
|
|
|
|
hasOperate: false,
|
2023-02-08 10:46:16 +08:00
|
|
|
|
url: "/api/bs/hrmsalary/salaryacct/acctresult/list",
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
salaryAcctRecordId,
|
|
|
|
|
|
employeeName: this.state.searchValue,
|
|
|
|
|
|
current, pageSize
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
2023-05-16 15:13:45 +08:00
|
|
|
|
} else if (id === "COLUMNINDEX") {
|
|
|
|
|
|
if (!extraId) {
|
|
|
|
|
|
this.setState({ columnIndex: record });
|
|
|
|
|
|
}
|
2023-01-16 11:39:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const payload = {
|
|
|
|
|
|
type: "PR",
|
|
|
|
|
|
listType: "",
|
|
|
|
|
|
hasOperate: false,
|
|
|
|
|
|
url: "/api/bs/hrmsalary/salaryacct/acctresult/list",
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
salaryAcctRecordId,
|
|
|
|
|
|
employeeName: this.state.searchValue
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2023-02-08 10:46:16 +08:00
|
|
|
|
type && childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
2023-01-16 11:39:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
2022-08-04 17:07:09 +08:00
|
|
|
|
|
2023-01-16 11:39:49 +08:00
|
|
|
|
handleSearch = (employeeName) => {
|
|
|
|
|
|
const childFrameObj = document.getElementById("atdTable");
|
|
|
|
|
|
const salaryAcctRecordId = getQueryString("id");
|
|
|
|
|
|
const payload = {
|
|
|
|
|
|
type: "PR",
|
|
|
|
|
|
listType: "",
|
2023-02-14 16:21:48 +08:00
|
|
|
|
hasOperate: false,
|
2023-01-16 11:39:49 +08:00
|
|
|
|
url: "/api/bs/hrmsalary/salaryacct/acctresult/list",
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
salaryAcctRecordId,
|
|
|
|
|
|
employeeName
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*");
|
|
|
|
|
|
};
|
2022-08-04 17:07:09 +08:00
|
|
|
|
|
2023-07-20 17:03:20 +08:00
|
|
|
|
handleMenuClick = ({ key }) => {
|
|
|
|
|
|
if (key === "3") {
|
|
|
|
|
|
const { calculateStore: { exportAll } } = this.props;
|
|
|
|
|
|
const { selectedRowKeys } = this.state;
|
|
|
|
|
|
if (selectedRowKeys.length === 0) {
|
|
|
|
|
|
message.warning("未选择条目");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
exportAll(this.id, selectedRowKeys.join(","));
|
|
|
|
|
|
} else if (key === "4") {
|
|
|
|
|
|
this.getExportField();
|
2022-08-04 17:07:09 +08:00
|
|
|
|
}
|
2023-07-20 17:03:20 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
getExportField = () => {
|
|
|
|
|
|
getExportField({ salaryAcctRecordId: getQueryString("id") }).then(({ status, data }) => {
|
|
|
|
|
|
if (status) {
|
|
|
|
|
|
const { checkItems, itemsByGroup } = data;
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
customExportParams: {
|
|
|
|
|
|
visible: true,
|
|
|
|
|
|
checkItems, itemsByGroup
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
2022-08-04 17:07:09 +08:00
|
|
|
|
|
2023-01-16 11:39:49 +08:00
|
|
|
|
handleExportAll = () => {
|
2022-08-04 17:07:09 +08:00
|
|
|
|
const { calculateStore: { exportAll } } = this.props;
|
|
|
|
|
|
exportAll(this.id);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
|
const { calculateStore } = this.props;
|
2023-05-16 15:13:45 +08:00
|
|
|
|
const { baseSalarySobCycle, columnDescList } = calculateStore;
|
2023-07-20 17:03:20 +08:00
|
|
|
|
const { slideVisiable, columnIndex, customExportParams } = this.state;
|
2022-08-04 17:07:09 +08:00
|
|
|
|
|
|
|
|
|
|
const menu = (
|
|
|
|
|
|
<Menu onClick={(e) => this.handleMenuClick(e)}>
|
|
|
|
|
|
<Menu.Item key="3">导出所选</Menu.Item>
|
2023-07-20 17:03:20 +08:00
|
|
|
|
<Menu.Item key="4">{getLabel(111, "自定义导出")}</Menu.Item>
|
2022-08-04 17:07:09 +08:00
|
|
|
|
</Menu>
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const renderRightOperation = () => {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div style={{ display: "inline-block" }}>
|
|
|
|
|
|
<Dropdown.Button type="primary" style={{ marginRight: "10px" }} onClick={() => {
|
|
|
|
|
|
this.handleExportAll();
|
|
|
|
|
|
}} overlay={menu}>导出全部</Dropdown.Button>
|
|
|
|
|
|
<WeaInputSearch placeholder="请输入姓名" onChange={(value) => {
|
|
|
|
|
|
this.setState({ searchValue: value });
|
|
|
|
|
|
}} value={this.state.searchValue} onSearch={(value) => {
|
|
|
|
|
|
this.handleSearch(value);
|
|
|
|
|
|
}}/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="placeOnFileDetail">
|
|
|
|
|
|
<CustomTab
|
|
|
|
|
|
searchOperationItem={
|
|
|
|
|
|
renderRightOperation()
|
|
|
|
|
|
}
|
|
|
|
|
|
/>
|
2023-05-16 15:13:45 +08:00
|
|
|
|
<div className="tabWrapper" style={{ borderBottom: "none" }}>
|
2023-08-25 16:12:05 +08:00
|
|
|
|
<span style={{ marginRight: 10 }}>薪资所属月:{baseSalarySobCycle.salaryMonth}</span>
|
2022-08-04 17:07:09 +08:00
|
|
|
|
<WeaHelpfulTip
|
|
|
|
|
|
width={100}
|
|
|
|
|
|
title={`薪资周期\n
|
2022-04-19 16:34:19 +08:00
|
|
|
|
${baseSalarySobCycle.salaryCycle && baseSalarySobCycle.salaryCycle.fromDate}至${baseSalarySobCycle.salaryCycle && baseSalarySobCycle.salaryCycle.endDate}\n
|
2022-03-17 12:30:37 +08:00
|
|
|
|
税款所属期\n
|
2022-04-19 16:34:19 +08:00
|
|
|
|
${baseSalarySobCycle.taxCycle}\n
|
2022-03-17 12:30:37 +08:00
|
|
|
|
考勤取值周期\n
|
2022-04-19 16:34:19 +08:00
|
|
|
|
${baseSalarySobCycle.attendCycle && baseSalarySobCycle.attendCycle.fromDate}至${baseSalarySobCycle.attendCycle && baseSalarySobCycle.attendCycle.endDate}\n
|
2022-03-17 12:30:37 +08:00
|
|
|
|
福利台账月份\n
|
2022-04-19 16:34:19 +08:00
|
|
|
|
引用${baseSalarySobCycle.socialSecurityCycle}的福利台账数据`}
|
2022-08-04 17:07:09 +08:00
|
|
|
|
placement="topLeft"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
2023-05-16 15:13:45 +08:00
|
|
|
|
<div className="tabWrapper">
|
|
|
|
|
|
<span>公式=</span>
|
|
|
|
|
|
<span>{toJS(columnDescList)[columnIndex] && toJS(columnDescList)[columnIndex].formulaContent}</span>
|
|
|
|
|
|
</div>
|
2022-08-04 17:07:09 +08:00
|
|
|
|
<div className="tableWrapper">
|
2023-01-16 11:39:49 +08:00
|
|
|
|
<iframe
|
|
|
|
|
|
style={{ border: 0, width: "100%", height: "100%" }}
|
|
|
|
|
|
// src="http://localhost:7607/#/atdTable"
|
|
|
|
|
|
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/atdTable"
|
|
|
|
|
|
id="atdTable"
|
2022-08-04 17:07:09 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
2023-07-20 17:03:20 +08:00
|
|
|
|
<CustomExportDialog
|
|
|
|
|
|
{...customExportParams}
|
|
|
|
|
|
searchItemsValue={{ employeeName: this.state.searchValue }}
|
|
|
|
|
|
onCancel={() => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
customExportParams: {
|
|
|
|
|
|
visible: false, checkItems: [], itemsByGroup: []
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}}
|
|
|
|
|
|
/>
|
2022-08-04 17:07:09 +08:00
|
|
|
|
{
|
2023-01-16 11:39:49 +08:00
|
|
|
|
slideVisiable &&
|
|
|
|
|
|
<WeaSlideModal
|
|
|
|
|
|
visible={slideVisiable}
|
|
|
|
|
|
top={0}
|
|
|
|
|
|
width={40}
|
|
|
|
|
|
height={100}
|
|
|
|
|
|
direction={"right"}
|
|
|
|
|
|
measure={"%"}
|
|
|
|
|
|
title={
|
|
|
|
|
|
<SlideModalTitle
|
|
|
|
|
|
subtitle={"合并计税详情"}
|
|
|
|
|
|
editable={true}
|
|
|
|
|
|
/>
|
|
|
|
|
|
}
|
|
|
|
|
|
content={(<FileMergeDetail/>)}
|
|
|
|
|
|
onClose={() => this.setState({ slideVisiable: false })}
|
|
|
|
|
|
showMask={true}
|
|
|
|
|
|
closeMaskOnClick={() => this.setState({ slideVisiable: false })}/>
|
2022-08-04 17:07:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|