2023-08-18 15:27:27 +08:00
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* name: 个税申报-异常、失败详情
|
|
|
|
|
* Description:
|
|
|
|
|
* Date: 2023/8/18
|
|
|
|
|
*/
|
|
|
|
|
import React, { Component } from "react";
|
2023-08-21 10:43:08 +08:00
|
|
|
import { WeaDialog, WeaInputSearch, WeaLocaleProvider, WeaReqTop, WeaTable } from "ecCom";
|
2023-08-18 15:27:27 +08:00
|
|
|
import { Button, Col, Row } from "antd";
|
2023-08-21 10:43:08 +08:00
|
|
|
import {
|
|
|
|
|
taxdeclarationEmployeeList4Fail,
|
|
|
|
|
taxdeclarationEmployeeList4NotDeclare,
|
|
|
|
|
taxdeclarationEmployeeList4NoValue
|
|
|
|
|
} from "../../../apis/declare";
|
2023-08-24 13:43:01 +08:00
|
|
|
import { convertToUrlString, getQueryString } from "../../../util/url";
|
2023-08-18 15:27:27 +08:00
|
|
|
|
|
|
|
|
const { getLabel } = WeaLocaleProvider;
|
2023-08-21 10:43:08 +08:00
|
|
|
const APIFox = {
|
|
|
|
|
list4NotDeclare: taxdeclarationEmployeeList4NotDeclare,
|
|
|
|
|
list4NoValue: taxdeclarationEmployeeList4NoValue,
|
|
|
|
|
list4Fail: taxdeclarationEmployeeList4Fail
|
|
|
|
|
};
|
2023-08-18 15:27:27 +08:00
|
|
|
|
|
|
|
|
class DeclareResultDialog extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
2023-08-21 10:43:08 +08:00
|
|
|
keyword: "", selectedKey: "",
|
2023-08-18 15:27:27 +08:00
|
|
|
pageInfo: { current: 1, pageSize: 10, total: 0 },
|
|
|
|
|
loading: false, columns: [], dataSource: []
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps, nextContext) {
|
2023-08-21 10:43:08 +08:00
|
|
|
if (nextProps.visible !== this.props.visible && nextProps.visible) {
|
|
|
|
|
const { type } = nextProps;
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedKey: _.head(type).key
|
|
|
|
|
}, () => this.queryList());
|
|
|
|
|
}
|
2023-08-18 15:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
2023-08-21 10:43:08 +08:00
|
|
|
queryList = () => {
|
|
|
|
|
const taxDeclareRecordId = getQueryString("id");
|
|
|
|
|
const { keyword, pageInfo, selectedKey } = this.state;
|
|
|
|
|
const payload = {
|
|
|
|
|
...pageInfo, keyword, taxDeclareRecordId
|
|
|
|
|
};
|
|
|
|
|
this.setState({ loading: true });
|
|
|
|
|
APIFox[selectedKey](payload).then(({ status, data }) => {
|
|
|
|
|
this.setState({ loading: false });
|
|
|
|
|
if (status) {
|
|
|
|
|
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
|
|
|
|
|
this.setState({
|
|
|
|
|
dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => this.setState({ loading: false }));
|
|
|
|
|
};
|
2023-08-24 13:43:01 +08:00
|
|
|
errorExport = () => {
|
|
|
|
|
let exportUrl = "";
|
|
|
|
|
const { selectedKey, keyword } = this.state;
|
|
|
|
|
const payload = {
|
|
|
|
|
taxDeclareRecordId: getQueryString("id"), keyword
|
|
|
|
|
};
|
|
|
|
|
if (selectedKey === "list4NotDeclare") {
|
|
|
|
|
exportUrl = "/api/bs/hrmsalary/taxdeclaration/employee/export4NotDeclare";
|
|
|
|
|
} else if (selectedKey === "list4NoValue") {
|
|
|
|
|
exportUrl = "/api/bs/hrmsalary/taxdeclaration/employee/export4NoValue";
|
|
|
|
|
}
|
|
|
|
|
window.open(`${window.ecologyContentPath || ""}${exportUrl}?${convertToUrlString(payload)}`, "_blank");
|
|
|
|
|
};
|
|
|
|
|
failExport = () => {
|
|
|
|
|
const payload = {
|
|
|
|
|
taxDeclareRecordId: getQueryString("id")
|
|
|
|
|
};
|
|
|
|
|
window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/taxdeclaration/employee/export4Fail?${convertToUrlString(payload)}`, "_blank");
|
|
|
|
|
};
|
2023-08-18 15:27:27 +08:00
|
|
|
|
|
|
|
|
render() {
|
2023-08-21 10:43:08 +08:00
|
|
|
const { type } = this.props;
|
|
|
|
|
const { loading, columns, dataSource, pageInfo, selectedKey, keyword } = this.state;
|
2023-08-18 15:27:27 +08:00
|
|
|
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 }
|
2023-08-21 10:43:08 +08:00
|
|
|
}, () => this.queryList());
|
2023-08-18 15:27:27 +08:00
|
|
|
},
|
|
|
|
|
onChange: current => {
|
|
|
|
|
this.setState({
|
|
|
|
|
pageInfo: { ...pageInfo, current }
|
2023-08-21 10:43:08 +08:00
|
|
|
}, () => this.queryList());
|
2023-08-18 15:27:27 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return (
|
|
|
|
|
<WeaDialog
|
|
|
|
|
{...this.props}
|
|
|
|
|
scalable hasScroll className="declareResultDialog" initLoadCss
|
2023-08-21 10:43:08 +08:00
|
|
|
title={
|
|
|
|
|
type.length === 1 ?
|
|
|
|
|
(<Row className="declareResultDialogTitle" type="flex">
|
|
|
|
|
<Col span={12} className="declareResultDialogTitle-left">
|
|
|
|
|
<span className="title">{this.props.title}</span>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={12} className="declareResultDialogTitle-right">
|
2023-08-24 13:43:01 +08:00
|
|
|
<Button type="primary" onClick={this.failExport}>{getLabel(17416, "导出")}</Button>
|
2023-08-21 10:43:08 +08:00
|
|
|
</Col>
|
|
|
|
|
</Row>) :
|
|
|
|
|
<WeaReqTop
|
|
|
|
|
title={this.props.title} buttonSpace={10} tabDatas={type} selectedKey={selectedKey}
|
|
|
|
|
buttons={[
|
2023-08-24 13:43:01 +08:00
|
|
|
<Button type="primary" onClick={this.errorExport}>{getLabel(17416, "导出")}</Button>
|
2023-08-21 10:43:08 +08:00
|
|
|
]}
|
|
|
|
|
onChange={key => this.setState({ selectedKey: key }, () => this.queryList())}
|
|
|
|
|
/>
|
|
|
|
|
}
|
2023-08-18 15:27:27 +08:00
|
|
|
style={{
|
|
|
|
|
width: 1150,
|
|
|
|
|
height: 606.6,
|
|
|
|
|
minHeight: 200,
|
|
|
|
|
minWidth: 380,
|
|
|
|
|
maxHeight: "90%",
|
|
|
|
|
maxWidth: "90%",
|
|
|
|
|
overflow: "hidden",
|
|
|
|
|
transform: "translate(0px, 0px)"
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<div className="declareResultDialogContent">
|
2023-08-21 10:43:08 +08:00
|
|
|
{
|
|
|
|
|
type.length !== 1 &&
|
|
|
|
|
< div className="declareNoSearchBox">
|
|
|
|
|
<WeaInputSearch
|
|
|
|
|
style={{ width: 200 }} placeholder={getLabel(111, "请输入姓名/工号/身份证号")}
|
|
|
|
|
value={keyword} onChange={val => this.setState({ keyword: val })}
|
|
|
|
|
onSearch={this.queryList}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2023-08-18 15:27:27 +08:00
|
|
|
<WeaTable
|
|
|
|
|
columns={columns} dataSource={dataSource}
|
|
|
|
|
loading={loading} className="declareTable"
|
|
|
|
|
pagination={pagination}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</WeaDialog>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default DeclareResultDialog;
|