Merge branch 'feature/2.10.1.2401.01-个税在线对比' into release/2.10.1.2401.01-个税

# Conflicts:
#	pc4mobx/hrmSalary/apis/declare.js
This commit is contained in:
黎永顺 2024-02-02 14:13:01 +08:00
commit abfeb1aae7
6 changed files with 149 additions and 6 deletions

View File

@ -268,3 +268,7 @@ export const deleteTaxDeclaration = (params) => {
export const deleteInfo = (params) => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/deleteInfo", params);
};
//个税申报表-对比申报结果
export const getTaxdeclarationContrastList = (params) => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/contrast", params);
};

View File

@ -28,6 +28,7 @@ import PayrollGrant from "./pages/payroll/payrollGrant";
import PayrollDetail from "./pages/payroll/payrollDetail";
// import Declare from "./pages/declare";
import DeclareDetail from "./pages/declareDetail";
import DeclareOnlineComparison from "./pages/declareOnlineComparison";
import Employeedeclare from "./pages/employeedeclare";
import EnterprisePayCertificationDetail from "./pages/enterprisePayCertificationDetail";
import BankVoucherDetail from "./pages/bankVoucherDetail";
@ -183,6 +184,7 @@ const Routes = (
<Route key="payrollinfo" path="payrollinfo" component={PayrollTemplatePreview}/>
<Route key="declare" path="declare" component={Declare}/>
<Route key="declareDetail" path="declareDetail" component={DeclareDetail}/>
<Route key="declareOnlineComparison" path="declareDetail/:taxDeclarationId" component={DeclareOnlineComparison}/>
<Route key="employeedeclare" path="employeedeclare" component={Employeedeclare}/>
<Route key="enterprisePayCertificationDetail" path="enterprisePayCertificationDetail"
component={EnterprisePayCertificationDetail}/>

View File

@ -55,12 +55,20 @@ class TaxDeclarationInfo extends Component {
];
let dropMenuDatas = [];
if (["DECLARE_SUCCESS_NO_PAY", "DECLARE_SUCCESS_UNPAID", "DECLARE_SUCCESS_PAID", "DECLARE_SUCCESS_PAYING"].includes(declareInfo.declareStatus)) {
dropMenuDatas = dropMenuDatas.concat([{
key: "exportGetDeclareTaxResultFeedback",
icon: <i className="icon-coms-download2"/>,
content: getLabel(111, "下载申报内置算税结果"),
onClick: onOperate
}]);
dropMenuDatas = dropMenuDatas.concat([
{
key: "exportGetDeclareTaxResultFeedback",
icon: <i className="icon-coms-download2"/>,
content: getLabel(111, "下载申报内置算税结果"),
onClick: onOperate
},
{
key: "onlineComparison",
icon: <i className="icon-coms-Journal-o"/>,
content: getLabel(111, "在线对比"),
onClick: onOperate
}
]);
}
return (
<div className="taxDeclarationInfo_layout">

View File

@ -305,6 +305,10 @@ class Index extends Component {
message.error(getLabel(111, "下载失败!"));
});
};
onlineComparison = () => {
const [__, taxDeclarationId] = this.state.selectedKey.split("%%");
window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_target");
};
handleTabEdit = (tabKey, type) => {
if (type === "remove") {
const [__, taxDeclarationId] = tabKey.split("%%");

View File

@ -0,0 +1,114 @@
/*
* Author: 黎永顺
* name: 在线申报-在线对比
* Description:
* Date: 2024/1/22
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaLocaleProvider, WeaTable, WeaTop } from "ecCom";
import { getTaxdeclarationContrastList } from "../../apis/declare";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, dataSource: [], columns: [],
pageInfo: { current: 1, pageSize: 10, total: 0 },
queryParams: { onlyShowDiffEmp: true, onlyShowDiffItem: true }
};
}
componentDidMount() {
this.getTaxdeclarationContrastList();
}
getTaxdeclarationContrastList = () => {
const { pageInfo, queryParams } = this.state;
const { params: { taxDeclarationId } } = this.props;
this.setState({ loading: true });
getTaxdeclarationContrastList({ taxDeclarationId, ...pageInfo, ...queryParams })
.then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, pageInfo: result } = data;
const { list: dataSource, pageNum: current, pageSize, total } = result;
this.setState({
dataSource, pageInfo: { ...pageInfo, current, pageSize, total },
columns: _.map(columns, o => ({
dataIndex: o, title: o, width: 150,
render: (__, record) => {
return <div className="comparison-column-item-container">
<div className="comparison-single-row">
<span>{getLabel(543280, "系统值")}</span>
<span>{record[o].local}</span>
</div>
<div className="comparison-single-row">
<span>{getLabel(111, "线上值")}</span>
<span>{record[o].online}</span>
</div>
{
!_.isNil(record[o].diff) &&
<div className="comparison-single-row danger">
<span>{getLabel(543282, "差值")}</span>
<span>{record[o].diff}</span>
</div>
}
</div>;
}
}))
});
}
}).catch(() => this.setState({ loading: false }));
};
handleDiffChange = (key, value) => {
const { queryParams } = this.state;
this.setState({
queryParams: { ...queryParams, [key]: value === "1" }
}, () => this.getTaxdeclarationContrastList());
};
render() {
const { loading, columns, dataSource, pageInfo, queryParams } = this.state;
const { onlyShowDiffEmp, onlyShowDiffItem } = queryParams;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => this.getTaxdeclarationContrastList());
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => this.getTaxdeclarationContrastList());
}
};
return (
<WeaTop title={getLabel(111, "在线对比")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" buttonSpace={10} showDropIcon={false}
buttons={[
<WeaCheckbox content={getLabel(543283, "只显示有差异的人员")} value={onlyShowDiffEmp ? 1 : 0}
onChange={v => this.handleDiffChange("onlyShowDiffEmp", v)}
/>,
<WeaCheckbox content={getLabel(543284, "只显示有差异的薪资项目")} value={onlyShowDiffItem ? 1 : 0}
onChange={v => this.handleDiffChange("onlyShowDiffItem", v)}
/>
]}
>
<WeaTable rowKey="id" dataSource={dataSource} pagination={pagination} bordered
loading={loading} columns={columns} scroll={{ x: 1200, y: `calc(100vh - 170px)` }}
className="online-comparison-table"
/>
</WeaTop>
);
}
}
export default Index;

View File

@ -0,0 +1,11 @@
.online-comparison-table {
.comparison-column-item-container {
.comparison-single-row {
margin: 4px 0;
}
.danger {
color: #ff4d4f;
}
}
}