feature/2.12.1.2404.02-薪资账套配置流程审批
This commit is contained in:
parent
7dee340ab8
commit
10e981d0d3
|
|
@ -155,3 +155,15 @@ export const salarysobRangeImportData = params => {
|
|||
export const getSalaryItemForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/item/getSalaryItemForm", params);
|
||||
};
|
||||
//薪资核算规则配置-获取薪资审批规则表单
|
||||
export const getSalaryApprovalForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/getForm", params);
|
||||
};
|
||||
//薪资核算规则配置-保存薪资审批规则表单
|
||||
export const salaryApprovalSaveForm = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/saveForm", params);
|
||||
};
|
||||
//薪资核算规则配置-获取能够添加的项目
|
||||
export const getListSalaryItem = params => {
|
||||
return postFetch("/api/bs/hrmsalary/salarysob/salaryApproval/listSalaryItem", params);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
* 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: saveSalarySobId || editId }).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: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}
|
||||
onChange={this.handleFormItemChange}/>
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
com: (
|
||||
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<LedgerAccountSalaryItemsSet datas={approvalItemGroup} salarySobId={saveSalarySobId || editId}
|
||||
onAdd={(groupId, items) => 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: _.map(approvalItemGroup, o => ({
|
||||
...o, groupName: groupId === o.id ? groupName : o.groupName
|
||||
}))
|
||||
}, () => 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 } }))}/>
|
||||
</WeaFormItem>),
|
||||
hide: fields.hide
|
||||
});
|
||||
}
|
||||
});
|
||||
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||
});
|
||||
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 (
|
||||
<div className="form-dialog-layout" style={{ background: "#FFF" }}>
|
||||
{this.renderForm(AARForm, conditions)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountApprRule;
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* 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 } = 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);
|
||||
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 (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 80 }} initLoadCss
|
||||
title={getLabel(111, "分类名称编辑")}
|
||||
buttons={[
|
||||
<Button type="primary" onClick={this.save}>{getLabel(537558, "保存")}</Button>
|
||||
]}
|
||||
>
|
||||
<div className="form-dialog-layout">{getSearchs(AARClassifyForm, conditions, 1, false)}</div>
|
||||
</WeaDialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountApprRuleClassifyNameEditDialog;
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 薪资核算规则配置-审批薪资项目
|
||||
* Description:
|
||||
* Date: 2024/4/24
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { 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: "" },
|
||||
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 } = this.props;
|
||||
const payload = {
|
||||
salarySobId, excludeIds: _.map(group.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.onAdd(salaryItemDialog.groupId, _.filter(this.state.salaryItemDialog.options, g => g.checkedSalaryItem)));
|
||||
};
|
||||
|
||||
render() {
|
||||
const { editDialog, salaryItemDialog } = this.state;
|
||||
const { datas } = this.props;
|
||||
return (
|
||||
<div className={cs("salaryItemSettingWrapper", { required: _.isEmpty(datas) })}>
|
||||
<WeaSortable
|
||||
datas={datas}
|
||||
onChange={list => this.props.onChange(list)}
|
||||
renderNodeItem={(item) => {
|
||||
return <div className="salaryItemWrapper">
|
||||
<div className="salaryItemHeader">
|
||||
<span className="titleWrapper">
|
||||
<span className="salaryClassTitle">{item.groupName}</span>
|
||||
<span className="iconWrapper">
|
||||
<i className="icon-coms-edit" onClick={() => this.setState({
|
||||
editDialog: { visible: true, groupName: item.groupName, groupId: item.id }
|
||||
})}/>
|
||||
<i className="icon-coms-Delete" onClick={() => this.handleDeleteClick(item)}/>
|
||||
</span>
|
||||
</span>
|
||||
<i className="icon-coms-Add-to" onClick={() => this.handleAddSalaryItems(item)}/>
|
||||
</div>
|
||||
<div className="salaryItemContent">
|
||||
{
|
||||
!_.isEmpty(item.approvalItems) ?
|
||||
<WeaSortable
|
||||
datas={item.approvalItems}
|
||||
onChange={(items) => this.props.onChange(
|
||||
_.map(datas, child => {
|
||||
if (child.id === item.id) {
|
||||
return { ...child, approvalItems: items };
|
||||
}
|
||||
return { ...child };
|
||||
})
|
||||
)}
|
||||
renderNodeItem={(filed) => {
|
||||
return <div className="salaryItemList">
|
||||
<div className="salaryItem" title={filed.salaryItemName}>
|
||||
<div className="salaryItemName">{filed.salaryItemName}</div>
|
||||
<Icon type="cross" onClick={() => this.handleDeleteClick(item, filed)}/>
|
||||
</div>
|
||||
</div>;
|
||||
}}
|
||||
className="wea-sortable-salary-item"
|
||||
/> :
|
||||
<div className="empty">暂无数据</div>
|
||||
}
|
||||
</div>
|
||||
</div>;
|
||||
}}
|
||||
className="wea-sortable-salary-item"
|
||||
/>
|
||||
<LedgerAccountApprRuleClassifyNameEditDialog {...editDialog} {...this.props}
|
||||
onCancel={() => this.setState({
|
||||
editDialog: { ...editDialog, visible: false }
|
||||
})}/>
|
||||
<SalaryItemModal {...salaryItemDialog}
|
||||
onCancel={() => this.setState({
|
||||
salaryItemDialog: { ...salaryItemDialog, visible: false }
|
||||
})} onConfirm={this.handleConfirm}>
|
||||
<div className="modalContent">
|
||||
<WeaTransfer
|
||||
data={salaryItemDialog.options}
|
||||
selectedKeys={_.map(_.filter(salaryItemDialog.options, g => g.checkedSalaryItem), o => o.id)}
|
||||
onChange={v => {
|
||||
this.setState({
|
||||
salaryItemDialog: {
|
||||
...salaryItemDialog,
|
||||
options: _.map(salaryItemDialog.options, o => ({ ...o, checkedSalaryItem: _.includes(v, o.id) }))
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</SalaryItemModal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountSalaryItemsSet;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaSlideModal, WeaSteps } from "ecCom";
|
||||
import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import LedgerBaseSetting from "./ledgerBaseSetting";
|
||||
|
|
@ -14,17 +14,12 @@ import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel";
|
|||
import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules";
|
||||
import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
|
||||
import LedgerSalaryItem from "./ledgerSalaryItem";
|
||||
import { saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
|
||||
import LedgerAccountApprRule from "./ledgerAccountApprRule";
|
||||
import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
|
||||
import "./index.less";
|
||||
|
||||
const Step = WeaSteps.Step;
|
||||
const tabs = [
|
||||
{ key: 0, title: "基础设置" },
|
||||
{ key: 1, title: "关联人员" },
|
||||
{ key: 2, title: "薪资项目" },
|
||||
{ key: 3, title: "回算薪资项目" },
|
||||
{ key: 4, title: "调薪计薪规则" }
|
||||
];
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore", "ledgerStore")
|
||||
@observer
|
||||
|
|
@ -95,7 +90,6 @@ class LedgerSlide extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("保存成功");
|
||||
this.handleClose();
|
||||
} else {
|
||||
message.success(errormsg || "保存失败");
|
||||
}
|
||||
|
|
@ -166,6 +160,40 @@ 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, "保存成功!"));
|
||||
} else {
|
||||
message.error(errormsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
renderChildren = () => {
|
||||
const { current, saveSalarySobId } = this.state;
|
||||
let CurrentDom = null;
|
||||
|
|
@ -189,7 +217,8 @@ class LedgerSlide extends Component {
|
|||
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>;
|
||||
break;
|
||||
default:
|
||||
CurrentDom = null;
|
||||
CurrentDom =
|
||||
<LedgerAccountApprRule {...this.props} ref={dom => this.approRef = dom} saveSalarySobId={saveSalarySobId}/>;
|
||||
break;
|
||||
}
|
||||
return CurrentDom;
|
||||
|
|
@ -245,13 +274,28 @@ class LedgerSlide extends Component {
|
|||
case 4:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost" onClick={() => this.setState({ current: current - 1 })}>上一步</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>完成</Button>
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={() => this.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(33199, "保存并进入下一步")}</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>保存</Button>
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.saveLedgerAdjustRule}>{getLabel(537558, "保存")}</Button>
|
||||
];
|
||||
break;
|
||||
default:
|
||||
CurrentDom = !editId ?
|
||||
[
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={() => {
|
||||
this.handleClose();
|
||||
this.handleDefaultSave();
|
||||
}}>{getLabel(555, "完成")}</Button>
|
||||
] : [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.handleDefaultSave}>{getLabel(537558, "保存")}</Button>
|
||||
];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -261,6 +305,14 @@ class LedgerSlide extends Component {
|
|||
render() {
|
||||
const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { current } = this.state;
|
||||
const tabs = [
|
||||
{ key: 0, title: getLabel(82751, "基础设置") },
|
||||
{ key: 1, title: getLabel(543467, "关联人员") },
|
||||
{ key: 2, title: getLabel(542362, "薪资项目") },
|
||||
{ key: 3, title: getLabel(543468, "回算薪资项目") },
|
||||
{ key: 4, title: getLabel(543469, "调薪计薪规则") },
|
||||
{ key: 10, title: getLabel(111, "核算审批规则") }
|
||||
];
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
|
|
|
|||
|
|
@ -803,3 +803,57 @@ export const keepDecimalPlaces = [
|
|||
showname: "5"
|
||||
}
|
||||
];
|
||||
export const acctApprRulesConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "SWITCH",
|
||||
domkey: ["isOpenApproval"],
|
||||
fieldcol: 20,
|
||||
label: "是否开启审批",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["approvalWorkflowUrl"],
|
||||
fieldcol: 20,
|
||||
label: "审批流程地址",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
},
|
||||
{
|
||||
conditionType: "CUSTOM",
|
||||
domkey: ["approvalItemGroup"],
|
||||
fieldcol: 20,
|
||||
label: "审批薪资项目",
|
||||
lanId: 111,
|
||||
labelcol: 4,
|
||||
value: "",
|
||||
viewAttr: 2
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
export const classifyConditions = [
|
||||
{
|
||||
items: [
|
||||
{
|
||||
conditionType: "INPUT",
|
||||
domkey: ["groupName"],
|
||||
fieldcol: 18,
|
||||
label: "分类名称",
|
||||
lanId: 111,
|
||||
labelcol: 6,
|
||||
value: "",
|
||||
rules: "required|string",
|
||||
viewAttr: 3
|
||||
}
|
||||
],
|
||||
defaultshow: true
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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("保存成功");
|
||||
|
|
|
|||
Loading…
Reference in New Issue