-
{children}
+ {children}
{/*导入弹框*/}
- }
+ title={this.renderTitle()}
content={slideChildren}
onClose={onClose}
/>
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js
index e693c017..92237ee8 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/columns.js
@@ -1,70 +1,3 @@
-export const columns = [
- {
- title: "姓名",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "个税扣缴义务人",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "部门",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "手机号",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "工号",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "证件号码",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "入职日期",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "累计子女教育",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "累计继续教育",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "累计住房贷款利息",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "累计住房租金",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "累计赡养老人",
- dataIndex: "title",
- key: "title"
- },
- {
- title: "操作",
- dataIndex: "title",
- key: "title"
- }
-];
export const dataCollectCondition = [
{
items: [
@@ -74,7 +7,7 @@ export const dataCollectCondition = [
fieldcol: 12,
label: "税款所属期",
lanId: 542240,
- labelcol: 4,
+ labelcol: 8,
value: "",
rules: "required|string",
viewAttr: 3
@@ -84,7 +17,7 @@ export const dataCollectCondition = [
domkey: ["taxAgentId"],
fieldcol: 12,
label: "个税扣缴义务人",
- labelcol: 4,
+ labelcol: 8,
lanId: 537996,
value: "",
options: [],
@@ -118,7 +51,7 @@ export const dataCollectCondition = [
isQuickSearch: false,
label: "人员",
lanId: 30042,
- labelcol: 4,
+ labelcol: 8,
rules: "required",
viewAttr: 3
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
index b5f3b024..4f1a92a7 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
@@ -400,7 +400,7 @@ class Index extends Component {
...slidePayload,
visible: false,
title: "",
- chidren: null,
+ children: null,
data: {}
}
});
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js
index 241efd93..1e009b70 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/components/condition.js
@@ -7,7 +7,7 @@ export const condition = [
fieldcol: 12,
label: "个税扣缴义务人",
lanId: 537996,
- labelcol: 4,
+ labelcol: 8,
value: "",
options: [],
rules: "required|string",
@@ -40,7 +40,7 @@ export const condition = [
isQuickSearch: false,
label: "人员",
lanId: 30042,
- labelcol: 4,
+ labelcol: 8,
rules: "required",
viewAttr: 3
}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
index be738854..d68e6812 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
@@ -338,7 +338,7 @@ class Index extends Component {
...slidePayload,
visible: false,
title: "",
- chidren: null,
+ children: null,
data: {}
}
});
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js
new file mode 100644
index 00000000..1a19b304
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRule.js
@@ -0,0 +1,162 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资核算规则配置
+ * Description:
+ * Date: 2024/4/24
+ */
+import React, { Component } from "react";
+import { WeaSwitch } from "comsMobx";
+import { inject, observer } from "mobx-react";
+import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
+import LedgerAccountSalaryItemsSet from "./ledgerAccountSalaryItemsSet";
+import * as API from "../../../apis/ledger";
+import { acctApprRulesConditions } from "../config";
+
+const getLabel = WeaLocaleProvider.getLabel;
+const getKey = WeaTools.getKey;
+
+@inject("ledgerStore")
+@observer
+class LedgerAccountApprRule extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ conditions: [], approvalId: "", approvalItemGroup: []
+ };
+ }
+
+ componentDidMount() {
+ this.init();
+ }
+
+ init = () => {
+ const { saveSalarySobId, editId } = this.props;
+ API.getSalaryApprovalForm({ salarySobId: editId || saveSalarySobId }).then(({ status, data }) => {
+ if (status) {
+ this.setState({
+ approvalId: data.id,
+ approvalItemGroup: _.map(data.approvalItemGroup, item => ({
+ ...item, id: String(item.sorted),
+ approvalItems: _.map(item.approvalItems, o => ({ ...o, id: `${String(item.sorted)}-${String(o.sorted)}` }))
+ })),
+ conditions: _.map(acctApprRulesConditions, item => ({
+ ...item, items: _.map(item.items, o => ({
+ ...o, value: getKey(o) === "isOpenApproval" ? (data[getKey(o)] ? "1" : "0") : data[getKey(o)],
+ viewAttr: getKey(o) === "approvalWorkflowUrl" ? (data["isOpenApproval"] ? 3 : 2) : o.viewAttr,
+ hide: getKey(o) !== "isOpenApproval" ? !data["isOpenApproval"] : false,
+ label: getLabel(o.lanId, o.label)
+ }))
+ }))
+ }, () => {
+ const { ledgerStore: { AARForm } } = this.props;
+ AARForm.initFormFields(this.state.conditions);
+ });
+ }
+ });
+ };
+
+ componentWillUnmount() {
+ const { ledgerStore: { initAARForm } } = this.props;
+ initAARForm();
+ }
+
+ renderForm = (form, conditions) => {
+ const { saveSalarySobId, editId } = this.props;
+ const { approvalItemGroup } = this.state;
+ const { isFormInit } = form;
+ const formParams = form.getFormParams();
+ let group = [];
+ isFormInit && conditions && conditions.map(c => {
+ let items = [];
+ c.items.map(fields => {
+ if (getKey(fields) !== "approvalItemGroup") {
+ items.push({
+ com: (
+
+
+ ),
+ hide: fields.hide
+ });
+ } else {
+ items.push({
+ com: (
+
+ this.setState({
+ approvalItemGroup: _.map(approvalItemGroup, o => ({
+ ...o,
+ approvalItems: (groupId === o.id && !_.isEmpty(items)) ? [...o.approvalItems, ..._.map(items, (k, ki) => ({
+ salaryItemId: k.id, salaryItemName: k.name,
+ id: `${String(o.sorted)}-${String(o.approvalItems.length + ki)}`
+ }))] : o.approvalItems
+ }))
+ }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
+ onEdit={(groupName, groupId) => this.setState({
+ approvalItemGroup: groupId ? _.map(approvalItemGroup, o => ({
+ ...o, groupName: groupId === o.id ? groupName : o.groupName
+ })) : [{
+ approvalItems: [], groupName, id: String(approvalItemGroup.length)
+ }, ...approvalItemGroup]
+ }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
+ onDelete={(group, item) => this.setState({
+ approvalItemGroup: _.isEmpty(item) ? _.filter(approvalItemGroup, o => o.id !== group.id) :
+ _.map(approvalItemGroup, o => ({
+ ...o,
+ approvalItems: _.filter(o.approvalItems, oo => oo.id !== item.id)
+ }))
+ }, () => form.updateFields({ approvalItemGroup: { value: this.state.approvalItemGroup } }))}
+ onChange={datas => this.setState({
+ approvalItemGroup: datas
+ }, () => form.updateFields({ approvalItemGroup: { value: datas } }))}/>
+ ),
+ hide: fields.hide
+ });
+ }
+ });
+ group.push(
);
+ });
+ return group;
+ };
+ convertFormItemViewAttr = (viewAttr) => {
+ const { ledgerStore: { AARForm } } = this.props;
+ const { isOpenApproval } = AARForm.getFormParams();
+ this.setState({
+ conditions: _.map(this.state.conditions, item => ({
+ ...item, items: _.map(item.items, o => {
+ if (getKey(o) === "approvalWorkflowUrl") {
+ return { ...o, viewAttr, hide: isOpenApproval === "0" };
+ } else if (getKey(o) === "approvalItemGroup") {
+ return { ...o, viewAttr, hide: isOpenApproval === "0" };
+ }
+ return { ...o };
+ })
+ }))
+ });
+ };
+ handleFormItemChange = (value) => {
+ const { ledgerStore: { AARForm } } = this.props;
+ const { isOpenApproval } = AARForm.getFormParams();
+ if (_.keys(value)[0] === "isOpenApproval") {
+ this.convertFormItemViewAttr(isOpenApproval === "1" ? 3 : 2);
+ }
+ };
+
+ render() {
+ const { conditions } = this.state;
+ const { ledgerStore: { AARForm } } = this.props;
+ return (
+
+ {this.renderForm(AARForm, conditions)}
+
+ );
+ }
+}
+
+export default LedgerAccountApprRule;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js
new file mode 100644
index 00000000..9958b727
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountApprRuleClassifyNameEditDialog.js
@@ -0,0 +1,70 @@
+/*
+ * Author: 黎永顺
+ * name:审批规则分类编辑
+ * Description:
+ * Date: 2024/4/25
+ */
+import React, { Component } from "react";
+import { inject, observer } from "mobx-react";
+import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
+import { Button } from "antd";
+import { getSearchs } from "../../../util";
+import { classifyConditions } from "../config";
+
+const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("ledgerStore")
+@observer
+class LedgerAccountApprRuleClassifyNameEditDialog extends Component {
+ constructor(props) {
+ super(props);
+ this.state = { conditions: [] };
+ }
+
+ componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) this.init(nextProps);
+ if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.ledgerStore.initAARClassifyForm();
+ }
+
+ init = (props) => {
+ const { ledgerStore: { AARClassifyForm }, groupName, groupId } = props;
+ this.setState({
+ conditions: _.map(classifyConditions, item => ({
+ ...item,
+ items: _.map(item.items, o => ({ ...o, label: getLabel(o.lanId, o.label) }))
+ }))
+ }, () => {
+ AARClassifyForm.initFormFields(this.state.conditions);
+ groupId && AARClassifyForm.updateFields({ groupName });
+ });
+ };
+ save = () => {
+ const { ledgerStore: { AARClassifyForm }, groupId } = this.props;
+ AARClassifyForm.validateForm().then(f => {
+ if (f.isValid) {
+ this.props.onCancel();
+ this.props.onEdit(AARClassifyForm.getFormParams().groupName, groupId);
+ } else {
+ f.showErrors();
+ }
+ });
+ };
+
+ render() {
+ const { conditions } = this.state;
+ const { ledgerStore: { AARClassifyForm } } = this.props;
+ return (
+ {getLabel(537558, "保存")}
+ ]}
+ >
+ {getSearchs(AARClassifyForm, conditions, 1, false)}
+
+ );
+ }
+}
+
+export default LedgerAccountApprRuleClassifyNameEditDialog;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js
new file mode 100644
index 00000000..1f53c37b
--- /dev/null
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerAccountSalaryItemsSet.js
@@ -0,0 +1,147 @@
+/*
+ * Author: 黎永顺
+ * name: 薪资核算规则配置-审批薪资项目
+ * Description:
+ * Date: 2024/4/24
+ */
+import React, { Component } from "react";
+import { WeaButtonIcon, WeaLocaleProvider, WeaSortable, WeaTransfer } from "ecCom";
+import LedgerAccountApprRuleClassifyNameEditDialog from "./ledgerAccountApprRuleClassifyNameEditDialog";
+import * as API from "../../../apis/ledger";
+import { Icon, Modal } from "antd";
+import cs from "classnames";
+import SalaryItemModal from "../../payroll/stepForm/salaryItemModal";
+
+const getLabel = WeaLocaleProvider.getLabel;
+
+class LedgerAccountSalaryItemsSet extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ editDialog: { visible: false, groupName: "", groupId: "", title: "" },
+ salaryItemDialog: { visible: false, title: getLabel(111, "薪资项目项"), options: [], groupId: "" }
+ };
+ }
+
+ handleDeleteClick = (group, item = {}) => {
+ Modal.confirm({
+ title: getLabel(131329, "信息确认"),
+ content: getLabel(543231, "确认删除本条数据吗?"),
+ onOk: () => this.props.onDelete(group, item)
+ });
+ };
+ handleAddSalaryItems = (group) => {
+ const { salaryItemDialog } = this.state;
+ const { salarySobId, datas } = this.props;
+ const payload = {
+ salarySobId, excludeIds: _.reduce(datas, (pre, cur) => {
+ return pre.concat(_.map(cur.approvalItems, o => o.salaryItemId));
+ }, [])
+ };
+ API.getListSalaryItem(payload).then(({ status, data }) => {
+ if (status) this.setState({
+ salaryItemDialog: {
+ ...salaryItemDialog, visible: true, options: data, groupId: group.id
+ }
+ });
+ });
+ };
+ handleConfirm = () => {
+ const { salaryItemDialog } = this.state;
+ this.setState({
+ salaryItemDialog: { ...salaryItemDialog, visible: false }
+ }, () => this.props.onAddItems(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem)));
+ };
+
+ render() {
+ const { editDialog, salaryItemDialog } = this.state;
+ const { datas } = this.props;
+ return (
+
+
+ this.setState({
+ editDialog: { visible: true, title: getLabel(111, "添加分类") }
+ })}/>
+
+
+
+
this.props.onChange(list)}
+ renderNodeItem={(item) => {
+ return
+
+
+ {item.groupName}
+
+ this.setState({
+ editDialog: {
+ visible: true, groupName: item.groupName, groupId: item.id, title: getLabel(111, "分类名称编辑")
+ }
+ })}/>
+ this.handleDeleteClick(item)}/>
+
+
+ this.handleAddSalaryItems(item)}/>
+
+
+ {
+ !_.isEmpty(item.approvalItems) ?
+
this.props.onChange(
+ _.map(datas, child => {
+ if (child.id === item.id) {
+ return { ...child, approvalItems: items };
+ }
+ return { ...child };
+ })
+ )}
+ renderNodeItem={(filed) => {
+ return
+
+
{filed.salaryItemName}
+
this.handleDeleteClick(item, filed)}/>
+
+
;
+ }}
+ className="wea-sortable-salary-item"
+ /> :
+ 暂无数据
+ }
+
+
;
+ }}
+ className="wea-sortable-salary-item"
+ />
+ this.setState({
+ editDialog: { ...editDialog, visible: false }
+ })}/>
+ this.setState({
+ salaryItemDialog: { ...salaryItemDialog, visible: false }
+ })} onConfirm={this.handleConfirm}>
+
+ g.checkedSalaryItem), o => o.id)}
+ onChange={v => {
+ this.setState({
+ salaryItemDialog: {
+ ...salaryItemDialog,
+ options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) }))
+ }
+ });
+ }}
+ />
+
+
+
+
+ );
+ }
+}
+
+export default LedgerAccountSalaryItemsSet;
diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
index 30d446d7..68239b5f 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -13,9 +13,11 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
import LedgerSalaryItem from "./ledgerSalaryItem";
+import LedgerAccountApprRule from "./ledgerAccountApprRule";
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
-import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
+import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
+import { sysConfCodeRule } from "../../../apis/ruleconfig";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
@@ -28,10 +30,18 @@ class LedgerSlide extends Component {
super(props);
this.state = {
current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
- empFields: [], itemGroups: [], saveSalarySobId: ""
+ empFields: [], itemGroups: [], saveSalarySobId: "",
+ salaryApprovalStatus: false
};
}
+ async componentWillReceiveProps(nextProps, nextContext) {
+ if (nextProps.visible !== this.props.visible && nextProps.visible) {
+ const { data } = await sysConfCodeRule({ code: "SALARY_APPROVAL_STATUS" });
+ this.setState({ salaryApprovalStatus: data === "1" });
+ }
+ }
+
componentWillUnmount() {
this.setState({
saveSalarySobId: ""
@@ -87,7 +97,6 @@ class LedgerSlide extends Component {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
- this.handleClose();
} else {
message.success(errormsg || "保存失败");
}
@@ -152,9 +161,45 @@ class LedgerSlide extends Component {
*/
handleSaveSalaryItemParams = (empFields, itemGroups) => this.setState({ empFields, itemGroups });
+ handleDefaultSave = () => {
+ const { saveSalarySobId } = this.state;
+ const { state: { approvalId } } = this.approRef.wrappedInstance;
+ const { ledgerStore: { AARForm } } = this.props;
+ const { approvalItemGroup, isOpenApproval, ...extra } = AARForm.getFormParams();
+ const group = _.map(approvalItemGroup, (item, index) => ({
+ groupName: item.groupName, sorted: index,
+ approvalItems: _.map(item.approvalItems, (o, oi) => ({
+ salaryItemId: o.salaryItemId, sorted: oi,
+ salaryItemName: o.salaryItemName
+ }))
+ }));
+ if (isOpenApproval === "1" && _.isEmpty(extra.approvalWorkflowUrl)) {
+ AARForm.showError("approvalWorkflowUrl", getLabel(111, "\"审批流程地址\"未填写"));
+ return;
+ } else if (isOpenApproval === "1" && _.isEmpty(group)) {
+ AARForm.showError("approvalItemGroup", getLabel(111, "\"审批薪资项目\"未填写"));
+ return;
+ }
+ const payload = {
+ ...extra, isOpenApproval: isOpenApproval === "1", id: approvalId,
+ salarySobId: this.props.editId || saveSalarySobId,
+ approvalItemGroup: group
+ };
+ this.setState({ loading: true });
+ salaryApprovalSaveForm(payload).then(({ status, errormsg }) => {
+ this.setState({ loading: false });
+ if (status) {
+ message.success(getLabel(111, "保存成功!"));
+ saveSalarySobId && this.handleClose();
+ } else {
+ message.error(errormsg);
+ }
+ });
+ };
+
render() {
const { visible, editId, record } = this.props;
- const { current, saveSalarySobId, loading } = this.state;
+ const { current, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
let tabs = [
{
key: 0, title: getLabel(82751, "基础设置"),
@@ -211,9 +256,11 @@ class LedgerSlide extends Component {
{
key: 4, title: getLabel(543469, "调薪计薪规则"),
createBtns: [
+ ,
,
-
+
],
editBtns: [
);
}
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js
index efe5dff3..01a66e2b 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js
@@ -22,7 +22,7 @@ class Index extends Component {
copyDialog: { visible: false, title: "", copyId: "", salarySobId: "" },
tmplSlide: {
visible: false, tmplId: "", top: 0, width: 792, height: 100,
- measureT: "%", measureX: "px", measureY: "%"
+ measureT: "%", measureX: "px", measureY: "%", detail: false
}
};
}
@@ -79,9 +79,10 @@ class Index extends Component {
const { copyDialog, tmplSlide, selectedRowKeys } = this.state;
const { id, salarySobId } = record;
switch (key) {
+ case "view":
case "edit":
this.setState({
- tmplSlide: { ...tmplSlide, visible: true, tmplId: id }
+ tmplSlide: { ...tmplSlide, visible: true, tmplId: id, detail: key === "view" }
});
break;
case "copy":
@@ -171,7 +172,8 @@ class Index extends Component {
>
- :
{getLabel(83110, "查看详情")};
+ :
this.handleOpts({ key: "view" }, record)}>{getLabel(83110, "查看详情")};
}
}
]}
diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js
index e59cf608..1ebc0216 100644
--- a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js
+++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js
@@ -123,7 +123,7 @@ class Index extends Component {
}).catch(() => this.setState({ loading: false }));
};
renderTitle = () => {
- const { tmplId } = this.props, { current, loading } = this.state;
+ const { tmplId, detail } = this.props, { current, loading } = this.state;
const { payrollStore: { payrollTempNormalForm, setTmplDataSource, tmplDataSource } } = this.props;
return
@@ -156,7 +156,11 @@ class Index extends Component {
this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}
- {getLabel(537558, "保存")}
+ {
+ !detail &&
+ {getLabel(537558, "保存")}
+ }
}
@@ -185,8 +189,29 @@ class Index extends Component {
payrollStore: {
initPayrollTempForm, initPayrollTempFeedbackForm, setSalaryBillItemNameSetting,
initPayrollTempNormalForm, setTmplDataSource, hasBeenModify
- }, onClose
+ }, onClose, detail
} = this.props;
+ if (detail) {
+ initPayrollTempForm();
+ initPayrollTempFeedbackForm();
+ initPayrollTempNormalForm();
+ setTmplDataSource({});
+ setSalaryBillItemNameSetting([
+ {
+ salaryTemplateId: "",
+ salaryBillType: 0,
+ itemShowNameSetting: []
+ },
+ {
+ salaryTemplateId: "",
+ salaryBillType: 1,
+ itemShowNameSetting: []
+ }
+ ]);
+ this.setState({ current: 0 });
+ onClose(type);
+ return;
+ }
if (hasBeenModify) {
Modal.confirm({
title: getLabel(131329, "信息确认"),
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js
index bb22f65e..22135a29 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/conditions.js
@@ -59,6 +59,24 @@ export const conditions = [
lanId: 543358,
defaultshow: true
},
+ {
+ items: [
+ {
+ conditionType: "SWITCH",
+ domkey: ["openSecondaryAccount"],
+ fieldcol: 10,
+ label: "启用主次账号",
+ tip: "启用后,若有次账号相关档案,则此功能不能关闭。",
+ tipLanId: 111,
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ }
+ ],
+ title: "主次身份",
+ lanId: 111,
+ defaultshow: true
+ },
{
items: [
{
@@ -196,6 +214,16 @@ export const conditions = [
options: [],
labelcol: 8,
viewAttr: 2
+ },
+ {
+ conditionType: "SELECT",
+ domkey: ["SALARY_DETAILS_REPORT_SHOW_TYPE"],
+ fieldcol: 10,
+ label: "薪资明细显示模式",
+ lanId: 111,
+ options: [],
+ labelcol: 8,
+ viewAttr: 2
}
],
title: "薪资报表",
@@ -219,6 +247,51 @@ export const conditions = [
// defaultshow: true
// },
];
+export const salaryApprovalConditions = [
+ {
+ items: [
+ {
+ conditionType: "SWITCH",
+ domkey: ["SALARY_APPROVAL_STATUS"],
+ fieldcol: 10,
+ label: "薪资审批",
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["APPROVAL_CAN_MANUAL_FILE_STATUS"],
+ fieldcol: 10,
+ label: "开启审批的核算记录允许手动归档",
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["APPROVAL_CAN_RE_CALC_STATUS"],
+ fieldcol: 10,
+ label: "开启审批的核算记录允许重新核算",
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ },
+ {
+ conditionType: "SWITCH",
+ domkey: ["APPROVAL_CAN_EDIT_RESULT_STATUS"],
+ fieldcol: 10,
+ label: "审批流程发起后允许修改核算数据",
+ lanId: 111,
+ labelcol: 8,
+ viewAttr: 2
+ }
+ ],
+ title: "薪资审批设置",
+ lanId: 111,
+ defaultshow: true
+ }
+];
export const payloadList = [
{ enumClass: "com.engine.salary.sys.enums.SalaryAcctEmployeeRuleEnum" },
{ enumClass: "com.engine.salary.sys.enums.OrderRuleEnum" },
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/form.js b/pc4mobx/hrmSalary/pages/ruleConfig/form.js
index 9b17f248..09a946f8 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/form.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/form.js
@@ -1,8 +1,9 @@
import React from "react";
-import { WeaFormItem, WeaSearchGroup, WeaTools } from "ecCom";
+import { WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
import { WeaSwitch } from "comsMobx";
const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
export const renderRuleForm = (form, condition, onChange) => {
const { isFormInit } = form;
@@ -14,7 +15,12 @@ export const renderRuleForm = (form, condition, onChange) => {
items.push({
com: (
+ {fields.label}
+ {fields.tip && }
+ }
+ labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
tipPosition="bottom">
span {
+ margin-right: 4px;
+ }
+ }
+
.wea-search-group {
background: #fff;
margin-bottom: 16px;
diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
index 8c56b847..f84987cb 100644
--- a/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
+++ b/pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
@@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
import { message, Modal } from "antd";
import * as API from "../../apis/ruleconfig";
-import { conditions, payloadList } from "./conditions";
+import { conditions, payloadList, salaryApprovalConditions } from "./conditions";
import ProgressModal from "../../components/progressModal";
import { renderRuleForm } from "./form";
import { getConditionDomkeys } from "../../util";
@@ -33,12 +33,13 @@ class RuleConfig extends Component {
}
init = async () => {
- const { data: sysinfo } = await API.sysinfo();
+ const [{ data: sysinfo }, { data: confCode }] = await Promise.all([API.sysinfo(), API.sysConfCodeRule({ code: "SHOW_SALARY_ACCT_APPROVAL" })]);
const [{ data: matchRule }, { data: orderRule }, { data: ascOrDesc }, { data: rule }] =
await Promise.all(_.map(payloadList, it => API.commonEnumList(it)));
const optionsList = { matchRule, orderRule, ascOrDesc, rule };
+ const conditonsSlice = confCode === "1" ? [...conditions, ...salaryApprovalConditions] : conditions;
this.setState({
- sysinfo, conditions: _.map(conditions, item => ({
+ sysinfo, conditions: _.map(conditonsSlice, item => ({
...item, title: getLabel(item.lanId, item.title),
items: _.map(item.items, o => {
o = { ...o, label: getLabel(o.lanId, o.label) };
@@ -51,6 +52,13 @@ class RuleConfig extends Component {
{ key: "1", showname: getLabel(111, "实时组织信息"), selected: false }
]
};
+ } else if (getKey(o) === "SALARY_DETAILS_REPORT_SHOW_TYPE") {
+ return {
+ ...o, options: [
+ { key: "0", showname: getLabel(111, "定制列"), selected: true },
+ { key: "1", showname: getLabel(111, "模板"), selected: false }
+ ]
+ };
} else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") {
return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 };
} else if (getKey(o) === "taxDeclarationFunction") {
@@ -58,6 +66,13 @@ class RuleConfig extends Component {
...o,
viewAttr: (_.isNil(sysinfo.taxDeclarationFunction) || sysinfo.taxDeclarationFunction !== "0") ? 2 : 1
};
+ } else if (
+ getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS"
+ ) {
+ return {
+ ...o,
+ hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"])
+ };
}
return { ...o };
})
@@ -78,12 +93,16 @@ class RuleConfig extends Component {
form.updateFields({ [item]: { value: sysinfo["salaryAcctEmployeeRule"] || "" } });
} else if (item === "taxDeclarationFunction") {
form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "1") } });
- } else if (item === "REPORT_ORGANIZATIN_TYPE") {
+ } else if (item === "REPORT_ORGANIZATIN_TYPE" || item === "SALARY_DETAILS_REPORT_SHOW_TYPE") {
form.updateFields({ [item]: { value: sysinfo[item] === "0" ? "0" : (sysinfo[item] || "0") } });
} else if (item === "taxAgentShowStatus" || item === "salaryShowStatus" || item === "adjustShowStatus") {
form.updateFields({ [item]: { value: sysinfo[item] || "1" } });
} else if (item === "OPEN_APPLICATION_ENCRYPT") {
form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "") } });
+ } else if (
+ item === "APPROVAL_CAN_MANUAL_FILE_STATUS" || item === "APPROVAL_CAN_RE_CALC_STATUS" || item === "APPROVAL_CAN_EDIT_RESULT_STATUS"
+ ) {
+ form.updateFields({ [item]: { value: _.isNil(sysinfo[item]) ? "1" : (sysinfo[item] || "0") } });
} else {
form.updateFields({ [item]: { value: sysinfo[item] || "" } });
}
@@ -128,6 +147,12 @@ class RuleConfig extends Component {
case "salaryShowStatus":
case "adjustShowStatus":
case "REPORT_ORGANIZATIN_TYPE":
+ case "SALARY_DETAILS_REPORT_SHOW_TYPE":
+ case "openSecondaryAccount":
+ case "SALARY_APPROVAL_STATUS":
+ case "APPROVAL_CAN_MANUAL_FILE_STATUS":
+ case "APPROVAL_CAN_RE_CALC_STATUS":
+ case "APPROVAL_CAN_EDIT_RESULT_STATUS":
if (!this.handleDebounce) {
this.handleDebounce = _.debounce(() => {
const confTitle = {
@@ -138,7 +163,13 @@ class RuleConfig extends Component {
taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"),
salaryShowStatus: getLabel(111, "显示工资单页签"),
adjustShowStatus: getLabel(111, "显示调薪记录页签"),
- REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息")
+ REPORT_ORGANIZATIN_TYPE: getLabel(111, "组织信息"),
+ SALARY_DETAILS_REPORT_SHOW_TYPE: getLabel(111, "薪资明细显示模式"),
+ openSecondaryAccount: getLabel(111, "启用主次身份"),
+ SALARY_APPROVAL_STATUS: getLabel(111, "是否开启薪资审批"),
+ APPROVAL_CAN_MANUAL_FILE_STATUS: getLabel(111, "开启审批的核算记录允许手动归档"),
+ APPROVAL_CAN_RE_CALC_STATUS: getLabel(111, "开启审批的核算记录允许重新核算"),
+ APPROVAL_CAN_EDIT_RESULT_STATUS: getLabel(111, "审批流程发起后允许修改核算数据")
};
this.unifiedSettings(key, confTitle[key]);
this.handleDebounce = null;
@@ -311,6 +342,20 @@ class RuleConfig extends Component {
API.saveSysOperate(payload).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(22619, "保存成功!"));
+ if (confKey === "SALARY_APPROVAL_STATUS") {
+ this.setState({
+ conditions: _.map(this.state.conditions, item => ({
+ ...item, items: _.map(item.items, o => {
+ if (
+ getKey(o) === "APPROVAL_CAN_MANUAL_FILE_STATUS" || getKey(o) === "APPROVAL_CAN_RE_CALC_STATUS" || getKey(o) === "APPROVAL_CAN_EDIT_RESULT_STATUS"
+ ) {
+ return { ...o, hide: form.getFormParams()[confKey] === "0" };
+ }
+ return { ...o };
+ })
+ }))
+ });
+ }
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
index b1271972..979cccc9 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/regEditDetial.js
@@ -62,7 +62,6 @@ class RegEditDetial extends Component {
otherComJson: {}
};
_.forEach(socialData.dataSource, item => {
- console.log(item)
if (item.personalPaymentAmount) {
payload["socialPerJson"][item["insuranceId"]] = toDecimal_n(item.personalPaymentAmount, item.personalPaymentAmountValidNum || 2);
}
@@ -164,7 +163,6 @@ class RegEditDetial extends Component {
const social = this.combinedData(socialSecurity, result);
const fund = this.combinedData(accumulationFund, result);
const other = this.combinedData(otherBenefits, result);
- console.log(social)
this.setState({
listMap: [
{
diff --git a/pc4mobx/hrmSalary/stores/attendanceStore.js b/pc4mobx/hrmSalary/stores/attendanceStore.js
index 142caa6d..40dcf875 100644
--- a/pc4mobx/hrmSalary/stores/attendanceStore.js
+++ b/pc4mobx/hrmSalary/stores/attendanceStore.js
@@ -22,6 +22,9 @@ export class AttendanceStore {
@observable extensionForm = new WeaForm(); //扩展属性
@action("报表查看-扩展属性表单初始化")
initExtensionForm = () => this.extensionForm = new WeaForm();
+ @observable tempForm = new WeaForm(); //扩展属性
+ @action("薪资明细-模板设置表单初始化")
+ initTempForm = () => this.tempForm = new WeaForm();
@action("报表查看-分享报表表单初始化")
initShareForm = () => this.shareForm = new WeaForm();
diff --git a/pc4mobx/hrmSalary/stores/ledger.js b/pc4mobx/hrmSalary/stores/ledger.js
index 8dc46dc8..0411826d 100644
--- a/pc4mobx/hrmSalary/stores/ledger.js
+++ b/pc4mobx/hrmSalary/stores/ledger.js
@@ -1,10 +1,9 @@
-import { observable, action, toJS } from "mobx";
+import { action, observable } from "mobx";
import { message } from "antd";
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;
@@ -13,6 +12,11 @@ export class LedgerStore {
@observable copyForm = new WeaForm(); // 复制form
@observable categoryForm = new WeaForm(); // 新增分类form
@observable searchForm = new WeaForm(); // 查询form
+ @observable AARForm = new WeaForm(); // 核算审批规则form
+ @observable AARClassifyForm = new WeaForm(); // 核算审批规则分类编辑form
+
+ @action initAARForm = (v) => this.AARForm = new WeaForm();//重置核算审批规则form
+ @action initAARClassifyForm = (v) => this.AARClassifyForm = new WeaForm();//重置审批规则分类编辑form
/*******************************************************/
@@ -148,14 +152,14 @@ export class LedgerStore {
setItemGroups = itemGroups => {
itemGroups = itemGroups ? [...itemGroups] : [];
itemGroups &&
- itemGroups.map(item => {
- if (item.items) {
- item.items &&
- item.items.map(i => {
- i.key = i.id;
- });
- }
- });
+ itemGroups.map(item => {
+ if (item.items) {
+ item.items &&
+ item.items.map(i => {
+ i.key = i.id;
+ });
+ }
+ });
this.itemGroups = itemGroups;
};
@@ -388,9 +392,9 @@ export class LedgerStore {
if (!this.validateBaseFrom(params)) {
reject("保存失败");
}
- this.saveLoading= true;
+ this.saveLoading = true;
API.saveLedgerBasic(params).then(res => {
- this.saveLoading= false;
+ this.saveLoading = false;
if (res.status) {
this.salarySobId = res.data;
resolve();
@@ -463,9 +467,9 @@ export class LedgerStore {
//薪资帐套人员范围(包含)列表
getLedgerPersonRangeInclude = params => {
- this.loading= true;
+ this.loading = true;
API.getLedgerPersonRangeInclude(params).then(res => {
- this.loading= false;
+ this.loading = false;
if (res.status) {
this.setUserTableStore(res.data);
} else {
@@ -476,9 +480,9 @@ export class LedgerStore {
//薪资帐套人员范围(排除)列表
getLedgerPersonRangeExclude = params => {
- this.loading= true;
+ this.loading = true;
API.getLedgerPersonRangeExclude(params).then(res => {
- this.loading= false;
+ this.loading = false;
if (res.status) {
this.setUserTableStore(res.data);
} else {
@@ -508,12 +512,12 @@ export class LedgerStore {
listSalaryItem = (searchValue = "", current = 1) => {
let excludeIds = [];
this.itemGroups &&
- this.itemGroups.map(item => {
- item.items &&
- item.items.map(i => {
- excludeIds.push(i.salaryItemId);
- });
+ this.itemGroups.map(item => {
+ item.items &&
+ item.items.map(i => {
+ excludeIds.push(i.salaryItemId);
});
+ });
this.loading = true;
API.listSalaryItem({ name: searchValue, excludeIds, current }).then(res => {
if (res.status) {
@@ -562,7 +566,7 @@ export class LedgerStore {
salaryItemId: i.salaryItemId,
sortedIndex: index + 1,
formulaId: i.formulaId,
- itemHide: i.itemHide || "0",
+ itemHide: i.itemHide || "0"
}));
return result;
}
@@ -571,14 +575,14 @@ export class LedgerStore {
let params = {
salarySobId: this.salarySobId,
- empFields: _.map(this.userSelectedList, (it, idx) => ({...it, sortedIndex:idx })),
+ empFields: _.map(this.userSelectedList, (it, idx) => ({ ...it, sortedIndex: idx })),
itemGroups: itemGroups.filter(item => item.id != "default"),
items: itemGroups.filter(item => item.id == "default")[0].items
};
return new Promise((resolve, reject) => {
- this.saveLoading= true;
+ this.saveLoading = true;
API.saveLedgerItem(params).then(res => {
- this.saveLoading= false;
+ this.saveLoading = false;
if (res.status) {
resolve();
message.success("保存成功");
@@ -626,9 +630,9 @@ export class LedgerStore {
ruleParams: this.sobItemRuleDataSource
};
return new Promise((resolve, reject) => {
- this.saveLoading= true;
+ this.saveLoading = true;
API.saveAdjustmentRule(params).then(res => {
- this.saveLoading= false;
+ this.saveLoading = false;
if (res.status) {
resolve();
message.success("保存成功");