-
{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 e9e61438..f812edda 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js
@@ -394,7 +394,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 fe79d45f..70c04767 100644
--- a/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
+++ b/pc4mobx/hrmSalary/pages/dataAcquisition/specialAddDeduction/index.js
@@ -332,7 +332,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 09c4278a..e5514082 100644
--- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
+++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js
@@ -13,12 +13,14 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
import LedgerSalaryItem from "./ledgerSalaryItem";
+import LedgerAccountApprRule from "./ledgerAccountApprRule";
import IncomeTaxFields from "./incomeTaxFields";
import IncomeTaxFieldsCorresponding from "./incomeTaxFieldsCorresponding";
import CumulativeFields from "./cumulativeFields";
import WeaTopTitle from "../../../components/custom-title/weaTopTitle";
import WeaReqTitle from "../../../components/custom-title/weaReqTitle";
import {
+ salaryApprovalSaveForm,
addupruleSave,
saveAdjustmentRule,
saveLedgerBasic,
@@ -26,6 +28,7 @@ import {
taxreportruleSave,
taxruleSave
} from "../../../apis/ledger";
+import { sysConfCodeRule } from "../../../apis/ruleconfig";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
@@ -37,19 +40,23 @@ class LedgerSlide extends Component {
constructor(props) {
super(props);
this.state = {
- current: 0,
- loading: false,
- baseSettingInfo: {},
- adjustRules: [],
- empFields: [], itemGroups: [],
+ current: 0, loading: false, baseSettingInfo: {}, adjustRules: [],
+ empFields: [], itemGroups: [], saveSalarySobId: "",
+ salaryApprovalStatus: false,
taxruleFields: [], taxruleKeys: "", //个税字段对应
incomeTaxFields: [], incomeTaxKeys: "", //个税申报字段对应
addupruleFields: [], addupruleKeys: "", //累计字段对应
- saveSalarySobId: "",
taxableItems: "" //薪资类型 1||489 对应显示个税设置-累计字段对应
};
}
+ 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: ""
@@ -319,9 +326,45 @@ class LedgerSlide extends Component {
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, taxAgentStore: { showOperateBtn } } = this.props;
- const { current, taxableItems, saveSalarySobId, loading } = this.state;
+ const { current, taxableItems, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
let tabs = [
{
key: 0, title: getLabel(82751, "基础设置"),
@@ -443,10 +486,25 @@ class LedgerSlide extends Component {
onSetAdduprule={(addupruleFields, selectedKey) => this.setState({
addupruleFields, addupruleKeys: selectedKey
})}/>
+ },
+ {
+ key: 8, title: getLabel(111, "核算审批规则"),
+ createBtns: [
+ ,
+
+ ],
+ editBtns: [
+
+ ],
+ children: this.approRef = dom}
+ saveSalarySobId={saveSalarySobId}/>
}
];
(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") &&
(tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j })));
+ !salaryApprovalStatus && tabs.pop();
return (
{
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">