添加报税规则

This commit is contained in:
黎永顺 2022-11-08 16:39:29 +08:00
parent 12d6fc73cf
commit b187b17263
2 changed files with 85 additions and 42 deletions

View File

@ -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);
}

View File

@ -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 (
<div className="ruleWrapper">
<WeaTop
@ -259,39 +287,50 @@ class Index extends Component {
iconBgcolor="#F14A2D"
buttons={[]}
/>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>排序规则</span>
<Button type="primary" onClick={() => this.handleSave("ORDER")} loading={loading.order}>保存</Button>
</div>
} showGroup center items={items}/>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>人员校验规则</span>
<Button type="primary" onClick={() => this.handleSave("EMPLOYEE")}
loading={loading.employee}>保存</Button>
</div>
} showGroup center items={importItems}/>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>加密规则</span>
<Button type="primary" onClick={() => this.handleSave("ENCRYTION")} loading={loading.encry}>保存</Button>
</div>
} showGroup center items={enctryItems}/>
{
this.state.progressVisible &&
<ProgressModal
title="加密/解密中..."
visible={this.state.progressVisible}
onCancel={() => {
this.setState({ progressVisible: false, progress: 0 });
}}
progress={this.state.progress}
/>
}
<WeaNewScroll height={`calc(100% - 46px)`}>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>排序规则</span>
<Button type="primary" onClick={() => this.handleSave("ORDER")} loading={loading.order}>保存</Button>
</div>
} showGroup center items={items}/>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>人员校验规则</span>
<Button type="primary" onClick={() => this.handleSave("EMPLOYEE")}
loading={loading.employee}>保存</Button>
</div>
} showGroup center items={importItems}/>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>加密规则</span>
<Button type="primary" onClick={() => this.handleSave("ENCRYTION")}
loading={loading.encry}>保存</Button>
</div>
} showGroup center items={enctryItems}/>
<WeaSearchGroup
title={
<div className="titleWrapper">
<span>报税规则</span>
<Button type="primary" onClick={() => this.handleSave("DECLARATION")}
loading={loading.declare}>保存</Button>
</div>
} showGroup center items={declareItems}/>
{
this.state.progressVisible &&
<ProgressModal
title="加密/解密中..."
visible={this.state.progressVisible}
onCancel={() => {
this.setState({ progressVisible: false, progress: 0 });
}}
progress={this.state.progress}
/>
}
</WeaNewScroll>
</div>
);
}
@ -300,7 +339,7 @@ class Index extends Component {
export default Index;
export const Select = payload => {
const { label, onChange, value, options = [], viewAttr=3 } = payload;
const { label, onChange, value, options = [], viewAttr = 3 } = payload;
return (
<WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaSelect options={[{ key: "", showname: "" }, ...options]} viewAttr={viewAttr} value={value}