feature/2.12.1.2404.02-薪资账套配置流程审批

添加规则配置功能
This commit is contained in:
黎永顺 2024-04-28 17:53:12 +08:00
parent ffeb4283b2
commit e58f5e73e0
3 changed files with 145 additions and 19 deletions

View File

@ -16,6 +16,7 @@ import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem";
import LedgerSalaryItem from "./ledgerSalaryItem";
import LedgerAccountApprRule from "./ledgerAccountApprRule";
import { salaryApprovalSaveForm, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem } from "../../../apis/ledger";
import { sysConfCodeRule } from "../../../apis/ruleconfig";
import "./index.less";
const Step = WeaSteps.Step;
@ -32,10 +33,18 @@ class LedgerSlide extends Component {
baseSettingInfo: {},
adjustRules: [],
empFields: [], itemGroups: [],
saveSalarySobId: ""
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: ""
@ -225,7 +234,7 @@ class LedgerSlide extends Component {
};
renderCustomOperate = () => {
const { taxAgentStore: { showOperateBtn }, editId } = this.props;
const { current, loading } = this.state;
const { current, loading, salaryApprovalStatus } = this.state;
let CurrentDom = [];
//管理员操作权限
if (showOperateBtn) {
@ -272,16 +281,25 @@ class LedgerSlide extends Component {
] : [];
break;
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.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(33199, "保存并进入下一步")}</Button>
] : [
<Button type="primary" loading={loading}
onClick={this.saveLedgerAdjustRule}>{getLabel(537558, "保存")}</Button>
];
const btns = salaryApprovalStatus ? [
<Button type="ghost" onClick={this.handleClose}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>,
<Button type="primary" loading={loading}
onClick={() => this.setState({ current: current + 1 }, () => this.saveLedgerAdjustRule())}>{getLabel(33199, "保存并进入下一步")}</Button>
] : [
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>,
<Button type="primary" loading={loading}
onClick={() => {
this.handleClose();
this.saveLedgerAdjustRule();
}}>{getLabel(555, "完成")}</Button>
];
CurrentDom = !editId ? btns : [
<Button type="primary" loading={loading}
onClick={this.saveLedgerAdjustRule}>{getLabel(537558, "保存")}</Button>
];
break;
default:
CurrentDom = !editId ?
@ -304,7 +322,7 @@ class LedgerSlide extends Component {
render() {
const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props;
const { current } = this.state;
const { current, salaryApprovalStatus } = this.state;
const tabs = [
{ key: 0, title: getLabel(82751, "基础设置") },
{ key: 1, title: getLabel(543467, "关联人员") },
@ -313,6 +331,7 @@ class LedgerSlide extends Component {
{ key: 4, title: getLabel(543469, "调薪计薪规则") },
{ key: 10, title: getLabel(111, "核算审批规则") }
];
!salaryApprovalStatus && tabs.splice(_.indexOf(tabs, { key: 10 }), 1);
return (
<WeaSlideModal
className="slideOuterWrapper"

View File

@ -11,6 +11,7 @@ export const conditions = [
domkey: ["orderRule"],
fieldcol: 10,
label: getLabel(15512, "排序字段"),
lanId: 15512,
labelcol: 8,
options: [],
viewAttr: 2
@ -20,12 +21,14 @@ export const conditions = [
domkey: ["ascOrDesc"],
fieldcol: 10,
label: getLabel(543351, "正序/倒序"),
lanId: 543351,
labelcol: 8,
options: [],
viewAttr: 2
}
],
title: getLabel(543356, "排序规则"),
lanId: 543356,
defaultshow: true
},
{
@ -35,12 +38,14 @@ export const conditions = [
domkey: ["rule"],
fieldcol: 10,
label: getLabel(543352, "人员字段"),
lanId: 543352,
labelcol: 8,
options: [],
viewAttr: 2
}
],
title: getLabel(543357, "人员校验规则"),
lanId: 543357,
defaultshow: true
},
{
@ -50,11 +55,13 @@ export const conditions = [
domkey: ["OPEN_APPLICATION_ENCRYPT"],
fieldcol: 10,
label: getLabel(526997, "加密设置"),
lanId: 526997,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(543358, "加密规则"),
lanId: 543358,
defaultshow: true
},
{
@ -64,6 +71,7 @@ export const conditions = [
domkey: ["taxDeclarationFunction"],
fieldcol: 10,
label: getLabel(111, "系统算税"),
lanId: 111,
labelcol: 8,
viewAttr: 1
},
@ -72,11 +80,13 @@ export const conditions = [
domkey: ["WITHDRAW_TAX_DECLARATION"],
fieldcol: 10,
label: getLabel(111, "撤回申报表"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "算税规则"),
lanId: 111,
defaultshow: true
},
{
@ -86,11 +96,13 @@ export const conditions = [
domkey: ["salaryArchiveDelete"],
fieldcol: 10,
label: getLabel(111, "允许删除档案"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(538004, "薪资档案"),
lanId: 538004,
defaultshow: true
},
{
@ -100,6 +112,7 @@ export const conditions = [
domkey: ["welBaseDiffByPerAndCom"],
fieldcol: 10,
label: getLabel(111, "区分个人和公司"),
lanId: 111,
labelcol: 8,
viewAttr: 2
},
@ -108,11 +121,13 @@ export const conditions = [
domkey: ["welBaseAutoAdjust"],
fieldcol: 10,
label: getLabel(111, "导入基数自动调整上/下限"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "福利档案基数"),
lanId: 111,
defaultshow: true
},
{
@ -122,12 +137,14 @@ export const conditions = [
domkey: ["matchRule"],
fieldcol: 10,
label: getLabel(111, "匹配规则"),
lanId: 111,
options: [],
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "薪资核算人员匹配规则"),
lanId: 111,
defaultshow: true
},
{
@ -137,11 +154,13 @@ export const conditions = [
domkey: ["salaryAcctFixedColumns"],
fieldcol: 10,
label: getLabel(111, "固定数"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "薪资核算固定列头数"),
lanId: 111,
defaultshow: true
},
{
@ -151,11 +170,13 @@ export const conditions = [
domkey: ["extEmpsWitch"],
fieldcol: 10,
label: getLabel(111, "开启非系统人员"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "非系统人员"),
lanId: 111,
defaultshow: true
},
{
@ -165,6 +186,7 @@ export const conditions = [
domkey: ["salaryShowStatus"],
fieldcol: 10,
label: getLabel(111, "显示工资单页签"),
lanId: 111,
labelcol: 8,
viewAttr: 2
},
@ -173,6 +195,7 @@ export const conditions = [
domkey: ["adjustShowStatus"],
fieldcol: 10,
label: getLabel(111, "显示调薪记录页签"),
lanId: 111,
labelcol: 8,
viewAttr: 2
},
@ -181,11 +204,56 @@ export const conditions = [
domkey: ["taxAgentShowStatus"],
fieldcol: 10,
label: getLabel(111, "显示【个税扣缴义务人】信息"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "我的薪资福利设置"),
lanId: 111,
defaultshow: true
},
{
items: [
{
conditionType: "SWITCH",
domkey: ["SALARY_APPROVAL_STATUS"],
fieldcol: 10,
label: getLabel(111, "薪资审批"),
lanId: 111,
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["APPROVAL_CAN_MANUAL_FILE_STATUS"],
fieldcol: 10,
label: getLabel(111, "开启审批的核算记录允许手动归档"),
lanId: 111,
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["APPROVAL_CAN_RE_CALC_STATUS"],
fieldcol: 10,
label: getLabel(111, "开启审批的核算记录允许重新核算"),
lanId: 111,
labelcol: 8,
viewAttr: 2
},
{
conditionType: "SWITCH",
domkey: ["APPROVAL_CAN_EDIT_RESULT_STATUS"],
fieldcol: 10,
label: getLabel(111, "审批流程发起后允许修改核算数据"),
lanId: 111,
labelcol: 8,
viewAttr: 2
}
],
title: getLabel(111, "薪资审批设置"),
lanId: 111,
defaultshow: true
}
];

View File

@ -38,19 +38,32 @@ class RuleConfig extends Component {
const optionsList = { matchRule, orderRule, ascOrDesc, rule };
this.setState({
sysinfo, conditions: _.map(conditions, item => ({
...item,
...item, title: getLabel(item.lanId, item.title),
items: _.map(item.items, o => {
if (getKey(o) === "matchRule" || getKey(o) === "orderRule" || getKey(o) === "ascOrDesc" || getKey(o) === "rule") {
return { ...o, options: _.map(optionsList[getKey(o)], g => ({ key: g.value, showname: g.defaultLabel })) };
return {
...o, label: getLabel(o.lanId, o.label),
options: _.map(optionsList[getKey(o)], g => ({ key: g.value, showname: g.defaultLabel }))
};
} else if (getKey(o) === "OPEN_APPLICATION_ENCRYPT") {
return { ...o, viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1 };
return {
...o, label: getLabel(o.lanId, o.label),
viewAttr: sysinfo.showEncryptOperationButton === "true" ? 2 : 1
};
} else if (getKey(o) === "taxDeclarationFunction") {
return {
...o,
...o, label: getLabel(o.lanId, o.label),
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, label: getLabel(o.lanId, o.label),
hide: sysinfo["SALARY_APPROVAL_STATUS"] === "0" || _.isNil(sysinfo["SALARY_APPROVAL_STATUS"])
};
}
return { ...o };
return { ...o, label: getLabel(o.lanId, o.label) };
})
}))
}, async () => {
@ -73,6 +86,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] || "" } });
}
@ -116,6 +133,10 @@ class RuleConfig extends Component {
case "taxAgentShowStatus":
case "salaryShowStatus":
case "adjustShowStatus":
case "SALARY_APPROVAL_STATUS":
case "APPROVAL_CAN_MANUAL_FILE_STATUS":
case "APPROVAL_CAN_RE_CALC_STATUS":
case "APPROVAL_CAN_EDIT_RESULT_STATUS":
const confTitle = {
welBaseDiffByPerAndCom: getLabel(111, "福利档案基数区分个人和公司"),
welBaseAutoAdjust: getLabel(111, "福利档案导入基数不符合要求时自动调整为上限/下限"),
@ -123,7 +144,11 @@ class RuleConfig extends Component {
extEmpsWitch: getLabel(544097, "开启非系统人员"),
taxAgentShowStatus: getLabel(111, "显示【个税扣缴义务人】信息"),
salaryShowStatus: getLabel(111, "显示工资单页签"),
adjustShowStatus: getLabel(111, "显示调薪记录页签")
adjustShowStatus: 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]);
break;
@ -292,6 +317,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, "保存失败!"));
}