Merge branch 'feature/2.16.1.2410.01-薪资账套配置流程审批' into release/2.17.1.2411.01
# Conflicts: # pc4mobx/hrmSalary/pages/ruleConfig/ruleConfig.js
This commit is contained in:
commit
b0a45c9bbe
|
|
@ -277,6 +277,10 @@ export const deleteExportTemplate = (params) => {
|
|||
export const getExportTemplateForm = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/getExportTemplateForm", params);
|
||||
};
|
||||
//薪资审批-薪资核算页面获取审批信息
|
||||
export const getApprovalInfoByRecordId = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salarysob/salaryApproval/getApprovalInfoByRecordId", "GET", params);
|
||||
};
|
||||
//薪资核算-薪资项目改变否
|
||||
export const getCompareSobConfig = params => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/compareSobConfig", "GET", params);
|
||||
|
|
|
|||
|
|
@ -159,3 +159,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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ class Index extends Component {
|
|||
|
||||
renderTabBtns = () => {
|
||||
const { selectedKey, selectedRowKeys } = this.state;
|
||||
const { calcDetail } = this.props;
|
||||
let tabBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "range":
|
||||
|
|
@ -95,6 +96,7 @@ class Index extends Component {
|
|||
className="icon-coms-Refresh"/></span>,
|
||||
<Button type="primary" onClick={this.handleExport}>{getLabel(17416, "导出")}</Button>
|
||||
];
|
||||
calcDetail && tabBtns.splice(0, 2);
|
||||
break;
|
||||
case "add":
|
||||
case "sub":
|
||||
|
|
@ -202,7 +204,7 @@ class Index extends Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const { calculateStore: { PCSearchForm } } = this.props;
|
||||
const { calculateStore: { PCSearchForm }, calcDetail } = this.props;
|
||||
const {
|
||||
selectedKey, showSearchAd, searchConditions, pageInfo, loading, selectedRowKeys,
|
||||
columns, dataSource
|
||||
|
|
@ -280,8 +282,8 @@ class Index extends Component {
|
|||
onAdReset={() => PCSearchForm.resetForm()} autoCalculateWidth
|
||||
/>
|
||||
<WeaTable
|
||||
dataSource={dataSource} loading={loading} rowSelection={rowSelection} pagination={pagination}
|
||||
scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
|
||||
dataSource={dataSource} loading={loading} rowSelection={calcDetail ? null : rowSelection}
|
||||
pagination={pagination} scroll={{ y: `calc(100vh - 365px)` }} rowKey="id"
|
||||
columns={[..._.map(columns, item => {
|
||||
let width = "";
|
||||
const { dataIndex } = item;
|
||||
|
|
@ -300,9 +302,10 @@ class Index extends Component {
|
|||
dataIndex: "operate",
|
||||
title: getLabel(30585, "操作"),
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<a href="javascript:void(0);"
|
||||
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>
|
||||
render: (_, record) => (<React.Fragment>
|
||||
{calcDetail ? null : <a href="javascript:void(0);"
|
||||
onClick={() => this.handleDeletePCitem([record.id])}>{getLabel(535052, "删除")}</a>}
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
]}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,12 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom";
|
|||
import { Button, Dropdown, Menu, message, Modal } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import Layout from "./layout";
|
||||
import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate";
|
||||
import {
|
||||
acctresultAccounting,
|
||||
getApprovalInfoByRecordId,
|
||||
getCalculateProgress,
|
||||
getExportField
|
||||
} from "../../../apis/calculate";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
|
||||
import SalaryEditCalc from "./components/salaryEditCalc";
|
||||
|
|
@ -30,6 +35,7 @@ class Index extends Component {
|
|||
selectedKey: "person", progressVisible: false, progress: 0,
|
||||
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
|
||||
salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" },
|
||||
approvalInfo: {},//审批信息,
|
||||
accountExceptInfo: "" //核算报错信息,
|
||||
|
||||
};
|
||||
|
|
@ -37,6 +43,12 @@ class Index extends Component {
|
|||
this.timer = null;
|
||||
}
|
||||
|
||||
init = () => {
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
getApprovalInfoByRecordId({ salaryAcctRecordId }).then(({ status, data: approvalInfo }) => {
|
||||
if (status) this.setState({ approvalInfo });
|
||||
});
|
||||
};
|
||||
handleMenuClick = ({ key }) => {
|
||||
switch (key) {
|
||||
case "calc_selected":
|
||||
|
|
@ -139,7 +151,9 @@ class Index extends Component {
|
|||
}
|
||||
};
|
||||
renderReqBtns = () => {
|
||||
const { selectedKey, accountExceptInfo } = this.state;
|
||||
const { routeParams: { salaryAcctRecordId } } = this.props;
|
||||
const { selectedKey, accountExceptInfo, approvalInfo } = this.state;
|
||||
const { isOpenApproval, approvalWorkflowUrl, canEdit } = approvalInfo;
|
||||
let reqBtns = [];
|
||||
switch (selectedKey) {
|
||||
case "calc":
|
||||
|
|
@ -150,7 +164,7 @@ class Index extends Component {
|
|||
);
|
||||
const moreMenu = (
|
||||
<Menu onClick={this.handleMoreMenuClick}>
|
||||
<Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>
|
||||
{canEdit && <Menu.Item key="import">{getLabel(32935, "导入")}</Menu.Item>}
|
||||
<Menu.Item key="exportAll">{getLabel(81272, "导出全部")}</Menu.Item>
|
||||
<Menu.Item key="export_custom">{getLabel(544270, "自定义导出")}</Menu.Item>
|
||||
<Menu.Item key="offlineCompare">{getLabel(543249, "线下对比")}</Menu.Item>
|
||||
|
|
@ -166,6 +180,10 @@ class Index extends Component {
|
|||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.calc.openAdvanceSearch()}
|
||||
onAdvanceSearch={() => this.calc.onAdSearch(false)}/>
|
||||
];
|
||||
!canEdit && reqBtns.splice(0, 1);
|
||||
isOpenApproval && reqBtns.unshift(<Button type="ghost" onClick={() => {
|
||||
window.open(`${approvalWorkflowUrl}&salaryAcctRecordId=${salaryAcctRecordId}`, "_blank");
|
||||
}}>{getLabel(111, "发起审批")}</Button>);
|
||||
accountExceptInfo && reqBtns.unshift(<i className="iconfont icon-jinggao"
|
||||
title={getLabel(111, "存在异常信息,点击下载!")}
|
||||
onClick={() => this.downloadTxtfile(accountExceptInfo)}/>);
|
||||
|
|
@ -184,14 +202,15 @@ class Index extends Component {
|
|||
element.click();
|
||||
};
|
||||
renderContent = () => {
|
||||
const { selectedKey } = this.state;
|
||||
const { selectedKey, approvalInfo } = this.state;
|
||||
const { canEdit } = approvalInfo;
|
||||
let dom = null;
|
||||
switch (selectedKey) {
|
||||
case "person":
|
||||
dom = <SalaryCalcPersonConfirm {...this.props}/>;
|
||||
dom = <SalaryCalcPersonConfirm calcDetail={!canEdit} {...this.props}/>;
|
||||
break;
|
||||
case "calc":
|
||||
dom = <SalaryEditCalc {...this.props} ref={dom => this.calc = dom}/>;
|
||||
dom = <SalaryEditCalc {...this.props} calcDetail={!canEdit} ref={dom => this.calc = dom}/>;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -207,7 +226,7 @@ class Index extends Component {
|
|||
const { calculateStore: { setOtherConditions } } = this.props;
|
||||
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
|
||||
return (
|
||||
<Layout {...this.props}>
|
||||
<Layout {...this.props} init={this.init}>
|
||||
<div className="salary-calculate-do-calc">
|
||||
<WeaReqTop
|
||||
title={getLabel(538011, "薪资核算")} tabDatas={tabs} selectedKey={selectedKey}
|
||||
|
|
|
|||
|
|
@ -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: (
|
||||
<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={editId || saveSalarySobId}
|
||||
onAddItems={(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: 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 } }))}/>
|
||||
</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,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 (
|
||||
<WeaDialog
|
||||
{...this.props} style={{ width: 480, height: 80 }} initLoadCss
|
||||
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,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 (
|
||||
<div>
|
||||
<div style={{ textAlign: "right", padding: "10px 0" }}>
|
||||
<WeaButtonIcon buttonType="add" type="primary"
|
||||
onClick={() => this.setState({
|
||||
editDialog: { visible: true, title: getLabel(111, "添加分类") }
|
||||
})}/>
|
||||
|
||||
</div>
|
||||
<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, title: getLabel(111, "分类名称编辑")
|
||||
}
|
||||
})}/>
|
||||
<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>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default LedgerAccountSalaryItemsSet;
|
||||
|
|
@ -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: ""
|
||||
|
|
@ -86,7 +96,6 @@ class LedgerSlide extends Component {
|
|||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
message.success("保存成功");
|
||||
this.handleClose();
|
||||
} else {
|
||||
message.success(errormsg || "保存失败");
|
||||
}
|
||||
|
|
@ -151,9 +160,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, taxAgentStore: { showOperateBtn } } = this.props;
|
||||
const { current, saveSalarySobId, loading } = this.state;
|
||||
const { current, saveSalarySobId, loading, salaryApprovalStatus } = this.state;
|
||||
let tabs = [
|
||||
{
|
||||
key: 0, title: getLabel(82751, "基础设置"),
|
||||
|
|
@ -210,9 +255,11 @@ class LedgerSlide extends Component {
|
|||
{
|
||||
key: 4, title: getLabel(543469, "调薪计薪规则"),
|
||||
createBtns: [
|
||||
<Button type="ghost" onClick={this.handleClose}>{getLabel(111, "完成,跳过所有步骤")}</Button>,
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.saveLedgerAdjustRule}>{getLabel(111, "完成")}</Button>
|
||||
<Button type="primary"
|
||||
onClick={() => this.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(111, "保存并进入下一步")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
|
|
@ -220,8 +267,23 @@ class LedgerSlide extends Component {
|
|||
],
|
||||
children: <LedgerSalaryAdjustmentRules {...this.props} saveSalarySobId={saveSalarySobId}
|
||||
onSaveParams={(adjustRules) => this.setState({ adjustRules })}/>
|
||||
},
|
||||
{
|
||||
key: 5, title: getLabel(111, "核算审批规则"),
|
||||
createBtns: [
|
||||
<Button type="ghost"
|
||||
onClick={() => this.setState({ current: current - 1 })}>{getLabel(111, "上一步")}</Button>,
|
||||
<Button type="primary" loading={loading} onClick={this.handleDefaultSave}>{getLabel(111, "完成")}</Button>
|
||||
],
|
||||
editBtns: [
|
||||
<Button type="primary" loading={loading}
|
||||
onClick={this.handleDefaultSave}>{getLabel(111, "保存")}</Button>
|
||||
],
|
||||
children: <LedgerAccountApprRule {...this.props} ref={dom => this.approRef = dom}
|
||||
saveSalarySobId={saveSalarySobId}/>
|
||||
}
|
||||
];
|
||||
!salaryApprovalStatus && tabs.pop();
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="ledgerSlideLayout 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
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -247,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" },
|
||||
|
|
|
|||
|
|
@ -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) };
|
||||
|
|
@ -65,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 };
|
||||
})
|
||||
|
|
@ -91,6 +99,10 @@ class RuleConfig extends Component {
|
|||
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] || "" } });
|
||||
}
|
||||
|
|
@ -137,6 +149,10 @@ class RuleConfig extends Component {
|
|||
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 = {
|
||||
|
|
@ -150,6 +166,10 @@ class RuleConfig extends Component {
|
|||
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;
|
||||
|
|
@ -322,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, "保存失败!"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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