如果:调薪生效日期在
@@ -146,5 +146,6 @@ const AdjustTitle = () => {
title="该规则适用于一个薪资核算周期内只调整一次薪资或个税扣缴义务人的情况,其他情况默认按照分段计薪规则核算"
placement="topLeft"
/>
+ :
;
};
From a193ed669015a180eb9d9c496d0b87e6d9aa428d 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, 13 Dec 2022 16:10:48 +0800
Subject: [PATCH 23/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/ledger.js | 14 ++
.../LedgerBackCalculatedSalaryItemTable.js | 102 +++++++++
.../pages/ledgerPage/components/index.less | 40 +++-
.../components/ledgerAdjustRuleAddModal.js | 75 +++++--
.../components/ledgerBackCalcEditSlide.js | 196 ++++++++++++++++++
.../ledgerBackCalculatedSalaryItem.js | 104 ++++++++++
.../components/ledgerSalaryAdjustmentRules.js | 95 ++++++++-
.../ledgerPage/components/ledgerSlide.js | 45 +++-
pc4mobx/hrmSalary/pages/ledgerPage/config.js | 88 ++++++++
.../pages/salaryItem/formalFormModal.js | 8 +-
10 files changed, 734 insertions(+), 33 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js
index 2d411cd3..254c4643 100644
--- a/pc4mobx/hrmSalary/apis/ledger.js
+++ b/pc4mobx/hrmSalary/apis/ledger.js
@@ -268,3 +268,17 @@ export const listAdjustmentRule = params => {
body: JSON.stringify(params)
}).then(res => res.json());
};
+
+//获取回算薪资项目
+export const getAggregate = params => {
+ return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getAggregate", "GET", params);
+};
+
+//编辑回算薪资项目详情
+export const getBackitemForm = params => {
+ return WeaTools.callApi("/api/bs/hrmsalary/salarysob/backitem/getForm", "GET", params);
+};
+//保存回算薪资项目详情
+export const salarysobBackitemSave = params => {
+ return postFetch("/api/bs/hrmsalary/salarysob/backitem/save", params);
+};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js
new file mode 100644
index 00000000..5fa8bfdd
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js
@@ -0,0 +1,102 @@
+/*
+ * Author: 黎永顺
+ * name: 回算薪资项目表格数据
+ * Description:
+ * Date: 2022/12/13
+ */
+import React, { Component } from "react";
+import { WeaTable } from "ecCom";
+import { inject, observer } from "mobx-react";
+import LedgerBackCalcEditSlide from "./ledgerBackCalcEditSlide";
+
+@inject("taxAgentStore")
+@observer
+class LedgerBackCalculatedSalaryItemTable extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ backCalcEditSlide: {
+ visible: false,
+ title: "编辑薪资项目",
+ id: "",
+ salaryItemId: ""
+ }
+ };
+ }
+
+ handleEditBackCalc = (record) => {
+ const { id, salaryItemId } = record;
+ const { backCalcEditSlide } = this.state;
+ this.setState({
+ backCalcEditSlide: {
+ ...backCalcEditSlide,
+ visible: true,
+ id,
+ salaryItemId
+ }
+ });
+ };
+ handleClose = (isRefresh = false) => {
+ const { backCalcEditSlide } = this.state;
+ const { onRefresh } = this.props;
+ this.setState({
+ backCalcEditSlide: {
+ ...backCalcEditSlide,
+ visible: false,
+ id: "",
+ salaryItemId: ""
+ }
+ }, () => {
+ isRefresh && onRefresh();
+ });
+ };
+
+ render() {
+ const { backCalcEditSlide } = this.state;
+ const { taxAgentStore: { showOperateBtn }, dataSource, editId } = this.props;
+ const columns = [
+ {
+ dataIndex: "name",
+ title: "薪资项目",
+ render: (text) => {
+ return
{text};
+ }
+ },
+ {
+ dataIndex: "formulaContent",
+ title: "核算公式",
+ render: (text, record) => {
+ return
{text};
+ }
+ },
+ {
+ dataIndex: "",
+ title: "操作",
+ width: 80,
+ render: (text, record, index) => {
+ const { canEdit } = record;
+ return (showOperateBtn && canEdit) ?
+
this.handleEditBackCalc(record)}>编辑 :
;
+ }
+ }
+ ];
+ return (
+
+
+
+
+ );
+ }
+}
+
+export default LedgerBackCalculatedSalaryItemTable;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less
index f11be705..0fc0fb8d 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less
@@ -88,10 +88,11 @@
}
}
- .adjustRuleDetailWrapper{
+ .adjustRuleDetailWrapper {
display: flex;
flex-direction: column;
- .adjustSalaryFlex{
+
+ .adjustSalaryFlex {
display: flex;
align-items: center;
margin-bottom: 10px;
@@ -112,3 +113,38 @@
border-radius: 0;
}
}
+
+// 回算薪资项目
+.ledgerBackCalculatedSalaryItemWrapper {
+ .titleWrapper {
+ display: flex;
+ align-items: center;
+
+ & > span {
+ margin-right: 8px;
+ }
+ }
+}
+
+//回算薪资项目编辑弹框
+.backCalcSlideWrapper {
+ .backCalcSlideCol {
+ border: 1px solid #ebedf0;
+ border-bottom: none;
+ margin: 10px;
+
+ .wea-form-item {
+ padding: 4px 10px;
+ border-bottom: 1px solid #ebedf0;
+ }
+ }
+
+ .textareaBox {
+ position: relative;
+ z-index: 1;
+
+ & > .wea-textarea-normal {
+ z-index: -11;
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js
index a557844d..220ff5e2 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js
@@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { WeaDialog, WeaFormItem, WeaHelpfulTip, WeaSearchGroup, WeaSelect } from "ecCom";
-import { Button, Radio } from "antd";
+import { Button, Modal, Radio } from "antd";
import { monthDays } from "../config";
import { listSalarySobItem } from "../../../apis/ledger";
import "./index.less";
@@ -15,7 +15,7 @@ class LedgerAdjustRuleAddModal extends Component {
constructor(props) {
super(props);
this.state = {
- beforeAdjustmentType: 4,
+ beforeAdjustmentType: 2,
afterAdjustmentType: 1,
salaryItemId: "",
salaryItemName: "",
@@ -25,11 +25,10 @@ class LedgerAdjustRuleAddModal extends Component {
}
componentWillReceiveProps(nextProps, nextContext) {
- if (nextProps.visible !== this.props.visible && nextProps.salarySobId) this.listSalarySobItem();
+ if (nextProps.visible !== this.props.visible && nextProps.salarySobId) this.listSalarySobItem(nextProps.salarySobId);
}
- listSalarySobItem = () => {
- const { salarySobId } = this.props;
+ listSalarySobItem = (salarySobId) => {
const payload = {
excludeSalaryItemIds: [],
salarySobId
@@ -37,11 +36,42 @@ class LedgerAdjustRuleAddModal extends Component {
listSalarySobItem(payload).then(({ status, data }) => {
if (status) {
this.setState({
- salaryItemOptions: _.map(data, it => ({ key: it.id, showname: it.content }))
+ salaryItemOptions: _.map(data, it => ({ key: it.salaryItemId.toString(), showname: it.salaryItemName }))
});
}
});
};
+ handleSave = () => {
+ const { salaryRuleItemsList, onSave } = this.props;
+ const { salaryItemOptions, ...extraItems } = this.state;
+ if (_.isEmpty(extraItems.salaryItemId)) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ const items = {
+ ...extraItems,
+ salaryItemName: this.state.salaryItemName,
+ };
+ this.handleReset();
+ onSave([...salaryRuleItemsList, items]);
+ };
+ handleReset = () => {
+ this.setState({
+ beforeAdjustmentType: 2,
+ afterAdjustmentType: 1,
+ salaryItemId: "",
+ salaryItemName: "",
+ dayOfMonth: "1",
+ salaryItemOptions: []
+ }, () => {
+ const { onCancel } = this.props;
+ onCancel();
+ });
+ };
+
render() {
const {
@@ -51,34 +81,37 @@ class LedgerAdjustRuleAddModal extends Component {
beforeAdjustmentType,
afterAdjustmentType
} = this.state;
- const { onCancel, title, visible } = this.props;
- const buttons = [
];
+ const { title, visible } = this.props;
+ const buttons = [
];
return (
-
-
+
+
this.setState({ salaryItemId, salaryItemName })}
/>
- } labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} colon={false}>
+ } labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} colon={false}>
如果:调薪生效日期在
this.setState({ dayOfMonth })}
@@ -87,9 +120,8 @@ class LedgerAdjustRuleAddModal extends Component {
计薪规则为:
- {
- console.log(value);
- }} value={beforeAdjustmentType}>
+ this.setState({ beforeAdjustmentType: e.target.value })}
+ value={beforeAdjustmentType}>
取调整后薪资
分段计薪
-
否则:调薪生效日期在{dayOfMonth}号之后
+
否则:调薪生效日期在{dayOfMonth}号之后
计薪规则为:
-
{
- console.log(value);
- }} value={afterAdjustmentType}>
+ this.setState({ afterAdjustmentType: e.target.value })}
+ value={afterAdjustmentType}>
取调整前薪资
分段计薪 {
+ getBackitemForm({ id }).then(({ status, data }) => {
+ if (status) {
+ this.setState({ ...data });
+ }
+ });
+ };
+ handleChange = (type, value) => {
+ this.setState({
+ ...this.state,
+ [type]: value
+ });
+ };
+ handleSaveBackCalcItems = () => {
+ const { salaryItem, loading, backCalcEditFormulModal, ...extra } = this.state;
+ const { salaryItemId, editId: salarySobId, onCancle } = this.props;
+ if (extra.valueType === "FORMULA" && _.isEmpty(extra.formulaContent)) {
+ Modal.warning({
+ title: "信息确认",
+ content: "必要信息不完整,红色*为必填项!"
+ });
+ return;
+ }
+ const payload = { ...extra, salarySobId, salaryItemId };
+ this.setState({ loading: true });
+ salarysobBackitemSave(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success("保存成功");
+ onCancle(true);
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
+ handleEditFormnul = () => {
+ const { backCalcEditFormulModal, valueType, dataType } = this.state;
+ this.setState({
+ backCalcEditFormulModal: {
+ ...backCalcEditFormulModal,
+ visible: true,
+ valueType,
+ dataType: _.lowerCase(dataType)
+ }
+ });
+ };
+ handleCloseEditFormnul = () => {
+ const { backCalcEditFormulModal } = this.state;
+ this.setState({
+ backCalcEditFormulModal: {
+ ...backCalcEditFormulModal,
+ visible: false,
+ valueType: "",
+ dataType: ""
+ }
+ });
+ };
+
+ render() {
+ const { title, visible, showOperateBtn, onCancle } = this.props;
+ const {
+ valueType,
+ dataType,
+ roundingMode,
+ pattern,
+ salaryItem = [],
+ loading,
+ formulaContent,
+ backCalcEditFormulModal
+ } = this.state;
+ const salaryItemName = salaryItem[0] ? salaryItem[0].name : "";
+ return (
+
+ }
+ content={
+
+
+
+
+
+
+
+
+
+
+
+
+ this.handleChange("roundingMode", v)}
+ />
+
+
+
+
+ this.handleChange("pattern", v)}
+ />
+
+
+
+
+ this.handleChange("valueType", v)}
+ />
+
+ {
+ valueType === "FORMULA" &&
+
+
+
+
+ {/*公式弹框*/}
+ {
+ backCalcEditFormulModal.visible &&
+ this.setState({
+ ...this.state,
+ formulaId: data.id,
+ formulaContent: data.formula
+ })}
+ onCancel={this.handleCloseEditFormnul}
+ />
+ }
+
+ }
+
+
+
+ }
+ onClose={onCancle}
+ />
+ );
+ }
+}
+
+export default LedgerBackCalcEditSlide;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
new file mode 100644
index 00000000..e7382646
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
@@ -0,0 +1,104 @@
+/*
+ * Author: 黎永顺
+ * name: 回算薪资项目
+ * Description:
+ * Date: 2022/12/13
+ */
+import React, { Component } from "react";
+import { WeaHelpfulTip, WeaSearchGroup } from "ecCom";
+import LedgerBackCalculatedSalaryItemTable from "./LedgerBackCalculatedSalaryItemTable";
+import { getAggregate } from "../../../apis/ledger";
+import "./index.less";
+
+class LedgerBackCalculatedSalaryItem extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ backCalcItems: [
+ {
+ key: "issuedItems",
+ label: "已发项目设置",
+ dataSource: [],
+ helpContent: [
+ "核算时,已发项目的公式中各项目值均取该项目在该账套核算中的最后一次核算值;",
+ "已发项目的公式设置,只可在【取最后一次核算值的项目】中选择;"
+ ]
+ },
+ {
+ key: "reissueItems",
+ label: "补发项目设置",
+ dataSource: [],
+ helpContent: [
+ "系统内置补发项目【补发薪资合计】,可新增其他的项目,如【补发备注】等;",
+ "公式取值为当次回算的核算值。"
+ ]
+ }
+ ]
+ };
+ }
+
+ componentDidMount() {
+ this.getAggregate();
+ }
+
+ getAggregate = () => {
+ const { editId: salarySobId } = this.props;
+ const { backCalcItems } = this.state;
+ getAggregate({ salarySobId }).then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ backCalcItems: _.map(backCalcItems, item => {
+ const { key } = item;
+ return {
+ ...item,
+ dataSource: data[key]
+ };
+ })
+ });
+ }
+ });
+ };
+
+ render() {
+ const { backCalcItems } = this.state;
+ return (
+
+ {
+ _.map(backCalcItems, item => {
+ const { key, label, helpContent, dataSource } = item;
+ return (
+
+ }
+ showGroup
+ >
+
+ );
+ })
+ }
+
+ );
+ }
+}
+
+export default LedgerBackCalculatedSalaryItem;
+
+const TitleComp = (props) => {
+ const helpContent = _.map(props.helpContent, (it, idx) => {
+ return {`${idx + 1}、${it}`}
;
+ });
+ return
+ {props.title}
+
+
;
+};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js
index 9ab9f162..706b0ff5 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js
@@ -7,7 +7,9 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaButtonIcon, WeaTab, WeaTable } from "ecCom";
+import { Modal } from "antd";
import LedgerAdjustRuleAddModal from "./ledgerAdjustRuleAddModal";
+import { listAdjustmentRule } from "../../../apis/ledger";
@inject("taxAgentStore")
@observer
@@ -16,7 +18,6 @@ class LedgerSalaryAdjustmentRules extends Component {
super(props);
this.state = {
dataSource: [],
- columns: [],
adjustRuleAddModal: {
visible: false,
title: "调薪计薪规则项",
@@ -25,6 +26,24 @@ class LedgerSalaryAdjustmentRules extends Component {
};
}
+ componentDidMount() {
+ this.listAdjustmentRule();
+ }
+
+ listAdjustmentRule = () => {
+ const { editId: salarySobId } = this.props;
+ listAdjustmentRule({ salarySobId }).then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ dataSource: data
+ }, () => {
+ const { onSaveParams } = this.props;
+ const { dataSource } = this.state;
+ onSaveParams(dataSource);
+ });
+ }
+ });
+ };
handleAddAdjustRule = () => {
const { adjustRuleAddModal } = this.state;
const { editId } = this.props;
@@ -46,14 +65,73 @@ class LedgerSalaryAdjustmentRules extends Component {
}
});
};
+ handleDelete = (index) => {
+ const { dataSource } = this.state;
+ Modal.confirm({
+ title: "信息确认",
+ content: "确认要删除吗?",
+ onOk: () => {
+ this.setState({
+ dataSource: _.filter(dataSource, (it, idx) => idx !== index)
+ }, () => {
+ const { onSaveParams } = this.props;
+ const { dataSource } = this.state;
+ onSaveParams(dataSource);
+ });
+ }
+ });
+ };
+ convertAdjustmentType = (index) => {
+ const nameList = {
+ 1: "取调薪前薪资",
+ 2: "取调薪后薪资",
+ 3: "平均值",
+ 4: "分段计薪"
+ };
+ return nameList[Number(index)];
+ };
render() {
- const { taxAgentStore: { showOperateBtn }, editId } = this.props;
+ const { taxAgentStore: { showOperateBtn }, editId, onSaveParams } = this.props;
const { adjustRuleAddModal } = this.state;
- const { dataSource, columns } = this.state;
+ const { dataSource } = this.state;
const btns = showOperateBtn ? [
] : [];
+ const columns = [
+ {
+ title: "序号",
+ dataIndex: "index",
+ width: 60,
+ render: (text, record, index) => {
+ return index + 1;
+ }
+ },
+ {
+ dataIndex: "salaryItemName",
+ title: "薪资项目",
+ render: (text) => {
+ return {text};
+ }
+ },
+ {
+ dataIndex: "salaryCalculationRules",
+ title: "计薪规则",
+ render: (text, record) => {
+ const salaryCalculationRules = `${record.dayOfMonth}号(含)之前调薪,${this.convertAdjustmentType(record.beforeAdjustmentType)};${record.dayOfMonth}号之后调薪,${this.convertAdjustmentType(record.afterAdjustmentType)}`;
+ return {salaryCalculationRules};
+ }
+ },
+ {
+ dataIndex: "",
+ title: "操作",
+ width: 80,
+ render: (text, record, index) => {
+ return showOperateBtn ?
+ this.handleDelete(index)}>删除 : ;
+ }
+ }
+ ];
return (
@@ -65,7 +143,18 @@ class LedgerSalaryAdjustmentRules extends Component {
/>
{
+ this.setState({ dataSource }, () => {
+ const { dataSource } = this.state;
+ const ruleParams = _.map(dataSource, it => {
+ const { salaryCalculationRules, ...params } = it;
+ return { ...params };
+ });
+ onSaveParams(ruleParams);
+ });
+ }}
/>
);
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
index 1eb231da..02402512 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -12,7 +12,8 @@ import SlideModalTitle from "../../../components/slideModalTitle";
import LedgerBaseSetting from "./ledgerBaseSetting";
import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
-import { saveLedgerBasic } from "../../../apis/ledger";
+import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
+import { saveAdjustmentRule, saveLedgerBasic } from "../../../apis/ledger";
import "./index.less";
const Step = WeaSteps.Step;
@@ -32,10 +33,17 @@ class LedgerSlide extends Component {
this.state = {
current: 0,
loading: false,
- baseSettingInfo: {}
+ baseSettingInfo: {},
+ adjustRules: []
};
}
+ /*
+ * Author: 黎永顺
+ * Description: 保存基本信息
+ * Params:
+ * Date: 2022/12/12
+ */
saveLedgerBasic = () => {
const { baseSettingInfo, current } = this.state;
const { editId } = this.props;
@@ -61,6 +69,29 @@ class LedgerSlide extends Component {
}
}).catch(() => this.setState({ loading: false }));
};
+ /*
+ * Author: 黎永顺
+ * Description: 保存调薪计薪规则
+ * Params:
+ * Date: 2022/12/12
+ */
+ saveLedgerAdjustRule = () => {
+ const { adjustRules } = this.state;
+ const payload = {
+ salarySobId: this.props.editId,
+ ruleParams: adjustRules
+ };
+ this.setState({ loading: true });
+ saveAdjustmentRule(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success("保存成功");
+ } else {
+ message.success(errormsg || "保存失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ }
+ ;
handleChangeSlideTab = (current) => {
this.setState({ current: Number(current) });
};
@@ -86,8 +117,12 @@ class LedgerSlide extends Component {
case 1:
CurrentDom = ;
break;
+ case 3:
+ CurrentDom = ;
+ break;
case 4:
- CurrentDom = ;
+ CurrentDom =
+ this.setState({ adjustRules })}/>;
break;
default:
CurrentDom = null;
@@ -136,9 +171,9 @@ class LedgerSlide extends Component {
CurrentDom = !editId ?
[
,
-
+
] : [
-
+
];
break;
default:
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
index 01fb9d44..6bd81428 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
@@ -666,3 +666,91 @@ export const monthDays = [
showname: "31号"
}
];
+export const fieldType = [
+ {
+ key: "STRING",
+ selected: false,
+ showname: "字符"
+ },
+ {
+ key: "NUMBER",
+ selected: false,
+ showname: "数值"
+ }
+];
+export const valueTaking = [
+ {
+ key: "INPUT",
+ selected: false,
+ showname: "输入"
+ },
+ {
+ key: "FORMULA",
+ selected: false,
+ showname: "公式"
+ }
+];
+export const roundingRules = [
+ {
+ key: "RAW_DATA",
+ selected: false,
+ showname: "原始数据"
+ },
+ {
+ key: "ROUNDING",
+ selected: false,
+ showname: "四舍五入"
+ },
+ {
+ key: "ROUND_UP",
+ selected: false,
+ showname: "向上舍入"
+ },
+ {
+ key: "ROUND_DOWN",
+ selected: false,
+ showname: "向下舍入"
+ },
+ {
+ key: "CEILING",
+ selected: false,
+ showname: "见分进角"
+ },
+ {
+ key: "UP_EVEN",
+ selected: false,
+ showname: "向上求偶"
+ },
+];
+export const keepDecimalPlaces = [
+ {
+ key: "0",
+ selected: false,
+ showname: "0"
+ },
+ {
+ key: "1",
+ selected: false,
+ showname: "1"
+ },
+ {
+ key: "2",
+ selected: false,
+ showname: "2"
+ },
+ {
+ key: "3",
+ selected: false,
+ showname: "3"
+ },
+ {
+ key: "4",
+ selected: false,
+ showname: "4"
+ },
+ {
+ key: "5",
+ selected: false,
+ showname: "5"
+ }
+];
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
index 3ddf0cad..92de743a 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
@@ -67,6 +67,12 @@ export default class FormalFormModal extends React.Component {
let groupParams = {};
if (this.props.valueType == "3") {
groupParams = { "referenceType": "sql" };
+ } else if (this.props.valueType === "FORMULA") {
+ groupParams = { "referenceType": "backCalc" };
+ this.referenceType = "backCalc";
+ this.setState({
+ value: this.props.formulaContent
+ });
}
salaryAcctImportTemplateParam(groupParams);
}
@@ -247,7 +253,7 @@ export default class FormalFormModal extends React.Component {
const { value, formulaDatasourceList, extendParam } = this.state;
return (
Date: Wed, 14 Dec 2022 15:37:55 +0800
Subject: [PATCH 24/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ledgerPage/components/categoryAddModal.js | 79 +++++
.../pages/ledgerPage/components/index.less | 60 ++++
.../components/ledgerAdjustRuleAddModal.js | 5 +-
.../components/ledgerAssociatedPersonnel.js | 4 +-
.../ledgerBackCalculatedSalaryItem.js | 4 +-
.../components/ledgerSalaryAdjustmentRules.js | 8 +-
.../ledgerPage/components/ledgerSalaryItem.js | 301 ++++++++++++++++++
.../components/ledgerSalaryItemAddModal.js | 150 +++++++++
.../components/ledgerSalaryItemBaseInfo.js | 103 ++++++
.../components/ledgerSalaryItemNormal.js | 252 +++++++++++++++
.../components/ledgerSalaryItemTable.js | 135 ++++++++
.../ledgerPage/components/ledgerSlide.js | 94 +++++-
pc4mobx/hrmSalary/pages/ledgerPage/config.js | 20 +-
pc4mobx/hrmSalary/stores/ledger.js | 4 +-
14 files changed, 1190 insertions(+), 29 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/categoryAddModal.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/categoryAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/categoryAddModal.js
new file mode 100644
index 00000000..2aef96cb
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/categoryAddModal.js
@@ -0,0 +1,79 @@
+/*
+ * Author: 黎永顺
+ * name: 复制账套
+ * Description:
+ * Date: 2022/12/8
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { categoryConditions } from "../config";
+import { WeaDialog } from "ecCom";
+import { Button } from "antd";
+import { getSearchs } from "../../../util";
+
+@inject("ledgerStore")
+@observer
+class CategoryAddModal extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: false
+ };
+ }
+
+ componentDidMount() {
+ this.getFormFields();
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ const { ledgerStore, name = "" } = nextProps;
+ const { categoryForm: form } = ledgerStore;
+ form.updateFields({
+ name: { value: name }
+ });
+ }
+ }
+
+ getFormFields = () => {
+ const { ledgerStore } = this.props;
+ const { categoryForm: form } = ledgerStore;
+ form.initFormFields(categoryConditions);
+ };
+ handleSubmit = () => {
+ const { ledgerStore, id, onSaveCategory, onCancel } = this.props;
+ const { categoryForm: form } = ledgerStore;
+ form.validateForm().then(f => {
+ if (f.isValid) {
+ const payload = form.getFormParams();
+ onSaveCategory({ ...payload, id });
+ onCancel();
+ } else {
+ f.showErrors();
+ }
+ });
+ };
+
+
+ render() {
+ const { onCancel, ledgerStore, ...extra } = this.props;
+ const { loading } = this.state;
+ const { categoryForm: form } = ledgerStore;
+ const buttons = [
+ ,
+
+ ];
+ return (
+
+ {getSearchs(form, categoryConditions, 1)}
+
+ );
+ }
+}
+
+export default CategoryAddModal;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less
index 0fc0fb8d..f4c29337 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less
@@ -148,3 +148,63 @@
}
}
}
+
+//薪资项目
+.ledgerSalaryItemWrapper {
+ .userInfoWrapper {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 10px;
+ border: 1px solid #ebedf0;
+ border-radius: 5px;
+ display: flex;
+ align-items: center;
+
+ .wea-sortable-grid-item {
+ display: inline-block;
+ border: none;
+ padding: 0;
+ }
+ }
+
+ .categroyListWrapper {
+ .titleNormalWrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ .titleWrapper, .titleBtnWrapper{
+ display: flex;
+ align-items: center;
+ width: inherit;
+ }
+ .titleWrapper{
+ i{
+ font-size: 16px;
+ color: #333;
+ margin-left: 8px;
+ }
+ }
+ .titleBtnWrapper{
+ .wea-button-icon{
+ margin-left: 12px;
+ }
+ }
+ }
+ }
+
+ .titleWrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+
+ .titleLeft {
+ display: flex;
+ align-items: center;
+
+ & > span {
+ margin-right: 8px;
+ }
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js
index 220ff5e2..38552ba7 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAdjustRuleAddModal.js
@@ -29,8 +29,9 @@ class LedgerAdjustRuleAddModal extends Component {
}
listSalarySobItem = (salarySobId) => {
+ const { salaryRuleItemsList } = this.props;
const payload = {
- excludeSalaryItemIds: [],
+ excludeSalaryItemIds: _.map(salaryRuleItemsList, item => item.salaryItemId),
salarySobId
};
listSalarySobItem(payload).then(({ status, data }) => {
@@ -53,7 +54,7 @@ class LedgerAdjustRuleAddModal extends Component {
}
const items = {
...extraItems,
- salaryItemName: this.state.salaryItemName,
+ salaryItemName: this.state.salaryItemName
};
this.handleReset();
onSave([...salaryRuleItemsList, items]);
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
index 53aef91a..5aa85886 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
@@ -85,7 +85,7 @@ class LedgerAssociatedPersonnel extends Component {
render() {
const { selectedKey, searchValue, rowKeys, personalAddModal } = this.state;
- const { taxAgentStore: { showOperateBtn }, editId } = this.props;
+ const { taxAgentStore: { showOperateBtn }, editId, saveSalarySobId } = this.props;
const topTab = [
{
title: "关联人员范围",
@@ -129,7 +129,7 @@ class LedgerAssociatedPersonnel extends Component {
/>
this.personalScopeTableRef = dom}
- searchKeyVal={{ key: "salarySobId", value: editId }}
+ searchKeyVal={{ key: "salarySobId", value: editId || saveSalarySobId }}
APIFox={APIFox}
tabActive={selectedKey}
searchValue={searchValue}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
index e7382646..6d39fd12 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
@@ -42,9 +42,9 @@ class LedgerBackCalculatedSalaryItem extends Component {
}
getAggregate = () => {
- const { editId: salarySobId } = this.props;
+ const { editId: salarySobId, saveSalarySobId } = this.props;
const { backCalcItems } = this.state;
- getAggregate({ salarySobId }).then(({ status, data }) => {
+ getAggregate({ salarySobId: salarySobId || saveSalarySobId }).then(({ status, data }) => {
if (status) {
this.setState({
backCalcItems: _.map(backCalcItems, item => {
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js
index 706b0ff5..a1aad64c 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryAdjustmentRules.js
@@ -31,8 +31,8 @@ class LedgerSalaryAdjustmentRules extends Component {
}
listAdjustmentRule = () => {
- const { editId: salarySobId } = this.props;
- listAdjustmentRule({ salarySobId }).then(({ status, data }) => {
+ const { editId: salarySobId, saveSalarySobId } = this.props;
+ listAdjustmentRule({ salarySobId: salarySobId || saveSalarySobId }).then(({ status, data }) => {
if (status) {
this.setState({
dataSource: data
@@ -46,12 +46,12 @@ class LedgerSalaryAdjustmentRules extends Component {
};
handleAddAdjustRule = () => {
const { adjustRuleAddModal } = this.state;
- const { editId } = this.props;
+ const { editId, saveSalarySobId } = this.props;
this.setState({
adjustRuleAddModal: {
...adjustRuleAddModal,
visible: true,
- salarySobId: editId
+ salarySobId: editId || saveSalarySobId
}
});
};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
new file mode 100644
index 00000000..45bd3000
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
@@ -0,0 +1,301 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资项目
+ * Description:
+ * Date: 2022/12/13
+ */
+import React, { Component } from "react";
+import LedgerSalaryItemBaseInfo from "./ledgerSalaryItemBaseInfo";
+import LedgerSalaryItemNormal from "./ledgerSalaryItemNormal";
+import { getLedgerItemForm } from "../../../apis/ledger";
+import "./index.less";
+
+class LedgerSalaryItem extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ empFields: [], //员工基本信息
+ itemGroups: [] //正常工资薪金所得项
+ };
+ }
+
+ componentDidMount() {
+ this.getLedgerItemForm();
+ }
+
+ /*
+ * Author: 黎永顺
+ * Description: 薪资项目以及员工基本信息查询
+ * Params:
+ * Date: 2022/12/14
+ */
+ getLedgerItemForm = () => {
+ const { editId: salarySobId, saveSalarySobId } = this.props;
+ getLedgerItemForm({ salarySobId: salarySobId || saveSalarySobId }).then(({ status, data }) => {
+ if (status) {
+ const { empFields, itemGroups, items } = data;
+ const obj = {
+ id: itemGroups.length,
+ itemHide: null,
+ items,
+ name: "未分类",
+ salarySobId,
+ sortedIndex: itemGroups.length
+ };
+ this.setState({ empFields, itemGroups: [...itemGroups, obj] }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ }
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 员工基本信息排序
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleChangeSortableList = (empFields) => {
+ this.setState({ empFields }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description:编辑保存性子项目分类
+ * Params:
+ * Date: 2022/12/13
+ */
+ handleSaveCateGory = (payload) => {
+ const { itemGroups } = this.state;
+ if (payload.id) {
+ this.setState({
+ itemGroups: _.map(itemGroups, it => {
+ if (it.id === payload.id) {
+ return { ...it, name: payload.name };
+ }
+ return { ...it };
+ })
+ });
+ } else {
+ const obj = {
+ id: itemGroups.length,
+ itemHide: null,
+ items: [],
+ name: payload.name
+ };
+ this.setState({
+ itemGroups: _.map([obj, ...itemGroups], (it, idx) => ({ ...it, sortedIndex: idx }))
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ }
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 删除分类
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleDeleteCategroy = (id) => {
+ const { itemGroups } = this.state;
+ this.setState({
+ itemGroups: _.filter(itemGroups, it => it.id !== id)
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 删除分类项下的列表数据
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleDeleteCategroyItems = (id, selectedRowKeys) => {
+ const { itemGroups } = this.state;
+ this.setState({
+ itemGroups: _.map(itemGroups, item => {
+ if (item.id === id) {
+ return {
+ ...item,
+ items: _.filter(item.items, it => !selectedRowKeys.includes(it.id))
+ };
+ }
+ return { ...item };
+ })
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 修改信息项目分类的顺序-向上移动
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleUpgo = (index) => {
+ const { itemGroups } = this.state;
+ let newItemGroups = [...itemGroups];
+ if (index !== 0) {
+ newItemGroups[index] = newItemGroups.splice(index - 1, 1, newItemGroups[index])[0];
+ } else {
+ newItemGroups.push(newItemGroups.shift());
+ }
+ this.setState({
+ itemGroups: _.map(newItemGroups, (it, idx) => ({
+ ...it,
+ sortedIndex: idx
+ }))
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 修改信息项目分类的顺序-向下移动
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleDowngo = (index) => {
+ const { itemGroups } = this.state;
+ let newItemGroups = [...itemGroups];
+ if (index !== newItemGroups.length - 1) {
+ newItemGroups[index] = newItemGroups.splice(index + 1, 1, newItemGroups[index])[0];
+ } else {
+ newItemGroups.unshift(newItemGroups.splice(index, 1)[0]);
+ }
+ this.setState({
+ itemGroups: _.map(newItemGroups, (it, idx) => ({
+ ...it,
+ sortedIndex: idx
+ }))
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 移動分类下的列表数据\切换薪资分类-隐藏复选框
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleDropCategroyItem = (filed, data) => {
+ const { itemGroups } = this.state;
+ this.setState({
+ itemGroups: _.map(itemGroups, it => {
+ if (filed.id === it.id) {
+ return { ...it, items: data };
+ }
+ return { ...it };
+ })
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 薪资分类选中复选框
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleChangeSelectedRowKeys = (filed, data) => {
+ const { itemGroups } = this.state;
+ this.setState({
+ itemGroups: _.map(itemGroups, it => {
+ if (filed.id === it.id) {
+ return { ...it, selectedRowKeys: data };
+ }
+ return { ...it };
+ })
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 薪资项目-新增项
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleAddSalaryItems = (id, items) => {
+ const { itemGroups } = this.state;
+ this.setState({
+ itemGroups: _.map(itemGroups, it => {
+ if (id === it.id) {
+ return { ...it, items: [...it.items, ...items] };
+ }
+ return { ...it };
+ })
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 保存薪资项目公式
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleSaveFormnul = (id, items) => {
+ const { itemGroups } = this.state;
+ this.setState({
+ itemGroups: _.map(itemGroups, it => {
+ if (id === it.id) {
+ return { ...it, items };
+ }
+ return { ...it };
+ })
+ }, () => {
+ const { empFields, itemGroups } = this.state;
+ const { onSaveSalaryItem } = this.props;
+ onSaveSalaryItem(empFields, itemGroups);
+ });
+ };
+
+ render() {
+ const { empFields, itemGroups } = this.state;
+ return (
+
+
+ this.ledgerSalaryItemNormalRef = dom}
+ {...this.props} dataSource={itemGroups}
+ onSaveCategory={this.handleSaveCateGory}
+ onDeleteCategroy={this.handleDeleteCategroy}
+ onDeleteCategroyItems={this.handleDeleteCategroyItems}
+ onUpgo={this.handleUpgo}
+ onDowngo={this.handleDowngo}
+ onDropCategoryItem={this.handleDropCategroyItem}
+ onHandleItemhide={this.handleDropCategroyItem}
+ onChangeSelectedRowKeys={this.handleChangeSelectedRowKeys}
+ onAddSalaryItems={this.handleAddSalaryItems}
+ onSaveFormnul={this.handleSaveFormnul}
+ />
+
+ );
+ }
+}
+
+export default LedgerSalaryItem;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
new file mode 100644
index 00000000..0df63310
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
@@ -0,0 +1,150 @@
+import React from "react";
+import { Button, Switch } from "antd";
+import { WeaDialog, WeaInputSearch, WeaTable } from "ecCom";
+import { listSalaryItem } from "../../../apis/ledger";
+
+export default class LedgerSalaryItemAddModal extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: {
+ query: false
+ },
+ name: "",
+ selectedRowKeys: [],
+ dataSource: [],
+ columns: [],
+ pageInfo: {
+ current: 1,
+ pageSize: 10,
+ total: 0
+ }
+ };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visivle && nextProps.visible) {
+ this.setState({ selectedRowKeys: [] }, () => {
+ this.listSalaryItem();
+ });
+ }
+ }
+
+ listSalaryItem = () => {
+ const { itemGroups } = this.props;
+ const { name, pageInfo, loading } = this.state;
+ let excludeIds = [];
+ itemGroups.map(item => {
+ item.items && item.items.map(i => {
+ excludeIds.push(i.salaryItemId);
+ });
+ });
+ const payload = {
+ excludeIds,
+ name,
+ ...pageInfo
+ };
+ this.setState({ loading: { ...loading, query: true } });
+ listSalaryItem(payload).then(({ status, data }) => {
+ this.setState({ loading: { ...loading, query: false } });
+ if (status) {
+ const { pageNum: current, pageSize, total, columns, list: dataSource } = data;
+ this.setState({
+ pageInfo: { ...pageInfo, current, pageSize, total },
+ dataSource,
+ columns
+ });
+ }
+ }).catch(() => {
+ this.setState({ loading: { ...loading, query: false } });
+ });
+ };
+ getSalaryItemAddColumns = () => {
+ const { columns } = this.state;
+ let newColumns = [];
+ newColumns = columns.map(column => {
+ let newColumn = column;
+ newColumn.render = (text, record, index) => { //前端元素转义
+ let valueSpan = record[newColumn.dataIndex + "span"] !== undefined ? record[newColumn.dataIndex + "span"] : record[newColumn.dataIndex];
+ switch (newColumn.dataIndex) {
+ case "useDefault":
+ case "useInEmployeeSalary":
+ return ;
+ default:
+ return ;
+ }
+ };
+ return newColumn;
+ });
+ return newColumns;
+ };
+
+ handleAdd = () => {
+ const { dataSource, selectedRowKeys } = this.state;
+ const { onAddSalaryItems, id, onCancel } = this.props;
+ let selectItems = [];
+ dataSource.map(item => {
+ item = { ...item };
+ selectedRowKeys.map(key => {
+ if (item.id === key) {
+ item.salaryItemId = item.id;
+ item.key = item.id;
+ selectItems.push(item);
+ }
+ });
+ });
+ onCancel();
+ onAddSalaryItems(id, selectItems);
+ };
+
+ render() {
+ const { onCancel, visible } = this.props;
+ const { name, selectedRowKeys, pageInfo, dataSource, loading } = this.state;
+ const pagination = {
+ ...pageInfo,
+ showTotal: total => `共 ${total} 条`,
+ showQuickJumper: true,
+ pageSizeOptions: ["10", "20", "50", "100"],
+ onChange: current => {
+ this.setState({
+ pageInfo: { ...pageInfo, current }
+ }, () => {
+ this.listSalaryItem();
+ });
+ }
+ };
+ const rowSelection = {
+ selectedRowKeys,
+ onChange: (selectedRowKeys) => {
+ this.setState({ selectedRowKeys }, () => {
+ });
+ }
+ };
+ return (
+ 添加]}
+ >
+
+ this.setState({ name })}
+ onSearch={() => this.listSalaryItem()}
+ />
+
+
+
+ );
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
new file mode 100644
index 00000000..7d399054
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
@@ -0,0 +1,103 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资项目-员工基本信息
+ * Description:
+ * Date: 2022/12/13
+ */
+import React, { Component } from "react";
+import { WeaHelpfulTip, WeaSearchGroup, WeaSelect, WeaSortable } from "ecCom";
+import { Button, Icon } from "antd";
+import { empFieldList } from "../../../apis/ledger";
+
+class LedgerSalaryItemBaseInfo extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ empFieldListOptions: []
+ };
+ }
+
+ componentDidMount() {
+ this.empFieldList();
+ }
+
+ empFieldList = () => {
+ empFieldList().then(({ status, data }) => {
+ if (status) {
+ const dataFilter = _.filter(data, it => !["taxAgentName", "username", "departmentName"].includes(it.id));
+ this.setState({
+ empFieldListOptions: _.map(dataFilter, it => ({ key: it.id, showname: it.name }))
+ });
+ }
+ });
+ };
+
+ handleAddEmpList = (key, showname) => {
+ const { dataSource, onChangeSortableList } = this.props;
+ const obj = {
+ canDelete: true,
+ fieldId: key,
+ fieldName: showname,
+ id: dataSource.length,
+ salarySobId: "",
+ sortedIndex: dataSource.length
+ };
+ onChangeSortableList([...dataSource, obj]);
+ };
+ handleDeleteEmplist = (item) => {
+ const { dataSource, onChangeSortableList } = this.props;
+ onChangeSortableList(_.xorWith(dataSource, [item], _.isEqual));
+ };
+
+ render() {
+ const { dataSource, onChangeSortableList } = this.props;
+ const { empFieldListOptions } = this.state;
+ return (
+ }>
+
+
{
+ const { fieldName, canDelete } = item;
+ return
+ {fieldName}
+ {
+ canDelete &&
+ this.handleDeleteEmplist(item)}
+ />
+ }
+
;
+ }}
+ className="wea-sortable-grid-item"
+ />
+
+
+
+ );
+ }
+}
+
+export default LedgerSalaryItemBaseInfo;
+const TitleComp = () => {
+ return ;
+};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
new file mode 100644
index 00000000..26f9a98d
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemNormal.js
@@ -0,0 +1,252 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资项目-正常薪资所得
+ * Description:
+ * Date: 2022/12/13
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaButtonIcon, WeaSearchGroup } from "ecCom";
+import { Button, Modal } from "antd";
+import CategoryAddModal from "./categoryAddModal";
+import LedgerSalaryItemAddModal from "./ledgerSalaryItemAddModal";
+import LedgerSalaryItemTable from "./ledgerSalaryItemTable";
+import "./index.less";
+import FormalFormModal from "../../salaryItem/formalFormModal";
+
+@inject("ledgerStore")
+@observer
+class LedgerSalaryItemNormal extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ addCategoryItemsVisible: false,
+ categoryModal: {
+ visible: false,
+ title: "新增分类",
+ name: "",
+ id: ""
+ },
+ editFormulModal: {
+ visible: false,
+ formulaId: "",
+ valueType: "",
+ dataType: ""
+ },
+ //公式保存数据
+ formnulField: {},
+ formnulId: ""
+ };
+ }
+
+ componentWillUnmount() {
+ this.handleResetFormnul();
+ }
+
+ handleEditFormnul = (field, record) => {
+ const { valueType, formulaId, dateType: dataType, id } = record;
+ const { editFormulModal } = this.state;
+ this.setState({
+ editFormulModal: {
+ ...editFormulModal,
+ visible: true,
+ valueType, formulaId, dataType
+ },
+ formnulField: field,
+ formnulId: id
+ });
+ };
+ handleSaveFormnul = (data) => {
+ const { onSaveFormnul } = this.props;
+ const { formnulField, formnulId } = this.state;
+ const tmpV = _.cloneDeep(formnulField.items);
+ const formnulData = _.map(tmpV, it => {
+ if (it.id === formnulId) {
+ return { ...it, formulaId: data.id, formulaContent: data.formula };
+ }
+ return { ...it };
+ });
+ onSaveFormnul(formnulField.id, formnulData);
+ };
+ handleAddCategory = (name = "", id = "") => {
+ const { categoryModal } = this.state;
+ this.setState({
+ categoryModal: {
+ ...categoryModal,
+ visible: true,
+ name,
+ title: name ? "编辑分类" : "新增分类",
+ id
+ }
+ });
+ };
+ handleDeleteCategory = (id) => {
+ const { onDeleteCategroy } = this.props;
+ Modal.confirm({
+ title: "信息确认",
+ content: "确认要删除吗?",
+ onOk: () => {
+ onDeleteCategroy(id);
+ }
+ });
+ };
+ handleDeleteCategoryItems = (id, selectedRowKeys) => {
+ const { onDeleteCategroyItems } = this.props;
+ Modal.confirm({
+ title: "信息确认",
+ content: "确认删除所选薪资项目吗?删除后此项目下的进位规则/保留小数位/公式内容会一起被清除!",
+ onOk: () => {
+ onDeleteCategroyItems(id, selectedRowKeys);
+ }
+ });
+ };
+ handleUpgo = (sortedIndex) => {
+ const { onUpgo } = this.props;
+ onUpgo(sortedIndex);
+ };
+ handleDowngo = (sortedIndex) => {
+ const { onDowngo } = this.props;
+ onDowngo(sortedIndex);
+ };
+ handleClose = () => {
+ const { ledgerStore } = this.props;
+ const { categoryForm: form } = ledgerStore;
+ const { categoryModal } = this.state;
+ this.setState({
+ categoryModal: {
+ ...categoryModal,
+ visible: false,
+ title: "新增分类",
+ name: "",
+ id: ""
+ }
+ }, () => form.resetForm());
+ };
+ handleCloseFormnul = () => {
+ const { editFormulModal } = this.state;
+ this.setState({
+ editFormulModal: {
+ ...editFormulModal,
+ visible: false,
+ formulaId: "",
+ valueType: "", dataType: ""
+ }
+ });
+ };
+ handleResetFormnul = () => {
+ this.setState({
+ formnulField: {},
+ formnulId: ""
+ });
+ };
+
+ render() {
+ const {
+ dataSource,
+ onSaveCategory,
+ onDropCategoryItem,
+ onHandleItemhide,
+ onChangeSelectedRowKeys,
+ onAddSalaryItems
+ } = this.props;
+ const { categoryModal, addCategoryItemsVisible, editFormulModal } = this.state;
+ return (
+ }>
+
+ {
+ _.map(dataSource, field => {
+ const { items } = field;
+ return this.setState({ addCategoryItemsVisible: { visible: true, id } })}
+ onUpgo={this.handleUpgo}
+ onDowngo={this.handleDowngo}
+ />
+ }
+ >
+ onDropCategoryItem(field, data)}
+ onHandleItemhide={(data) => onHandleItemhide(field, data)}
+ onChangeSelectedRowKeys={(data) => onChangeSelectedRowKeys(field, data)}
+ onEditFormnul={(data) => this.handleEditFormnul(field, data)}
+ />
+ ;
+ })
+ }
+ this.setState({ addCategoryItemsVisible: { visible: false, id: "" } })}
+ onAddSalaryItems={onAddSalaryItems}
+ />
+
+ {/*公式编辑*/}
+ {
+ editFormulModal.visible &&
+
+ }
+
+
+ );
+ }
+}
+
+export default LedgerSalaryItemNormal;
+const TitleNormalComp = (props) => {
+ const {
+ name, onEditCategory, onDeleteCategory,
+ sortedIndex, dataSourceLen, id, onUpgo,
+ onDowngo, selectedRowKeys = [], onDeleteCategoryItems,
+ onAddCategoryItems
+ } = props;
+ return
+
+ {name}
+ {
+ name !== "未分类" &&
+ onEditCategory(name, id)}/>
+ }
+ {
+ name !== "未分类" &&
+ onDeleteCategory(id)}/>
+ }
+ {
+ sortedIndex !== 0 &&
+ onUpgo(sortedIndex)}/>
+ }
+ {
+ sortedIndex !== dataSourceLen - 1 &&
+ onDowngo(sortedIndex)}/>
+ }
+
+
+ onDeleteCategoryItems(id, selectedRowKeys)}/>
+ onAddCategoryItems(id)}/>
+
+
;
+};
+
+const TitleComp = (props) => {
+ const { onAddCategory } = props;
+ return
+ 正常工资薪金所得
+
+
;
+};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js
new file mode 100644
index 00000000..4498a36d
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js
@@ -0,0 +1,135 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资项目-列表数据
+ * Description:
+ * Date: 2022/12/13
+ */
+import React, { Component } from "react";
+import { WeaCheckbox, WeaHelpfulTip, WeaTable } from "ecCom";
+
+class LedgerSalaryItemTable extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectedRowKeys: []
+ };
+ }
+
+ /*
+ * Author: 黎永顺
+ * Description: 列表操作隐藏复选框
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleChangeItem = (value, id) => {
+ const { dataSource, onHandleItemhide } = this.props;
+ onHandleItemhide(
+ _.map([...dataSource], item => {
+ if (id === item.id) {
+ return {
+ ...item,
+ itemHide: String(value)
+ };
+ }
+ return { ...item };
+ })
+ );
+ };
+ handleChangeAllItem = (value) => {
+ const { dataSource, onHandleItemhide } = this.props;
+ onHandleItemhide(
+ _.map([...dataSource], item => {
+ return {
+ ...item,
+ itemHide: String(value)
+ };
+ })
+ );
+ };
+
+ render() {
+ const { dataSource, onDropCategoryItem, onChangeSelectedRowKeys, onEditFormnul } = this.props;
+ const { selectedRowKeys } = this.state;
+ const rowSelection = {
+ selectedRowKeys,
+ onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }, () => {
+ onChangeSelectedRowKeys(this.state.selectedRowKeys);
+ }),
+ getCheckboxProps: record => ({
+ disabled: !record.canDelete
+ })
+ };
+ const checkValue = _.every(dataSource, it => it.itemHide && it.itemHide === "1") ? "1" : "0";
+ const columns = [
+ {
+ title: "名称",
+ dataIndex: "name",
+ key: "name"
+ },
+ {
+ title:
+ 核算公式
+ } placement="bottom" width={200}/>
+ ,
+ dataIndex: "formulaContent",
+ key: "formulaContent",
+ render: (text, record) => {
+ if (record.canEdit) {
+ return (
+
+ onEditFormnul(record)}> {text}
+
+ );
+ } else {
+ return {text} ;
+ }
+ }
+ },
+ {
+ title: "个税申请表对应字段",
+ dataIndex: "taxDeclarationColumn",
+ key: "taxDeclarationColumn"
+ },
+ {
+ title:
+ this.handleChangeAllItem(value)}
+ />
+ 隐藏
+ ,
+ dataIndex: "itemHide",
+ key: "itemHide",
+ render: (text, record) => this.handleChangeItem(value, record.id)}
+ />
+ }
+ ];
+ return (
+ ({
+ index,
+ moveRow: record
+ })}
+ pagination={false}
+ onDrop={onDropCategoryItem}
+ draggable={true}
+ />
+ );
+ }
+}
+
+export default LedgerSalaryItemTable;
+
+const HelpContent = () => {
+ return
+ 1、新建薪资账套时,核算公式与【薪资项目管理】菜单一致;
+ 2、取值方式为公式的薪资项目,核算公式显示为具体公式;点击公式可编辑公式,核算时,按照当前薪资项目的公式进行核算;
+ 3、薪资账套内的薪资项目的公式或SQL的修改或公式的修改,都不影响【薪资项目管理】菜单的薪资项目取值方式或公式,只对当前账套生效;
+ ;
+};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
index 02402512..cf486f21 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -13,7 +13,8 @@ import LedgerBaseSetting from "./ledgerBaseSetting";
import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
-import { saveAdjustmentRule, saveLedgerBasic } from "../../../apis/ledger";
+import LedgerSalaryItem from "./ledgerSalaryItem";
+import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
import "./index.less";
const Step = WeaSteps.Step;
@@ -34,10 +35,19 @@ class LedgerSlide extends Component {
current: 0,
loading: false,
baseSettingInfo: {},
- adjustRules: []
+ adjustRules: [],
+ empFields: [], itemGroups: [],
+ saveSalarySobId: ""
};
}
+ componentWillUnmount() {
+ alert(1111);
+ this.setState({
+ saveSalarySobId: ""
+ });
+ }
+
/*
* Author: 黎永顺
* Description: 保存基本信息
@@ -57,13 +67,13 @@ class LedgerSlide extends Component {
return false;
}
this.setState({ loading: true });
- saveLedgerBasic({ ...extra, description, id: editId }).then(({ status, errormsg }) => {
+ saveLedgerBasic({ ...extra, description, id: editId }).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
const { onRefreshList } = this.props;
message.success("保存成功");
onRefreshList();
- !editId && this.setState({ current: current + 1 });
+ !editId && this.setState({ current: current + 1, saveSalarySobId: data });
} else {
message.error(errormsg || "保存失败");
}
@@ -76,9 +86,9 @@ class LedgerSlide extends Component {
* Date: 2022/12/12
*/
saveLedgerAdjustRule = () => {
- const { adjustRules } = this.state;
+ const { adjustRules, saveSalarySobId } = this.state;
const payload = {
- salarySobId: this.props.editId,
+ salarySobId: this.props.editId || saveSalarySobId,
ruleParams: adjustRules
};
this.setState({ loading: true });
@@ -86,12 +96,37 @@ class LedgerSlide extends Component {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
+ this.handleClose();
} else {
message.success(errormsg || "保存失败");
}
}).catch(() => this.setState({ loading: false }));
- }
- ;
+ };
+ /*
+ * Author: 黎永顺
+ * Description: 薪资项目保存
+ * Params:
+ * Date: 2022/12/14
+ */
+ saveLedgerItem = () => {
+ const { empFields, itemGroups, saveSalarySobId } = this.state;
+ const { editId: salarySobId } = this.props;
+ const payload = {
+ empFields,
+ itemGroups: _.filter(itemGroups, it => it.name !== "未分类"),
+ items: _.find(itemGroups, it => it.name === "未分类").items || [],
+ salarySobId: salarySobId || saveSalarySobId
+ };
+ this.setState({ loading: true });
+ saveLedgerItem(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success("保存成功");
+ } else {
+ message.error(errormsg || "保存失败");
+ }
+ }).catch(() => this.setState({ loading: false }));
+ };
handleChangeSlideTab = (current) => {
this.setState({ current: Number(current) });
};
@@ -107,22 +142,36 @@ class LedgerSlide extends Component {
handleChangeSaveParams = (baseSettingInfo) => {
this.setState({ baseSettingInfo });
};
+ /*
+ * Author: 黎永顺
+ * Description: 薪资项目保存数据
+ * Params:
+ * Date: 2022/12/14
+ */
+ handleSaveSalaryItemParams = (empFields, itemGroups) => {
+ this.setState({ empFields, itemGroups });
+ };
renderChildren = () => {
- const { current } = this.state;
+ const { current, saveSalarySobId } = this.state;
let CurrentDom = null;
switch (current) {
case 0:
CurrentDom = ;
break;
case 1:
- CurrentDom = ;
+ CurrentDom = ;
+ break;
+ case 2:
+ CurrentDom = ;
break;
case 3:
- CurrentDom = ;
+ CurrentDom = ;
break;
case 4:
CurrentDom =
- this.setState({ adjustRules })}/>;
+ this.setState({ adjustRules })}/>;
break;
default:
CurrentDom = null;
@@ -148,23 +197,34 @@ class LedgerSlide extends Component {
break;
case 1:
CurrentDom = !editId ? [
- ,
+ ,
] : [];
break;
case 2:
CurrentDom = !editId ?
[
- ,
+ ,
,
-
- ] : [];
+
+ ] : [
+
+ ];
break;
case 3:
CurrentDom = !editId ?
[
+ ,
,
-
+
] : [];
break;
case 4:
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/config.js b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
index 6bd81428..b130f4f6 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/config.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/config.js
@@ -27,6 +27,24 @@ export const copyConditions = [
defaultshow: true
}
];
+export const categoryConditions = [
+ {
+ items: [
+ {
+ colSpan: 1,
+ conditionType: "INPUT",
+ domkey: ["name"],
+ fieldcol: 14,
+ rules: "required|string",
+ label: "名称",
+ labelcol: 6,
+ value: "",
+ viewAttr: 3
+ }
+ ],
+ defaultshow: true
+ }
+];
export const baseSettingFormItem = [
{
key: "name",
@@ -720,7 +738,7 @@ export const roundingRules = [
key: "UP_EVEN",
selected: false,
showname: "向上求偶"
- },
+ }
];
export const keepDecimalPlaces = [
{
diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js
index 618cae74..848c22fb 100644
--- a/pc4mobx/hrmSalary/stores/ledger.js
+++ b/pc4mobx/hrmSalary/stores/ledger.js
@@ -4,12 +4,14 @@ import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/ledger"; // 引入API接口文件
import { notNull } from "../util/validate";
+import { categoryConditions } from "../pages/ledgerPage/config";
const { TableStore } = WeaTableNew;
export class LedgerStore {
//重构薪资账套
- @observable copyForm = new WeaForm(); // nrew 一个form
+ @observable copyForm = new WeaForm(); // 复制form
+ @observable categoryForm = new WeaForm(); // 新增分类form
/*******************************************************/
From d44b5d279ddd86f7ed13973594e2ec80bf764213 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Wed, 14 Dec 2022 19:40:05 +0800
Subject: [PATCH 25/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84,=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A0=B8=E7=AE=97=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=9B=9E?=
=?UTF-8?q?=E7=AE=97=E5=8A=9F=E8=83=BD=E4=BB=A5=E5=8F=8A=E6=A0=B8=E7=AE=97?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E8=A1=A5?=
=?UTF-8?q?=E5=8F=91=E5=B7=B2=E5=8F=91tab?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/calculate.js | 11 ++
pc4mobx/hrmSalary/pages/calculate/index.js | 10 ++
.../pages/calculateDetail/editSalaryDetail.js | 143 +++++++++++-------
.../calculateDetail/issuedAndReissueTable.js | 70 +++++++++
.../LedgerBackCalculatedSalaryItemTable.js | 18 ++-
.../components/ledgerBackCalcEditSlide.js | 10 +-
.../ledgerBackCalculatedSalaryItem.js | 2 +-
.../components/ledgerBaseSetting.js | 1 +
.../ledgerPage/components/ledgerSalaryItem.js | 23 ++-
.../components/ledgerSalaryItemAddModal.js | 3 +-
.../components/ledgerSalaryItemBaseInfo.js | 9 +-
.../ledgerSalaryItemPreviewModal.js | 63 ++++++++
.../ledgerPage/components/ledgerSlide.js | 1 -
.../pages/salaryItem/formalFormModal.js | 14 +-
pc4mobx/hrmSalary/stores/calculate.js | 17 ++-
15 files changed, 314 insertions(+), 81 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
create mode 100644 pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js
diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js
index c03ac28a..371a8763 100644
--- a/pc4mobx/hrmSalary/apis/calculate.js
+++ b/pc4mobx/hrmSalary/apis/calculate.js
@@ -333,6 +333,17 @@ export const fileSalaryAcct = (params) => {
}
}).then(res => res.json());
};
+// 薪资记录-回算
+export const backCalculate = (params) => {
+ return fetch("/api/bs/hrmsalary/salaryacct/backCalculate", {
+ method: "POST",
+ mode: "cors",
+ headers: {
+ "Content-Type": "application/json"
+ },
+ body: JSON.stringify(params)
+ }).then(res => res.json());
+};
// 薪资记录-重新核算
export const reAccounting = (params) => {
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js
index ff83ab84..34bf91b0 100644
--- a/pc4mobx/hrmSalary/pages/calculate/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/index.js
@@ -152,6 +152,14 @@ export default class Calculate extends React.Component {
});
}
+ // 回算
+ handleBackCalculate = (record) => {
+ const { calculateStore: { backCalculate } } = this.props;
+ backCalculate(record.id).then(() => {
+ this.handleSearch(this.state.searchValue);
+ });
+ };
+
// 查看详情回调
handleDetail(record) {
window.open(
@@ -222,6 +230,8 @@ export default class Calculate extends React.Component {
this.handleReaccount(record);
} else if (cz.text == "查看") {
this.handleDetail(record);
+ } else if (cz.text == "回算") {
+ this.handleBackCalculate(record);
}
}}>
{cz.text}
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js
index 385fa87b..e268ac5f 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js
@@ -1,13 +1,22 @@
import React from "react";
-import { WeaHelpfulTip, WeaInput } from "ecCom";
+import { WeaHelpfulTip, WeaInput, WeaTab } from "ecCom";
+import IssuedAndReissueTable from "./issuedAndReissueTable";
import { Col, Row } from "antd";
import { inject, observer } from "mobx-react";
+import { toJS } from "mobx";
import cs from "classnames";
import "./index.less";
@inject("calculateStore")
@observer
export default class EditSalaryDetail extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectedKey: "0"
+ };
+ }
+
componentWillMount() {
const { calculateStore: { acctresultDetail } } = this.props;
acctresultDetail(this.props.id);
@@ -62,6 +71,17 @@ export default class EditSalaryDetail extends React.Component {
render() {
const { calculateStore: { acctresultDetailForm } } = this.props;
+ const { selectedKey } = this.state;
+ const topTab = [
+ {
+ title: "正常工资薪金所得",
+ viewcondition: "0"
+ },
+ {
+ title: "已发补发",
+ viewcondition: "1"
+ }
+ ];
return (
@@ -84,39 +104,45 @@ export default class EditSalaryDetail extends React.Component {
}
-
-
-
-
输入项
-
-
- {
- acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map((item, index) => {
- const len = acctresultDetailForm.inputItems.length;
- return (
-
-
- {item.salaryItemName}
- {
- this.handleItemValueChange(item.salaryItemName, value, true);
- }}/>
-
-
- );
- })
- }
-
+ {
+ !_.isEmpty(toJS(acctresultDetailForm.issuedAndReissueItems)) &&
+
this.setState({ selectedKey: v })}
+ />
+ }
+ {
+ selectedKey === "0" &&
+
+
+
输入项
+
+
+ {
+ acctresultDetailForm.inputItems && acctresultDetailForm.inputItems.map((item, index) => {
+ const len = acctresultDetailForm.inputItems.length;
+ return (
+
+
+ {item.salaryItemName}
+ {
+ this.handleItemValueChange(item.salaryItemName, value, true);
+ }}/>
+
+
+ );
+ })
+ }
+
+
-
-
-
-
-
-
+
公式项
-
-
- {
- acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map((item, index) => {
- const len = acctresultDetailForm.formulaItems.length;
- return (
-
-
- {item.salaryItemName}
- {
- this.handleItemValueChange(item.salaryItemName, value, false);
- }}/>
-
-
- );
- })
- }
-
+
+
+ {
+ acctresultDetailForm.formulaItems && acctresultDetailForm.formulaItems.map((item, index) => {
+ const len = acctresultDetailForm.formulaItems.length;
+ return (
+
+
+ {item.salaryItemName}
+ {
+ this.handleItemValueChange(item.salaryItemName, value, false);
+ }}/>
+
+
+ );
+ })
+ }
+
+
-
+ }
+ {
+ selectedKey === "1" &&
+
+ }
);
}
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
new file mode 100644
index 00000000..ddeea850
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
@@ -0,0 +1,70 @@
+/*
+ * Author: 黎永顺
+ * name: 已发补发列表
+ * Description:
+ * Date: 2022/12/14
+ */
+import React, { Component } from "react";
+import { WeaHelpfulTip, WeaInputNumber, WeaTable } from "ecCom";
+
+class IssuedAndReissueTable extends Component {
+ render() {
+ const { dataSource } = this.props;
+ const columns = [
+ {
+ dataIndex: "salaryItemName",
+ title: "薪资项目",
+ render: (text) => {
+ return
{text};
+ }
+ },
+ {
+ dataIndex: "resultValue",
+ title:
+ 项目值
+
+ ,
+ render: (text, record) => {
+ const { canEdit } = record;
+ return
{
+ console.log(value);
+ }}
+ />;
+ }
+ },
+ {
+ dataIndex: "salaryBackItemFormula",
+ title:
+ 核算公式
+
+ ,
+ render: (text, record) => {
+ return {_.isNil(text) ? "输入" : text};
+ }
+ }
+ ];
+ return (
+
+ );
+ }
+}
+
+export default IssuedAndReissueTable;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js
index 5fa8bfdd..3788b5f9 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/LedgerBackCalculatedSalaryItemTable.js
@@ -19,20 +19,22 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
visible: false,
title: "编辑薪资项目",
id: "",
- salaryItemId: ""
+ salaryItemId: "",
+ backCalcType: ""
}
};
}
handleEditBackCalc = (record) => {
- const { id, salaryItemId } = record;
+ const { id, salaryItemId, backCalcType } = record;
const { backCalcEditSlide } = this.state;
this.setState({
backCalcEditSlide: {
...backCalcEditSlide,
visible: true,
id,
- salaryItemId
+ salaryItemId,
+ backCalcType
}
});
};
@@ -44,7 +46,8 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
...backCalcEditSlide,
visible: false,
id: "",
- salaryItemId: ""
+ salaryItemId: "",
+ backCalcType: ""
}
}, () => {
isRefresh && onRefresh();
@@ -53,7 +56,7 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
render() {
const { backCalcEditSlide } = this.state;
- const { taxAgentStore: { showOperateBtn }, dataSource, editId } = this.props;
+ const { taxAgentStore: { showOperateBtn }, dataSource, editId, saveSalarySobId, key } = this.props;
const columns = [
{
dataIndex: "name",
@@ -76,7 +79,8 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
render: (text, record, index) => {
const { canEdit } = record;
return (showOperateBtn && canEdit) ?
- this.handleEditBackCalc(record)}>编辑 : ;
+ this.handleEditBackCalc(record)}>编辑 :
+ ;
}
}
];
@@ -90,7 +94,7 @@ class LedgerBackCalculatedSalaryItemTable extends Component {
/>
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
index f6f13e6b..6386dbff 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
@@ -27,7 +27,8 @@ class LedgerBackCalcEditSlide extends Component {
backCalcEditFormulModal: {
visible: false,
valueType: "",
- dataType: ""
+ dataType: "",
+ backCalcType: ""
}
};
}
@@ -72,13 +73,15 @@ class LedgerBackCalcEditSlide extends Component {
}).catch(() => this.setState({ loading: false }));
};
handleEditFormnul = () => {
+ const { backCalcType } = this.props;
const { backCalcEditFormulModal, valueType, dataType } = this.state;
this.setState({
backCalcEditFormulModal: {
...backCalcEditFormulModal,
visible: true,
valueType,
- dataType: _.lowerCase(dataType)
+ dataType: _.lowerCase(dataType),
+ backCalcType
}
});
};
@@ -89,7 +92,8 @@ class LedgerBackCalcEditSlide extends Component {
...backCalcEditFormulModal,
visible: false,
valueType: "",
- dataType: ""
+ dataType: "",
+ backCalcType: ""
}
});
};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
index 6d39fd12..80764a70 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalculatedSalaryItem.js
@@ -77,7 +77,7 @@ class LedgerBackCalculatedSalaryItem extends Component {
>
);
})
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js
index 29f4af17..538a1b92 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js
@@ -11,6 +11,7 @@ import { inject, observer } from "mobx-react";
import { baseSettingFormItem } from "../config";
import { getLedgerBasicForm } from "../../../apis/ledger";
import { getAddMonthYearMonth, getCurrentYearMonth, getSubtractMonthYearMonth } from "../../../util/date";
+import moment from "moment";
import "./index.less";
@inject("taxAgentStore")
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
index 45bd3000..6af6af3a 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
@@ -7,6 +7,7 @@
import React, { Component } from "react";
import LedgerSalaryItemBaseInfo from "./ledgerSalaryItemBaseInfo";
import LedgerSalaryItemNormal from "./ledgerSalaryItemNormal";
+import LedgerSalaryItemPreviewModal from "./ledgerSalaryItemPreviewModal";
import { getLedgerItemForm } from "../../../apis/ledger";
import "./index.less";
@@ -14,6 +15,7 @@ class LedgerSalaryItem extends Component {
constructor(props) {
super(props);
this.state = {
+ previewVisible: false, //预览标识
empFields: [], //员工基本信息
itemGroups: [] //正常工资薪金所得项
};
@@ -125,7 +127,8 @@ class LedgerSalaryItem extends Component {
if (item.id === id) {
return {
...item,
- items: _.filter(item.items, it => !selectedRowKeys.includes(it.id))
+ items: _.filter(item.items, it => !selectedRowKeys.includes(it.id)),
+ selectedRowKeys: []
};
}
return { ...item };
@@ -271,13 +274,29 @@ class LedgerSalaryItem extends Component {
});
};
+ /*
+ * Author: 黎永顺
+ * Description: 员工基本信息-预览
+ * Params:
+ * Date: 2022/12/14
+ */
+ handlePreview = () => {
+ this.setState({ previewVisible: true });
+ };
+
render() {
- const { empFields, itemGroups } = this.state;
+ const { empFields, itemGroups, previewVisible } = this.state;
return (
+
this.setState({ previewVisible: false })}
/>
this.ledgerSalaryItemNormalRef = dom}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
index 0df63310..d669d295 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemAddModal.js
@@ -83,12 +83,13 @@ export default class LedgerSalaryItemAddModal extends React.Component {
const { dataSource, selectedRowKeys } = this.state;
const { onAddSalaryItems, id, onCancel } = this.props;
let selectItems = [];
- dataSource.map(item => {
+ dataSource.map((item, index) => {
item = { ...item };
selectedRowKeys.map(key => {
if (item.id === key) {
item.salaryItemId = item.id;
item.key = item.id;
+ item.sortedIndex = index;
selectItems.push(item);
}
});
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
index 7d399054..6961ded8 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemBaseInfo.js
@@ -50,10 +50,10 @@ class LedgerSalaryItemBaseInfo extends Component {
};
render() {
- const { dataSource, onChangeSortableList } = this.props;
+ const { dataSource, onChangeSortableList, onPreview } = this.props;
const { empFieldListOptions } = this.state;
return (
- }>
+ }>
{
+const TitleComp = (props) => {
+ const { onPreview } = props;
return
员工基本信息
@@ -98,6 +99,6 @@ const TitleComp = () => {
placement="topLeft"
/>
-
+
;
};
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js
new file mode 100644
index 00000000..281d2257
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemPreviewModal.js
@@ -0,0 +1,63 @@
+import React from "react";
+import { WeaDialog, WeaTable } from "ecCom";
+
+export default class LedgerSalaryItemPreviewModal extends React.Component {
+ getColumns = () => {
+ const { empFields, itemGroups } = this.props;
+ let columns = [];
+ let length = 0;
+ empFields.map(item => {
+ columns.push({
+ title: item.fieldName,
+ key: item.fieldId,
+ width: 150
+ });
+ length++;
+ });
+
+ itemGroups.map(item => {
+ if (item.id !== "default") {
+ let columnItem = {
+ title: item.name,
+ children: item.items.map(i => {
+ return {
+ title: i.name,
+ key: i.id,
+ width: 150
+ };
+ length++;
+ })
+ };
+ columns.push(columnItem);
+ }
+ });
+
+ itemGroups.map(item => {
+ if (item.id === "default") {
+ item.items.map(i => {
+ columns.push({
+ title: i.name,
+ key: i.id,
+ width: 150
+ });
+ length++;
+ });
+ }
+ });
+ return { columns, length };
+ };
+
+ render() {
+ const { onCancel, visible } = this.props;
+ return (
+
+
+
+ );
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
index cf486f21..09b1f1cc 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -42,7 +42,6 @@ class LedgerSlide extends Component {
}
componentWillUnmount() {
- alert(1111);
this.setState({
saveSalarySobId: ""
});
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
index 92de743a..5d1d327c 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
@@ -10,6 +10,8 @@ export default class FormalFormModal extends React.Component {
constructor(props) {
super(props);
this.state = {
+ returnType: "",
+ validateType: "",
value: "",
extendParam: {
sqlReturnKey: "",
@@ -35,7 +37,9 @@ export default class FormalFormModal extends React.Component {
if (this.props.formulaId) {
detailFormual(this.props.formulaId).then(data => {
this.setState({
- value: data.formula
+ value: data.formula,
+ returnType: data.returnType,
+ validateType: data.validateType
});
this.parameters = data.parameters;
this.referenceType = data.referenceType;
@@ -68,8 +72,8 @@ export default class FormalFormModal extends React.Component {
if (this.props.valueType == "3") {
groupParams = { "referenceType": "sql" };
} else if (this.props.valueType === "FORMULA") {
- groupParams = { "referenceType": "backCalc" };
- this.referenceType = "backCalc";
+ groupParams = this.props.backCalcType === "issuedItems" ? { "referenceType": "backCalc" } : {};
+ this.referenceType = "formula";
this.setState({
value: this.props.formulaContent
});
@@ -191,8 +195,8 @@ export default class FormalFormModal extends React.Component {
description: "备注",
module: "salary",
useFor: "salaryitem",
- returnType: this.props.dataType,
- validateType: this.props.dataType,
+ returnType: this.props.dataType || this.state.returnType,
+ validateType: this.props.dataType || this.state.returnType,
extendParam: JSON.stringify(this.state.extendParam),
formula: this.state.value,
parameters: this.parameters,
diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js
index c1f420ff..63b5b235 100644
--- a/pc4mobx/hrmSalary/stores/calculate.js
+++ b/pc4mobx/hrmSalary/stores/calculate.js
@@ -3,6 +3,7 @@ import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import * as API from "../apis/calculate";
+import { backCalculate } from "../apis/calculate";
const { TableStore } = WeaTableNew;
@@ -466,7 +467,21 @@ export class calculateStore {
}
});
});
-
+ };
+ // 薪资记录-回算
+ @action
+ backCalculate = (salaryAcctRecordId) => {
+ return new Promise((resolve, reject) => {
+ API.backCalculate({ salaryAcctRecordId }).then(res => {
+ if (res.status) {
+ message.success("回算成功");
+ resolve();
+ } else {
+ message.error(res.errormsg || "回算失败");
+ reject();
+ }
+ });
+ });
};
// 薪资结果-编辑表单保存
From 11120294d9802f76847c0526f4a260dd0dbcd066 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Thu, 15 Dec 2022 10:07:05 +0800
Subject: [PATCH 26/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pages/calculateDetail/editSalaryDetail.js | 30 +++++++++++++------
.../calculateDetail/issuedAndReissueTable.js | 6 ++--
.../pages/calculateDetail/salaryDetail.js | 2 +-
.../components/ledgerBackCalcEditSlide.js | 12 +++++---
.../pages/salaryItem/formalFormModal.js | 2 ++
pc4mobx/hrmSalary/stores/calculate.js | 9 +++++-
6 files changed, 42 insertions(+), 19 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js
index e268ac5f..075c55a1 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/editSalaryDetail.js
@@ -22,28 +22,37 @@ export default class EditSalaryDetail extends React.Component {
acctresultDetail(this.props.id);
}
- handleItemValueChange(field, value, isInput) {
+ handleItemValueChange = (field, value, isInput) => {
+ console.log(field, value, isInput);
const { calculateStore: { acctresultDetailForm, setAcctresultDetailForm } } = this.props;
let form = { ...acctresultDetailForm };
- if (isInput) {
+ if (isInput === "inputItems") {
form.inputItems = acctresultDetailForm.inputItems.map(item => {
item = { ...item };
- if (item.salaryItemName == field) {
+ if (item.salaryItemName === field) {
item.resultValue = value;
}
return item;
});
- } else {
+ } else if (isInput === "formulaItems") {
form.formulaItems = acctresultDetailForm.formulaItems.map(item => {
item = { ...item };
- if (item.salaryItemName == field) {
+ if (item.salaryItemName === field) {
+ item.resultValue = value;
+ }
+ return item;
+ });
+ } else if (isInput === "issuedAndReissueItems") {
+ form.issuedAndReissueItems = acctresultDetailForm.issuedAndReissueItems.map(item => {
+ item = { ...item };
+ if (item.salaryItemName === field) {
item.resultValue = value;
}
return item;
});
}
setAcctresultDetailForm(form);
- }
+ };
renderTableTr = (data, isInput) => {
const tables = [];
@@ -132,7 +141,7 @@ export default class EditSalaryDetail extends React.Component {
"borderB-none": Math.ceil((index + 1) / 3) === len / 3,
"borderR-none": (index + 1) % 3 === 0
})}> {
- this.handleItemValueChange(item.salaryItemName, value, true);
+ this.handleItemValueChange(item.salaryItemName, value, "inputItems");
}}/>
@@ -166,7 +175,7 @@ export default class EditSalaryDetail extends React.Component {
"borderB-none": Math.ceil((index + 1) / 3) === len / 3,
"borderR-none": (index + 1) % 3 === 0
})}> {
- this.handleItemValueChange(item.salaryItemName, value, false);
+ this.handleItemValueChange(item.salaryItemName, value, "formulaItems");
}}/>
@@ -180,7 +189,10 @@ export default class EditSalaryDetail extends React.Component {
}
{
selectedKey === "1" &&
-
+
}
);
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
index ddeea850..ff82bad7 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
@@ -9,7 +9,7 @@ import { WeaHelpfulTip, WeaInputNumber, WeaTable } from "ecCom";
class IssuedAndReissueTable extends Component {
render() {
- const { dataSource } = this.props;
+ const { dataSource, onChangeIssueReissueValue } = this.props;
const columns = [
{
dataIndex: "salaryItemName",
@@ -35,9 +35,7 @@ class IssuedAndReissueTable extends Component {
min={0}
precision={2}
value={text || 0}
- onChange={(value) => {
- console.log(value);
- }}
+ onChange={(value) => onChangeIssueReissueValue(record.salaryItemName, value, "issuedAndReissueItems")}
/>;
}
},
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js
index a7791cba..91cf2263 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js
@@ -266,7 +266,7 @@ export default class SalaryDetail extends React.Component {
measure={"%"}
title={
this.handleEditSlideSave()}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
index 6386dbff..b427977f 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBackCalcEditSlide.js
@@ -24,11 +24,13 @@ class LedgerBackCalcEditSlide extends Component {
roundingMode: "",
valueType: "",
salaryItem: [],
+ formulaId: "",
backCalcEditFormulModal: {
visible: false,
valueType: "",
dataType: "",
- backCalcType: ""
+ backCalcType: "",
+ formulaId: ""
}
};
}
@@ -74,14 +76,15 @@ class LedgerBackCalcEditSlide extends Component {
};
handleEditFormnul = () => {
const { backCalcType } = this.props;
- const { backCalcEditFormulModal, valueType, dataType } = this.state;
+ const { backCalcEditFormulModal, valueType, dataType, formulaId } = this.state;
this.setState({
backCalcEditFormulModal: {
...backCalcEditFormulModal,
visible: true,
valueType,
dataType: _.lowerCase(dataType),
- backCalcType
+ backCalcType,
+ formulaId
}
});
};
@@ -93,7 +96,8 @@ class LedgerBackCalcEditSlide extends Component {
visible: false,
valueType: "",
dataType: "",
- backCalcType: ""
+ backCalcType: "",
+ formulaId: ""
}
});
};
diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
index 5d1d327c..f521f909 100644
--- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
+++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js
@@ -64,6 +64,8 @@ export default class FormalFormModal extends React.Component {
let groupParams = {};
if (this.referenceType == "sql") {
groupParams = { "referenceType": "sql" };
+ }else{
+ groupParams = this.props.backCalcType === "issuedItems" ? { "referenceType": "backCalc" } : {};
}
salaryAcctImportTemplateParam(groupParams);
});
diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js
index 63b5b235..3b7c9820 100644
--- a/pc4mobx/hrmSalary/stores/calculate.js
+++ b/pc4mobx/hrmSalary/stores/calculate.js
@@ -501,7 +501,14 @@ export class calculateStore {
return record;
});
- let items = inputItems.concat(formulaItems);
+ let issuedAndReissueItems = this.acctresultDetailForm.issuedAndReissueItems.map(item => {
+ let record = {};
+ record.salaryItemId = item.salaryItemId;
+ record.resultValue = item.resultValue;
+ return record;
+ });
+
+ let items = inputItems.concat(formulaItems).concat(issuedAndReissueItems);
let params = {
salaryAcctEmpId: recordId,
items
From 78b8d796f069b4e52294a047218f74be3766cccb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Thu, 15 Dec 2022 11:59:45 +0800
Subject: [PATCH 27/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=87=8D=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/pages/calculate/index.js | 25 +++++++++++++++----
pc4mobx/hrmSalary/pages/calculate/index.less | 16 ++++++++++++
.../components/ledgerAssociatedPersonnel.js | 2 +-
.../hrmSalary/pages/payroll/SalarySendList.js | 23 +++++++++++++----
4 files changed, 55 insertions(+), 11 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js
index 34bf91b0..d1f23346 100644
--- a/pc4mobx/hrmSalary/pages/calculate/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/index.js
@@ -1,15 +1,15 @@
import React from "react";
import { inject, observer } from "mobx-react";
-import { Button, DatePicker, Dropdown, Menu, message, Modal } from "antd";
+import { Button, DatePicker, Dropdown, Menu, message, Modal, Tag } from "antd";
import { WeaInputSearch, WeaTop } from "ecCom";
import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
-
import { columns } from "./columns";
import moment from "moment";
import BaseFormModal from "./baseFormModal";
import CustomPaginationTable from "../../components/customPaginationTable";
import ProgressModal from "../../components/progressModal";
+import "./index.less";
const MonthPicker = DatePicker.MonthPicker;
@@ -169,13 +169,28 @@ export default class Calculate extends React.Component {
}
// 获取列表
- getColumns() {
+ getColumns = () => {
const {
calculateStore: { salaryListColumns },
taxAgentStore: { showOperateBtn }
} = this.props;
- let columns = [...salaryListColumns];
+ let columns = [...salaryListColumns].filter(item => item.dataIndex !== "backCalcStatus" && item.dataIndex !== "acctTimes");
columns.map(item => {
+ if (item.dataIndex === "salarySobName") {
+ item.width = 300;
+ item.render = (text, record) => {
+ return
+
{text}
+
+ {
+ record.backCalcStatus === 1 &&
+
+ }
+ {`第${record.acctTimes}次`}
+
+
;
+ };
+ }
if (item.title == "操作" && showOperateBtn) {
item.render = (text, record) => {
const accountBtn = _.filter(
@@ -252,7 +267,7 @@ export default class Calculate extends React.Component {
}
});
return showOperateBtn ? columns : _.filter(columns, it => it.title != "操作");
- }
+ };
// 分页
handleDataPageChange(value) {
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.less b/pc4mobx/hrmSalary/pages/calculate/index.less
index 1a510f08..59c90584 100644
--- a/pc4mobx/hrmSalary/pages/calculate/index.less
+++ b/pc4mobx/hrmSalary/pages/calculate/index.less
@@ -13,3 +13,19 @@
}
}
}
+
+.salarySobNameWrapper{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+ .salarySobNameTagWrapper{
+ display: flex;
+ align-items: center;
+ i{
+ color: #5d9cec;
+ margin-right: 10px;
+ cursor: pointer;
+ }
+ }
+}
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
index 5aa85886..f77d31fa 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAssociatedPersonnel.js
@@ -140,7 +140,7 @@ class LedgerAssociatedPersonnel extends Component {
{...personalAddModal}
APISaveFox={APISaveFox}
isTaxgent={false}
- saveKeyVal={{ key: "salarySobId", value: editId }}
+ saveKeyVal={{ key: "salarySobId", value: editId || saveSalarySobId }}
onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()}
onCancel={() =>
this.setState({
diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
index 8839fdbd..060feaf6 100644
--- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
+++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
@@ -1,8 +1,9 @@
import React from "react";
import { inject, observer } from "mobx-react";
-import { message } from "antd";
+import { message, Tag } from "antd";
import moment from "moment";
import CustomPaginationTable from "../../components/customPaginationTable";
+import "../calculate/index.less";
@inject("payrollStore", "taxAgentStore")
@observer
@@ -49,10 +50,8 @@ export default class SalarySendList extends React.Component {
getColumns = () => {
const { payrollStore: { salarySendTableStore }, taxAgentStore: { showOperateBtn } } = this.props;
const { columns } = salarySendTableStore;
- if (!columns) {
- return [];
- }
- let result = columns.filter(item => item.hide === "false");
+ if (!columns) return [];
+ let result = columns.filter(item => (item.hide === "false" && item.dataIndex !== "acctTimes"));
result.map(item => {
if (item.dataIndex === "salaryYearMonth") {
item.render = (text, record) => {
@@ -70,6 +69,20 @@ export default class SalarySendList extends React.Component {
);
};
+ } else if (item.dataIndex === "salarySob") {
+ item.width = 300;
+ item.render = (text, record) => {
+ return
+
{text}
+
+ {
+ record.sendStatus === 1 &&
+ 补发
+ }
+ {`第${record.acctTimes}次`}
+
+
;
+ };
}
});
showOperateBtn
From 47bc638cdb590e88521a0915b4a68ec356dda85a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Thu, 15 Dec 2022 16:21:56 +0800
Subject: [PATCH 28/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A0=B8=E7=AE=97?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/pages/calculate/index.js | 27 +++-------
pc4mobx/hrmSalary/pages/payrollFiles/index.js | 50 ++++++++++++++++---
2 files changed, 51 insertions(+), 26 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js
index d1f23346..3ac81ef4 100644
--- a/pc4mobx/hrmSalary/pages/calculate/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/index.js
@@ -4,7 +4,6 @@ import { Button, DatePicker, Dropdown, Menu, message, Modal, Tag } from "antd";
import { WeaInputSearch, WeaTop } from "ecCom";
import { renderNoright } from "../../util"; // 渲染form数据的方法:因为多个页面都会使用,所以抽的公共方法在util中
import CustomTab from "../../components/customTab";
-import { columns } from "./columns";
import moment from "moment";
import BaseFormModal from "./baseFormModal";
import CustomPaginationTable from "../../components/customPaginationTable";
@@ -26,25 +25,7 @@ export default class Calculate extends React.Component {
searchValue: "",
startDate: moment(new Date()).startOf("year").format("YYYY-MM"),
endDate: moment(new Date()).startOf("month").format("YYYY-MM"),
- current: 1,
- columns: columns.map(item => {
- if (item.dataIndex == "cz") {
- item.render = () =>
- ;
- }
- })
+ current: 1
};
this.pageInfo = { current: 1, pageSize: 10 };
}
@@ -141,6 +122,12 @@ export default class Calculate extends React.Component {
message.success("归档成功");
this.handleSearch(this.state.searchValue);
});
+ }).catch(() => {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
});
}
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js
index 2d87d3da..7373b6da 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js
@@ -14,13 +14,13 @@ import {
WeaFormItem,
WeaHelpfulTip,
WeaInput,
+ WeaPopoverHrm,
WeaSearchGroup,
WeaSelect,
WeaSlideModal,
WeaTab,
WeaTable,
- WeaTop,
- WeaPopoverHrm
+ WeaTop
} from "ecCom";
import { WeaTableNew } from "comsMobx";
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
@@ -230,8 +230,6 @@ class Index extends Component {
} else {
message.error(errormsg || "操作失败!");
}
- }).catch(err => {
- console.log(err);
});
}
});
@@ -289,6 +287,33 @@ class Index extends Component {
}
});
};
+ handleClick = ({ key }) => {
+ const { selectedRowKeys } = this.state;
+ if (selectedRowKeys.length === 0) {
+ message.warning("请选择表格数据");
+ return;
+ }
+ if (key === "batchDelete") {
+ this.deletePendingTodo(selectedRowKeys);
+ } else {
+ API.gotoFixed(selectedRowKeys).then(({ status, data, errormsg }) => {
+ if (status) {
+ if (data.type === "success") {
+ message.success("操作成功!");
+ this.setState({
+ selectedRowKeys: []
+ }, () => {
+ this.query();
+ });
+ } else {
+ message.info(data.msg);
+ }
+ } else {
+ message.error(errormsg || "操作失败!");
+ }
+ });
+ }
+ };
getRightOptionBtns = () => {
const { selectedKey, importType, selectedRowKeys, searchItemsValue, pageInfo } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
@@ -304,7 +329,20 @@ class Index extends Component {
verticalAlign: "middle"
}}/>
,
-
+ ,
+
+ 批量设为发薪员工
+ 批量删除待办
+
+ }
+ >
+
+
];
} else if (selectedKey === "fixed" && showOperateBtn) {
return [
@@ -427,7 +465,7 @@ class Index extends Component {
;
}
};
- }else if (item.dataIndex === "operate") {
+ } else if (item.dataIndex === "operate") {
return {
...item,
fixed: "right",
From 9b6c8ed544dfd0fd93a864d444a8a7b79a0dc57b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 10:47:59 +0800
Subject: [PATCH 29/38] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?=
=?UTF-8?q?=E5=8F=B0=E8=B4=A6=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E7=9A=84?=
=?UTF-8?q?=E8=A1=A5=E7=BC=B4=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/welfareArchive.js | 6 +-
.../socialSecurityBenefits/archives/index.js | 23 ++-
.../standingBook/index.js | 56 ++++---
.../standingBookDetail/components/index.less | 8 +
.../standingBookDetail/components/normal.js | 139 +++++++++++++-----
5 files changed, 170 insertions(+), 62 deletions(-)
diff --git a/pc4mobx/hrmSalary/apis/welfareArchive.js b/pc4mobx/hrmSalary/apis/welfareArchive.js
index 5c1a1b48..974ed260 100644
--- a/pc4mobx/hrmSalary/apis/welfareArchive.js
+++ b/pc4mobx/hrmSalary/apis/welfareArchive.js
@@ -17,10 +17,14 @@ export const queryList = (params) => {
export const queryInsuranceTabTotal = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/queryInsuranceTabTotal', params);
};
-//删除待办
+//删除待办-待增员
export const updateRunStatus = (params) => {
return postFetch('/api/bs/hrmsalary/archives/updateRunStatus', params);
};
+//删除待办-待减员
+export const cancelStayDel = (params) => {
+ return postFetch('/api/bs/hrmsalary/archives/cancelStayDel', params);
+};
//全量增员
export const allStayAddToPay = (params) => {
return WeaTools.callApi('/api/bs/hrmsalary/archives/allStayAddToPay', 'GET', params);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
index d574bacb..7f451cbf 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.js
@@ -174,17 +174,17 @@ export default class Archives extends React.Component {
placement="bottomRight"
content={} title="">
@@ -401,6 +401,8 @@ export default class Archives extends React.Component {
case "suspend":
if (key === "1") {
this.stayDelToStop(selectedRowKeys);
+ } else if (key === "2") {
+ this.cancelStayDel({ runStatus: "3", ids: selectedRowKeys });
}
break;
default:
@@ -454,7 +456,7 @@ export default class Archives extends React.Component {
}
});
};
- //删除待办
+ //删除待办-待增员
deleteTodoList = (payload) => {
API.updateRunStatus(payload).then(({ status, errormsg }) => {
if (status) {
@@ -466,6 +468,18 @@ export default class Archives extends React.Component {
}
});
};
+ //删除待办-待减员
+ cancelStayDel = (payload) => {
+ API.cancelStayDel(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("操作成功");
+ this.query();
+ this.onSelectChange([]);
+ } else {
+ message.error(errormsg || "操作失败");
+ }
+ });
+ };
getTipChildren = () => {
const { selectedKey } = this.state;
@@ -649,6 +663,7 @@ export default class Archives extends React.Component {
overlay={
}
type="primary"
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
index d8cb4cf3..baf15d91 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/index.js
@@ -9,6 +9,7 @@ import CustomPaginationTable from "../../../components/customPaginationTable";
import moment from "moment";
import _ from "lodash";
import ProgressModal from "../../../components/progressModal";
+import { getCalculateProgress } from "../../../apis/calculate";
import "./index.less";
const MonthPicker = DatePicker.MonthPicker;
@@ -318,39 +319,54 @@ export default class StandingBook extends React.Component {
break;
}
};
- handleOk = (formVal) => {
+ handleOk = async (formVal) => {
const { save } = this.props.standingBookStore;
const { billMonth, ...extra } = formVal;
const payload = {
billMonth: moment(billMonth).format("YYYY-MM"),
...extra
};
- save(payload).then(({ data }) => {
- this.setState({
- progressVisible: true
- }, () => {
- this.timer = setInterval(() => {
- if (this.state.progress !== 100) {
- this.setState({
- progress: this.state.progress + 10
- });
+ const { data: saveData } = await save(payload);
+ this.setState({
+ progressVisible: true
+ }, () => {
+ this.timer = setInterval(() => {
+ getCalculateProgress(moment(billMonth).format("YYYY-MM")).then(({ status, data }) => {
+ if (status) {
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: (Number(data.progress).toFixed(2)) * 100
+ });
+ } else {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ }, () => {
+ message.success("核算成功");
+ this.handleClose();
+ this.getCommonList({
+ ...this.state.tableParams,
+ current: this.state.current
+ });
+ this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", saveData);
+ });
+ }
} else {
clearInterval(this.timer);
this.setState({
progressVisible: false,
progress: 0
- }, () => {
- message.success("核算成功");
- this.handleClose();
- this.getCommonList({
- ...this.state.tableParams,
- current: this.state.current
- });
- this.handleGoDetail(moment(billMonth).format("YYYY-MM"), "", extra.paymentOrganization ? extra.paymentOrganization : "", data);
});
}
- }, 1000);
- });
+ }).catch(() => {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ });
+ }, 600);
});
};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
index c3f0ab99..84b963f0 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
@@ -37,6 +37,14 @@
margin-right: 0px;
}
}
+
+ .tdEllipsis {
+ display: inline-block;
+ width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
}
//退差
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
index 5892b500..aab96473 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
@@ -14,8 +14,10 @@ import { getQueryString } from "../../../../util/url";
import ProgressModal from "../../../../components/progressModal";
import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
import AdjustmentSlide from "./adjustmentSlide";
+import { getCalculateProgress } from "../../../../apis/calculate";
import _ from "lodash";
import "./index.less";
+import RegEditDetial from "./regEditDetial";
@inject("standingBookStore")
@observer
@@ -46,6 +48,11 @@ export default class NormalIndex extends Component {
fieldData: {}, //选中的表单头信息
importParams: { //导入信息的弹框表示
visible: false
+ },
+ returnEditPersonSlide: {
+ title: "",
+ editId: "",
+ visible: false
}
};
this.timer = null;
@@ -192,7 +199,6 @@ export default class NormalIndex extends Component {
...it,
width: 150,
fixed: "left",
-
render: (text, r) => {
const { userName, employeeId } = r;
return (
@@ -362,40 +368,52 @@ export default class NormalIndex extends Component {
handleCommonAccountClick() {
const { billMonth, selectedKey, paymentOrganization } = this.props;
const { commonAccount } = this.props.standingBookStore;
- commonAccount({
- billMonth,
- paymentOrganization,
- includes: []
- }).then(() => {
- this.setState({
- progressVisible: true
- }, () => {
- this.timer = setInterval(() => {
- if (this.state.progress !== 100) {
- this.setState({
- progress: this.state.progress + 10
- });
+ commonAccount({ billMonth, paymentOrganization, includes: [] });
+ this.setState({
+ progressVisible: true
+ }, () => {
+ this.timer = setInterval(() => {
+ getCalculateProgress(billMonth).then(({ status, data }) => {
+ if (status) {
+ if (this.state.progress !== 100) {
+ this.setState({
+ progress: (Number(data.progress).toFixed(2)) * 100
+ });
+ } else {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ }, () => {
+ message.success("核算成功");
+ selectedKey === "1"
+ ? this.getNormalList({
+ billMonth,
+ paymentOrganization,
+ current: this.state.current
+ })
+ : this.getSupplementaryList({
+ billMonth,
+ paymentOrganization,
+ current: this.state.current
+ });
+ });
+ }
} else {
clearInterval(this.timer);
- message.success("核算成功");
this.setState({
progressVisible: false,
progress: 0
});
- selectedKey === "1"
- ? this.getNormalList({
- billMonth,
- paymentOrganization,
- current: this.state.current
- })
- : this.getSupplementaryList({
- billMonth,
- paymentOrganization,
- current: this.state.current
- });
}
- }, 1000);
- });
+ }).catch(() => {
+ clearInterval(this.timer);
+ this.setState({
+ progressVisible: false,
+ progress: 0
+ });
+ });
+ }, 600);
});
}
@@ -410,15 +428,25 @@ export default class NormalIndex extends Component {
window.open(url, "_self");
};
+ handleEditNormalStandingBook = (record) => {
+ const { userName, id: editId } = record;
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
+ });
+ };
+ handleCloseNormalStandingBookModal = () => {
+ const { returnPersonModal, returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
+ }, () => {
+ });
+ };
+
render() {
const { remarks, billMonth, selectedKey, paymentOrganization } = this.props;
- const { selectedRowKeys, addProps, adjustSlide, importParams } = this.state;
- const {
- loading,
- form,
- condition,
- saveLoading
- } = this.props.standingBookStore;
+ const { selectedRowKeys, addProps, adjustSlide, importParams, returnEditPersonSlide } = this.state;
+ const { loading, form, condition, saveLoading } = this.props.standingBookStore;
let { list, columns, total } = this.state.tableData;
const rowSelection = {
selectedRowKeys,
@@ -457,9 +485,43 @@ export default class NormalIndex extends Component {
});
}
};
+ columns = _.map(toJS(columns), item => {
+ if (item.dataIndex === "employeeId") {
+ return { ...item };
+ }
+ return {
+ ...item,
+ render: (text) => {
+ return {text};
+ }
+ };
+ });
+ if (selectedKey === "3") {
+ columns = [
+ ...columns,
+ {
+ title: "操作",
+ dataIndex: "operate",
+ fixed: "right",
+ width: "120px",
+ render: (text, record) => {
+ return (
+
+ );
+ }
+ }
+ ];
+ }
return (
- {selectedKey === "1" &&
+ {
+ selectedKey === "1" &&
@@ -478,7 +540,8 @@ export default class NormalIndex extends Component {
{remarks}
-
}
+
+ }
{this.props.type !== "detail" && this.props.selectedKey == "3"
?
@@ -624,6 +687,8 @@ export default class NormalIndex extends Component {
scroll={{ x: 1200, y: "calc(100vh - 233px)" }}
/>
+ {/*编辑弹框*/}
+
{
From 00f87ba5e5ce1fc4ee5da69e4f34f91d9587b501 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 11:05:07 +0800
Subject: [PATCH 30/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E9=9D=9E=E7=A9=BA=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js
index 538a1b92..9181b6d3 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js
@@ -78,7 +78,7 @@ class LedgerBaseSetting extends Component {
const { settingBaseInfo } = this.state;
let tmpV = {};
_.map(Object.keys(settingBaseInfo), key => {
- tmpV[key] = basicForm[key].toString();
+ tmpV[key] = !_.isNil(basicForm[key]) ? basicForm[key].toString() : "";
});
this.setState({
settingBaseInfo: {
From 26457c01e61ea05b82062d7aa49c4d39e18c9d05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 15:38:39 +0800
Subject: [PATCH 31/38] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?=
=?UTF-8?q?=E5=8F=B0=E8=B4=A6=E6=A0=B8=E7=AE=97=E8=AF=A6=E6=83=85=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E8=A1=A5=E5=B7=AE=E7=9A=84=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/apis/standingBook.js | 27 ++++
.../importModal/acctResultImportModal.js | 19 ++-
.../importModal/selectFieldModal.js | 17 ++-
.../standingBookDetail/components/index.less | 4 +-
.../components/makeupDifference.js | 136 ++++++++++++++++++
.../standingBookDetail/components/normal.js | 33 ++---
.../components/regAddEmployee.js | 27 ----
.../standingBookDetail/components/regList.js | 8 +-
.../standingBookDetail/components/regTop.js | 15 +-
.../components/regression.js | 3 +-
.../standingBookDetail/index.js | 8 +-
pc4mobx/hrmSalary/stores/StandingBook.js | 80 +++++++----
12 files changed, 283 insertions(+), 94 deletions(-)
create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
diff --git a/pc4mobx/hrmSalary/apis/standingBook.js b/pc4mobx/hrmSalary/apis/standingBook.js
index 745b3706..9f8b28b1 100644
--- a/pc4mobx/hrmSalary/apis/standingBook.js
+++ b/pc4mobx/hrmSalary/apis/standingBook.js
@@ -202,6 +202,14 @@ export const getWelfareList = () => {
{}
);
};
+// 补差表单字段对应的接口
+export const getBalanceWelfareList = () => {
+ return WeaTools.callApi(
+ "/api/bs/hrmsalary/siaccount/getBalanceWelfareList",
+ "get",
+ {}
+ );
+};
// 社保福利台账-导入预览
export const welfarePreview = (params) => {
@@ -226,6 +234,17 @@ export const importInsuranceAcctDetail = (params) => {
body: JSON.stringify(params)
}).then((res) => res.json());
};
+// 社保福利台账-补差数据导入
+export const importBalanceInsuranceDetail = (params) => {
+ return fetch("/api/bs/hrmsalary/siaccount/welfare/importBalanceInsuranceDetail", {
+ method: "post",
+ mode: "cors",
+ headers: {
+ "Content-Type": "application/json"
+ },
+ body: JSON.stringify(params)
+ }).then((res) => res.json());
+};
// 社保福利台账-线下对比数据导入
export const importExcelInsuranceDetail = (params) => {
@@ -251,10 +270,18 @@ export const saveRecession = (params) => {
export const recessionList = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params);
};
+//查询补差列表
+export const balanceList = (params) => {
+ return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params);
+};
//删除退差数据
export const delRecession = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params);
};
+//删除补差数据
+export const delBalance = (params) => {
+ return postFetch("/api/bs/hrmsalary/siaccount/delBalance", params);
+};
//编辑社保福利缴纳数据
export const editAccount = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params);
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js
index 44d0a208..86b4be54 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/acctResult/importModal/acctResultImportModal.js
@@ -37,7 +37,7 @@ export default class AcctResultImportModal extends React.Component {
// 获取模板
handleAccResultTemplateLink() {
- const { isStandingBook, standingBookTabKey } = this.props;
+ const { isStandingBook, standingBookTabKey, standingBookType } = this.props;
let url = "";
if (_.isEmpty(this.state.modalParam.salaryItemIds)) {
message.warning("请选择表单字段");
@@ -52,6 +52,8 @@ export default class AcctResultImportModal extends React.Component {
url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/importtemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
} else if (standingBookTabKey === "3") {
url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
+ } else if (standingBookType === "difference") {
+ url = `${window.location.origin}/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export?welfareNames=${this.state.modalParam.salaryItemIds}&billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
}
}
window.open(url, "_self");
@@ -162,8 +164,10 @@ export default class AcctResultImportModal extends React.Component {
}
render() {
+ const billMonth = getQueryString("billMonth");
//isStandingBook: 是否是社保福利台账核算的导入标识
- const { calculateStore, standingBookStore, isStandingBook, visiable } = this.props;
+ //standingBookType: 是否是补差的导入标识
+ const { calculateStore, standingBookStore, isStandingBook, visiable, standingBookType } = this.props;
const {
fetchPreviewAcctResult,
previewAcctResultColumns,
@@ -176,7 +180,8 @@ export default class AcctResultImportModal extends React.Component {
previewStandingBookAcctResultColumns,
previewStandingBookAcctResultDataSource,
importStandingBookAcctResult,
- importInsuranceAcctDetail
+ importInsuranceAcctDetail,
+ importBalanceInsuranceDetail
} = standingBookStore;
const { step, selectFieldVisible, modalParam } = this.state;
return (
@@ -184,6 +189,7 @@ export default class AcctResultImportModal extends React.Component {
{
visiable && {
this.handleImportModalInit();
}}
@@ -200,7 +206,11 @@ export default class AcctResultImportModal extends React.Component {
!isStandingBook ? fetchPreviewAcctResult(params) : welfarePreview(params);
}}
importFile={(params) => {
- !isStandingBook ? fetchImportAcctResult(params) : importInsuranceAcctDetail(params);
+ !isStandingBook ?
+ fetchImportAcctResult(params) :
+ standingBookType === "difference" ?
+ importBalanceInsuranceDetail({...params, billMonth}) :
+ importInsuranceAcctDetail(params);
}}
templateLink={() => {
this.handleAccResultTemplateLink();
@@ -215,6 +225,7 @@ export default class AcctResultImportModal extends React.Component {
{
selectFieldVisible && {
let fieldData = {};
@@ -43,7 +49,8 @@ export default class SelectFieldModal extends React.Component {
this.fieldData = fieldData;
});
} else {
- getWelfareList().then(result => {
+ const APIFox = standingBookType === "difference" ? getBalanceWelfareList : getWelfareList;
+ APIFox().then(result => {
let fieldData = {};
let formulaItems = [];
formulaItems = _.map(result, it => ({ ...it, salaryItemId: it.salaryItemName }));
@@ -146,9 +153,9 @@ export default class SelectFieldModal extends React.Component {
const { isStandingBook } = this.props;
return (
{
this.props.onCancel();
}}
@@ -161,7 +168,7 @@ export default class SelectFieldModal extends React.Component {
{
!_.isEmpty(fieldData.formulaItems) &&
-
+
{
this.handleTitleCheckboxChange(value, "formula");
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
index 84b963f0..e266ce39 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less
@@ -47,8 +47,8 @@
}
}
-//退差
-.regressionWrapper {
+//退差;补差
+.regressionWrapper, .differenceWrapper {
height: calc(100vh - 47px);
overflow: auto;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
new file mode 100644
index 00000000..0541af88
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
@@ -0,0 +1,136 @@
+/*
+ * Author: 黎永顺
+ * name: 补差
+ * Description:
+ * Date: 2022/12/16
+ */
+import React, { Component } from "react";
+import RegTop from "./regTop";
+import { message, Modal } from "antd";
+import { getQueryString } from "../../../../util/url";
+import RegList from "./regList";
+import AcctResultImportModal from "../../../calculateDetail/acctResult/importModal/acctResultImportModal";
+import * as API from "../../../../apis/standingBook";
+import "./index.less";
+import RegEditDetial from "./regEditDetial";
+
+class MakeupDifference extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectKey: [],
+ fieldData: {},
+ returnEditPersonSlide: {
+ title: "",
+ editId: "",
+ visible: false
+ },
+ importDiffModal: {
+ visible: false
+ },
+ loading: { save: false }
+ };
+ this.diffListRef = null;
+ this.regTopRef = null;
+ }
+
+ delBalance = () => {
+ const { selectKey: ids } = this.state;
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ const payload = { ids, billMonth, paymentOrganization };
+ API.delBalance(payload).then(({ status, errormsg }) => {
+ if (status) {
+ message.success("删除成功");
+ this.diffListRef.recessionList();
+ this.diffListRef.handleResetSelectRowKeys([]);
+ this.setState({ selectKey: [] });
+ } else {
+ message.error(errormsg || "删除失败");
+ }
+ });
+ };
+ handleChangeOpt = (key) => {
+ const { importDiffModal } = this.state;
+ const name = this.regTopRef.state.name;
+ const billMonth = getQueryString("billMonth");
+ const paymentOrganization = getQueryString("paymentOrganization");
+ switch (key) {
+ case "delete":
+ Modal.confirm({
+ title: "信息确认",
+ content: "确定删除数据吗?",
+ onOk: () => this.delBalance()
+ });
+ break;
+ case "import":
+ this.setState({ importDiffModal: { ...importDiffModal, visible: true } });
+ break;
+ case "export":
+ const url = `${window.location.origin}/api/bs/hrmsalary/welfare/balance/export?billMonth=${billMonth}&paymentOrganization=${paymentOrganization}`;
+ window.open(url, "_self");
+ break;
+ case "search":
+ this.diffListRef.recessionList(name);
+ break;
+ default:
+ break;
+ }
+ };
+ handleEdit = (record) => {
+ const { userName, id: editId } = record;
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
+ });
+ };
+ handleCloseModal = () => {
+ const { returnEditPersonSlide } = this.state;
+ this.setState({
+ returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
+ });
+ };
+
+ render() {
+ const billMonth = getQueryString("billMonth");
+ const { selectKey, importDiffModal, fieldData, returnEditPersonSlide } = this.state;
+ return (
+
+
this.regTopRef = dom}
+ billMonth={billMonth}
+ onChange={this.handleChangeOpt}
+ selectKey={selectKey}
+ />
+ this.diffListRef = dom}
+ onChangeRowkey={(selectKey) => this.setState({ selectKey })}
+ onEdit={this.handleEdit}
+ />
+ {/*编辑弹框*/}
+
+ {/*导入补差*/}
+ {
+ importDiffModal.visible &&
+ this.setState({ fieldData })}
+ onCancel={() => {
+ this.setState({ importDiffModal: { ...importDiffModal, visible: false }, fieldData: {} }, () => {
+ const name = this.regTopRef.state.name;
+ this.diffListRef.recessionList(name);
+ });
+ }}
+ isStandingBook
+ standingBookType="difference"
+ />
+ }
+
+ );
+ }
+}
+
+export default MakeupDifference;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
index aab96473..e3859fa6 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
@@ -496,28 +496,29 @@ export default class NormalIndex extends Component {
}
};
});
- if (selectedKey === "3") {
- columns = [
- ...columns,
- {
- title: "操作",
- dataIndex: "operate",
- fixed: "right",
- width: "120px",
- render: (text, record) => {
- return (
-
+ columns = [
+ ...columns,
+ {
+ title: "操作",
+ dataIndex: "operate",
+ fixed: "right",
+ width: "120px",
+ render: (text, record) => {
+ return (
+
- );
- }
+ }
+
+ );
}
- ];
- }
+ }
+ ];
return (
{
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js
index 822cc0c7..c311d035 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee.js
@@ -30,33 +30,6 @@ class RegAddEmployee extends Component {
};
}
- componentDidMount() {
- this.getEmployeeListByTaxAgent();
- }
-
- getEmployeeListByTaxAgent = () => {
- const { returnPersonInfo, selectPersonInfo } = this.state;
- const payload = {
- pageNum: 1,
- pageSize: 10000,
- name: null
- };
- API.getEmployeeListByTaxAgent(payload).then(({ status, data }) => {
- if (status) {
- const { list } = data;
- this.setState({
- returnPersonInfo: {
- ...returnPersonInfo,
- employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username }))
- },
- selectPersonInfo: {
- ...selectPersonInfo,
- employeeOptions: _.map(list || [], it => ({ key: String(it.employeeId), showname: it.username }))
- }
- });
- }
- });
- };
handleReset = () => {
this.setState({
baseInfo: {
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
index 2bb8d60f..787cd272 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
@@ -10,6 +10,11 @@ import { getQueryString } from "../../../../util/url";
import * as API from "../../../../apis/standingBook";
import "./index.less";
+const APIFox = {
+ "regression": API.recessionList,
+ "difference": API.balanceList
+};
+
class RegList extends Component {
constructor(props) {
super(props);
@@ -42,6 +47,7 @@ class RegList extends Component {
this.setState({ selectedRowKeys });
};
recessionList = (userName = "") => {
+ const { type } = this.props;
const { loading, pageInfo } = this.state;
const billMonth = getQueryString("billMonth");
const paymentOrganization = getQueryString("paymentOrganization");
@@ -54,7 +60,7 @@ class RegList extends Component {
...pageInfo
};
this.setState({ loading: { ...loading, query: true } });
- API.recessionList(payload).then(({ status, data }) => {
+ APIFox[type](payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageInfo: list } = data;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
index 96107ed0..78a837b9 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regTop.js
@@ -13,7 +13,7 @@ class RegTop extends Component {
renderTopBtns = () => {
const { name } = this.state;
- const { onChange, selectKey } = this.props;
+ const { onChange, selectKey, type: regtopType } = this.props;
const type = getQueryString("type");
let dom = [
onChange("add")}>
+
+ :
+ ;
dom = [
dom1,
,
- ,
- ...extra
+ , domBtn, ...extra
];
}
return dom;
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js
index 2b91f51b..33a79fb9 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regression.js
@@ -40,7 +40,6 @@ class Regression extends Component {
API.delRecession(selectKey).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
-
this.regListRef.recessionList();
this.regListRef.handleResetSelectRowKeys([]);
this.setState({ selectKey: [] });
@@ -124,12 +123,14 @@ class Regression extends Component {
return (
this.regTopRef = dom}
billMonth={billMonth}
onChange={this.handleChangeOpt}
selectKey={selectKey}
/>
this.regListRef = dom}
visible={returnPersonModal.visible}
onChangeRowkey={(selectKey) => this.setState({ selectKey })}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js
index 75b41a1b..a5ae1a93 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/index.js
@@ -11,6 +11,7 @@ import NormalIndex from "./components/normal";
import OverViewIndex from "./components/overView";
import AbnormalListIndex from "./components/abnormalList";
import Regression from "./components/regression";
+import MakeupDifference from "./components/makeupDifference";
@inject("standingBookStore")
@observer
@@ -39,7 +40,7 @@ class StandingBookDetail extends Component {
getTabList({ billMonth, paymentOrganization: this.paymentOrganization }).then(({ data }) => {
const { tabList, remarks, billMonth } = data;
let newTabList = tabList.filter(item => item.id != "2");
- newTabList[newTabList.length - 2] = newTabList.splice(newTabList.length - 1, 1, newTabList[newTabList.length - 2])[0]
+ newTabList.push(newTabList.splice(_.findIndex(newTabList, it => it.id === "4"), 1)[0]);
this.setState({
selectedKey: newTabList[0].id,
tabList: _.map(newTabList, it => ({ title: it.content, viewcondition: it.id })),
@@ -74,7 +75,10 @@ class StandingBookDetail extends Component {
}
{
- selectedKey === "5" &&
+ selectedKey === "5" &&
+ }
+ {
+ selectedKey === "6" &&
}
);
diff --git a/pc4mobx/hrmSalary/stores/StandingBook.js b/pc4mobx/hrmSalary/stores/StandingBook.js
index 083914f8..d74c1c5c 100644
--- a/pc4mobx/hrmSalary/stores/StandingBook.js
+++ b/pc4mobx/hrmSalary/stores/StandingBook.js
@@ -1,11 +1,8 @@
-import { observable, action, toJS } from "mobx";
+import { action, observable } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
-import _ from "lodash";
-
import * as API from "../apis/standingBook";
-import { importExcelInsuranceDetail } from "../apis/standingBook";
const { TableStore } = WeaTableNew;
@@ -44,7 +41,7 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
- pageInfo: { list, columns, total, pageNum },
+ pageInfo: { list, columns, total, pageNum }
} = data;
resolve({ list, columns, total, pageNum });
} else {
@@ -66,7 +63,7 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
- pageInfo: { list, columns, total },
+ pageInfo: { list, columns, total }
} = data;
resolve({ list, columns, total });
} else {
@@ -88,7 +85,7 @@ export class StandingBookStore {
if (status) {
// 接口请求成功/失败处理
const {
- pageInfo: { list, columns, total },
+ pageInfo: { list, columns, total }
} = data;
resolve({ list, columns, total });
} else {
@@ -131,7 +128,7 @@ export class StandingBookStore {
// 接口请求成功/失败处理
const {
dataKey: { datas },
- pageInfo: { list, total },
+ pageInfo: { list, total }
} = data;
this.tableStore.getDatas(datas);
resolve({ list, total });
@@ -229,7 +226,7 @@ export class StandingBookStore {
// 接口请求成功/失败处理
const {
dataKey: { datas },
- pageInfo: { list, total },
+ pageInfo: { list, total }
} = data;
this.tableStore.getDatas(datas);
resolve({ list, total });
@@ -302,7 +299,7 @@ export class StandingBookStore {
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
- let condition = removePropertyCondition(res.data.condition)
+ let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
@@ -318,7 +315,7 @@ export class StandingBookStore {
action((res) => {
if (res.status) {
// 接口请求成功/失败处理
- let condition = removePropertyCondition(res.data.condition)
+ let condition = removePropertyCondition(res.data.condition);
this.condition = condition;
this.form.initFormFields(condition); // 渲染高级搜索form表单
} else {
@@ -361,57 +358,70 @@ export class StandingBookStore {
commonAccount = (params) => {
return new Promise((resolve, reject) => {
API.commonAccount(params).then(res => {
- if(res.status) {
+ if (res.status) {
resolve();
} else {
- message.error(res.errormsg || "接口调用失败!")
+ message.error(res.errormsg || "接口调用失败!");
reject();
}
- })
- })
- }
+ });
+ });
+ };
@action("社保福利台账重新核算")
socialSecurityBenefitsRecalculate = (params) => {
return new Promise((resolve, reject) => {
API.socialSecurityBenefitsRecalculate(params).then(res => {
- if(res.status) {
+ if (res.status) {
resolve();
} else {
reject(res.errormsg || "接口调用失败!");
}
- })
- })
- }
+ });
+ });
+ };
// 获取当前管理员下的所有个税扣缴义务人
@action
getAdminTaxAgentList = () => {
return new Promise((resolve, reject) => {
API.getAdminTaxAgentList().then(res => {
- if(res.status) {
+ if (res.status) {
resolve(res.data);
} else {
- message.error(res.errormsg || "接口调用失败!")
+ message.error(res.errormsg || "接口调用失败!");
reject();
}
- })
- })
- }
+ });
+ });
+ };
@action("社保福利台账核算导入信息表头信息列表")
getWelfareList = () => {
return new Promise((resolve, reject) => {
API.getWelfareList().then(res => {
- if(res.status) {
+ if (res.status) {
resolve(res.data);
} else {
- message.error(res.errormsg || "接口调用失败!")
+ message.error(res.errormsg || "接口调用失败!");
reject();
}
- })
- })
- }
+ });
+ });
+ };
+ @action("社保福利台账补差导入信息表头信息列表")
+ getBalanceWelfareList = () => {
+ return new Promise((resolve, reject) => {
+ API.getBalanceWelfareList().then(res => {
+ if (res.status) {
+ resolve(res.data);
+ } else {
+ message.error(res.errormsg || "接口调用失败!");
+ reject();
+ }
+ });
+ });
+ };
@action
setPreviewStandingBookAcctResultDataSource = previewAcctResultDataSource => {
@@ -452,6 +462,16 @@ export class StandingBookStore {
});
};
+ @action("社保福利台账-补差数据导入")
+ importBalanceInsuranceDetail = (params) => {
+ API.importBalanceInsuranceDetail(params).then(res => {
+ if (res.status) {
+ this.importStandingBookAcctResult = res.data;
+ } else {
+ message.error(res.errormsg || "导入失败");
+ }
+ });
+ };
@action("社保福利台账-核算数据导入")
importInsuranceAcctDetail = (params) => {
API.importInsuranceAcctDetail(params).then(res => {
From 28b34fa112fce3000138be5242748a96b022d8f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 16:07:04 +0800
Subject: [PATCH 32/38] =?UTF-8?q?=E8=96=AA=E8=B5=84=E8=B4=A6=E5=A5=97?=
=?UTF-8?q?=E4=B8=AD=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE=E8=B0=83=E6=8D=A2?=
=?UTF-8?q?=E4=BD=8D=E7=BD=AE=E4=BF=9D=E5=AD=98=E4=B8=8D=E7=94=9F=E6=95=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ledgerPage/components/ledgerSalaryItem.js | 10 ++++++++-
.../hrmSalary/pages/payroll/SalarySendList.js | 21 +++++++++++++------
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
index 6af6af3a..cc6444fb 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItem.js
@@ -200,7 +200,15 @@ class LedgerSalaryItem extends Component {
this.setState({
itemGroups: _.map(itemGroups, it => {
if (filed.id === it.id) {
- return { ...it, items: data };
+ return {
+ ...it,
+ items: _.map(data, (child, childIndex) => {
+ return {
+ ...child,
+ sortedIndex: childIndex
+ };
+ })
+ };
}
return { ...it };
})
diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
index 060feaf6..6e7d0a52 100644
--- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
+++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
@@ -76,7 +76,7 @@ export default class SalarySendList extends React.Component {
{text}
{
- record.sendStatus === 1 &&
+ record.salaryAcctType === 1 &&
补发
}
{`第${record.acctTimes}次`}
@@ -92,15 +92,18 @@ export default class SalarySendList extends React.Component {
title: "操作",
key: "operate",
render: (text, record) => {
- const { sendNum, sendTotal } = record;
+ const { sendNum, sendTotal, salaryAcctType } = record;
return (
this.handleGrant(record)}
style={{ marginRight: 10 }}>发放
- this.handleShowDetail(record)}
- style={{ marginRight: 10 }}>查看详情
{
- sendNum !== sendTotal &&
+ salaryAcctType === 0 &&
+ this.handleShowDetail(record)}
+ style={{ marginRight: 10 }}>查看详情
+ }
+ {
+ sendNum !== sendTotal && salaryAcctType === 0 &&
this.handleUpdateTemplate(record)}>更新模板
}
@@ -114,8 +117,14 @@ export default class SalarySendList extends React.Component {
title: "操作",
key: "operate",
render: (text, record) => {
+ const { salaryAcctType } = record;
return (
-
this.handleShowDetail(record)}>查看详情
+
+ {
+ salaryAcctType === 0 &&
+ this.handleShowDetail(record)}>查看详情
+ }
+
);
}
}
From 42ec1c691817ebe3d40f82f7061427d604125ea5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 16:19:30 +0800
Subject: [PATCH 33/38] =?UTF-8?q?=E8=A1=A5=E5=B7=AE=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../standingBookDetail/components/makeupDifference.js | 8 +++++---
.../standingBookDetail/components/regList.js | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
index 0541af88..266ea170 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
@@ -13,6 +13,7 @@ import AcctResultImportModal from "../../../calculateDetail/acctResult/importMod
import * as API from "../../../../apis/standingBook";
import "./index.less";
import RegEditDetial from "./regEditDetial";
+import { calcPageNo } from "../../../../util";
class MakeupDifference extends Component {
constructor(props) {
@@ -42,7 +43,8 @@ class MakeupDifference extends Component {
API.delBalance(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
- this.diffListRef.recessionList();
+ const current = calcPageNo(this.regListRef.state.pageInfo.total, this.regListRef.state.pageInfo.current, 10, ids.length);
+ this.diffListRef.recessionList({ current });
this.diffListRef.handleResetSelectRowKeys([]);
this.setState({ selectKey: [] });
} else {
@@ -71,7 +73,7 @@ class MakeupDifference extends Component {
window.open(url, "_self");
break;
case "search":
- this.diffListRef.recessionList(name);
+ this.diffListRef.recessionList({ userName: name });
break;
default:
break;
@@ -121,7 +123,7 @@ class MakeupDifference extends Component {
onCancel={() => {
this.setState({ importDiffModal: { ...importDiffModal, visible: false }, fieldData: {} }, () => {
const name = this.regTopRef.state.name;
- this.diffListRef.recessionList(name);
+ this.diffListRef.recessionList({ userName: name });
});
}}
isStandingBook
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
index 0aeca243..6979d48a 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regList.js
@@ -46,7 +46,7 @@ class RegList extends Component {
handleResetSelectRowKeys = (selectedRowKeys) => {
this.setState({ selectedRowKeys });
};
- recessionList = (userName = "") => {
+ recessionList = (module) => {
const { type } = this.props;
const { loading, pageInfo } = this.state;
const billMonth = getQueryString("billMonth");
From 5b66b538b838f1b2ff968994e33c2ab5a9f309d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 17:00:24 +0800
Subject: [PATCH 34/38] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A1=A3=E6=A1=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/pages/payrollFiles/index.js | 21 +++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js
index faef8b8c..0721f5d1 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js
@@ -14,13 +14,13 @@ import {
WeaFormItem,
WeaHelpfulTip,
WeaInput,
+ WeaPopoverHrm,
WeaSearchGroup,
WeaSelect,
WeaSlideModal,
WeaTab,
WeaTable,
- WeaTop,
- WeaPopoverHrm
+ WeaTop
} from "ecCom";
import { WeaTableNew } from "comsMobx";
import { Button, Dropdown, Menu, message, Modal, Popover } from "antd";
@@ -148,8 +148,8 @@ class Index extends Component {
const { taxAgentStore } = this.props;
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
getTaxAgentSelectListAsAdmin();
- const init = this.init();
this.queryList("/api/bs/hrmsalary/salaryArchive/pendingList");
+ const init = this.init();
}
init = async () => {
@@ -192,7 +192,16 @@ class Index extends Component {
const { loading, pageInfo, searchItemsValue } = this.state;
const { payrollFilesStore: { tableStore, queryList } } = this.props;
const payload = { ...pageInfo };
- this.setState({ loading: { ...loading, query: true } });
+ this.setState({
+ loading: { ...loading, query: true },
+ dataSource: [],
+ tabCount: {
+ SUSPEND: 0,
+ STOP: 0,
+ FIXED: 0,
+ PENDING: 0
+ }
+ });
queryList(payload, searchItemsValue, url).then(({ data, status }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
@@ -427,7 +436,7 @@ class Index extends Component {
;
}
};
- }else if (item.dataIndex === "operate") {
+ } else if (item.dataIndex === "operate") {
return {
...item,
fixed: "right",
@@ -487,7 +496,7 @@ class Index extends Component {
...item,
width: item.oldWidth,
render: (text) => {
- return
{text}
+ return
{text};
}
};
});
From 0894f91765bcd724bd85fdc6ce081c3f462fee9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Fri, 16 Dec 2022 17:36:56 +0800
Subject: [PATCH 35/38] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=96=AA=E8=B5=84?=
=?UTF-8?q?=E6=A1=A3=E6=A1=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/pages/payrollFiles/index.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js
index 0721f5d1..65c03aca 100644
--- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js
@@ -572,7 +572,13 @@ class Index extends Component {
current: 1,
pageSize: 10
}
- }, () => this.query());
+ });
+ if (!this.handleChangeDebounce) {
+ this.handleChangeDebounce = _.debounce(() => {
+ this.query()
+ }, 500);
+ }
+ this.handleChangeDebounce();
};
//编辑保存
handleSave = () => {
From 7c3af0ad5bcd30894977ff3529c9d52c80ad5274 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, 19 Dec 2022 14:55:46 +0800
Subject: [PATCH 36/38] =?UTF-8?q?=E9=83=A8=E5=88=86bug=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pc4mobx/hrmSalary/pages/calculate/index.js | 13 ++++++++++---
.../pages/calculateDetail/issuedAndReissueTable.js | 4 ++--
pc4mobx/hrmSalary/pages/payroll/SalarySendList.js | 8 +++++---
.../hrmSalary/pages/payroll/payrollGrant/index.js | 7 +++++--
4 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/calculate/index.js b/pc4mobx/hrmSalary/pages/calculate/index.js
index 3ac81ef4..cf287595 100644
--- a/pc4mobx/hrmSalary/pages/calculate/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/index.js
@@ -9,6 +9,7 @@ import BaseFormModal from "./baseFormModal";
import CustomPaginationTable from "../../components/customPaginationTable";
import ProgressModal from "../../components/progressModal";
import "./index.less";
+import { deleteLedgerPersonRange } from "../../apis/ledger";
const MonthPicker = DatePicker.MonthPicker;
@@ -141,9 +142,15 @@ export default class Calculate extends React.Component {
// 回算
handleBackCalculate = (record) => {
- const { calculateStore: { backCalculate } } = this.props;
- backCalculate(record.id).then(() => {
- this.handleSearch(this.state.searchValue);
+ Modal.confirm({
+ title: "信息确认",
+ content: "确定回算吗?\n 回算后,正常核算的数据会被覆盖,正常核算的工资单不能继续发放或撤回!",
+ onOk: () => {
+ const { calculateStore: { backCalculate } } = this.props;
+ backCalculate(record.id).then(() => {
+ this.handleSearch(this.state.searchValue);
+ });
+ }
});
};
diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
index ff82bad7..f18e620f 100644
--- a/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
+++ b/pc4mobx/hrmSalary/pages/calculateDetail/issuedAndReissueTable.js
@@ -23,7 +23,7 @@ class IssuedAndReissueTable extends Component {
title:
项目值
@@ -44,7 +44,7 @@ class IssuedAndReissueTable extends Component {
title:
核算公式
diff --git a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
index 6e7d0a52..b92a62c5 100644
--- a/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
+++ b/pc4mobx/hrmSalary/pages/payroll/SalarySendList.js
@@ -92,18 +92,20 @@ export default class SalarySendList extends React.Component {
title: "操作",
key: "operate",
render: (text, record) => {
- const { sendNum, sendTotal, salaryAcctType } = record;
+ const { sendNum, sendTotal, salaryAcctType, haveBackCalc } = record;
+ //显示发放
+ const showGrant = haveBackCalc === 1 && salaryAcctType === 0;
return (
this.handleGrant(record)}
style={{ marginRight: 10 }}>发放
{
- salaryAcctType === 0 &&
+ !showGrant &&
this.handleShowDetail(record)}
style={{ marginRight: 10 }}>查看详情
}
{
- sendNum !== sendTotal && salaryAcctType === 0 &&
+ sendNum !== sendTotal && !showGrant &&
this.handleUpdateTemplate(record)}>更新模板
}
diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
index 6bf91113..a7190a1d 100644
--- a/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
+++ b/pc4mobx/hrmSalary/pages/payroll/payrollGrant/index.js
@@ -243,6 +243,9 @@ export default class PayrollGrant extends React.Component {
};
getSearchsAdQuick() {
+ const { payrollStore } = this.props;
+ const { salarySendDetailBaseInfo } = payrollStore;
+ const notShowGrantOrWithdraw = salarySendDetailBaseInfo.haveBackCalc === 1 && salarySendDetailBaseInfo.salaryAcctType === "0";
const { selectedKey } = this.state;
const handleMenuClick = e => {
switch (e.key) {
@@ -267,7 +270,7 @@ export default class PayrollGrant extends React.Component {
更多
];
- if (selectedKey === "0") {
+ if (selectedKey === "0" && !notShowGrantOrWithdraw) {
btnDom = [
,
...btnDom
];
- } else {
+ } else if(selectedKey === "1" && !notShowGrantOrWithdraw) {
btnDom = [
Date: Tue, 20 Dec 2022 10:52:24 +0800
Subject: [PATCH 37/38] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?=
=?UTF-8?q?=E6=96=B9=E6=A1=88=E8=AF=A6=E6=83=85bug=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../standingBookDetail/components/makeupDifference.js | 6 ++++--
.../standingBookDetail/components/normal.js | 5 +++--
.../standingBookDetail/components/regEditDetial.js | 5 ++++-
.../standingBookDetail/components/regression.js | 1 +
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
index 266ea170..c560bb00 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/makeupDifference.js
@@ -43,7 +43,7 @@ class MakeupDifference extends Component {
API.delBalance(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
- const current = calcPageNo(this.regListRef.state.pageInfo.total, this.regListRef.state.pageInfo.current, 10, ids.length);
+ const current = calcPageNo(this.diffListRef.state.pageInfo.total, this.diffListRef.state.pageInfo.current, 10, ids.length);
this.diffListRef.recessionList({ current });
this.diffListRef.handleResetSelectRowKeys([]);
this.setState({ selectKey: [] });
@@ -86,10 +86,12 @@ class MakeupDifference extends Component {
returnEditPersonSlide: { ...returnEditPersonSlide, visible: true, title: userName, editId }
});
};
- handleCloseModal = () => {
+ handleCloseModal = (refreshList = false) => {
const { returnEditPersonSlide } = this.state;
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
+ }, () => {
+ refreshList && this.diffListRef.recessionList();
});
};
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
index e3859fa6..afa64704 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/normal.js
@@ -436,10 +436,11 @@ export default class NormalIndex extends Component {
});
};
handleCloseNormalStandingBookModal = () => {
- const { returnPersonModal, returnEditPersonSlide } = this.state;
+ const { returnEditPersonSlide } = this.state;
this.setState({
returnEditPersonSlide: { ...returnEditPersonSlide, visible: false, title: "", editId: "" }
}, () => {
+ this.getNormalList();
});
};
@@ -507,7 +508,7 @@ export default class NormalIndex extends Component {
return (