Merge branch 'feature/2.12.1.2403.02-个税-外籍人员信息报送' into release/2.12.1.2404.02-个税

This commit is contained in:
黎永顺 2024-04-23 11:17:49 +08:00
commit 6c72f335cc
10 changed files with 336 additions and 121 deletions

View File

@ -16,9 +16,13 @@ export const saveDeclare = params => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params); return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params);
}; };
//个税申报表-获取分类
export const getTaxReports = params => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxReports", "get", params);
};
//个税申报表-个税申报表相关信息 //个税申报表-个税申报表相关信息
export const getDeclareInfo = params => { export const getDeclareInfo = params => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", "get", params); return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationInfo", params);
}; };
// 个税申报表详情列表 // 个税申报表详情列表
@ -110,7 +114,7 @@ export const employeedeclareDeclare = (params) => {
//个税在线对接-获取个税申报记录下的个税申报表TAB //个税在线对接-获取个税申报记录下的个税申报表TAB
export const getTaxDeclarationTab = params => { export const getTaxDeclarationTab = params => {
return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", "GET", params); return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", params);
}; };
//个税在线对接-个税申报表是否已经生成 //个税在线对接-个税申报表是否已经生成

View File

@ -31,7 +31,7 @@ class Index extends Component {
const payload = { const payload = {
taxDeclareRecordId: getQueryString("taxDeclareRecordId"), taxDeclareRecordId: getQueryString("taxDeclareRecordId"),
taxAgentId: getQueryString("taxAgentId"), taxAgentId: getQueryString("taxAgentId"),
taxYearMonth: getQueryString("taxYearMonth") + "-01", taxYearMonth: getQueryString("taxYearMonth"),
checkFeedback: 0 checkFeedback: 0
}; };
this.setState({ loading: true }); this.setState({ loading: true });

View File

@ -0,0 +1,71 @@
/*
* Author: 黎永顺
* name: 报表查看-左侧tab标题
* Description:
* Date: 2023/4/20
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { Menu } from "antd";
import * as API from "../../../apis/declare";
import { getQueryString } from "../../../util/url";
const { getLabel } = WeaLocaleProvider;
class LeftTab extends Component {
constructor(props) {
super(props);
this.state = {
reportName: "",
selectedKeys: "",
dataSource: []
};
}
componentDidMount() {
this.getTaxReports();
}
getTaxReports = () => {
const { onChangeTab, onCollapse } = this.props;
API.getTaxReports({ id: getQueryString("id") }).then(({ status, data: dataSource }) => {
if (status) this.setState({
dataSource, selectedKeys: !_.isEmpty(dataSource) ? _.head(dataSource).id + "" : ""
}, () => {
!_.isEmpty(this.state.dataSource) && onChangeTab(_.head(this.state.dataSource).reportType);
onCollapse(!_.isEmpty(this.state.dataSource) && this.state.dataSource.length > 1);
});
});
};
render() {
const { selectedKeys, dataSource } = this.state;
const { onChangeTab } = this.props;
const reportTypeNameMap = {
1: getLabel(111, "综合所得"),
2: getLabel(111, "分类所得"),
3: getLabel(111, "非居民所得"),
4: getLabel(111, "限售股所得")
};
return (
<div className="leftTabWrapper">
<Menu mode="inline" selectedKeys={selectedKeys}
onClick={({ key }) => {
this.setState({ selectedKeys: key }, () => {
onChangeTab(_.find(dataSource, o => String(o.id) === key).reportType, true);
});
}}
>
{
_.map(dataSource, item => {
const { reportType, id } = item;
return <Menu.Item key={id + ""}>{reportTypeNameMap[reportType]}</Menu.Item>;
})
}
</Menu>
</div>
);
}
}
export default LeftTab;

View File

@ -262,7 +262,8 @@ class PaymentBtn extends Component {
const { taxAgentId, taxCycle: taxYearMonth } = this.props.declareInfo; const { taxAgentId, taxCycle: taxYearMonth } = this.props.declareInfo;
const payload = { const payload = {
taxDeclareRecordId: getQueryString("id"), taxDeclareRecordId: getQueryString("id"),
taxAgentId, taxYearMonth: taxYearMonth + "-01" taxAgentId, taxYearMonth: taxYearMonth + "-01",
reportType: this.props.reportType
}; };
taxPaymentVoucherCancel(payload).then(({ status, errormsg }) => { taxPaymentVoucherCancel(payload).then(({ status, errormsg }) => {
if (status) { if (status) {

View File

@ -46,11 +46,11 @@ class TaxDeclarationInfo extends Component {
const { declareInfo, onOperate } = this.props; const { declareInfo, onOperate } = this.props;
const { abnormalSize, declareFailSize } = declareInfo; const { abnormalSize, declareFailSize } = declareInfo;
const infoItem = [ const infoItem = [
{ key: "taxCycle", label: getLabel(542240, "税款所属期") },
{ key: "salaryMonth", label: getLabel(542604, "薪资所属月") }, { key: "salaryMonth", label: getLabel(542604, "薪资所属月") },
{ key: "taxAgentName", label: getLabel(537996, "个税扣缴义务人") }, { key: "taxAgentName", label: getLabel(537996, "个税扣缴义务人") },
{ key: "declareTypeDesc", label: getLabel(111, "申报类型") }, { key: "declareTypeDesc", label: getLabel(111, "申报类型") },
{ key: "declareStatusDesc", label: getLabel(111, "申报状态") }, { key: "declareStatusDesc", label: getLabel(111, "申报状态") },
{ key: "taxCycle", label: getLabel(542240, "税款所属期") },
{ key: "taxPaidAmount", label: getLabel(111, "已缴金额") } { key: "taxPaidAmount", label: getLabel(111, "已缴金额") }
]; ];
let dropMenuDatas = []; let dropMenuDatas = [];

View File

@ -2,7 +2,7 @@ import { WeaLocaleProvider } from "ecCom";
import { Modal } from "antd"; import { Modal } from "antd";
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
export const confirmDialog = (type, callback) => { export const confirmDialog = (type, callback, reportType) => {
let content = ""; let content = "";
switch (type) { switch (type) {
case "refresh": case "refresh":
@ -15,7 +15,7 @@ export const confirmDialog = (type, callback) => {
content = getLabel(111, "申报作废,只有申报成功,无需缴款/申报成功,未缴款的状态才能作废,当作废成功时,企业状态会变成未申报;当作废失败时,企业状态还是原来的未缴款或无需缴款的状态。"); content = getLabel(111, "申报作废,只有申报成功,无需缴款/申报成功,未缴款的状态才能作废,当作废成功时,企业状态会变成未申报;当作废失败时,企业状态还是原来的未缴款或无需缴款的状态。");
break; break;
case "declare": case "declare":
content = getLabel(111, "解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报;解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。是否确认申报?"); content = reportType === 1 ? getLabel(111, "解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报;解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。是否确认申报?") : getLabel(111, "确认申报?");
break; break;
default: default:
break; break;

View File

@ -5,7 +5,7 @@
* Date: 2023/8/18 * Date: 2023/8/18
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { WeaLocaleProvider, WeaTab } from "ecCom"; import { WeaLeftRightLayout, WeaLocaleProvider, WeaTab } from "ecCom";
import { Button, message, Modal, Spin } from "antd"; import { Button, message, Modal, Spin } from "antd";
import TaxDeclarationInfo from "./components/taxDeclarationInfo"; import TaxDeclarationInfo from "./components/taxDeclarationInfo";
import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings";
@ -25,13 +25,13 @@ import {
taxdeclarationRefreshData, taxdeclarationRefreshData,
taxdeclaratioUpdateCancel, taxdeclaratioUpdateCancel,
taxdeclaratioUpdateDeclare, taxdeclaratioUpdateDeclare,
taxPaymentVoucherStatusSync, taxPaymentVoucherStatusSync
taxPaymentWithheldVoucherGet
} from "../../apis/declare"; } from "../../apis/declare";
import { convertToUrlString, getQueryString } from "../../util/url"; import { convertToUrlString, getQueryString } from "../../util/url";
import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide"; import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide";
import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDialog"; import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDialog";
import TabEditDialog from "./components/tabEditDialog"; import TabEditDialog from "./components/tabEditDialog";
import LeftTab from "./components/leftTab";
import { confirmDialog } from "./confirm"; import { confirmDialog } from "./confirm";
import "./index.less"; import "./index.less";
@ -60,7 +60,8 @@ class Index extends Component {
visible: false, title: getLabel(1421, "新增"), taxDeclarationId: "", id: "" visible: false, title: getLabel(1421, "新增"), taxDeclarationId: "", id: ""
}, },
intelCalcSalaryStatus: false, //智能算薪 总开关是否开启 intelCalcSalaryStatus: false, //智能算薪 总开关是否开启
declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 } declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 },
reportType: "", showLeft: false
}; };
this.timer = null; this.timer = null;
this.taxDeclareRef = null; this.taxDeclareRef = null;
@ -75,7 +76,8 @@ class Index extends Component {
} }
init = async (isInit = true) => { init = async (isInit = true) => {
const [tabsResult, infoResult, calcResult] = await Promise.all([this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]); const [tabsResult, infoResult, calcResult] = await Promise.all([
this.getTaxDeclarationTab(), this.getDeclareInfo(), this.apiflowBillingConfigStatus()]);
const { data: tabDataSource, status: tabStatus } = tabsResult; const { data: tabDataSource, status: tabStatus } = tabsResult;
const { data: infoDataSource, status: infoStatus } = infoResult; const { data: infoDataSource, status: infoStatus } = infoResult;
const { data: calcSalaryStatus, status: calcStatus } = calcResult; const { data: calcSalaryStatus, status: calcStatus } = calcResult;
@ -101,10 +103,12 @@ class Index extends Component {
this.getDetailList(); this.getDetailList();
}; };
getTaxDeclarationTab = () => { getTaxDeclarationTab = () => {
return getTaxDeclarationTab({ id: getQueryString("id") }); const { reportType } = this.state;
return getTaxDeclarationTab({ taxDeclareRecordId: getQueryString("id"), reportType });
}; };
getDeclareInfo = () => { getDeclareInfo = () => {
return getDeclareInfo({ id: getQueryString("id") }); const { reportType } = this.state;
return getDeclareInfo({ taxDeclareRecordId: getQueryString("id"), reportType });
}; };
apiflowBillingConfigStatus = () => { apiflowBillingConfigStatus = () => {
return apiflowBillingConfigStatus(); return apiflowBillingConfigStatus();
@ -183,7 +187,7 @@ class Index extends Component {
} }
}).catch(() => this.setState({ loading: { ...loading, query: false } })); }).catch(() => this.setState({ loading: { ...loading, query: false } }));
}; };
handleOperateDeclare = (type) => { handleOperateDeclare = (type, params = {}) => {
const loadingTxt = { const loadingTxt = {
refresh: getLabel(111, "刷新中..."), //刷新数据 refresh: getLabel(111, "刷新中..."), //刷新数据
declare: getLabel(111, "申报中..."), //在线申报 declare: getLabel(111, "申报中..."), //在线申报
@ -207,7 +211,7 @@ class Index extends Component {
cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈 cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈
}; };
this.setState({ loading: { ...this.state.loading, [type]: true } }); this.setState({ loading: { ...this.state.loading, [type]: true } });
APIFox[type]({ taxDeclareRecordId: getQueryString("id") }) APIFox[type]({ taxDeclareRecordId: getQueryString("id"), ...params })
.then(async ({ status, data, errormsg }) => { .then(async ({ status, data, errormsg }) => {
if (status) { if (status) {
message.destroy(); message.destroy();
@ -247,7 +251,8 @@ class Index extends Component {
const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo;
const payload = { const payload = {
taxDeclareRecordId: getQueryString("id"), taxDeclareRecordId: getQueryString("id"),
taxAgentId, taxYearMonth: taxYearMonth + "-01" taxAgentId, taxYearMonth: taxYearMonth + "-01",
reportType: this.state.reportType
}; };
this.setState({ loading: { ...this.state.loading, refreshingPay: true } }); this.setState({ loading: { ...this.state.loading, refreshingPay: true } });
taxPaymentVoucherStatusSync(payload).then(({ status, errormsg }) => { taxPaymentVoucherStatusSync(payload).then(({ status, errormsg }) => {
@ -264,17 +269,19 @@ class Index extends Component {
const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo;
const payload = { const payload = {
taxDeclareRecordId: getQueryString("id"), taxDeclareRecordId: getQueryString("id"),
taxAgentId, taxYearMonth: taxYearMonth + "-01" taxAgentId, taxYearMonth: taxYearMonth + "-01",
reportType: this.state.reportType
}; };
this.setState({ loading: { ...this.state.loading, issuance: true } }); window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`);
taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => { // this.setState({ loading: { ...this.state.loading, issuance: true } });
this.setState({ loading: { ...this.state.loading, issuance: false } }); // taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => {
if (status && !_.isEmpty(data.vouchers)) { // this.setState({ loading: { ...this.state.loading, issuance: false } });
window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`); // if (status && !_.isEmpty(data.vouchers)) {
} else { // window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`);
message.error(errormsg || ""); // } else {
} // message.error(errormsg || "");
}).catch(() => this.setState({ loading: { ...this.state.loading, issuance: false } })); // }
// }).catch(() => this.setState({ loading: { ...this.state.loading, issuance: false } }));
}; };
export = () => { export = () => {
const [incomeCategory, taxDeclarationId] = this.state.selectedKey.split("%%"); const [incomeCategory, taxDeclarationId] = this.state.selectedKey.split("%%");
@ -294,9 +301,10 @@ class Index extends Component {
}, () => callback && this.getDetailList()); }, () => callback && this.getDetailList());
}; };
exportGetDeclareTaxResultFeedback = () => { exportGetDeclareTaxResultFeedback = () => {
const { reportType } = this.state;
message.destroy(); message.destroy();
message.loading(getLabel(111, "下载中..."), 0); message.loading(getLabel(111, "下载中..."), 0);
exportGetDeclareTaxResultFeedback({ id: getQueryString("id") }) exportGetDeclareTaxResultFeedback({ id: getQueryString("id"), reportType })
.then(async () => { .then(async () => {
message.destroy(); message.destroy();
message.success(getLabel(111, "下载成功!")); message.success(getLabel(111, "下载成功!"));
@ -338,12 +346,13 @@ class Index extends Component {
render() { render() {
const { const {
tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide, tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide,
editTabVisible editTabVisible, reportType, showLeft
} = this.state; } = this.state;
const [__, taxDeclarationId] = selectedKey.split("%%"); const [__, taxDeclarationId] = selectedKey.split("%%");
let btns = [ let btns = [
<Button type="primary" onClick={this.export}>{getLabel(17416, "导出")}</Button>, <Button type="primary" onClick={this.export}>{getLabel(17416, "导出")}</Button>,
<Button type="ghost" onClick={() => confirmDialog("declare", () => this.handleOperateDeclare("declare"))} <Button type="ghost"
onClick={() => confirmDialog("declare", () => this.handleOperateDeclare("declare", { reportType }), reportType)}
loading={loading.declare}>{getLabel(111, "在线申报")}</Button>, loading={loading.declare}>{getLabel(111, "在线申报")}</Button>,
<Button type="ghost" onClick={() => confirmDialog("refresh", () => this.handleOperateDeclare("refresh"))} <Button type="ghost" onClick={() => confirmDialog("refresh", () => this.handleOperateDeclare("refresh"))}
loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button> loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button>
@ -355,30 +364,30 @@ class Index extends Component {
//申报状态:申报中 //申报状态:申报中
declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, <Button declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, <Button
type="ghost" loading={loading.feedback} type="ghost" loading={loading.feedback}
onClick={() => this.handleOperateDeclare("feedback")}>{getLabel(111, "申报反馈")}</Button>)); onClick={() => this.handleOperateDeclare("feedback", { reportType })}>{getLabel(111, "申报反馈")}</Button>));
//申报状态:缴款中 //申报状态:缴款中
declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2)); declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2));
//申报状态:已缴款 //申报状态:已缴款
declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2, declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2,
<Button type="ghost" loading={loading.correct} <Button type="ghost" loading={loading.correct}
onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct"))}>{getLabel(111, "更正申报")}</Button>)); onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}</Button>));
//申报状态:申报成功,无需缴款 //申报状态:申报成功,无需缴款
declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" && declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" &&
(btns.splice(1, 2, (btns.splice(1, 2,
<Button type="ghost" loading={loading.correct} <Button type="ghost" loading={loading.correct}
onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct"))}>{getLabel(111, "更正申报")}</Button>, onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}</Button>,
<Button type="ghost" <Button type="ghost"
loading={loading.cancel} loading={loading.cancel}
onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel"))}>{getLabel(111, "作废申报")}</Button> onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}</Button>
)); ));
//申报状态:申报成功,未缴款 //申报状态:申报成功,未缴款
declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" && declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" &&
(btns.splice(1, 2, (btns.splice(1, 2,
<Button type="ghost" loading={loading.correct} <Button type="ghost" loading={loading.correct}
onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct"))}>{getLabel(111, "更正申报")}</Button>, onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}</Button>,
<Button type="ghost" <Button type="ghost"
loading={loading.cancel} loading={loading.cancel}
onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel"))}>{getLabel(111, "作废申报")}</Button>, onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}</Button>,
<Button type="ghost" <Button type="ghost"
loading={loading.refreshingPay} loading={loading.refreshingPay}
onClick={this.taxPaymentVoucherStatusSync}>{getLabel(111, "刷新缴款状态")}</Button> onClick={this.taxPaymentVoucherStatusSync}>{getLabel(111, "刷新缴款状态")}</Button>
@ -404,7 +413,7 @@ class Index extends Component {
} }
if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) { if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) {
btns.push( btns.push(
<PaymentBtn declareInfo={declareInfo} updateDeclare={this.declare}/>, <PaymentBtn declareInfo={declareInfo} updateDeclare={this.declare} reportType={reportType}/>,
<PaymentFeedbackBtn declareInfo={declareInfo} updateDeclare={this.declare}/> <PaymentFeedbackBtn declareInfo={declareInfo} updateDeclare={this.declare}/>
); );
} }
@ -413,41 +422,49 @@ class Index extends Component {
onClick={this.getEnterprisePayCertificate}>{getLabel(111, "开具企业完税证明")}</Button>); onClick={this.getEnterprisePayCertificate}>{getLabel(111, "开具企业完税证明")}</Button>);
} }
return ( return (
<div className="declareDetail-layout"> <WeaLeftRightLayout
<TaxDeclarationInfo declareInfo={declareInfo} onOperate={fun => this[fun]()}/> showLeft={showLeft}
<div className="declareDetail-layout-content"> leftWidth={210}
<WeaTab leftCom={<LeftTab
datas={tabs} keyParam="viewcondition" selectedKey={selectedKey} showAddBtn buttons={btns} onChangeTab={(reportType, isInit = false) => this.setState({ reportType }, () => isInit && this.init())}
type="editable-inline" onEdit={this.handleTabEdit} leftStyle={{ width: "calc(100% - 450px)" }} onCollapse={showLeft => this.setState({ showLeft })}/>}
onChange={(v) => this.setState({ selectedKey: v }, () => this.getDetailList())} onCollapse={showLeft => this.setState({ showLeft })}>
searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")} <div className="declareDetail-layout">
onSearchChange={keyword => this.setState({ keyword })} <TaxDeclarationInfo declareInfo={declareInfo} onOperate={fun => this[fun]()}/>
onSearch={this.getDetailList} <div className="declareDetail-layout-content">
/> <WeaTab
{/*个税申报表-新增编辑框*/} datas={tabs} keyParam="viewcondition" selectedKey={selectedKey} showAddBtn buttons={btns}
<IncomeTaxDeclarationPersonnelSlide type="editable-inline" onEdit={this.handleTabEdit} leftStyle={{ width: "calc(100% - 450px)" }}
{...taxDecPersonSlide} onChange={(v) => this.setState({ selectedKey: v }, () => this.getDetailList())}
onClose={(callback) => this.handleTaxDescPerSlide({ visible: false, id: "", callback })} searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")}
/> onSearchChange={keyword => this.setState({ keyword })}
{/*个税申报表导入*/} onSearch={this.getDetailList}
<TaxDeclareDetailImportDialog ref={dom => this.taxDeclareRef = dom}
onSuccess={this.declare}
/>
{/*个税申报表-新增tab弹框*/}
<TabEditDialog visible={editTabVisible}
onCancel={(isRefresh) => this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/>
</div>
<div className="declareDetail-layout-table-content">
<Spin spinning={loading.query}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/taxDeclareTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/taxDeclareTable"
id="atdTable"
/> />
</Spin> {/*个税申报表-新增编辑框*/}
<IncomeTaxDeclarationPersonnelSlide
{...taxDecPersonSlide}
onClose={(callback) => this.handleTaxDescPerSlide({ visible: false, id: "", callback })}
/>
{/*个税申报表导入*/}
<TaxDeclareDetailImportDialog ref={dom => this.taxDeclareRef = dom}
onSuccess={this.declare}
/>
{/*个税申报表-新增tab弹框*/}
<TabEditDialog visible={editTabVisible}
onCancel={(isRefresh) => this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/>
</div>
<div className="declareDetail-layout-table-content">
<Spin spinning={loading.query}>
<iframe
style={{ border: 0, width: "100%", height: "100%" }}
// src="http://localhost:7607/#/taxDeclareTable"
src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/taxDeclareTable"
id="atdTable"
/>
</Spin>
</div>
</div> </div>
</div> </WeaLeftRightLayout>
); );
} }
} }

View File

@ -5,14 +5,16 @@
* Date: 2023/8/14 * Date: 2023/8/14
*/ */
import React, { Component } from "react"; import React, { Component } from "react";
import { WeaLocaleProvider, WeaSlideModal } from "ecCom"; import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom";
import { Button, Col, message, Modal, Row } from "antd"; import { Button, Col, message, Row } from "antd";
import { inject, observer } from "mobx-react"; import { inject, observer } from "mobx-react";
import { declareConditions } from "../constants"; import { declareConditions } from "../constants";
import { getSearchs } from "../../../util"; import { getSearchs } from "../../../util";
import { getQueryString } from "../../../util/url"; import { getQueryString } from "../../../util/url";
import { employeedeclareGetForm, getEmployeeSave } from "../../../apis/declare"; import { employeedeclareGetForm, getEmployeeSave } from "../../../apis/declare";
import { commonEnumList } from "../../../apis/archive";
const getKey = WeaTools.getKey;
const { getLabel } = WeaLocaleProvider; const { getLabel } = WeaLocaleProvider;
@inject("employeeDeclareStore") @inject("employeeDeclareStore")
@ -33,7 +35,8 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.employeeChangeInfo = {}; if (nextProps.visible !== this.props.visible && !nextProps.visible) this.employeeChangeInfo = {};
} }
employeedeclareGetForm = (props) => { employeedeclareGetForm = async (props) => {
const { data: cardTypeEnum } = await commonEnumList({ enumClass: `com.engine.salary.enums.employeedeclare.CardTypeEnum` });
employeedeclareGetForm(_.pick(props, ["id"])).then(({ status, data }) => { employeedeclareGetForm(_.pick(props, ["id"])).then(({ status, data }) => {
if (status) { if (status) {
this.setState({ this.setState({
@ -41,7 +44,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
return { return {
...it, ...it,
items: _.map(it.items, child => { items: _.map(it.items, child => {
if (child.domkey[0] === "employmentStatus") { if (getKey(child) === "employmentStatus") {
return { return {
...child, ...child,
value: _.take(props.employmentStatusList)[0].enum, value: _.take(props.employmentStatusList)[0].enum,
@ -50,7 +53,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
showname: getLabel(it.labelId, it.defaultLabel) showname: getLabel(it.labelId, it.defaultLabel)
})) }))
}; };
} else if (child.domkey[0] === "employmentType") { } else if (getKey(child) === "employmentType") {
return { return {
...child, ...child,
value: _.take(props.employmentTypeList)[0].enum, value: _.take(props.employmentTypeList)[0].enum,
@ -59,7 +62,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
showname: getLabel(it.labelId, it.defaultLabel) showname: getLabel(it.labelId, it.defaultLabel)
})) }))
}; };
} else if (child.domkey[0] === "gender") { } else if (getKey(child) === "gender") {
return { return {
...child, ...child,
value: "MALE", value: "MALE",
@ -68,7 +71,11 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
{ key: "FEMALE", showname: getLabel(111, "女") } { key: "FEMALE", showname: getLabel(111, "女") }
] ]
}; };
} else if (child.domkey[0] === "employeeType") { } else if (getKey(child) === "cardType") {
return {
...child, options: _.map(cardTypeEnum, o => ({ key: o.enum, showname: o.defaultLabel }))
};
} else if (getKey(child) === "employeeType") {
return { return {
...child, ...child,
viewAttr: props.id ? 1 : 3, viewAttr: props.id ? 1 : 3,
@ -77,7 +84,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
] ]
}; };
} }
if (child.conditionType === "SELECT" && child.domkey[0] !== "gender" && child.domkey[0] !== "employmentStatus" && child.domkey[0] !== "employmentType") { if (child.conditionType === "SELECT" && getKey(child) !== "gender" && getKey(child) !== "employmentStatus" && getKey(child) !== "employmentType" && getKey(child) !== "taxReasons") {
return { return {
...child, ...child,
options: [ options: [
@ -93,37 +100,37 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
employeeInfo: data.data employeeInfo: data.data
}, () => { }, () => {
const { data: result, columns } = data; const { data: result, columns } = data;
const { employeeDeclareStore: { declareForm } } = this.props; const { employeeDeclareStore: { declareForm }, id } = props;
declareForm.initFormFields(this.state.eConditions); declareForm.initFormFields(this.state.eConditions);
const filedKes = _.map(columns, it => it.dataIndex); if (id) {
_.map(filedKes, item => { const filedKes = _.map(columns, it => it.dataIndex);
if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") { _.map(filedKes, item => {
declareForm.updateFields({ [item]: result[item] || "OFF" }); if (item === "disability" || item === "lonelyOld" || item === "martyrDependents") {
} else if (item === "deductExpenses") { declareForm.updateFields({ [item]: result[item] || "OFF" });
declareForm.updateFields({ [item]: result[item] || "ON" }); } else if (item === "deductExpenses") {
} else if (item === "gender") { declareForm.updateFields({ [item]: result[item] || "ON" });
declareForm.updateFields({ [item]: result[item] || "MALE" }); } else if (item === "gender") {
} else if (item === "employmentStatus") { declareForm.updateFields({ [item]: result[item] || "MALE" });
declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum }); } else if (item === "employmentStatus") {
} else if (item === "employmentType") { declareForm.updateFields({ [item]: result[item] || _.take(props.employmentStatusList)[0].enum });
declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum }); } else if (item === "employmentType") {
} else if (item === "cardType") { declareForm.updateFields({ [item]: result[item] || _.take(props.employmentTypeList)[0].enum });
declareForm.updateFields({ [item]: "居民身份证" }); } else if (item === "employee") {
} else if (item === "employee") { const [employeeData] = result[item] || [];
const [employeeData] = result[item] || []; !_.isEmpty(employeeData) && declareForm.updateFields({
!_.isEmpty(employeeData) && declareForm.updateFields({ employeeType: {
employeeType: { value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{ id: employeeData.id,
id: employeeData.id, lastname: employeeData.name
lastname: employeeData.name }]]],
}]]], valueSpan: ["employeeId"]
valueSpan: ["employeeId"] }
} });
}); } else {
} else { declareForm.updateFields({ [item]: result[item] || "" });
declareForm.updateFields({ [item]: result[item] || "" }); }
} });
}); }
}); });
} }
}); });
@ -146,7 +153,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
return { return {
...it, ...it,
items: _.map(it.items, child => { items: _.map(it.items, child => {
if (child.domkey[0] === "dismissDate") { if (getKey(child) === "dismissDate") {
return { return {
...child, ...child,
viewAttr: value === "ABNORMAL" ? 3 : 2 viewAttr: value === "ABNORMAL" ? 3 : 2
@ -176,7 +183,7 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
return { return {
...it, ...it,
items: _.map(it.items, child => { items: _.map(it.items, child => {
if (child.domkey[0] === "employmentDate") { if (getKey(child) === "employmentDate") {
return { return {
...child, ...child,
viewAttr: value !== "OTHER" ? 3 : 2 viewAttr: value !== "OTHER" ? 3 : 2
@ -200,6 +207,39 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
}); });
}); });
break; break;
case "cardType":
this.setState({
eConditions: _.map(eConditions, it => {
return {
...it,
items: _.map(it.items, child => {
if (
getKey(child) === "entryDate" || getKey(child) === "departureDate" ||
getKey(child) === "birthplace" || getKey(child) === "taxReasons"
) {
return {
...child,
viewAttr: value !== "RESIDENT_IDENTITY_CARDS" ? 3 : 2
};
}
return { ...child };
})
};
})
}, () => {
declareForm.initFormFields(this.state.eConditions);
const [employeeData] = this.state.employeeInfo["employee"] || this.employeeChangeInfo["employee"] || [];
!_.isEmpty(employeeData) && declareForm.updateFields({
employeeType: {
value: [employeeData._entityType, [employeeData.id, employeeData.name, [{
id: employeeData.id,
lastname: employeeData.name
}]]],
valueSpan: ["employeeId"]
}
});
});
break;
default: default:
break; break;
} }
@ -209,17 +249,39 @@ class EmployeeDeclareDetailSchemaEditDialog extends Component {
const { employeeDeclareStore: { declareForm: form } } = this.props; const { employeeDeclareStore: { declareForm: form } } = this.props;
form.validateForm().then(f => { form.validateForm().then(f => {
if (f.isValid) { if (f.isValid) {
const { employmentType, employmentDate, employmentStatus, dismissDate, ...params } = form.getFormParams(); const {
employmentType, employmentDate, employmentStatus, dismissDate, cardType, entryDate, departureDate,
birthplace, taxReasons, ...params
} = form.getFormParams();
if ((employmentType !== "OTHER" && !employmentDate) || (employmentStatus === "ABNORMAL" && !dismissDate)) { if ((employmentType !== "OTHER" && !employmentDate) || (employmentStatus === "ABNORMAL" && !dismissDate)) {
Modal.warning({ form.showError("dismissDate", getLabel(111, "\"离职日期\"未填写"));
title: getLabel(131329, "信息确认"), return;
content: getLabel(518702, "必要信息不完整,红色*为必填项!") }
}); if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate && !departureDate && !birthplace && !taxReasons)) {
form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写"));
form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写"));
form.showError("birthplace", getLabel(111, "\"出生地\"未填写"));
form.showError("taxReasons", getLabel(111, "\"涉税事由\"未填写"));
return;
}
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !entryDate)) {
form.showError("entryDate", getLabel(111, "\"首次入境时间\"未填写"));
return;
}
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !departureDate)) {
form.showError("departureDate", getLabel(111, "\"预计离境时间\"未填写"));
return;
}
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !birthplace)) {
form.showError("birthplace", getLabel(111, "\"出生地\"未填写"));
return;
}
if ((cardType !== "RESIDENT_IDENTITY_CARDS" && !taxReasons)) {
form.showError("taxReasons", getLabel(111, "\"涉税事由\"未填写"));
return; return;
} }
const payload = { const payload = {
...form.getFormParams(), id: this.props.id, ...form.getFormParams(), id: this.props.id,
cardType: "RESIDENT_IDENTITY_CARDS", //暂时写死身份证类型
taxAgentId: getQueryString("id"), taxAgentId: getQueryString("id"),
taxCycle: this.props.taxCycle taxCycle: this.props.taxCycle
}; };

View File

@ -1,3 +1,7 @@
import React from "react";
import { WeaLocaleProvider } from "ecCom";
const { getLabel } = WeaLocaleProvider;
export const submitStatus = [ export const submitStatus = [
{ {
key: "ALL", key: "ALL",
@ -243,18 +247,21 @@ export const declareConditions = [
lanId: 111, lanId: 111,
labelcol: 6, labelcol: 6,
value: "", value: "",
viewAttr: 1 rules: "required|string",
viewAttr: 3
}, },
{ {
colSpan: 1, colSpan: 1,
conditionType: "INPUT", conditionType: "SELECT",
domkey: ["cardType"], domkey: ["cardType"],
fieldcol: 12, fieldcol: 12,
label: "证件类型", label: "证件类型",
lanId: 111, lanId: 111,
labelcol: 6, labelcol: 6,
value: "居民身份证", value: "",
viewAttr: 1 options: [],
rules: "required|string",
viewAttr: 3
}, },
{ {
colSpan: 1, colSpan: 1,
@ -281,6 +288,17 @@ export const declareConditions = [
rules: "required", rules: "required",
options: [] options: []
}, },
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["birthplace"],
fieldcol: 12,
label: "出生地",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{ {
colSpan: 1, colSpan: 1,
conditionType: "DATEPICKER", conditionType: "DATEPICKER",
@ -354,6 +372,47 @@ export const declareConditions = [
value: "", value: "",
viewAttr: 2 viewAttr: 2
}, },
{
colSpan: 1,
conditionType: "DATEPICKER",
domkey: ["entryDate"],
fieldcol: 12,
label: "首次入境时间",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "DATEPICKER",
domkey: ["departureDate"],
fieldcol: 12,
label: "预计离境时间",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 2
},
{
colSpan: 1,
conditionType: "SELECT",
domkey: ["taxReasons"],
fieldcol: 12,
label: "涉税事由",
lanId: 111,
labelcol: 6,
value: "",
multiple: true,
viewAttr: 2,
options: [
{ key: getLabel(111, "任职受雇"), showname: getLabel(111, "任职受雇") },
{ key: getLabel(111, "提供临时劳务"), showname: getLabel(111, "提供临时劳务") },
{ key: getLabel(111, "转让财产"), showname: getLabel(111, "转让财产") },
{ key: getLabel(111, "从事投资和经营活动"), showname: getLabel(111, "从事投资和经营活动") },
{ key: getLabel(111, "其他"), showname: getLabel(111, "其他") }
]
},
{ {
colSpan: 1, colSpan: 1,
conditionType: "SELECT", conditionType: "SELECT",

View File

@ -31,7 +31,8 @@ class Index extends Component {
const payload = { const payload = {
taxDeclareRecordId: getQueryString("taxDeclareRecordId"), taxDeclareRecordId: getQueryString("taxDeclareRecordId"),
taxAgentId: getQueryString("taxAgentId"), taxAgentId: getQueryString("taxAgentId"),
taxYearMonth: getQueryString("taxYearMonth") taxYearMonth: getQueryString("taxYearMonth"),
reportType: getQueryString("reportType")
}; };
this.setState({ loading: true }); this.setState({ loading: true });
taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => { taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => {