diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js
index d5e20da8..5f29b42c 100644
--- a/pc4mobx/hrmSalary/apis/ledger.js
+++ b/pc4mobx/hrmSalary/apis/ledger.js
@@ -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);
+};
diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js
index cef1aa55..75c84be5 100644
--- a/pc4mobx/hrmSalary/apis/standingBook.js
+++ b/pc4mobx/hrmSalary/apis/standingBook.js
@@ -351,3 +351,9 @@ export const exportSiaccountWelfaresupplyimporttemplatetemplate = params => {
export const exportSiaccountWelfarebalanceimporttemplatetetemplate = params => {
return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export", params);
};
+export const getBalancePaymentGroup = params => {
+ return postFetch("/api/bs/hrmsalary/siaccount/detail/getBalancePaymentGroup", params);
+};
+export const addNewBalance = params => {
+ return postFetch("/api/bs/hrmsalary/siaccount/detail/addNewBalance", params);
+};
diff --git a/pc4mobx/hrmSalary/components/mobileTemplate/index.js b/pc4mobx/hrmSalary/components/mobileTemplate/index.js
index 46cae517..063b8b8d 100644
--- a/pc4mobx/hrmSalary/components/mobileTemplate/index.js
+++ b/pc4mobx/hrmSalary/components/mobileTemplate/index.js
@@ -53,9 +53,10 @@ class Index extends Component {
}
{
items.map((templatItem, index) => {
- const { salaryItemValue, name } = templatItem || {};
+ const { salaryItemValue, name, salaryItemShowName } = templatItem || {};
return
-
{name || ""}
+
{salaryItemShowName || name || ""}
{salaryItemValue || "100"}
;
})
diff --git a/pc4mobx/hrmSalary/components/pcTemplate/index.js b/pc4mobx/hrmSalary/components/pcTemplate/index.js
index 8c9040c5..511a42bc 100644
--- a/pc4mobx/hrmSalary/components/pcTemplate/index.js
+++ b/pc4mobx/hrmSalary/components/pcTemplate/index.js
@@ -47,11 +47,11 @@ class Index extends Component {
}
{
items.map((templatItem, index) => {
- const { salaryItemValue, name } = templatItem || {};
+ const { salaryItemValue, name, salaryItemShowName } = templatItem || {};
return
-
-
{name || ""}
+
+ {salaryItemShowName || name || ""}
{salaryItemValue || ""}
;
diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js
index a20908e8..8351f046 100644
--- a/pc4mobx/hrmSalary/index.js
+++ b/pc4mobx/hrmSalary/index.js
@@ -54,6 +54,7 @@ import WatermarkPreview from "./pages/payroll/watermarkPreview";
import IntelligentCalculateSalarySettings from "./pages/intelligentCalculateSalarySettings";
import ExternalPersonManage from "./pages/externalPersonManage";
import AdjustSalaryManage from "./pages/adjustSalaryManage";
+import TopologyMap from "./pages/topologyMap";
import stores from "./stores";
import "./style/index";
@@ -190,6 +191,7 @@ const Routes = (
+
);
diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js
index 817a7b6d..fb0f3166 100644
--- a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js
+++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcList.js
@@ -5,8 +5,8 @@
* Date: 2023/9/26
*/
import React, { Component } from "react";
-import { WeaLocaleProvider, WeaTable } from "ecCom";
-import { Alert } from "antd";
+import { WeaLocaleProvider } from "ecCom";
+import { Alert, Spin } from "antd";
import { comparisonResultList } from "../../../../apis/calculate";
const getLabel = WeaLocaleProvider.getLabel;
@@ -21,9 +21,35 @@ class SalaryCalcOcList extends Component {
}
componentDidMount() {
- this.comparisonResultList(this.props);
+ window.addEventListener("message", this.handleReceive, false);
}
+ componentWillUnmount() {
+ window.removeEventListener("message", this.handleReceive, false);
+ }
+
+ handleReceive = async ({ data }) => {
+ const { type, payload: { id, params } = {} } = data;
+ if (type === "init") {
+ this.comparisonResultList(this.props);
+ } else if (type === "turn") {
+ switch (id) {
+ case "PAGEINFO":
+ const { size: pageSize, pageNum: current } = params;
+ this.setState({
+ pageInfo: { ...this.state.pageInfo, current, pageSize }
+ }, () => this.comparisonResultList(this.props));
+ break;
+ case "FORMULA":
+ const { formulaDesc } = params;
+ this.setState({ formulaDesc });
+ break;
+ default:
+ break;
+ }
+ }
+ };
+
componentWillReceiveProps(nextProps, nextContext) {
if (
(nextProps.form.onlyDiffEmployee !== this.props.form.onlyDiffEmployee) ||
@@ -34,6 +60,15 @@ class SalaryCalcOcList extends Component {
}
}
+ postMessageToChild = (payload = {}) => {
+ const i18n = {
+ "共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
+ "总计": getLabel(523, "总计"), "系统值": getLabel(543280, "系统值"),
+ "线下值": getLabel(543281, "线下值"), "差值": getLabel(543282, "差值")
+ };
+ const childFrameObj = document.getElementById("atdTable");
+ childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
+ };
comparisonResultList = (props) => {
const { form, routeParams: { salaryAcctRecordId } } = props;
const { pageInfo } = this.state;
@@ -42,85 +77,54 @@ class SalaryCalcOcList extends Component {
comparisonResultList(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
- const { list: dataSource, columns, pageNum: current, pageSize, total } = data;
+ const { columns, pageInfo: { pageNum: current, pageSize, total, list: dataSource } } = data;
this.setState({
- dataSource, columns,
+ dataSource, columns: this.convertColumns(this.removeItem(columns)),
pageInfo: { ...pageInfo, current, pageSize, total }
+ }, () => {
+ const { pageInfo, dataSource, columns } = this.state;
+ this.postMessageToChild({ dataSource, pageInfo, columns });
});
}
}).catch(() => this.setState({ loading: false }));
};
+ removeItem = (cols) => {
+ return _.filter(cols, o => {
+ if (JSON.stringify(o.children) === "[]") {
+ return false;
+ } else {
+ this.removeItem(o.children);
+ return true;
+ }
+ });
+ };
+ convertColumns = (cols) => {
+ return _.map(cols, (item, index) => {
+ const col = { title: item.text, dataIndex: item.column };
+ if (_.isNaN(parseInt(item.column))) {
+ return { ...col, width: 150, fixed: item.fixed || false };
+ } else {
+ return { ...col, width: 180, children: this.convertColumns(item.children) };
+ }
+ });
+ };
render() {
- const { dataSource, loading, columns, pageInfo, formulaDesc } = this.state;
- const pagination = {
- ...pageInfo,
- showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
- showQuickJumper: true,
- showSizeChanger: true,
- pageSizeOptions: ["10", "20", "50", "100"],
- onShowSizeChange: (current, pageSize) => {
- this.setState({
- pageInfo: { ...pageInfo, current, pageSize }
- }, () => this.comparisonResultList(this.props));
- },
- onChange: current => {
- this.setState({
- pageInfo: { ...pageInfo, current }
- }, () => this.comparisonResultList(this.props));
- }
- };
+ const { loading, formulaDesc } = this.state;
return (
-
+
-
{
- if (i > 1) {
- if (i > 2) {
- return {
- ...o, width: 180,
- render: (__, record) => {
- const formulaDesc = record["customParameters"][`${o["dataIndex"]}`];
- const showDifference = record[`${o["dataIndex"]}_type`] === "number";
- const { acctResultValue, excelResultValue } = record[o["dataIndex"]] || {};
- return this.setState({ formulaDesc })}>
-
- {getLabel(543280, "系统值")}:
- {acctResultValue}
-
-
- {getLabel(543281, "线下值")}:
- {excelResultValue}
-
- {
- showDifference &&
-
- {getLabel(543282, "差值")}:
- {calculateDifference(acctResultValue, excelResultValue)}
-
- }
-
;
- }
- };
- }
- return { ...o, width: 180 };
- }
- return { ...o, width: 150, fixed: "left" };
- })}
- />
-
+
+
+
+
);
}
}
export default SalaryCalcOcList;
-// 计算差值
-const calculateDifference = (systemValue, excelValue) => {
- if (_.isNil(systemValue) || _.isNil(excelValue)) return "";
- const systemNum = Number(systemValue);
- const excelNum = Number(excelValue);
- return (systemNum - excelNum).toFixed(2);
-};
diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less
index 7ec01822..6ed62967 100644
--- a/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/index.less
@@ -55,29 +55,12 @@
overflow-y: hidden;
.wea-new-table {
- background: #FFF;
height: calc(100% - 44px);
- .ant-table-tbody {
- td {
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
+ .ant-spin-nested-loading, .ant-spin-container {
+ height: 100% !important;
}
- .comparison-column-item-container {
- cursor: pointer;
-
- .comparison-single-row {
- margin: 4px 0;
- }
-
- .danger {
- color: #ff4d4f;
- }
- }
}
}
}
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index 5a3e2aa3..6ea72244 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -59,13 +59,23 @@ class EditCalcTable extends Component {
salaryCalcSlide: { visible: true, id: salaryCalcId }
});
break;
+ case "DIAGRAM":
+ const { salarySobId } = this.props;
+ const { salaryItemId: itemid, acctEmpId } = params;
+ window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${itemid}?acctEmpId=${acctEmpId}`, "_blank");
+ break;
default:
break;
}
}
};
updateLockStatus = (payload) => {
- const { lockStatus } = payload;
+ const { salarySobId } = this.props;
+ const { lockStatus, salaryItemId } = payload;
+ if (lockStatus === "DIAGRAM") {
+ window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}?type=ledger`, "_blank");
+ return;
+ }
Modal.confirm({
title: getLabel(131329, "信息确认"),
content:
@@ -125,7 +135,7 @@ class EditCalcTable extends Component {
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
"总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
- "批量锁定": getLabel(111, "批量锁定")
+ "批量锁定": getLabel(111, "批量锁定"), "查看拓扑图": getLabel(111, "查看拓扑图")
};
const childFrameObj = document.getElementById("atdTable");
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
index 8618f667..034d86f8 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
@@ -81,7 +81,7 @@ class Index extends Component {
onAdSearch={this.onAdSearch}
/>
- this.calcTableRef = dom}
+ this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId}
{...this.props} showTotalCell={showTotalCell}
onShowFormulaTd={this.handleShowFormulaTa}/>
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less
index 56fd88df..40dcfb30 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.less
@@ -58,6 +58,17 @@
// text-decoration: none;
//}
}
+
+ .wea-new-table {
+ .ant-table-tbody {
+ tr {
+ td {
+ height: 41px !important;
+ border-bottom: 1px solid #e2e2e2 !important;
+ }
+ }
+ }
+ }
}
.moreIconWrapper {
@@ -80,17 +91,6 @@
}
}
-.wea-new-table {
- .ant-table-tbody {
- tr {
- td {
- height: 41px !important;
- border-bottom: 1px solid #e2e2e2 !important;
- }
- }
- }
-}
-
.slideOuterWrapper {
.wea-slide-modal-title {
height: initial;
diff --git a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js
index c725a669..dcd474a7 100644
--- a/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js
+++ b/pc4mobx/hrmSalary/pages/intelligentCalculateSalarySettings/components/insufficientTrafficAlert.js
@@ -236,7 +236,7 @@ const ReminderRules = (props) => {
return (
{getLabel(111, "流量不足")}
-
+
{getLabel(111, "时提醒")}
{getLabel(111, "为确保智能算薪正常使用,设置建议:若每个月消耗流量10,000,则不足10,000时提醒,以此预留一个月时间续流量")}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
index 6961ded8..eb827a0a 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
@@ -38,7 +38,7 @@ class LedgerSalaryItemBaseInfo extends Component {
canDelete: true,
fieldId: key,
fieldName: showname,
- id: dataSource.length,
+ id: key,
salarySobId: "",
sortedIndex: dataSource.length
};
@@ -52,6 +52,9 @@ class LedgerSalaryItemBaseInfo extends Component {
render() {
const { dataSource, onChangeSortableList, onPreview } = this.props;
const { empFieldListOptions } = this.state;
+ const options = _.map(empFieldListOptions, o => ({
+ ...o, disabled: _.map(dataSource, g => g.fieldId).includes(o.key)
+ }));
return (
}>
@@ -77,7 +80,7 @@ class LedgerSalaryItemBaseInfo extends Component {
/>
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js
index 3d8b690a..a1bce538 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js
@@ -246,7 +246,13 @@ class LedgerSalaryItemTable extends Component {
{
title: "名称",
dataIndex: "name",
- key: "name"
+ key: "name",
+ render: (text, record) => {
+ const { salarySobId, salaryItemId } = record;
+ return
{text};
+ }
},
{
title:
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js
new file mode 100644
index 00000000..fa6242ce
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSearchComp.js
@@ -0,0 +1,91 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资账套查询
+ * Description:
+ * Date: 2023/11/27
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { Button } from "antd";
+import { WeaSwitch } from "comsMobx";
+import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
+import { searchConditions } from "../config";
+import { getTaxAgentSelectList } from "../../../apis/taxAgent";
+
+const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("ledgerStore")
+@observer
+class LedgerSearchComp extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ conditions: []
+ };
+ }
+
+ componentDidMount() {
+ this.getTaxAgentSelectList();
+ }
+
+ getTaxAgentSelectList = () => {
+ const { ledgerStore: { searchForm } } = this.props;
+ getTaxAgentSelectList().then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ conditions: _.map(searchConditions, o => {
+ return {
+ ...o,
+ items: _.map(o.items, j => {
+ if (getKey(j) === "taxAgentId") {
+ return {
+ ...j,
+ options: _.map(data, g => ({ key: g.id, showname: g.content }))
+ };
+ }
+ return { ...j };
+ })
+ };
+ })
+ }, () => searchForm.initFormFields(this.state.conditions));
+ }
+ });
+ };
+ formRender = (form, condition) => {
+ const { isFormInit } = form, formParams = form.getFormParams();
+ let group = [];
+ isFormInit && condition && condition.map(c => {
+ let items = [];
+ c.items.map(fields => {
+ items.push({
+ com: (
+
+
+ ),
+ colSpan: 2
+ });
+ });
+ group.push(
+ );
+ });
+ return group;
+ };
+
+ render() {
+ const { conditions } = this.state;
+ const { ledgerStore: { searchForm } } = this.props;
+ return (
+
+ {this.formRender(searchForm, conditions)}
+
+
+ );
+ }
+}
+
+export default LedgerSearchComp;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
index 17d18855..1395aed8 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -117,7 +117,7 @@ class LedgerSlide extends Component {
const { editId: salarySobId } = this.props;
const payload = {
empFields: _.map(empFields, it => {
- if (Object.prototype.toString.call(it.id) === "[object Number]") delete it.id;
+ if (!it.salarySobId) delete it.id;
return { ...it };
}),
itemGroups: _.map(_.filter(itemGroups, it => it.name !== "未分类"), item => {
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerTable.js
index 1ad0dbbb..efb7cca0 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerTable.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerTable.js
@@ -12,7 +12,7 @@ import { changeLedgerStatus, deleteLedger, getLedgerList } from "../../../apis/l
import CopyLedgerModal from "./copyLedgerModal";
import "./index.less";
-@inject("taxAgentStore")
+@inject("taxAgentStore", "ledgerStore")
@observer
class LedgerTable extends Component {
constructor(props) {
@@ -42,9 +42,9 @@ class LedgerTable extends Component {
}
getLedgerList = (extra = {}) => {
- const { name } = this.props;
+ const { ledgerStore: { searchForm } } = this.props;
const { pageInfo } = this.state;
- const payload = { name, ...pageInfo, ...extra };
+ const payload = { ...searchForm.getFormParams(), ...pageInfo, ...extra };
this.setState({ loading: true });
getLedgerList(payload).then(({ status, data }) => {
this.setState({ loading: false });
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
index 1a9f3717..0c56f799 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
@@ -27,6 +27,38 @@ export const copyConditions = [
defaultshow: true
}
];
+export const searchConditions = [
+ {
+ items: [
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["name"],
+ fieldcol: 24,
+ otherParams: {
+ placeholder: "请输入薪资账套名称"
+ },
+ lanId: 543431,
+ labelcol: 0,
+ value: "",
+ viewAttr: 2
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["taxAgentId"],
+ fieldcol: 24,
+ placeholder: "请选择个税扣缴义务人",
+ lanId: 543234,
+ label: "",
+ labelcol: 0,
+ value: "",
+ viewAttr: 2
+ }
+ ],
+ defaultshow: true
+ }
+];
export const categoryConditions = [
{
items: [
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.js b/pc4mobx/hrmSalary/pages/ledgerPage/index.js
index 9cef3433..c9246477 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/index.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.js
@@ -6,10 +6,11 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
-import { WeaInputSearch, WeaTop } from "ecCom";
+import { WeaTop } from "ecCom";
import { Button } from "antd";
import LedgerTable from "./components/ledgerTable";
import LedgerSlide from "./components/ledgerSlide";
+import LedgerSearchComp from "./components/ledgerSearchComp";
import "./index.less";
@inject("taxAgentStore")
@@ -60,11 +61,7 @@ class Index extends Component {
type="primary"
onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}
>新建,
- this.setState({ searchVal })}
- onSearch={() => this.setState({ doSearch: !doSearch })}
- />
+ this.setState({ doSearch: !doSearch })}/>
];
return (
-
+
button {
+ position: absolute;
+ right: -70px;
+ top: 0;
+ }
+
+ .wea-search-group, .wea-content {
+ padding: 0;
+ }
+
+ .wea-form-cell-wrapper {
+ & > div.wea-form-cell {
+ padding: 0;
+
+ .wea-form-item {
+ padding: 0;
+
+ .ant-select-selection-selected-value {
+ width: 150px !important;
+ }
+ }
+ }
+
+ & > div.wea-form-cell:first-child {
+ padding-right: 10px;
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js
index 69329ae3..d742b459 100644
--- a/pc4mobx/hrmSalary/pages/mobilePayroll/index.js
+++ b/pc4mobx/hrmSalary/pages/mobilePayroll/index.js
@@ -211,7 +211,6 @@ export default class MobilePayroll extends React.Component {
@@ -232,7 +231,6 @@ export default class MobilePayroll extends React.Component {
diff --git a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js
index 1e167175..574c315d 100644
--- a/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js
+++ b/pc4mobx/hrmSalary/pages/mySalary/mySalaryView.js
@@ -94,7 +94,7 @@ class MySalaryView extends Component {
diff --git a/pc4mobx/hrmSalary/pages/reportView/components/condition.js b/pc4mobx/hrmSalary/pages/reportView/components/condition.js
index 9d141953..b631fb0c 100644
--- a/pc4mobx/hrmSalary/pages/reportView/components/condition.js
+++ b/pc4mobx/hrmSalary/pages/reportView/components/condition.js
@@ -5,19 +5,19 @@ const { getLabel } = WeaLocaleProvider;
export const condition = [
{
items: [
- {
- colSpan: 2,
- checkbox: false,
- checkboxValue: false,
- conditionType: "SELECT",
- domkey: ["taxAgent"],
- fieldcol: 18,
- label: getLabel(111, "个税扣缴义务人"),
- labelcol: 6,
- options: [],
- multiple: true,
- viewAttr: 2
- },
+ // {
+ // colSpan: 2,
+ // checkbox: false,
+ // checkboxValue: false,
+ // conditionType: "SELECT",
+ // domkey: ["taxAgent"],
+ // fieldcol: 18,
+ // label: getLabel(111, "个税扣缴义务人"),
+ // labelcol: 6,
+ // options: [],
+ // multiple: true,
+ // viewAttr: 2
+ // },
{
browserConditionParam: {
completeParams: {},
diff --git a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js
index 35b36fa5..ce900020 100644
--- a/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js
+++ b/pc4mobx/hrmSalary/pages/reportView/components/statisticalMicroSettingsSlide.js
@@ -125,7 +125,7 @@ class StatisticalMicroSettingsSlide extends Component {
const { form, id, dimension, onClose } = this.props;
const [salaryStartMonth, salaryEndMonth] = salaryMonth;
const { department, employee, position, subCompany, taxAgent, ...extra } = form.getFormDatas();
- const { value, valueSpan } = taxAgent;
+ // const { value, valueSpan } = taxAgent;
if (!salaryEndMonth || !salaryStartMonth) {
this.refs.weaError.showError();
return;
@@ -137,7 +137,7 @@ class StatisticalMicroSettingsSlide extends Component {
employee: _.map(employee.valueObj, it => ({ id: it.id, name: it.name })),
// position: _.map(position.valueObj, it => ({ id: it.id, name: it.name })),
subCompany: _.map(subCompany.valueObj, it => ({ id: it.id, name: it.name })),
- taxAgent: value ? _.map(value.split(","), (it, idx) => ({ id: it, name: valueSpan.split(",")[idx] })) : [],
+ // taxAgent: value ? _.map(value.split(","), (it, idx) => ({ id: it, name: valueSpan.split(",")[idx] })) : [],
items: dataSource,
salaryEndMonth: salaryEndMonth + "-01",
salaryStartMonth: salaryStartMonth + "-01"
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js
index 2fccbadf..6a2bf87a 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js
@@ -5,7 +5,16 @@
* Date: 2022-09-19 18:15:32
*/
import React, { Component } from "react";
-import { WeaCheckbox, WeaFormItem, WeaLocaleProvider, WeaNewScroll, WeaSearchGroup, WeaSelect, WeaTop } from "ecCom";
+import {
+ WeaCheckbox,
+ WeaFormItem,
+ WeaInputNumber,
+ WeaLocaleProvider,
+ WeaNewScroll,
+ WeaSearchGroup,
+ WeaSelect,
+ WeaTop
+} from "ecCom";
import { message, Modal } from "antd";
import * as API from "../../apis/ruleconfig";
import "./index.less";
@@ -28,7 +37,8 @@ export default class Index extends Component {
matchRule: "",
confValue: "0",
withDrawTaxDeclaration: "0",
- extEmpsWitch: "0"
+ extEmpsWitch: "0",
+ salaryAcctFixedColumns: 0
},
showEncryptOperationButton: "",
progressVisible: false,
@@ -56,7 +66,7 @@ export default class Index extends Component {
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
taxDeclarationFunction: operateTaxDeclaration = "1", salaryArchiveDelete: confValue,
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
- OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0"
+ OPEN_APPLICATION_ENCRYPT: enctry = "1", extEmpsWitch = "0", salaryAcctFixedColumns = "0"
}
} = sysInfo;
// const { data: { ascOrDesc, orderRule } } = orderRules;
@@ -76,7 +86,7 @@ export default class Index extends Component {
showEncryptOperationButton,
saveParams: {
...saveParams,
- ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration,
+ ascOrDesc, orderRule, rule, enctry, matchRule, confValue, withDrawTaxDeclaration, salaryAcctFixedColumns,
extEmpsWitch, operateTaxDeclaration: (operateTaxDeclaration && operateTaxDeclaration !== "0") ? "1" : "0"
}
});
@@ -228,7 +238,7 @@ export default class Index extends Component {
});
};
saveSysOperate = (payload) => {
- API.saveSysOperate({ ...payload, confValue: this.state.saveParams.extEmpsWitch })
+ API.saveSysOperate({ ...payload })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(22619, "保存成功!"));
@@ -286,7 +296,15 @@ export default class Index extends Component {
case "extEmpsWitch":
this.saveSysOperate({
title: getLabel(111, "开启非系统人员"),
- module: "basic", confKey: key
+ module: "basic", confKey: key,
+ confValue: val
+ });
+ break;
+ case "salaryAcctFixedColumns":
+ this.saveSysOperate({
+ title: getLabel(111, "薪资核算固定列头数"),
+ module: "basic", confKey: key,
+ confValue: !_.isNil(val) ? val.toString() : "0"
});
break;
default:
@@ -323,7 +341,8 @@ export default class Index extends Component {
matchRule,
confValue,
withDrawTaxDeclaration,
- extEmpsWitch
+ extEmpsWitch,
+ salaryAcctFixedColumns
} = saveParams;
return (
@@ -386,6 +405,16 @@ export default class Index extends Component {
/>
+
+
+ this.setState({
+ saveParams: { ...saveParams, salaryAcctFixedColumns: v }
+ })}
+ onBlur={val => this.handleChange("salaryAcctFixedColumns", val)}
+ />
+
+
{
const { salaryItemStore: { setEditSlideVisible, initRequest } } = this.props;
if (e.key === "1") {
- setSystemItemVisible(true);
- } else if (e.key === "2") {
this.setState({ editable: true, isAdd: true });
initRequest();
setEditSlideVisible(true);
+ } else if (e.key === "2") {
+ setSystemItemVisible(true);
}
};
const menu = (
-
);
const renderRightOperation = () => {
@@ -236,7 +235,7 @@ export default class SalaryItem extends React.Component {
{
(showOperateBtn || showSalaryItemBtn) &&
handleMenuClick({ key: "1" })}
- style={{ marginRight: "10px" }}>{getLabel(111, "新增系统薪资项")}
+ style={{ marginRight: "10px" }}>{getLabel(111, "新增自定义薪资项")}
}
{
(showOperateBtn || showSalaryItemBtn) &&
@@ -265,7 +264,7 @@ export default class SalaryItem extends React.Component {
});
}
});
- }}>批量删除薪资项
+ }}>{getLabel(32136, "批量删除")}
}
{
this.setState({ searchValue: value });
diff --git a/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js b/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js
new file mode 100644
index 00000000..ec40beba
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js
@@ -0,0 +1,22 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资档案拓扑图
+ * Description:
+ * Date: 2023/10/19
+ */
+import React, { Component } from "react";
+
+class Index extends Component {
+ render() {
+ return (
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js
index 901517d1..ea3a33dc 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/columns.js
@@ -1,65 +1,43 @@
-export const columns = [
- {
- title: "账单月份",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "状态",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "社保核算人数",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "公积金核算人数",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "其他福利核算人数",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "公积金缴费",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "其他福利缴费",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "核算人",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "最后操作时间",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "备注",
- dataIndex: 'title',
- key: 'title',
- },
- {
- title: "操作",
- dataIndex: 'title',
- key: 'title',
- }
-]
-
-
-export const dataSource = [];
-
-
-
-
-
+export const socialAccountConditions = [
+ {
+ items: [
+ {
+ colSpan: 1,
+ conditionType: "MONTHPICKER",
+ domkey: ["billMonth"],
+ fieldcol: 14,
+ label: "账单月份",
+ lanId: 542443,
+ labelcol: 6,
+ value: "",
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "SELECT",
+ domkey: ["paymentOrganization"],
+ fieldcol: 14,
+ label: "个税扣缴义务人",
+ lanId: 537996,
+ labelcol: 6,
+ options: [],
+ rules: "required|string",
+ viewAttr: 3
+ },
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["remarks"],
+ fieldcol: 14,
+ label: "备注",
+ lanId: 536726,
+ labelcol: 6,
+ value: "",
+ viewAttr: 2
+ }
+ ],
+ defaultshow: true,
+ title: ""
+ }
+];
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js
index 6daf854d..fd21aba3 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/accountDialog.js
@@ -5,86 +5,73 @@
* LastEditTime: 2022-06-28 15:52:31
*/
import React, { Component } from "react";
-import { Button, Form, Input } from "antd";
-import { WeaDatePicker, WeaDialog, WeaSelect } from "ecCom";
+import { inject, observer } from "mobx-react";
+import { Button } from "antd";
+import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
+import { socialAccountConditions } from "../columns";
+import { getSearchs } from "../../../../util";
import "./index.less";
-const createForm = Form.create;
-const FormItem = Form.Item;
+const getLabel = WeaLocaleProvider.getLabel;
+const getKey = WeaTools.getKey;
+@inject("standingBookStore")
+@observer
class Accountdialog extends Component {
constructor(props) {
super(props);
- this.state = {};
+ this.state = { conditions: [] };
}
- handleSubmit = e => {
- const { onOk } = this.props;
- e.preventDefault();
- this.props.form.validateFields((errors, values) => {
- if (!!errors) {
- return;
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.init(nextProps);
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.standingBookStore.initAccountForm();
+ }
+
+ init = (props) => {
+ this.setState({
+ conditions: _.map(socialAccountConditions, item => ({
+ ...item, items: _.map(item.items, o => {
+ if (getKey(o) === "paymentOrganization") {
+ return {
+ ...o, label: getLabel(o.lanId, o.label),
+ options: this.props.options
+ };
+ }
+ return { ...o, label: getLabel(o.lanId, o.label) };
+ })
+ }))
+ }, () => props.standingBookStore.accountForm.initFormFields(this.state.conditions));
+ };
+
+ handleSubmit = () => {
+ const { onOk, standingBookStore: { accountForm } } = this.props;
+ accountForm.validateForm().then(f => {
+ if (f.isValid) {
+ onOk(accountForm.getFormParams());
+ } else {
+ f.showErrors();
}
- onOk(values);
});
};
render() {
- const { getFieldProps } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 7 },
- wrapperCol: { span: 12 }
- };
+ const { conditions } = this.state;
+ const { standingBookStore: { accountForm }, loading } = this.props;
return (
+
]}>
-
+ {getSearchs(accountForm, conditions, 1, false)}
);
}
}
-export default createForm()(Accountdialog);
+export default Accountdialog;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less
index c53709c0..2567a013 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/index.less
@@ -22,12 +22,38 @@
}
}
-.accountDialogWrapper{
- .wea-select,.ant-select,.ant-select-selection{
+.accountDialogWrapper {
+ .wea-dialog-body {
+ background: #f6f6f6;
+ padding: 16px;
+
+ .wea-search-group {
+ padding: 0;
+ background: #fff;
+ border: 1px solid #e5e5e5;
+ border-bottom: none;
+
+ .wea-form-item {
+ padding: 5px 16px;
+ border-bottom: 1px solid #e5e5e5;
+ }
+
+ .wea-content, .wea-form-cell {
+ padding: 0;
+ }
+ }
+ }
+
+ .wea-select, .ant-select, .ant-select-selection {
width: 100%;
}
- .ant-select-selection{
+
+ .ant-select-selection {
height: 30px;
border-radius: 0;
+
+ .ant-select-selection-selected-value {
+ max-width: 238px !important;
+ }
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
index 7e8a8af8..3c130802 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
@@ -1,7 +1,7 @@
import React from "react";
import { inject, observer } from "mobx-react";
import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd";
-import { WeaLocaleProvider, WeaNewScroll, WeaTop } from "ecCom";
+import { WeaLocaleProvider, WeaNewScroll, WeaSelect, WeaTop } from "ecCom";
import { renderNoright } from "../../../util";
import Accountdialog from "./components/accountDialog";
import AbnormalDrawer from "./components/abnormalDrawer";
@@ -25,7 +25,8 @@ export default class StandingBook extends React.Component {
selectedKey: "0",
tableParams: {
startTime: moment(new Date()).startOf("year").format("YYYY-MM"),
- endTime: moment(new Date()).startOf("month").format("YYYY-MM")
+ endTime: moment(new Date()).startOf("month").format("YYYY-MM"),
+ paymentOrganization: ""
},
current: 1,
dialogProps: {
@@ -344,6 +345,7 @@ export default class StandingBook extends React.Component {
progressVisible: false,
progress: 0
});
+ message.error(data.message);
return;
}
if (this.state.progress !== 100) {
@@ -423,7 +425,7 @@ export default class StandingBook extends React.Component {
tableStore
} = standingBookStore;
const { list, columns, total } = this.state.tableData;
- const { startTime, endTime } = this.state.tableParams;
+ const { startTime, endTime, paymentOrganization } = this.state.tableParams;
const { dialogProps, drawerProps } = this.state;
const abnormalColumns = _.map(
_.filter(tableStore.columns, (it) => it.hide && it.hide === "false"),
@@ -465,31 +467,32 @@ export default class StandingBook extends React.Component {
return (
-
} // 左侧图标
- iconBgcolor="#F14A2D" // 左侧图标背景色
- buttons={showOperateBtn ? rightBtns : []}
+
}
+ iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []}
>
-
-
账单月份:
-
{
- return current && endTime && current.getTime() > new Date(endTime).getTime();
- }}
- onChange={(val) => this.handleChangeMonth("startTime", val)}
- />
- 至
- {
- return current && startTime && current.getTime() < new Date(startTime).getTime();
- }}
- onChange={(val) => this.handleChangeMonth("endTime", val)}
- />
+
+
+
账单月份:
+
(current && endTime && current.getTime() > new Date(endTime).getTime())}
+ onChange={(val) => this.handleChangeMonth("startTime", val)}
+ />
+ 至
+ (current && startTime && current.getTime() < new Date(startTime).getTime())}
+ onChange={(val) => this.handleChangeMonth("endTime", val)}
+ />
+
+
+ {getLabel(537996, "个税扣缴义务人")}:
+ this.setState({
+ tableParams: { ...this.state.tableParams, paymentOrganization: val }
+ }, () => {
+ this.getCommonList({ ...this.state.tableParams, ...this.pageInfo });
+ })}
+ />
+
@@ -522,15 +525,7 @@ export default class StandingBook extends React.Component {
/>
-
- {dialogProps.visible && (
- this.handleClose()}
- onOk={this.handleOk}
- loading={loading}
- />
- )}
+ this.handleClose()} onOk={this.handleOk} loading={loading}/>
{/*核算进度条*/}
{
this.state.progressVisible &&
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less
index e36a4664..f306bdf9 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.less
@@ -38,14 +38,19 @@
}
}
- .billDateWrapper {
+ .filterWrapper {
display: flex;
align-items: center;
- height: 46px;
- padding: 0 16px;
- .to {
- padding: 0 8px;
+ .billDateWrapper {
+ display: flex;
+ align-items: center;
+ height: 46px;
+ padding: 0 16px;
+
+ .to {
+ padding: 0 8px;
+ }
}
}
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/addCompensationPersonnelDialog.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/addCompensationPersonnelDialog.js
new file mode 100644
index 00000000..34b7edb4
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/addCompensationPersonnelDialog.js
@@ -0,0 +1,223 @@
+/*
+ * Author: 黎永顺
+ * name: 添加补差人员
+ * Description:
+ * Date: 2023/11/28
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaDialog, WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaTableEdit } from "ecCom";
+import * as API from "../../../../apis/standingBook";
+import { Button, message } from "antd";
+import { addPersonConditions } from "../constant";
+import { getSearchs, toDecimal_n } from "../../../../util";
+import { convertData } from "./supplementarySlide";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("standingBookStore")
+@observer
+class AddCompensationPersonnelDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ conditions: [], paymentList: [
+ { title: getLabel(538967, "社保"), titleSign: "social", payment: [] },
+ { title: getLabel(538969, "公积金"), titleSign: "fund", payment: [] },
+ { title: getLabel(542518, "企业年金及其它福利"), titleSign: "other", payment: [] }
+ ], loading: false
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ const { standingBookStore: { addCPForm } } = nextProps;
+ this.setState({
+ conditions: _.map(addPersonConditions, o => {
+ return {
+ ...o,
+ items: _.map(o.items, g => ({
+ ...g, label: getLabel(g.lanId, g.label)
+ })),
+ title: getLabel(111, "补差人员")
+ };
+ })
+ }, () => addCPForm.initFormFields(this.state.conditions));
+ }
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.standingBookStore.initAddCPForm();
+ }
+
+ getBalancePaymentGroup = () => {
+ const { standingBookStore: { addCPForm }, paymentOrganization } = this.props;
+ const payload = { ...addCPForm.getFormParams(), paymentOrganization };
+ API.getBalancePaymentGroup(payload).then(({ status, data }) => {
+ if (status && !_.isEmpty(data)) {
+ this.setState({
+ paymentList: [
+ {
+ title: getLabel(538967, "社保"), titleSign: "social",
+ payment: convertData(_.filter(data, it => it.titleSign === "social"))
+ },
+ {
+ title: getLabel(538969, "公积金"), titleSign: "fund",
+ payment: convertData(_.filter(data, it => it.titleSign === "fund"))
+ },
+ {
+ title: getLabel(542518, "企业年金及其它福利"), titleSign: "other",
+ payment: convertData(_.filter(data, it => it.titleSign === "other"))
+ }
+ ]
+ });
+ } else {
+ message.error(getLabel(111, "数据不存在!"));
+ this.setState({
+ paymentList: [
+ { title: getLabel(538967, "社保"), titleSign: "social", payment: [] },
+ { title: getLabel(538969, "公积金"), titleSign: "fund", payment: [] },
+ { title: getLabel(542518, "企业年金及其它福利"), titleSign: "other", payment: [] }
+ ]
+ });
+ }
+ });
+ };
+ renderColumns = () => {
+ return [
+ {
+ title: getLabel(543262, "福利项"),
+ dataIndex: "insuranceName",
+ key: "insuranceName",
+ com: [
+ { label: "", type: "INPUT", viewAttr: 1, key: "insuranceName" }
+ ],
+ colSpan: 1,
+ width: "33%"
+ },
+ {
+ title: getLabel(543263, "个人缴纳金额"),
+ dataIndex: "custom",
+ key: "custom",
+ com: [
+ {
+ type: "custom",
+ key: "custom",
+ render: (text, record, index, onEdit) => (
+ onEdit({
+ record: { ...record, [`${record.insuranceId}_per`]: v },
+ index, key: "per", value: v
+ })}
+ />
+ )
+ }
+ ],
+ colSpan: 1,
+ width: "33%"
+ },
+ {
+ title: getLabel(543264, "单位缴纳金额"),
+ dataIndex: "custom",
+ key: "custom",
+ com: [
+ {
+ type: "custom",
+ key: "custom",
+ render: (text, record, index, onEdit) => (
+ onEdit({
+ record: { ...record, [`${record.insuranceId}_com`]: v },
+ index, key: "com", value: v
+ })}
+ />
+ )
+ }
+ ],
+ colSpan: 1,
+ width: "33%"
+ }
+ ];
+ };
+ save = () => {
+ const { standingBookStore: { addCPForm }, paymentOrganization, billMonth } = this.props;
+ const { paymentList } = this.state;
+ addCPForm.validateForm().then(f => {
+ if (f.isValid) {
+ const payload = {
+ billMonth, paymentOrganization, ...addCPForm.getFormParams(),
+ ...this.convertItemJSON(_.find(paymentList, i => i.titleSign === "social").payment, "social"),
+ ...this.convertItemJSON(_.find(paymentList, i => i.titleSign === "fund").payment, "fund"),
+ ...this.convertItemJSON(_.find(paymentList, i => i.titleSign === "other").payment, "other")
+ };
+ this.setState({ loading: true });
+ API.addNewBalance(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(30700, "操作成功!"));
+ this.props.onCancel(true);
+ } else {
+ message.error(errormsg);
+ }
+ }).catch(() => this.setState({ loading: false }));
+ } else {
+ f.showErrors();
+ }
+ });
+ };
+ convertItemJSON = (list, type) => {
+ let perJson = {}, comJson = {};
+ _.forEach(list, o => {
+ if (!_.isNil(o.per)) {
+ perJson = _.assign(perJson, { [o.insuranceId]: toDecimal_n(o.per, 2) });
+ }
+ if (!_.isNil(o.com)) {
+ comJson = _.assign(comJson, { [o.insuranceId]: toDecimal_n(o.com, 2) });
+ }
+ });
+ return { [`${type}PerJson`]: JSON.stringify(perJson), [`${type}ComJson`]: JSON.stringify(comJson) };
+ };
+ getRowSelection = (rowSelection) => {
+ let sel = { ...rowSelection };
+ sel.getCheckboxProps = (record) => {
+ return { disabled: true };
+ };
+ return sel;
+ };
+
+ render() {
+ const { conditions, paymentList, loading } = this.state;
+ const { standingBookStore: { addCPForm } } = this.props;
+ return (
+ {getLabel(826, "确定")}]}
+ style={{
+ width: 800, height: 600, minHeight: 200, minWidth: 380, maxHeight: "90%",
+ maxWidth: "90%", overflow: "hidden", transform: "translate(0px, 0px)"
+ }}
+ >
+
+
{getSearchs(addCPForm, conditions, 1, false, this.getBalancePaymentGroup)}
+ {
+ _.map(paymentList, item => (
+
+ this.setState({
+ paymentList: _.map(paymentList, o => {
+ if (o.titleSign === item.titleSign) {
+ return { ...o, payment };
+ }
+ return { ...o };
+ })
+ })}
+ />
+
+ ))
+ }
+
+
+ );
+ }
+}
+
+export default AddCompensationPersonnelDialog;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
index 0481abfb..2ceecea0 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
@@ -150,6 +150,67 @@
}
}
+//补差添加人员弹框
+.add-comp-per-dialog {
+ .wea-dialog-body {
+ overflow: hidden;
+
+ .add-comp-per-content {
+ height: 100%;
+ background: #F6F6F6;
+ padding: 16px;
+ overflow-y: auto;
+
+ .form {
+ margin-bottom: 10px;
+
+ .wea-search-group {
+ padding: 0;
+ background: #FFF;
+
+ .wea-title {
+ background: #f6f6f6;
+ border-bottom: none;
+
+ .text-elli {
+ font-weight: bold;
+ }
+ }
+
+ .wea-content {
+ padding: 0;
+
+ .wea-form-cell {
+ padding: 0;
+
+ .wea-form-item {
+ padding: 4px 16px;
+ border: 1px solid #e5e5e5;
+ }
+ }
+ }
+ }
+ }
+
+ .wea-search-group {
+ padding: 0;
+
+ .wea-title {
+ background: #f6f6f6;
+
+ .text-elli {
+ font-weight: bold;
+ }
+ }
+
+ .wea-table-edit {
+ background: #fff;
+ }
+ }
+ }
+ }
+}
+
//退差人员选择框
.regSelectWrapper {
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js
index 5765d55e..d6302145 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js
@@ -19,7 +19,7 @@ class InputPaymentAmount extends Component {
render: (text, record) => {
return (
this.handleChangeBaseItem(record, val, type, "per")}
/>
);
@@ -30,7 +30,7 @@ class InputPaymentAmount extends Component {
render: (text, record) => {
return (
this.handleChangeBaseItem(record, val, type, "com")}
/>
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
index c616f946..057f8379 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
@@ -14,23 +14,20 @@ import { calcPageNo } from "../../../../util";
import RegList from "./regList";
import RegEditDetial from "./regEditDetial";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
+import AddCompensationPersonnelDialog from "./addCompensationPersonnelDialog";
import "./index.less";
class MakeupDifference extends Component {
constructor(props) {
super(props);
this.state = {
- selectKey: [],
- fieldData: {},
+ selectKey: [], fieldData: {}, loading: { save: false }, importDiffModal: { visible: false },
returnEditPersonSlide: {
- title: "",
- editId: "",
- visible: false
+ title: "", editId: "", visible: false
},
- importDiffModal: {
- visible: false
- },
- loading: { save: false }
+ addPersonalDialog: {
+ visible: false, paymentOrganization: "", billMonth: ""
+ }
};
this.diffListRef = null;
this.regTopRef = null;
@@ -54,7 +51,7 @@ class MakeupDifference extends Component {
});
};
handleChangeOpt = (key) => {
- const { importDiffModal } = this.state;
+ const { importDiffModal, addPersonalDialog } = this.state;
const name = this.regTopRef.state.name;
const workcode = this.regTopRef.state.workcode;
const billMonth = getQueryString("billMonth");
@@ -77,6 +74,13 @@ class MakeupDifference extends Component {
case "search":
this.diffListRef.recessionList({ userName: name, workcode, current: 1 });
break;
+ case "add":
+ this.setState({
+ addPersonalDialog: {
+ ...addPersonalDialog, visible: true, paymentOrganization, billMonth
+ }
+ });
+ break;
default:
break;
}
@@ -99,7 +103,7 @@ class MakeupDifference extends Component {
render() {
const billMonth = getQueryString("billMonth");
- const { selectKey, importDiffModal, fieldData, returnEditPersonSlide } = this.state;
+ const { selectKey, importDiffModal, fieldData, returnEditPersonSlide, addPersonalDialog } = this.state;
return (
{/*编辑弹框*/}
+ {/*添加补差人员*/}
+ this.setState({
+ addPersonalDialog: {
+ ...addPersonalDialog,
+ visible: false
+ }
+ }, () => isRefresh && this.diffListRef.recessionList())}
+ />
{/*导入补差*/}
{
importDiffModal.visible &&
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
index c7b1120c..6dba0f8e 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
@@ -5,11 +5,14 @@
* Date: 2022/11/23
*/
import React, { Component } from "react";
-import { WeaInputNumber, WeaSearchGroup, WeaSlideModal, WeaTable } from "ecCom";
+import { WeaInputNumber, WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTable } from "ecCom";
import { message } from "antd";
import * as API from "../../../../apis/standingBook";
import SlideModalTitle from "../../../../components/slideModalTitle";
import { regColumns } from "../constant";
+import { toDecimal_n } from "../../../../util";
+
+const getLabel = WeaLocaleProvider.getLabel;
class RegEditDetial extends Component {
constructor(props) {
@@ -111,26 +114,26 @@ class RegEditDetial extends Component {
};
_.forEach(socialData.dataSource, item => {
if (item.personalPaymentAmount) {
- payload["socialPerJson"][item["insuranceId"]] = item.personalPaymentAmount;
+ payload["socialPerJson"][item["insuranceId"]] = toDecimal_n(item.personalPaymentAmount, 2);
}
if (item.companyPaymentAmount) {
- payload["socialComJson"][item["insuranceId"]] = item.companyPaymentAmount;
+ payload["socialComJson"][item["insuranceId"]] = toDecimal_n(item.companyPaymentAmount, 2);
}
});
_.forEach(foundData.dataSource, item => {
if (item.personalPaymentAmount) {
- payload["fundPerJson"][item["insuranceId"]] = item.personalPaymentAmount;
+ payload["fundPerJson"][item["insuranceId"]] = toDecimal_n(item.personalPaymentAmount, 2);
}
if (item.companyPaymentAmount) {
- payload["fundComJson"][item["insuranceId"]] = item.companyPaymentAmount;
+ payload["fundComJson"][item["insuranceId"]] = toDecimal_n(item.companyPaymentAmount, 2);
}
});
_.forEach(otherData.dataSource, item => {
if (item.personalPaymentAmount) {
- payload["otherPerJson"][item["insuranceId"]] = item.personalPaymentAmount;
+ payload["otherPerJson"][item["insuranceId"]] = toDecimal_n(item.personalPaymentAmount, 2);
}
if (item.companyPaymentAmount) {
- payload["otherComJson"][item["insuranceId"]] = item.companyPaymentAmount;
+ payload["otherComJson"][item["insuranceId"]] = toDecimal_n(item.companyPaymentAmount, 2);
}
});
_.forEach(Object.keys(payload), item => {
@@ -198,13 +201,13 @@ class RegEditDetial extends Component {
let socialSecurity = [], accumulationFund = [], otherBenefits = [];
const { data: result } = data;
_.map(result, it => {
- if (it.title.indexOf("社保") !== -1) {
+ if (it.titleSign === "social") {
socialSecurity.push(it);
}
- if (it.title.indexOf("公积金") !== -1) {
+ if (it.titleSign === "fund") {
accumulationFund.push(it);
}
- if (it.title.indexOf("其他") !== -1) {
+ if (it.titleSign === "other") {
otherBenefits.push(it);
}
});
@@ -226,9 +229,9 @@ class RegEditDetial extends Component {
result = _.map(_.uniqWith(fieldItems, _.isEqual), item => {
let obj = { benefits: item };
_.forEach(data, it => {
- if (item === it.insuranceName && it.paymentScope === "个人") {
+ if (item === it.insuranceName && it.paymentScopeSign === "per") {
obj = _.assign(obj, { ...it, personalPaymentAmount: it.insuranceValue });
- } else if (item === it.insuranceName && it.paymentScope === "公司") {
+ } else if (item === it.insuranceName && it.paymentScopeSign === "com") {
obj = _.assign(obj, { ...it, companyPaymentAmount: it.insuranceValue });
}
});
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
index 8971946d..72acc3f1 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
@@ -1,8 +1,10 @@
import React, { Component } from "react";
import { Button } from "antd";
-import { WeaFormItem, WeaHelpfulTip, WeaInput, WeaSearchGroup, WeaTab } from "ecCom";
+import { WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom";
import { getQueryString } from "../../../../util/url";
+const getLabel = WeaLocaleProvider.getLabel;
+
class RegTop extends Component {
constructor(props) {
super(props);
@@ -38,13 +40,16 @@ class RegTop extends Component {
if (!type) {
const [dom1, ...extra] = dom;
const domBtn = regtopType === "regression" ?
- :
- ;
+ [] :
+ [
+ ,
+
+ ];
dom = [
dom1,
, domBtn, ...extra
+ , ...domBtn, ...extra
];
}
return dom;
@@ -69,7 +74,7 @@ class RegTop extends Component {
{
title: `账单月份: ${billMonth}`,
viewcondition: "1"
- },
+ }
]}
keyParam="viewcondition" selectedKey="" advanceHeight={200} searchsAd={this.getSearchs()}
searchType={["base", "advanced"]} showSearchAd={showSearchAd}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
index 561a8242..9a0c7a78 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js
@@ -7,7 +7,7 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { message, Modal } from "antd";
-import { WeaFormItem, WeaSearchGroup, WeaSelect, WeaSlideModal } from "ecCom";
+import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaSelect, WeaSlideModal } from "ecCom";
import SlideModalTitle from "../../../../components/slideModalTitle";
import { Picker, SelectWithAll } from "./regAddEmployee";
import { Browser } from "../../../dataAcquisition/addItems";
@@ -15,6 +15,9 @@ import { getPaymentGroup, getSupplementPaymentForm, siaccountSupplementarySave }
import "./index.less";
import BusinessAccounting from "./businessAccounting";
import InputPaymentAmount from "./inputPaymentAmount";
+import { toDecimal_n } from "../../../../util";
+
+const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
@@ -88,8 +91,12 @@ class SupplementarySlide extends Component {
_.map(inputPaymentAmount[item], child => {
const key = child.insuranceId, valuePer = child[`${child.insuranceId}_per`],
valueCom = child[`${child.insuranceId}_com`];
- _.assign(payload[`${item}PerString`], { [key]: valuePer ? valuePer.toString() : "0" });
- _.assign(payload[`${item}ComString`], { [key]: valueCom ? valueCom.toString() : "0" });
+ if (!child.perDisabled) {
+ _.assign(payload[`${item}PerString`], { [key]: toDecimal_n(valuePer, 2) || "0" });
+ }
+ if (!child.comDisabled) {
+ _.assign(payload[`${item}ComString`], { [key]: toDecimal_n(valueCom, 2) || "0" });
+ }
});
});
for (let i in payload) {
@@ -97,22 +104,6 @@ class SupplementarySlide extends Component {
}
return payload;
};
- convertData = (dataSource) => {
- let endList = [];
- _.values(_.groupBy(dataSource, "insuranceName")).forEach((itemList) => {
- let data = {};
- itemList.forEach(d => {
- const perKey = `${d.insuranceId}_per`, comKey = `${d.insuranceId}_com`;
- data = _.assign(data, {
- ...d,
- [perKey]: "",
- [comKey]: ""
- });
- });
- return endList.push(data);
- });
- return endList;
- };
handleSaveSupplementSalary = () => {
const { billMonth, paymentOrganization, onCancel } = this.props;
const { baseInfo } = this.state;
@@ -185,9 +176,9 @@ class SupplementarySlide extends Component {
if (status) {
this.setState({
businessAccounting: {
- socialSecurityBase: _.filter(data, it => it.title === "社保"),
- fundBase: _.filter(data, it => it.title === "公积金"),
- otherBase: _.filter(data, it => it.title === "企业年金及其它福利")
+ socialSecurityBase: _.filter(data, it => it.titleSign === "social"),
+ fundBase: _.filter(data, it => it.titleSign === "fund"),
+ otherBase: _.filter(data, it => it.titleSign === "other")
}
});
} else {
@@ -214,9 +205,9 @@ class SupplementarySlide extends Component {
if (status) {
this.setState({
inputPaymentAmount: {
- socialPayment: this.convertData(_.filter(data, it => it.title === "社保")),
- fundPayment: this.convertData(_.filter(data, it => it.title === "公积金")),
- otherPayment: this.convertData(_.filter(data, it => it.title === "企业年金及其它福利"))
+ socialPayment: convertData(_.filter(data, it => it.titleSign === "social")),
+ fundPayment: convertData(_.filter(data, it => it.titleSign === "fund")),
+ otherPayment: convertData(_.filter(data, it => it.titleSign === "other"))
}
});
} else {
@@ -348,6 +339,16 @@ class SupplementarySlide extends Component {
...baseInfo,
supplementType,
historyMonth: ""
+ },
+ businessAccounting: {
+ socialSecurityBase: [],
+ fundBase: [],
+ otherBase: []
+ },
+ inputPaymentAmount: {
+ socialPayment: [],
+ fundPayment: [],
+ otherPayment: []
}
}, () => this.handleChangeItem());
}
@@ -431,3 +432,22 @@ export const SelectDetailType = payload => {
);
};
+
+export const convertData = (dataSource) => {
+ let endList = [];
+ _.values(_.groupBy(dataSource, "insuranceName")).forEach((itemList) => {
+ let data = {};
+ itemList.forEach(d => {
+ const perKey = `${d.insuranceId}_per`, comKey = `${d.insuranceId}_com`;
+ data = _.assign(data, {
+ ...d,
+ [perKey]: "",
+ [comKey]: "",
+ perDisabled: !_.includes(_.map(itemList, o => o.paymentScopeSign), "per"),
+ comDisabled: !_.includes(_.map(itemList, o => o.paymentScopeSign), "com")
+ });
+ });
+ return endList.push(data);
+ });
+ return endList;
+};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js
index 6b2634c3..276072e3 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/constant.js
@@ -1,50 +1,56 @@
-export const unArchiveTabs = [
- {
- title: "正常缴纳",
- viewcondition: "NORMAL",
- },
- {
- title: "异动清单",
- viewcondition: "LIST",
- },
- {
- title: "补缴",
- viewcondition: "PAY",
- },
- {
- title: "总览",
- viewcondition: "OVERVIEW",
- },
-];
-export const archiveTabs = [
- {
- title: "正常缴纳",
- viewcondition: "NORMAL",
- },
- {
- title: "补缴",
- viewcondition: "PAY",
- },
- {
- title: "总览",
- viewcondition: "OVERVIEW",
- },
-];
-
export const regColumns = [
{
- title: '福利项',
- dataIndex: 'benefits',
- key: 'benefits',
+ title: "福利项",
+ dataIndex: "benefits",
+ key: "benefits"
},
{
- title: '个人缴纳金额',
- dataIndex: 'personalPaymentAmount',
- key: 'personalPaymentAmount',
+ title: "个人缴纳金额",
+ dataIndex: "personalPaymentAmount",
+ key: "personalPaymentAmount"
},
{
- title: '单位缴纳金额',
- dataIndex: 'companyPaymentAmount',
- key: 'companyPaymentAmount',
- },
+ title: "单位缴纳金额",
+ dataIndex: "companyPaymentAmount",
+ key: "companyPaymentAmount"
+ }
+];
+export const addPersonConditions = [
+ {
+ items: [
+ {
+ colSpan: 1,
+ conditionType: "BROWSER",
+ browserConditionParam: {
+ completeParams: {},
+ conditionDataParams: {},
+ dataParams: {},
+ destDataParams: {},
+ hasAddBtn: false,
+ hasAdvanceSerach: true,
+ idSeparator: ",",
+ isAutoComplete: 1,
+ isDetail: 0,
+ isMultCheckbox: false,
+ isSingle: true,
+ linkUrl: "/hrm/resource/HrmResource.jsp?id=",
+ pageSize: 10,
+ quickSearchName: "",
+ replaceDatas: [],
+ title: "",
+ type: "1"
+ },
+ domkey: ["employeeId"],
+ fieldcol: 14,
+ label: "对象",
+ lanId: 106,
+ labelcol: 7,
+ rules: "required|string",
+ viewAttr: 3,
+ value: ""
+ }
+ ],
+ defaultshow: true,
+ title: ""
+ }
];
diff --git a/pc4mobx/hrmSalary/pages/topologyMap/index.js b/pc4mobx/hrmSalary/pages/topologyMap/index.js
new file mode 100644
index 00000000..448cfb61
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/topologyMap/index.js
@@ -0,0 +1,66 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资项目拓扑图-查看
+ * Description:
+ * Date: 2023/10/26
+ */
+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;
+
+class Index extends Component {
+ componentDidMount() {
+ window.addEventListener("message", this.handleReceive, false);
+ }
+
+ handleReceive = async ({ data }) => {
+ const { type } = data;
+ if (type === "initDiagram") this.postMessageToChild();
+ };
+
+ componentWillUnmount() {
+ window.removeEventListener("message", this.handleReceive, false);
+ }
+
+ postMessageToChild = async () => {
+ const i18n = { "薪资项目": getLabel(542362, "薪资项目"), "公式": getLabel(18125, "公式") };
+ const { params: payload = {} } = this.props;
+ 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, 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 (
+
+
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/stores/StandingBook.js b/pc4mobx/hrmSalary/stores/StandingBook.js
index d74c1c5c..1288da0f 100644
--- a/pc4mobx/hrmSalary/stores/StandingBook.js
+++ b/pc4mobx/hrmSalary/stores/StandingBook.js
@@ -7,6 +7,12 @@ import * as API from "../apis/standingBook";
const { TableStore } = WeaTableNew;
export class StandingBookStore {
+ @observable accountForm = new WeaForm(); // 社保台账核算Form
+ @action initAccountForm = () => this.accountForm = new WeaForm();
+ @observable addCPForm = new WeaForm(); // 社保台账详情页面,添加补差人员form
+ @action initAddCPForm = () => this.addCPForm = new WeaForm();
+
+
@observable tableStore = new TableStore(); // new table
@observable form = new WeaForm(); // nrew 一个form
@observable ocForm = new WeaForm(); // 社保福利线下对比form
diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js
index d1a0860c..8dc46dc8 100644
--- a/pc4mobx/hrmSalary/stores/ledger.js
+++ b/pc4mobx/hrmSalary/stores/ledger.js
@@ -12,6 +12,7 @@ export class LedgerStore {
//重构薪资账套
@observable copyForm = new WeaForm(); // 复制form
@observable categoryForm = new WeaForm(); // 新增分类form
+ @observable searchForm = new WeaForm(); // 查询form
/*******************************************************/
diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js
index 5040d1dc..019743c0 100644
--- a/pc4mobx/hrmSalary/util/index.js
+++ b/pc4mobx/hrmSalary/util/index.js
@@ -134,7 +134,7 @@ export const padding0 = (num, length) => {
};
export const toDecimal_n = (x, num) => {
if (isNaN(parseFloat(x))) return false;
- let f = Math.round(x * 100) / 100;
+ let f = Math.round(x * Math.pow(10, num)) / Math.pow(10, num);
let s = f.toString();
let rs = s.indexOf(".");
if (rs < 0) {