release/2.9.9.2312.01-个税
This commit is contained in:
parent
b163858722
commit
7fd754ad0f
|
|
@ -366,3 +366,7 @@ export const saveTaxMapping = params => {
|
|||
export const getSalaryItemForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params);
|
||||
};
|
||||
//薪资账套-获取薪资账套中拓扑图数据
|
||||
export const getSalaryItemTopology = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/topology", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class EditCalcTable extends Component {
|
|||
const { salarySobId } = this.props;
|
||||
const { lockStatus, salaryItemId } = payload;
|
||||
if (lockStatus === "DIAGRAM") {
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`, "_blank");
|
||||
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}?type=ledger`, "_blank");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ class LedgerSalaryItemTable extends Component {
|
|||
render: (text, record) => {
|
||||
const { salarySobId, salaryItemId } = record;
|
||||
return <a
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`}
|
||||
href={`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}?type=ledger`}
|
||||
target="_blank">{text}</a>;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ class Index extends Component {
|
|||
return (
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
src="http://localhost:7607/#/salaryItemDiagram"
|
||||
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryItemDiagram"
|
||||
// src={`http://localhost:7607/#/${this.props.pathname}`}
|
||||
src={`/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/${this.props.pathname}`}
|
||||
id="topologyDiagram"
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import React, { Component } from "react";
|
|||
import { WeaLocaleProvider } from "ecCom";
|
||||
import SalaryItemDiagram from "../salaryItemDiagram";
|
||||
import { getQueryString } from "../../util/url";
|
||||
import { getSalaryItemTopology } from "../../apis/ledger";
|
||||
import uuidV4 from "uuid/v4";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
|
@ -25,18 +27,37 @@ class Index extends Component {
|
|||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
postMessageToChild = () => {
|
||||
const i18n = { "公式": getLabel(18125, "公式") };
|
||||
postMessageToChild = async () => {
|
||||
const i18n = { "薪资项目": getLabel(542362, "薪资项目"), "公式": getLabel(18125, "公式") };
|
||||
const { params: payload = {} } = this.props;
|
||||
const acctEmpId = getQueryString("acctEmpId");
|
||||
const acctEmpId = getQueryString("acctEmpId"), type = getQueryString("type");
|
||||
let itemsTree = [];
|
||||
if (type === "ledger") {
|
||||
const { data } = await getSalaryItemTopology({ ...payload });
|
||||
itemsTree = this.convertToTreeDatas([data]);
|
||||
}
|
||||
const childFrameObj = document.getElementById("topologyDiagram");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n, acctEmpId }), "*");
|
||||
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n, acctEmpId, itemsTree }), "*");
|
||||
};
|
||||
convertToTreeDatas = (datas, parentId = "0") => {
|
||||
return _.map(datas, item => {
|
||||
if (_.isEmpty(item.children)) {
|
||||
return { ...item, salaryItemId: item.salaryItemId ? item.salaryItemId.toString() : uuidV4(), parentId };
|
||||
} else {
|
||||
return {
|
||||
...item, parentId, salaryItemId: item.salaryItemId.toString(),
|
||||
children: this.convertToTreeDatas(item.children, item.salaryItemId.toString())
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const type = getQueryString("type");
|
||||
const pathname = type === "ledger" ? "ledgerSalaryItemDiagram" : "salaryItemDiagram";
|
||||
return (
|
||||
<div style={{ width: "100%", height: "100%" }}>
|
||||
<SalaryItemDiagram/>
|
||||
<SalaryItemDiagram pathname={pathname}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue