diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index 13f2e0eb..2e5967fc 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -39,3 +39,7 @@ export const appSettingSave = (params) => { export const getEncryptProgress = params => { return WeaTools.callApi('/api/bs/hrmsalary/sys/app/getEncryptProgress', 'GET', params); } +//保存报税规则 +export const operateTaxDeclarationFunction = (params) => { + return postFetch('/api/bs/hrmsalary/sys/operateTaxDeclarationFunction', params); +} diff --git a/pc4mobx/hrmSalary/pages/ruleConfig/index.js b/pc4mobx/hrmSalary/pages/ruleConfig/index.js index 1a34d6c0..e440a1ce 100644 --- a/pc4mobx/hrmSalary/pages/ruleConfig/index.js +++ b/pc4mobx/hrmSalary/pages/ruleConfig/index.js @@ -5,7 +5,7 @@ * Date: 2022-09-19 18:15:32 */ import React, { Component } from "react"; -import { WeaFormItem, WeaSearchGroup, WeaSelect, WeaTop } from "ecCom"; +import { WeaFormItem, WeaNewScroll, WeaSearchGroup, WeaSelect, WeaTop } from "ecCom"; import { CheckBox } from "../appConfig"; import { Button, message, Modal } from "antd"; import * as API from "../../apis/ruleconfig"; @@ -19,16 +19,19 @@ class Index extends Component { items: [], importItems: [], enctryItems: [], + declareItems: [], loading: { order: false, employee: false, - encry: false + encry: false, + declare: false }, saveParams: { orderRule: "", ascOrDesc: "", rule: "", - enctry: "" + enctry: "", + operateTaxDeclaration: "" }, progressVisible: false, progress: 50 @@ -79,7 +82,16 @@ class Index extends Component { com: CheckBox({ label: "加密设置", value: queryAppsetting.data.isOpenEncrypt, - onChange: this.handleChane + onChange: (data) => this.handleChane({ type: "加密设置", selected: data }) + }) + } + ], + declareItems: [ + { + com: CheckBox({ + label: "取消报税", + value: queryAppsetting.data.isOpenTaxDeclaration, + onChange: (data) => this.handleChane({ type: "取消报税", selected: data }) }) } ], @@ -88,7 +100,8 @@ class Index extends Component { orderRule: sysOrderRule.data.orderRule, ascOrDesc: sysOrderRule.data.ascOrDesc, rule: sysConfCodeRule.data, - enctry: queryAppsetting.data.isOpenEncrypt + enctry: queryAppsetting.data.isOpenEncrypt, + operateTaxDeclaration: queryAppsetting.data.isOpenTaxDeclaration } }); } @@ -225,6 +238,17 @@ class Index extends Component { onCancel: () => { } }); + } else if (type === "DECLARATION") { + this.setState({ loading: { ...this.state.loading, declare: true } }); + API.operateTaxDeclarationFunction(_.pick(saveParams, ["operateTaxDeclaration"])).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, declare: false } }); + if (status) { + message.success("保存成功!"); + let sysSetting = this.getSysSetting(); + } else { + message.error(errormsg || "保存失败!"); + } + }); } }; @@ -242,15 +266,19 @@ class Index extends Component { this.setState({ saveParams: { ...this.state.saveParams, rule: selected } }); - } else { + } else if (type === "加密设置") { this.setState({ - saveParams: { ...this.state.saveParams, enctry: data } + saveParams: { ...this.state.saveParams, enctry: selected } + }); + } else if (type === "取消报税") { + this.setState({ + saveParams: { ...this.state.saveParams, operateTaxDeclaration: selected } }); } }; render() { - const { items, importItems, enctryItems, loading } = this.state; + const { items, importItems, enctryItems, declareItems, loading } = this.state; return (