diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index c041b4d3..b5f4f87f 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -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); diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 73636c83..7e934e77 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -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 (