Merge branch 'feature/非系统人员开关' into develop

# Conflicts:
#	pc4mobx/hrmSalary/apis/ruleconfig.js
#	pc4mobx/hrmSalary/pages/ruleConfig/index.js
This commit is contained in:
黎永顺 2023-07-14 10:43:05 +08:00
commit 91c2060265
2 changed files with 61 additions and 13 deletions

View File

@ -6,6 +6,10 @@ export const commonEnumList = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/common/enum/list", "GET", params);
};
export const sysinfo = params => {
return WeaTools.callApi("/api/bs/hrmsalary/sys/info", "GET", params);
};
export const sysOrderRule = params => {
return WeaTools.callApi("/api/bs/hrmsalary/sys/orderRule", "GET", params);
};
@ -47,6 +51,10 @@ export const operateTaxDeclarationFunction = (params) => {
export const saveArchiveDelete = (params) => {
return postFetch("/api/bs/hrmsalary/sys/saveArchiveDelete", params);
};
//保存系统规则开关
export const saveSysOperate = (params) => {
return postFetch("/api/bs/hrmsalary/sys/operate", params);
};
//保存个税申报撤回规则
export const saveWithDrawTaxDeclaration = (params) => {
return postFetch("/api/bs/hrmsalary/sys/saveWithDrawTaxDeclaration", params);

View File

@ -27,7 +27,8 @@ export default class Index extends Component {
operateTaxDeclaration: "",
matchRule: "",
confValue: "0",
withDrawTaxDeclaration: "0"
withDrawTaxDeclaration: "0",
extEmpsWitch: "0"
},
showEncryptOperationButton: "",
progressVisible: false,
@ -39,36 +40,52 @@ export default class Index extends Component {
const { saveParams } = this.state;
const [
matchRuleEnum, orderRuleEnum, ascOrDescEnum, matchEmployeeModeEnum,
orderRules, codeRule, appSettings
// orderRules, codeRule, appSettings,
sysInfo
] = await Promise.all([
this.matchRuleEnum(), this.orderRuleEnum(), this.ascOrDescEnum(), this.matchEmployeeModeEnum(),
this.sysOrderRule(), this.sysConfCodeRule(), this.queryAppsetting()
// this.sysOrderRule(), this.sysConfCodeRule(), this.queryAppsetting(),
this.sysinfo()
]);
const matchRuleOptions = _.map(matchRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const orderOptions = _.map(orderRuleEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const ascOptions = _.map(ascOrDescEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const employeeOptions = _.map(matchEmployeeModeEnum.data, it => ({ key: it.value, showname: it.defaultLabel }));
const { data: { ascOrDesc, orderRule } } = orderRules;
const { data: rule } = codeRule;
const {
data: {
showEncryptOperationButton,
isOpenEncrypt: enctry,
isOpenTaxDeclaration: operateTaxDeclaration,
salaryAcctEmployeeRule: matchRule,
salaryArchiveDelete: confValue, withDrawTaxDeclaration
ascOrDesc = "", orderRule = "", showEncryptOperationButton, matchEmployeeMode: rule = "",
taxDeclarationFunction: operateTaxDeclaration = "0", salaryArchiveDelete: confValue,
salaryAcctEmployeeRule: matchRule, WITHDRAW_TAX_DECLARATION: withDrawTaxDeclaration = "0",
OPEN_APPLICATION_ENCRYPT: enctry = "0", extEmpsWitch = "0"
}
} = appSettings;
} = sysInfo;
// const { data: { ascOrDesc, orderRule } } = orderRules;
// const { data: rule } = codeRule;
// const {
// data: {
// showEncryptOperationButton,
// isOpenEncrypt: enctry
// isOpenTaxDeclaration: operateTaxDeclaration,
// salaryAcctEmployeeRule: matchRule,
// salaryArchiveDelete: confValue,
// withDrawTaxDeclaration
// }
// } = appSettings;
this.setState({
matchRuleOptions, orderOptions, ascOptions, employeeOptions,
showEncryptOperationButton,
saveParams: {
...saveParams,
ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration
ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration,
extEmpsWitch
}
});
}
sysinfo = () => {
return API.sysinfo();
};
sysOrderRule = () => {
return API.sysOrderRule();
};
@ -210,6 +227,16 @@ export default class Index extends Component {
}
});
};
saveSysOperate = (payload) => {
API.saveSysOperate({ ...payload, confValue: this.state.saveParams.extEmpsWitch })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(22619, "保存成功!"));
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
});
};
withDrawTaxDeclaration = () => {
API.saveWithDrawTaxDeclaration({ confValue: _.pick(this.state.saveParams, ["withDrawTaxDeclaration"]).withDrawTaxDeclaration })
.then(({ status, errormsg }) => {
@ -256,6 +283,12 @@ export default class Index extends Component {
case "withDrawTaxDeclaration":
this.withDrawTaxDeclaration();
break;
case "extEmpsWitch":
this.saveSysOperate({
title: getLabel(111, "开启非系统人员"),
module: "basic", confKey: key
});
break;
default:
break;
}
@ -290,6 +323,7 @@ export default class Index extends Component {
matchRule,
confValue,
withDrawTaxDeclaration,
extEmpsWitch
} = saveParams;
return (
<div className="ruleWrapper">
@ -330,7 +364,7 @@ export default class Index extends Component {
}
<WeaSearchGroup title={getLabel(543359, "报税规则")} showGroup center>
<WeaFormItem label={getLabel(543353, "个税申报")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaCheckbox display="switch" value={operateTaxDeclaration}
<WeaCheckbox display="switch" value={operateTaxDeclaration !== "0" ? "1" : "0"}
onChange={val => this.handleChange("operateTaxDeclaration", val)}/>
</WeaFormItem>
<WeaFormItem label={getLabel(111, "允许个税申报撤回")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
@ -351,6 +385,12 @@ export default class Index extends Component {
/>
</WeaFormItem>
</WeaSearchGroup>
<WeaSearchGroup title={getLabel(111, "非系统人员")} showGroup center>
<WeaFormItem label={getLabel(111, "开启非系统人员")} labelCol={{ span: 8 }} wrapperCol={{ span: 16 }}>
<WeaCheckbox display="switch" value={extEmpsWitch}
onChange={val => this.handleChange("extEmpsWitch", val)}/>
</WeaFormItem>
</WeaSearchGroup>
{
this.state.progressVisible &&
<ProgressModal