From cf33419bc3222425f9ece25fc3b670ca472f803d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 14 Jul 2023 10:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/ruleconfig.js | 16 +++ pc4mobx/hrmSalary/pages/ruleConfig/index.js | 114 +++++++++++++++++--- 2 files changed, 117 insertions(+), 13 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 7ff084ce..69cfa1fa 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); }; @@ -43,6 +47,18 @@ export const getEncryptProgress = params => { export const operateTaxDeclarationFunction = (params) => { return postFetch("/api/bs/hrmsalary/sys/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); +}; //保存匹配规则 export const saveSalaryAcctEmployeeRule = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveSalaryAcctEmployeeRule", params); diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 6f088528..7e934e77 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -25,7 +25,10 @@ export default class Index extends Component { rule: "", enctry: "", operateTaxDeclaration: "", - matchRule: "" + matchRule: "", + confValue: "0", + withDrawTaxDeclaration: "0", + extEmpsWitch: "0" }, showEncryptOperationButton: "", progressVisible: false, @@ -37,35 +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 + 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 + ascOrDesc, orderRule, rule, enctry, operateTaxDeclaration, matchRule, confValue, withDrawTaxDeclaration, + extEmpsWitch } }); } + sysinfo = () => { + return API.sysinfo(); + }; + sysOrderRule = () => { return API.sysOrderRule(); }; @@ -197,6 +217,36 @@ export default class Index extends Component { } }); }; + saveArchiveDelete = () => { + API.saveArchiveDelete(_.pick(this.state.saveParams, ["confValue"])) + .then(({ status, errormsg }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }; + 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 }) => { + if (status) { + message.success(getLabel(22619, "保存成功!")); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }); + }; handleChange = (key, val) => { const { saveParams } = this.state; @@ -227,6 +277,18 @@ export default class Index extends Component { case "enctry": this.saveEncryptSetting(); break; + case "confValue": + this.saveArchiveDelete(); + break; + case "withDrawTaxDeclaration": + this.withDrawTaxDeclaration(); + break; + case "extEmpsWitch": + this.saveSysOperate({ + title: getLabel(111, "开启非系统人员"), + module: "basic", confKey: key + }); + break; default: break; } @@ -252,7 +314,17 @@ export default class Index extends Component { employeeOptions, showEncryptOperationButton } = this.state; - const { orderRule, ascOrDesc, rule, enctry, operateTaxDeclaration, matchRule } = saveParams; + const { + orderRule, + ascOrDesc, + rule, + enctry, + operateTaxDeclaration, + matchRule, + confValue, + withDrawTaxDeclaration, + extEmpsWitch + } = saveParams; return (