diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.less b/pc4mobx/hrmSalary/pages/calculateDetail/index.less index c0d7ed3b..7cbb9b42 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.less +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.less @@ -178,7 +178,9 @@ } .tableWrapper { - margin-top: 10px; + padding: 10px; + height: calc(100vh - 121px); + overflow: hidden; } } diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 195d4762..e7e207a1 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -2,143 +2,97 @@ import React from "react"; import CustomTab from "../../components/customTab"; import { Dropdown, Menu, message } from "antd"; import { WeaHelpfulTip, WeaInputSearch, WeaSlideModal } from "ecCom"; -import { placeOnFileColumns } from "./columns"; import SlideModalTitle from "../../components/slideModalTitle"; import FileMergeDetail from "./fileMergeDetail"; import { getQueryString } from "../../util/url"; import { inject, observer } from "mobx-react"; -import CustomPaginationTable from "../../components/customPaginationTable"; -import { renderLoading } from "../../util"; +import "./index.less"; @inject("calculateStore") @observer export default class PlaceOnFileDetail extends React.Component { constructor(props) { super(props); - placeOnFileColumns.map(item => { - if (item.dataIndex == "username") { - item.render = (text, record) => ( - { - this.onDetail(); - }}>{text} - ); - } - }); this.state = { slideVisiable: false, selectedRowKeys: [], searchValue: "" }; this.id = ""; - this.length = 0; - this.pageInfo = { - current: 1, - pageSize: 10 - }; } componentWillMount() { - let id = getQueryString("id"); - this.id = id; - const { calculateStore: { getSalarySobCycle, acctResultList } } = this.props; - getSalarySobCycle(id); - acctResultList({ salaryAcctRecordId: id }); + this.id = getQueryString("id"); + const { calculateStore: { getSalarySobCycle } } = this.props; + getSalarySobCycle(this.id); } + componentDidMount() { + window.addEventListener("message", this.handleClick, false); + } - // 获取列表的列 - getColumns() { - const { calculateStore: { acctResultListTableStore, acctResultListColumns } } = this.props; - let columns = acctResultListColumns ? acctResultListColumns : []; - columns = columns.filter(item => item.hide == "FALSE").map(item => { - let result = { ...item }; - result.title = item.text; - result.dataIndex = item.column; - result.oldWidth = result.width; - result.width = null; - this.length = 0; - if (result.children) { - result.children.map(child => { - child.width = 150; - child.title = child.text; - child.dataIndex = child.column; - this.length++; - }); - } else { - this.length++; - result.width = 150; + componentWillUnmount() { + window.removeEventListener("message", this.handleClick, false); + } + + handleClick = ({ data }) => { + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const { type, data: { id, data: record } = {} } = data; + if (type === "PR") { + if (id === "BATCHDELETE") { + this.setState({ selectedRowKeys: record }); } - return result; - }); - columns.push({ - title: "操作", - key: "cz", - render: (text, record) => { - return { - this.handleEdit(record); - }}>编辑; + } else { + const payload = { + type: "PR", + listType: "", + hasOperate: false, + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + employeeName: this.state.searchValue + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + } + }; + + handleSearch = (employeeName) => { + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const payload = { + type: "PR", + listType: "", + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + employeeName } - }); - return columns; - } - - onDetail() { - this.setState({ slideVisiable: true }); - } - - handleSearch(employeeName) { - const { calculateStore: { acctResultList } } = this.props; - acctResultList({ salaryAcctRecordId: this.id, employeeName, ...this.pageInfo, current: 1 }); - } - - // 分页 - handleDataPageChange(current) { - const { calculateStore: { acctResultList } } = this.props; - acctResultList({ salaryAcctRecordId: this.id, employeeName: this.state.searchValue, ...this.pageInfo, current }); - } - - handleShowSizeChange(pageInfo) { - const { calculateStore: { acctResultList } } = this.props; - acctResultList({ - salaryAcctRecordId: this.id, - employeeName: this.state.searchValue, ...this.pageInfo, ...pageInfo - }); - } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + }; handleMenuClick() { const { calculateStore: { exportAll } } = this.props; const { selectedRowKeys } = this.state; - if (selectedRowKeys.length == 0) { + if (selectedRowKeys.length === 0) { message.warning("未选择条目"); return; } exportAll(this.id, selectedRowKeys.join(",")); } - handleExportAll() { + handleExportAll = () => { const { calculateStore: { exportAll } } = this.props; exportAll(this.id); - } - - onSelectChange = selectedRowKeys => { - this.setState({ selectedRowKeys }); }; - render() { - const { calculateStore } = this.props; - const { - baseSalarySobCycle, - acctResultListDateSource, - acctResultListPageInfo - } = calculateStore; - const { selectedRowKeys, slideVisiable } = this.state; + const { baseSalarySobCycle } = calculateStore; + const { slideVisiable } = this.state; - const rowSelection = { - selectedRowKeys, - onChange: this.onSelectChange - }; const menu = (