+ {
+ accountExceptInfo &&
+
+ }
{getLabel(542604, "薪资所属月")}:
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
index 3e2cee5f..5acfc546 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
@@ -39,14 +39,18 @@ class Index extends Component {
handleMenuClick = ({ key }) => {
switch (key) {
case "calc_selected":
- console.log(this.calc);
- // this.doCacl(key);
+ const { selectedRowKeys } = this.calc.calcTableRef.wrappedInstance.state;
+ if (_.isEmpty(selectedRowKeys)) {
+ message.warning(getLabel(543303, "请选择表格数据!"));
+ return;
+ }
+ this.doCacl(key, selectedRowKeys);
break;
default:
break;
}
};
- doCacl = (key) => {
+ doCacl = (key, selectedRowKeys = []) => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(543544, "点击核算,公式项将按照公式逻辑核算,核算结果将覆盖原数据"),
@@ -54,12 +58,12 @@ class Index extends Component {
const { routeParams: { salaryAcctRecordId } } = this.props;
this.setState({ progress: 0 });
let payload = { salaryAcctRecordId };
- if (key === "calc_selected") payload = _.assign(payload, { ids: this.state.accountIds });
+ if (key === "calc_selected") payload = _.assign(payload, { ids: selectedRowKeys });
acctresultAccounting(payload).then(() => {
this.setState({ progressVisible: true });
if (this.timer) clearInterval(this.timer);
this.timer = setInterval(() => {
- getCalculateProgress(this.id).then(data => {
+ getCalculateProgress(salaryAcctRecordId).then(({ data }) => {
let progress = data.progress;
if (progress === 1 && this.timer) {
clearInterval(this.timer);
@@ -81,12 +85,11 @@ class Index extends Component {
}
this.setState({ progress: Number(progress) * 100 });
});
- }, 800);
+ }, 1000);
});
}
});
};
-
handleMoreMenuClick = ({ key }) => {
switch (key) {
case "exportAll":
@@ -134,14 +137,14 @@ class Index extends Component {
return reqBtns;
};
renderContent = () => {
- const { selectedKey } = this.state;
+ const { selectedKey, accountExceptInfo } = this.state;
let dom = null;
switch (selectedKey) {
case "person":
dom =
;
break;
case "calc":
- dom =
this.calc = dom}/>;
+ dom = this.calc = dom}/>;
break;
default:
break;
@@ -170,7 +173,7 @@ class Index extends Component {
{
- this.setState({ progressVisible: false, progress: 0 }, () => this.timer = null);
+ this.setState({ progressVisible: false, progress: 0 }, () => clearInterval(this.timer));
}}
progress={parseFloat(progress).toFixed(2)}
/>
From 98054b3c8d1204d9c732e080082a772e984679db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 18 Sep 2023 15:05:25 +0800
Subject: [PATCH 09/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/salaryEditCalc/editCalcTable.js | 2 +-
.../doCalc/components/salaryEditCalc/index.js | 18 ++++++++++++------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index 5a637906..deb70763 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -140,7 +140,7 @@ class EditCalcTable extends Component {
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
const { pageInfo, selectedRowKeys } = this.state;
this.postMessageToChild({
- dataSource, pageInfo, selectedRowKeys,
+ dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell,
columns: _.map(traverse(columns), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false }))
});
});
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
index dffbd55d..42b19d5d 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js
@@ -8,6 +8,7 @@ import React, { Component } from "react";
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
import { Alert } from "antd";
import { getColumnDesc, getSalarySobCycle } from "../../../../../apis/calculate";
+import { sysConfCodeRule } from "../../../../../apis/ruleconfig";
import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel";
import EditCalcTable from "./editCalcTable";
import SalaryMonthTip from "../salaryMonthTip";
@@ -21,7 +22,7 @@ class Index extends Component {
super(props);
this.state = {
salarySobCycle: {}, showSearchAd: false,
- columnDesc: {}, formulaTd: ""
+ columnDesc: {}, formulaTd: "", showTotalCell: false
};
}
@@ -36,18 +37,21 @@ class Index extends Component {
};
init = async () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
- const [salarySobCycle, columnDesc] = await Promise.all([getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId })]);
- if (salarySobCycle.status && columnDesc.status) {
+ const [salarySobCycle, columnDesc, confCode] = await Promise.all([
+ getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId }),
+ sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })
+ ]);
+ if (salarySobCycle.status && columnDesc.status && confCode.status) {
this.setState({
salarySobCycle: salarySobCycle.data,
- columnDesc: columnDesc.data
+ columnDesc: columnDesc.data, showTotalCell: confCode.data === "1"
});
}
};
handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex });
render() {
- const { salarySobCycle, showSearchAd, formulaTd, columnDesc } = this.state;
+ const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state;
const { accountExceptInfo } = this.props;
const formulaObj = _.get(columnDesc, [formulaTd]) || {};
return (
@@ -81,7 +85,9 @@ class Index extends Component {
onAdSearch={this.onAdSearch}
/>
-
this.calcTableRef = dom} {...this.props} onShowFormulaTd={this.handleShowFormulaTa}/>
+ this.calcTableRef = dom}
+ {...this.props} showTotalCell={showTotalCell}
+ onShowFormulaTd={this.handleShowFormulaTa}/>
);
}
From 1c7ad4e8715cf302f5fb3868117da43d086c94de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 18 Sep 2023 16:59:21 +0800
Subject: [PATCH 10/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../doCalc/components/salaryEditCalc/editCalcTable.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index deb70763..e5f8e66f 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -115,7 +115,8 @@ class EditCalcTable extends Component {
"锁定的项目值": getLabel(543647, "锁定的项目值"),
"当前状态锁定,点击解锁": getLabel(111, "当前状态锁定,点击解锁"),
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
- "共": getLabel(18609, "共"), "条": getLabel(18256, "条")
+ "共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
+ "总计": getLabel(523, "总计")
};
const childFrameObj = document.getElementById("atdTable");
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
@@ -139,8 +140,9 @@ class EditCalcTable extends Component {
const { list: dataSource, pageNum: current, pageSize, total } = list;
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
const { pageInfo, selectedRowKeys } = this.state;
+ const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
this.postMessageToChild({
- dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell,
+ dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
columns: _.map(traverse(columns), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false }))
});
});
From 1ee6650234e36a09ed21bde9760826766ce6a7ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 18 Sep 2023 18:42:27 +0800
Subject: [PATCH 11/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../customCalcExportDialog/index.js | 138 ++++++++++++++++++
.../salaryEditCalc/editCalcTable.js | 3 +-
.../hrmSalary/pages/calculate/doCalc/index.js | 33 ++++-
3 files changed, 169 insertions(+), 5 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js
new file mode 100644
index 00000000..9d76e00f
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/customCalcExportDialog/index.js
@@ -0,0 +1,138 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资核算-自定义导出
+ * Description:
+ * Date: 2023/9/18
+ */
+
+import React, { Component } from "react";
+import { Button, Col, message, Row } from "antd";
+import { inject, observer } from "mobx-react";
+import { WeaCheckbox, WeaDialog, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
+import { customCacheExportField } from "../../../../../apis/calculate";
+import { convertToUrlString } from "../../../../../util/url";
+
+const { getLabel } = WeaLocaleProvider;
+
+@inject("calculateStore")
+@observer
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ itemsCheckeds: [],
+ showOnlyChecked: false
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ this.setState({
+ itemsCheckeds: !_.isEmpty(nextProps.checkItems) ? nextProps.checkItems : []
+ });
+ }
+ }
+
+ customExportClick = () => {
+ const { calculateStore: { ECSearchForm }, salaryAcctRecordId } = this.props;
+ const { itemsCheckeds } = this.state;
+ customCacheExportField({ salaryItems: _.map(itemsCheckeds, it => it.toString()) }).then(({ status, errorMsg }) => {
+ if (status) {
+ const { consolidatedTaxation = "0", ...extra } = ECSearchForm.getFormParams();
+ const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation };
+ window.open(
+ `/api/bs/hrmsalary/salaryacct/acctresult/exportWithCustomFields?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}&salaryItemIds=${itemsCheckeds.join(",")}`
+ );
+ } else {
+ message.error(errorMsg);
+ }
+ });
+ };
+ handleShowOnlyChecked = (showOnlyChecked) => this.setState({ showOnlyChecked: !!Number(showOnlyChecked) });
+ handleSelectGroupAll = (groupId, checked) => {
+ const { itemsCheckeds } = this.state;
+ const { itemsByGroup } = this.props;
+ _.map(itemsByGroup, item => {
+ if (item.salarySobItemGroupId === groupId) {
+ if (!!Number(checked)) {
+ this.setState({
+ itemsCheckeds: [...itemsCheckeds, ..._.map(item.salaryItems, child => child.salaryItemId)]
+ });
+ } else {
+ this.setState({
+ itemsCheckeds: _.differenceWith(itemsCheckeds, _.map(item.salaryItems, child => child.salaryItemId), _.isEqual)
+ });
+ }
+ }
+ });
+ };
+
+ render() {
+ const { showOnlyChecked, itemsCheckeds } = this.state;
+ const { itemsByGroup } = this.props;
+ let dataSource = _.map(itemsByGroup, item => {
+ return {
+ ...item,
+ salaryItems: _.map(item.salaryItems, child => {
+ return { ...child, checked: itemsCheckeds.includes(child.salaryItemId) };
+ })
+ };
+ });
+ if (showOnlyChecked) {
+ dataSource = _.map(dataSource, item => {
+ return { ...item, salaryItems: _.filter(item.salaryItems, it => !!it.checked) };
+ });
+ }
+ return (
+
{getLabel(17416, "导出")},
+
+ ]}
+ bottomLeft={}
+ >
+ {
+ _.map(dataSource, item => {
+ const { salarySobItemGroupName, salaryItems, salarySobItemGroupId } = item;
+ const value = _.every(salaryItems, it => !!it.checked) ? "1" : "0";
+ return this.handleSelectGroupAll(salarySobItemGroupId, val)}/>}>
+
+ {
+ !_.isEmpty(salaryItems) ?
+ _.map(salaryItems, it => {
+ const { salaryItemId, salaryItemName, checked } = it;
+ return
+ this.setState({ itemsCheckeds: _.xorWith(itemsCheckeds, [salaryItemId], _.isEqual) })}/>
+ ;
+ }) : {getLabel(83553, "暂无数据")}
+ }
+
+ ;
+ })
+ }
+
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
index e5f8e66f..07b25888 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js
@@ -116,7 +116,8 @@ class EditCalcTable extends Component {
"当前状态锁定,点击解锁": getLabel(111, "当前状态锁定,点击解锁"),
"当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"),
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
- "总计": getLabel(523, "总计")
+ "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"),
+ "批量锁定": getLabel(111, "批量锁定")
};
const childFrameObj = document.getElementById("atdTable");
childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
index 5acfc546..4a7eb201 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
@@ -9,12 +9,13 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import Layout from "./layout";
-import { acctresultAccounting, getCalculateProgress } from "../../../apis/calculate";
+import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate";
import AdvanceInputBtn from "./components/advanceInputBtn";
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
import SalaryEditCalc from "./components/salaryEditCalc";
-import { convertToUrlString } from "../../../util/url";
import ProgressModal from "../../../components/progressModal";
+import CustomCalcExportDialog from "./components/customCalcExportDialog";
+import { convertToUrlString } from "../../../util/url";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@@ -26,7 +27,9 @@ class Index extends Component {
super(props);
this.state = {
selectedKey: "person", progressVisible: false, progress: 0,
+ customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
accountExceptInfo: "" //核算报错信息,
+
};
this.calc = null;
this.timer = null;
@@ -91,14 +94,27 @@ class Index extends Component {
});
};
handleMoreMenuClick = ({ key }) => {
+ const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props;
switch (key) {
case "exportAll":
- const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props;
const { consolidatedTaxation, ...extra } = ECSearchForm.getFormParams();
const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation };
const url = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}`;
window.open(`${window.ecologyContentPath || ""}${url}`, "_blank");
break;
+ case "export_custom":
+ getExportField({ salaryAcctRecordId }).then(({ status, data }) => {
+ if (status) {
+ const { checkItems, itemsByGroup } = data;
+ this.setState({
+ customExpDialog: {
+ ...this.state.customExpDialog, visible: true, salaryAcctRecordId,
+ checkItems, itemsByGroup
+ }
+ });
+ }
+ });
+ break;
default:
break;
}
@@ -157,7 +173,7 @@ class Index extends Component {
{ key: "person", title: getLabel(543547, "人员确认") },
{ key: "calc", title: getLabel(538011, "薪资核算") }
];
- const { selectedKey, progressVisible, progress } = this.state;
+ const { selectedKey, progressVisible, progress, customExpDialog } = this.state;
return (
@@ -178,6 +194,15 @@ class Index extends Component {
progress={parseFloat(progress).toFixed(2)}
/>
}
+ {/* 薪资核算-自定义导出*/}
+ {
+ this.setState({
+ customExpDialog: { ...customExpDialog, visible: false }
+ });
+ }}
+ />
From 9084c20717d20d3001bbcb249e1bc020909355df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 18 Sep 2023 19:34:16 +0800
Subject: [PATCH 12/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/salaryEditCalcImport/index.js | 65 +++++++++++++++++++
.../hrmSalary/pages/calculate/doCalc/index.js | 18 ++++-
2 files changed, 82 insertions(+), 1 deletion(-)
create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
new file mode 100644
index 00000000..c2b370bf
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
@@ -0,0 +1,65 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资核算-导入
+ * Description:
+ * Date: 2023/9/18
+ */
+import React, { Component } from "react";
+import { WeaLocaleProvider } from "ecCom";
+import { Badge, Button } from "antd";
+import ImportDialog from "../../../../../components/importDialog";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class Index extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ salaryItemIds: "", //选择的导入表单项
+ importDialog: {
+ visible: false, title: "", nextloading: false,
+ link: "", importResult: {}, imageId: ""
+ }
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible) {
+ this.setState({
+ importDialog: {
+ ...this.state.importDialog,
+ visible: nextProps.visible, title: nextProps.title
+ }
+ });
+ }
+ }
+
+ /*
+ * Author: 黎永顺
+ * Description:表单选项
+ * Params:
+ * Date: 2023/9/18
+ */
+ renderFormComponent = () => {
+ return
+
+ ;
+ };
+
+ render() {
+ const { importDialog } = this.state;
+ return (
+
this.setState(({
+ importDialog: { ...importDialog, importResult: {}, imageId: "" }
+ }))}
+ nextCallback={imageId => this.handleImport({ imageId })}
+ />
+ );
+ }
+}
+
+export default Index;
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
index 4a7eb201..17a2daf6 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
@@ -15,6 +15,7 @@ import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
import SalaryEditCalc from "./components/salaryEditCalc";
import ProgressModal from "../../../components/progressModal";
import CustomCalcExportDialog from "./components/customCalcExportDialog";
+import SalaryEditCalcImport from "./components/salaryEditCalcImport";
import { convertToUrlString } from "../../../util/url";
import "./index.less";
@@ -28,6 +29,7 @@ class Index extends Component {
this.state = {
selectedKey: "person", progressVisible: false, progress: 0,
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
+ salaryImpDialog: { visible: false, title: "" },
accountExceptInfo: "" //核算报错信息,
};
@@ -115,6 +117,11 @@ class Index extends Component {
}
});
break;
+ case "import":
+ this.setState({
+ salaryImpDialog: { ...this.state.salaryImpDialog, visible: true, title: getLabel(111, "薪资导入") }
+ });
+ break;
default:
break;
}
@@ -173,7 +180,7 @@ class Index extends Component {
{ key: "person", title: getLabel(543547, "人员确认") },
{ key: "calc", title: getLabel(538011, "薪资核算") }
];
- const { selectedKey, progressVisible, progress, customExpDialog } = this.state;
+ const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
return (
@@ -203,6 +210,15 @@ class Index extends Component {
});
}}
/>
+ {/* 薪资核算-导入*/}
+ {
+ this.setState({
+ salaryImpDialog: { ...salaryImpDialog, visible: false }
+ });
+ }}
+ />
From 2c56e8dc065f8c13271f450cc1fa1d78d50624ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 25 Sep 2023 09:43:03 +0800
Subject: [PATCH 13/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../doCalc/components/salaryEditCalcImport/index.js | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
index c2b370bf..44fa954e 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
@@ -41,10 +41,12 @@ class Index extends Component {
* Date: 2023/9/18
*/
renderFormComponent = () => {
- return
-
- ;
+ return
+
+
+
+
;
};
render() {
From ff3dd0ea604a5d2d0124afeaeca689fdd325dd5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 25 Sep 2023 15:35:11 +0800
Subject: [PATCH 14/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../importDialog/components/impStep1.js | 11 +-
.../importDialog/components/impStep2.js | 4 +-
.../components/salaryEditCalcImport/index.js | 129 ++++++++++++++++--
.../hrmSalary/pages/calculate/doCalc/index.js | 10 +-
4 files changed, 132 insertions(+), 22 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js
index 6ab09b3e..209125fb 100644
--- a/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js
+++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep1.js
@@ -61,8 +61,15 @@ class ImpStep1 extends Component {
{getLabel(27577, "操作步骤")}
{`1. ${getLabel(30907, "第一步")},${getLabel(543205, "请选择导出的Excel文件或")}`}
- {getLabel(543207, "点击这里下载模板")}
+ {
+ typeof this.props.link === "string" ?
+ {getLabel(543207, "点击这里下载模板")} :
+ {getLabel(543207, "点击这里下载模板")}
+ }
+
{this.props.exportDataDom}
{`2. ${getLabel(543211, "第二步")},${getLabel(543212, "请一定要确定Excel文档中的格式是模板中的格式")},${getLabel(543213, "没有被修改掉")};`}
diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js
index 8a7373d4..71c6e099 100644
--- a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js
+++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js
@@ -21,8 +21,8 @@ class ImpStep2 extends Component {
}
init = () => {
- const { previewUrl, imageId } = this.props;
- const payload = { imageId };
+ const { previewUrl, imageId, extraPreview = {} } = this.props;
+ const payload = { imageId, ...extraPreview };
this.setState({ loading: true });
postFetch(previewUrl, payload).then(({ status, data }) => {
this.setState({ loading: false });
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
index 44fa954e..c41f294f 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
@@ -5,9 +5,12 @@
* Date: 2023/9/18
*/
import React, { Component } from "react";
-import { WeaLocaleProvider } from "ecCom";
-import { Badge, Button } from "antd";
+import { WeaCheckbox, WeaLocaleProvider } from "ecCom";
+import { Badge, Button, message } from "antd";
import ImportDialog from "../../../../../components/importDialog";
+import { cacheImportField, getImportField, importAcctResult } from "../../../../../apis/calculate";
+import AddHeaderFieldsModal from "../../../../calculateDetail/acctResult/importModal/addHeaderFieldsModal";
+import { convertToUrlString, getURLParameters } from "../../../../../util/url";
const getLabel = WeaLocaleProvider.getLabel;
@@ -16,24 +19,85 @@ class Index extends Component {
super(props);
this.state = {
salaryItemIds: "", //选择的导入表单项
+ exportTempUrl: "", //导出模板url
+ headerFieldsDialog: { visible: false, itemsByGroup: [], selectItems: "" },
importDialog: {
visible: false, title: "", nextloading: false,
- link: "", importResult: {}, imageId: ""
+ link: null, importResult: {}, imageId: "",
+ previewUrl: "/api/bs/hrmsalary/salaryacct/acctresult/preview",
+ extraPreview: { salaryAcctRecordId: "", salaryItemIds: "" }
}
};
}
- componentWillReceiveProps(nextProps, nextContext) {
+ async componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible) {
+ if (nextProps.salaryAcctRecordId && nextProps.visible) {
+ const { data } = await getImportField({ salaryAcctRecordId: nextProps.salaryAcctRecordId });
+ const { checkItems, itemsByGroup } = data;
+ const payload = {
+ exportData: false, salaryAcctRecordId: nextProps.salaryAcctRecordId,
+ salaryItemIds: checkItems.join(",")
+ };
+ this.setState({
+ exportTempUrl: `/api/bs/hrmsalary/salaryacct/acctresult/importtemplate/export?${convertToUrlString(payload)}`,
+ importDialog: {
+ ...this.state.importDialog,
+ extraPreview: { salaryAcctRecordId: nextProps.salaryAcctRecordId, salaryItemIds: checkItems.join(",") }
+ },
+ headerFieldsDialog: {
+ ...this.state.headerFieldsDialog,
+ selectItems: checkItems.join(","),
+ itemsByGroup: _.map(itemsByGroup, item => {
+ return {
+ ...item,
+ salaryItems: _.map(item.salaryItems, it => ({
+ ...it,
+ checked: false
+ }))
+ };
+ })
+ }
+ });
+ }
this.setState({
importDialog: {
- ...this.state.importDialog,
+ ...this.state.importDialog, link: this.handleExportTemp,
visible: nextProps.visible, title: nextProps.title
}
});
}
}
+ handleImport = (payload) => {
+ const { headerFieldsDialog: { selectItems: salaryItemIds }, importDialog } = this.state;
+ const { salaryAcctRecordId } = this.props;
+ this.setState({ importDialog: { ...importDialog, nextloading: true } });
+ importAcctResult({ ...payload, salaryItemIds, salaryAcctRecordId })
+ .then(({ data, status }) => {
+ this.setState({ importDialog: { ...importDialog, nextloading: false } });
+ if (status) {
+ this.setState({
+ importDialog: { ...importDialog, ...payload, importResult: data }
+ });
+ }
+ }).catch(() => this.setState({ importDialog: { ...importDialog, nextloading: false } }));
+ };
+ handleExportTemp = () => {
+ const { headerFieldsDialog: { selectItems }, exportTempUrl } = this.state;
+ if (!selectItems) {
+ message.error(getLabel(111, "请选择表头字段"));
+ } else {
+ window.open(exportTempUrl, "_blank");
+ }
+ };
+ handleSelectedField = () => {
+ this.setState({
+ headerFieldsDialog: {
+ ...this.state.headerFieldsDialog, visible: true
+ }
+ });
+ };
/*
* Author: 黎永顺
* Description:表单选项
@@ -41,25 +105,60 @@ class Index extends Component {
* Date: 2023/9/18
*/
renderFormComponent = () => {
+ const { selectItems } = this.state.headerFieldsDialog;
return
+ count={!_.isEmpty(selectItems) ? selectItems.split(",").length : 0}>
;
};
render() {
- const { importDialog } = this.state;
+ const { importDialog, headerFieldsDialog, exportTempUrl } = this.state;
+ const { salaryAcctRecordId } = this.props;
return (
- this.setState(({
- importDialog: { ...importDialog, importResult: {}, imageId: "" }
- }))}
- nextCallback={imageId => this.handleImport({ imageId })}
- />
+
+ this.setState(({
+ importDialog: { ...importDialog, importResult: {}, imageId: "" }
+ }))}
+ exportDataDom={
+ {
+ const payload = {
+ exportData: val === "1", salaryAcctRecordId,
+ salaryItemIds: headerFieldsDialog.selectItems
+ };
+ this.setState(({
+ exportTempUrl: `/api/bs/hrmsalary/salaryacct/acctresult/importtemplate/export?${convertToUrlString(payload)}`
+ }));
+ }}
+ />
+ }
+ nextCallback={imageId => this.handleImport({ imageId })}
+ />
+ this.setState({
+ headerFieldsDialog: { ...headerFieldsDialog, visible: false }
+ })}
+ onAdd={selectItems => this.setState({
+ headerFieldsDialog: {
+ ...headerFieldsDialog,
+ visible: false, selectItems: selectItems.join(",")
+ }
+ }, () => {
+ const { selectItems: salaryItems } = this.state.headerFieldsDialog;
+ cacheImportField({ salaryItems: salaryItems ? salaryItems.split(",") : [] }).then();
+ })}
+ />
+
);
}
}
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
index 17a2daf6..78a2db08 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js
@@ -29,7 +29,7 @@ class Index extends Component {
this.state = {
selectedKey: "person", progressVisible: false, progress: 0,
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
- salaryImpDialog: { visible: false, title: "" },
+ salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
accountExceptInfo: "" //核算报错信息,
};
@@ -119,7 +119,11 @@ class Index extends Component {
break;
case "import":
this.setState({
- salaryImpDialog: { ...this.state.salaryImpDialog, visible: true, title: getLabel(111, "薪资导入") }
+ salaryImpDialog: {
+ ...this.state.salaryImpDialog,
+ salaryAcctRecordId, visible: true,
+ title: getLabel(111, "薪资导入")
+ }
});
break;
default:
@@ -216,7 +220,7 @@ class Index extends Component {
onCancel={(isFresh) => {
this.setState({
salaryImpDialog: { ...salaryImpDialog, visible: false }
- });
+ }, () => isFresh && this.calc.onAdSearch(false));
}}
/>
From b54a561ba48bc2fd591e0438f2714060fd66c4cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Tue, 26 Sep 2023 11:03:19 +0800
Subject: [PATCH 15/31] =?UTF-8?q?feature/2.9.42309.01-=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E6=94=B9=E9=80=A0=EF=BC=88=E9=A1=B5=E9=9D=A2=E7=BC=96?=
=?UTF-8?q?=E8=BE=91=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/salaryEditCalc/baseInfo.js | 59 +++++++
.../salaryEditCalc/editCalcTable.js | 19 ++-
.../salaryEditCalc/editSalaryCalcSlide.js | 160 ++++++++++++++++++
.../components/salaryEditCalc/index.less | 98 +++++++++++
.../pages/calculate/doCalc/index.less | 4 +
5 files changed, 338 insertions(+), 2 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
new file mode 100644
index 00000000..3539ec72
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js
@@ -0,0 +1,59 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资基本信息
+ * Description:
+ * Date: 2023/9/25
+ */
+import React, { Component } from "react";
+import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
+import cs from "classnames";
+import { Col, Row } from "antd";
+import "./index.less";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class EditSalaryBaseInfo extends Component {
+ render() {
+ const { baseInfo } = this.props;
+ return (
+
+ {getLabel(82743, "基础信息")}
+
+
+ }
+ >
+