diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index be04bdad..ada3f3b9 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -63,7 +63,7 @@ export const exportCumDeductDetailList = (id, ids = "") => { "/api/bs/hrmsalary/addUpDeduction/exportDetail?accumulatedSpecialAdditionalDeductionId=" + id + "&ids=" + - ids + ids+ "&taxAgentId=" + taxAgentId ).then((res) => res.blob().then((blob) => { var filename = `累计专项附加扣除.xlsx`; diff --git a/pc4mobx/hrmSalary/apis/cumSituation.js b/pc4mobx/hrmSalary/apis/cumSituation.js index aef62744..237d81ac 100644 --- a/pc4mobx/hrmSalary/apis/cumSituation.js +++ b/pc4mobx/hrmSalary/apis/cumSituation.js @@ -58,12 +58,12 @@ export const getCumSituationDetailList = (params) => { }; //数据采集-累计情况-导出明细 -export const exportCumSituationDetailList = (id, ids = "") => { +export const exportCumSituationDetailList = (id, ids = "", taxAgentId='') => { fetch( "/api/bs/hrmsalary/addUpSituation/exportDetail?accumulatedSituationId=" + id + "&ids=" + - ids + ids + "&taxAgentId=" + taxAgentId ).then((res) => res.blob().then((blob) => { var filename = `往期累计情况(工资、薪金).xlsx`; diff --git a/pc4mobx/hrmSalary/apis/otherDeduct.js b/pc4mobx/hrmSalary/apis/otherDeduct.js index 8c53b16c..972c641a 100644 --- a/pc4mobx/hrmSalary/apis/otherDeduct.js +++ b/pc4mobx/hrmSalary/apis/otherDeduct.js @@ -68,7 +68,7 @@ export const exportOtherDeductDetailList = (id, ids) => { "/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId=" + id + "&ids=" + - ids + ids + "&taxAgentId=" + taxAgentId ).then((res) => res.blob().then((blob) => { var filename = `其他免税扣除.xlsx`; diff --git a/pc4mobx/hrmSalary/components/customTable/index.js b/pc4mobx/hrmSalary/components/customTable/index.js index 418f849b..dc83e703 100644 --- a/pc4mobx/hrmSalary/components/customTable/index.js +++ b/pc4mobx/hrmSalary/components/customTable/index.js @@ -11,7 +11,7 @@ import "./index.less"; export default class CustomTable extends React.Component { render() { - const { loading, isWeaTable = true } = this.props; + const { loading, isWeaTable = true, className } = this.props; return (
{loading @@ -19,7 +19,7 @@ export default class CustomTable extends React.Component {
: isWeaTable - ? + ? : { diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index 03fca025..b93e0980 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -153,7 +153,18 @@ export default class CalculateDetail extends React.Component { progressVisible: false }); message.success("核算完成"); - acctResultList({ salaryAcctRecordId: this.id }); + // acctResultList({ salaryAcctRecordId: this.id }); + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const payload = { + type: "PR", + listType: "", + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); } else if (!data.status) { clearInterval(this.timer); this.timer = null; @@ -200,7 +211,19 @@ export default class CalculateDetail extends React.Component { // 核算结果搜索 handleSearch(params) { const { calculateStore: { acctResultList } } = this.props; - acctResultList({ salaryAcctRecordId: this.id, ...params }); + // acctResultList({ salaryAcctRecordId: this.id, ...params }); + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const payload = { + type: "PR", + listType: "", + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + ...params, + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); } componentWillUnmount() { @@ -310,8 +333,7 @@ export default class CalculateDetail extends React.Component { searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username /> {selectedKey == 0 && } - {selectedKey == 1 && - } + {selectedKey == 1 && } {acctResultImportVisiable && { - this.getColumns(res); - }); + const { calculateStore: { getSalarySobCycle } } = this.props; getSalarySobCycle(id); } - // 获取列表的列 - getColumns = (column) => { - const { calculateStore: { acctResultListColumns } } = this.props; - let columns = toJS(acctResultListColumns) ? [...toJS(acctResultListColumns)] : [...column]; - columns = columns.filter(item => item.hide == "FALSE").map(item => { - let result = { ...item }; - result.title = this.setState({ columnIndex: item.column })}>{item.text}; - result.dataIndex = item.column; - result.oldWidth = result.width; - result.width = "150px"; - if (result.children) { - result.width = (result.children.length * 150) + "px"; - result.children.map(child => { - child.title = this.setState({ columnIndex: child.column })}>{child.text}; - child.dataIndex = child.column; - child.width = "150px"; - }); - } + componentDidMount() { + window.addEventListener("message", this.handleClick, false); + } - if (result.dataIndex === "taxAgentName" || result.dataIndex === "username" || result.dataIndex === "departmentName") { - result.fixed = "left"; - result.render = (text) => { - return {text}; + componentWillUnmount() { + window.removeEventListener("message", this.handleClick, false); + this.timer && clearTimeout(this.timer); + } + + handleClick = ({ data }) => { + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const { type, data: { id, data: record } = {} } = data; + if (type === "PR") { + if (id === "EDIT") { + this.handleEdit(record); + } else if (id === "COLUMNINDEX") { + this.setState({ columnIndex: record }); + } else if (id === "PAGEINFO") { + const { pageNum: current, size: pageSize } = record; + this.pageInfo = { current, pageSize }; + const payload = { + type: "PR", + listType: "", + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + employeeName: this.props.employeeName, + current, pageSize + } }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); } - - return result; - }); - columns.push({ - title: "操作", - key: "cz", - width: "100px", - fixed: "right", - render: (text, record) => { - return { - this.handleEdit(record); - }}>编辑; - } - }); - this.setState({ - columns - }); + } else { + const payload = { + type: "PR", + listType: "", + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + employeeName: this.props.employeeName + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + } }; // 编辑时间回调 @@ -95,32 +94,27 @@ export default class SalaryDetail extends React.Component { slideVisiable: false }); saveAcctResult(this.recordId).then(() => { - acctResultList({ salaryAcctRecordId: this.id }); + const childFrameObj = document.getElementById("atdTable"); + const salaryAcctRecordId = getQueryString("id"); + const payload = { + type: "PR", + listType: "", + url: "/api/bs/hrmsalary/salaryacct/acctresult/list", + queryParams: { + salaryAcctRecordId, + employeeName: this.props.employeeName + } + }; + childFrameObj.contentWindow.postMessage(JSON.stringify(payload), "*"); + // acctResultList({ salaryAcctRecordId: this.id }); }); } - // 分页 - handleDataPageChange(current) { - const { calculateStore: { acctResultList } } = this.props; - acctResultList({ salaryAcctRecordId: this.id, employeeName: this.props.employeeName, ...this.pageInfo, current }); - } - - handleShowSizeChange(pageInfo) { - const { calculateStore: { acctResultList } } = this.props; - acctResultList({ salaryAcctRecordId: this.id, employeeName: this.props.employeeName, ...pageInfo }); - } render() { - const { slideVisiable, columnIndex, columns } = this.state; + const { slideVisiable, columnIndex } = this.state; const { calculateStore, taxAgentStore: { showOperateBtn } } = this.props; - const { - acctResultListDateSource, - acctResultListColumns, - baseSalarySobCycle, - acctResultListPageInfo, - loading, - columnDescList - } = calculateStore; + const { baseSalarySobCycle, columnDescList } = calculateStore; return (
@@ -129,7 +123,8 @@ export default class SalaryDetail extends React.Component { {toJS(columnDescList)[columnIndex] && toJS(columnDescList)[columnIndex].formulaContent}
- { - this.pageInfo.current = value; - this.handleDataPageChange(value); - }} - isWeaTable={false} - scroll={{ x: 1500 }} - onShowSizeChange={(current, pageSize) => { - this.pageInfo = { current, pageSize }; - this.handleShowSizeChange(this.pageInfo); - }} +