个税申报-在线申报接口对接

This commit is contained in:
黎永顺 2023-08-21 18:14:18 +08:00
parent 796d11466e
commit f7c03082f4
9 changed files with 421 additions and 62 deletions

View File

@ -58,7 +58,7 @@ export default class GenerateModal extends React.Component {
this.setState({ loading: false });
this.props.onCancel();
message.destroy();
message.loading(getLabel(22619, "正在生成中..."), 0);
message.loading(getLabel(111, "正在生成中..."), 0);
this.timer = setInterval(async () => {
const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data);
const { status: rateStatus, finish, msg } = result;
@ -70,9 +70,12 @@ export default class GenerateModal extends React.Component {
this.props.onGenerate();
}
} else {
clearInterval(this.timer);
message.destroy();
message.warning(msg || getLabel(111, "生成申报表失败!"));
this.props.onGenerate();
}
}, 800);
}, 1000);
}).catch(() => {
message.destroy();
clearInterval(this.timer);

View File

@ -29,9 +29,9 @@ class Index extends Component {
loading: { query: false, refresh: false, declare: false },
declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 }
};
this.timer = null;
}
componentDidMount() {
const promise = this.init();
}
@ -96,44 +96,81 @@ class Index extends Component {
taxdeclarationRefreshData({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => {
this.setState({ loading: { ...this.state.loading, refresh: false } });
if (status) {
const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data);
if (resStatus) {
const { status: rateStatus, msg } = result;
if (rateStatus) {
message.success(getLabel(111, "刷新数据成功!"));
const promise = this.init();
message.destroy();
message.loading(getLabel(111, "刷新中..."), 0);
this.timer = setInterval(async () => {
const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data);
const { status: rateStatus, finish, msg } = result;
if (resStatus && rateStatus) {
if (finish) {
clearInterval(this.timer);
message.destroy();
message.success(getLabel(111, "刷新数据成功!"));
const promise = this.init();
}
} else {
clearInterval(this.timer);
message.destroy();
message.warning(msg || getLabel(111, "刷新数据失败!"));
const promise = this.init();
}
}
}, 1000);
} else {
clearInterval(this.timer);
message.destroy();
message.warning(errormsg);
}
}).catch(() => this.setState({ loading: { ...this.state.loading, refresh: false } }));
}).catch(() => {
message.destroy();
clearInterval(this.timer);
this.setState({ loading: { ...this.state.loading, refresh: false } });
});
};
taxdeclarationDeclare = () => {
this.setState({ loading: { ...this.state.loading, declare: true } });
taxdeclarationDeclare({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => {
this.setState({ loading: { ...this.state.loading, declare: false } });
if (status) {
const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data);
if (resStatus) {
const { status: rateStatus, msg } = result;
if (rateStatus) {
message.success(getLabel(111, "在线申报成功!"));
const promise = this.declare();
message.destroy();
message.loading(getLabel(111, "申报中..."), 0);
this.timer = setInterval(async () => {
const { status: resStatus, data: result } = await this.taxdeclarationGetRate(data);
const { status: rateStatus, finish, msg } = result;
if (resStatus && rateStatus) {
if (finish) {
clearInterval(this.timer);
message.destroy();
message.success(getLabel(111, "在线申报成功!"));
const promise = this.declare();
}
} else {
clearInterval(this.timer);
message.destroy();
message.warning(msg || getLabel(111, "在线申报失败!"));
const promise = this.declare();
}
}
}, 1000);
} else {
clearInterval(this.timer);
message.destroy();
message.warning(errormsg);
}
}).catch(() => this.setState({ loading: { ...this.state.loading, declare: false } }));
}).catch(() => {
message.destroy();
clearInterval(this.timer);
this.setState({ loading: { ...this.state.loading, declare: false } });
});
};
render() {
const { tabs, selectedKey, columns, pageInfo, dataSource, loading, declareInfo } = this.state;
let btns = [
<Button type="primary">{getLabel(17416, "导出")}</Button>,
<Button type="ghost" onClick={this.taxdeclarationDeclare}
loading={loading.declare}>{getLabel(111, "在线申报")}</Button>,
<Button type="ghost" onClick={this.taxdeclarationRefreshData}
loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button>
];
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -151,19 +188,15 @@ class Index extends Component {
}, () => this.getDetailList());
}
};
declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, <Button
type="ghost">{getLabel(111, "申报反馈")}</Button>));
return (
<div className="declareDetail-layout">
<TaxDeclarationInfo declareInfo={declareInfo}/>
<div className="declareDetail-layout-content">
<WeaTab
datas={tabs} keyParam="viewcondition" selectedKey={selectedKey}
buttons={[
<Button type="primary">{getLabel(17416, "导出")}</Button>,
<Button type="ghost" onClick={this.taxdeclarationDeclare}
loading={loading.declare}>{getLabel(111, "在线申报")}</Button>,
<Button type="ghost" onClick={this.taxdeclarationRefreshData}
loading={loading.refresh}>{getLabel(111, "刷新数据")}</Button>
]}
buttons={btns}
/>
<WeaTable
loading={loading.query} bordered

View File

@ -50,6 +50,7 @@ class Index extends Component {
selectedRowKeys: []
};
this.baseInfoRef = null;
this.timer = null;
}
componentDidMount() {
@ -209,14 +210,35 @@ class Index extends Component {
employeedeclareRefresh(payload).then(async ({ status, data, errormsg }) => {
this.setState({ loading: { ...this.state.loading, refresh: false } });
if (status) {
const { status, data: result } = await employeedeclareGetRate({ index: data });
const { msg } = result || {};
(status && !msg) ? message.success(getLabel(111, "刷新成功!")) : message.warning(msg || getLabel(111, "刷新失败!"));
this.queryEmployeeList();
message.destroy();
message.loading(getLabel(111, "刷新中..."), 0);
this.timer = setInterval(async () => {
const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data });
const { status: rateStatus, finish, msg } = result;
if (resStatus && rateStatus) {
if (finish) {
clearInterval(this.timer);
message.destroy();
message.success(getLabel(111, "刷新成功!"));
this.queryEmployeeList();
}
} else {
clearInterval(this.timer);
message.destroy();
message.warning(msg || getLabel(111, "刷新失败!"));
this.queryEmployeeList();
}
}, 1000);
} else {
clearInterval(this.timer);
message.destroy();
message.error(errormsg);
}
}).catch(() => this.setState({ loading: { ...this.state.loading, refresh: false } }));
}).catch(() => {
clearInterval(this.timer);
message.destroy();
this.setState({ loading: { ...this.state.loading, refresh: false } });
});
};
/*
* Author: 黎永顺
@ -233,14 +255,35 @@ class Index extends Component {
getDeclareFeedback(payload).then(async ({ status, data, errormsg }) => {
this.setState({ loading: { ...this.state.loading, feedback: false } });
if (status) {
const { status, data: result } = await employeedeclareGetRate({ index: data });
const { msg } = result || {};
(status && !msg) ? message.success(getLabel(111, "获取报送结果成功!")) : message.warning(msg || "");
this.queryEmployeeList();
message.destroy();
message.loading(getLabel(111, "获取报送中..."), 0);
this.timer = setInterval(async () => {
const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data });
const { status: rateStatus, finish, msg } = result;
if (resStatus && rateStatus) {
if (finish) {
clearInterval(this.timer);
message.destroy();
message.success(getLabel(111, "获取报送结果成功!"));
this.queryEmployeeList();
}
} else {
clearInterval(this.timer);
message.destroy();
message.warning(msg || getLabel(111, "获取失败!"));
this.queryEmployeeList();
}
}, 1000);
} else {
clearInterval(this.timer);
message.destroy();
message.error(errormsg);
}
}).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } }));
}).catch(() => {
clearInterval(this.timer);
message.destroy();
this.setState({ loading: { ...this.state.loading, feedback: false } });
});
};
/*
* Author: 黎永顺
@ -283,14 +326,35 @@ class Index extends Component {
employeedeclareDeclare(payload).then(async ({ status, data, errormsg }) => {
this.setState({ loading: { ...this.state.loading, declare: false } });
if (status) {
const { status, data: result } = await employeedeclareGetRate({ index: data });
const { msg } = result || {};
(status && !msg) ? message.success(getLabel(111, "全部报送成功!")) : message.warning(msg || "");
this.queryEmployeeList();
message.destroy();
message.loading(getLabel(111, "报送中..."), 0);
this.timer = setInterval(async () => {
const { status: resStatus, data: result } = await employeedeclareGetRate({ index: data });
const { status: rateStatus, finish, msg } = result;
if (resStatus && rateStatus) {
if (finish) {
clearInterval(this.timer);
message.destroy();
message.success(getLabel(111, "全部报送成功!"));
this.queryEmployeeList();
}
} else {
clearInterval(this.timer);
message.destroy();
message.warning(msg || getLabel(111, "报送失败!"));
this.queryEmployeeList();
}
}, 1000);
} else {
clearInterval(this.timer);
message.destroy();
message.error(errormsg);
}
}).catch(() => this.setState({ loading: { ...this.state.loading, declare: false } }));
}).catch(() => {
clearInterval(this.timer);
message.destroy();
this.setState({ loading: { ...this.state.loading, declare: false } });
});
};
handleAdd = () => {
this.setState({

View File

@ -37,12 +37,12 @@ export const fieldList = [
{
key: "TAX_NET_PASSWORD",
showname: "个税网报密码",
lanId: 111,
lanId: 111
},
{
key: "REAL_NAME_PASSWORD",
showname: "实名账号密码",
lanId: 111,
lanId: 111
}
]
},
@ -89,3 +89,121 @@ export const fieldList = [
viewAttr: 1
}
];
export const taxFillCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxAgentName"],
fieldcol: 14,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxCode"],
fieldcol: 14,
label: "登记序号",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxpayerStatus"],
fieldcol: 14,
label: "纳税人状态",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["legalPersonName"],
fieldcol: 14,
label: "法人姓名",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["mobile"],
fieldcol: 14,
label: "联系电话",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["businessAddress"],
fieldcol: 14,
label: "生产经营地址",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["industryName"],
fieldcol: 14,
label: "行业名称",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxAuthorities"],
fieldcol: 14,
label: "主管税务机关",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxBranch"],
fieldcol: 14,
label: "主管税务科所",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["divideFiling"],
fieldcol: 14,
label: "是否分部门备案",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
}
],
defaultshow: true
}
];

View File

@ -96,3 +96,35 @@
border-radius: 0;
}
}
.taxfillingDialog {
.ant-modal-title {
.text-elli {
color: #111;
font-weight: 700;
}
}
.taxfillingDialogContent {
height: 100%;
padding: 16px;
background: #f6f6f6;
overflow-y: auto;
.wea-search-group {
padding: 0;
background: #FFF;
border: 1px solid #e5e5e5;
border-bottom: 0;
.ant-row, .wea-form-cell {
padding: 0;
}
.wea-form-item {
padding: 5px 16px;
border-bottom: 1px solid #e5e5e5;
}
}
}
}

View File

@ -13,6 +13,7 @@ import { decentralizationConditions, editConditions } from "../../taxAgent/editC
import BaseSettings, { convertConditon } from "./baseSettings";
import PersonalScope from "./personalScope";
import TaxDeclarationInfo from "./taxDeclarationInfo";
import TaxFilingInfoDialofg from "./taxFillingInfoDialog";
import * as API from "../../../apis/taxAgent";
import "./index.less";
@ -28,7 +29,12 @@ class TaxAgentSlide extends Component {
current: 0,
loading: false,
verifyLoading: false,
taxAgentId: ""
taxAgentId: "",
taxFilingInfoDialofg: {
visible: false, title: "",
isEdit: false, jumpAll: false,
taxAgentTaxReturnCheckFormDTO: {}
}
};
this.taxInfoRef = null;
}
@ -123,9 +129,9 @@ class TaxAgentSlide extends Component {
});
};
handleSaveAndVerify = (jumpAll = false) => {
const { taxAgentId } = this.state;
const { isEdit } = this.props, { taxAgentId, taxFilingInfoDialofg } = this.state;
const { fieldForm, fieldItem } = this.taxInfoRef.state;
const { city: cityVal, netPassword, realNamePassword, ...extra } = fieldForm;
const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm;
const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]);
if (!boolean) {
Modal.warning({
@ -134,18 +140,33 @@ class TaxAgentSlide extends Component {
});
return;
}
const [nation, province, city] = cityVal ? cityVal.split("-") : [];
const [nation, province, city] = cityStr ? cityStr.split("-") : [];
const proBool = _.every(cityStr ? cityStr.split("-") : [], it => it !== "undefined");
if (!proBool) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "请展开选择报税所属区域!")
});
return;
}
// requestType: 1:保存并验证 2保存
const payload = {
...extra, nation, province, city,
taxAgentId, requestType: 1, password: netPassword || realNamePassword
taxAgentId, requestType: 1, password: netPassword || realNamePassword,
cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : ""
};
this.setState({ verifyLoading: true });
API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, errormsg }) => {
API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, data, errormsg }) => {
this.setState({ verifyLoading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
jumpAll ? this.props.onCancel(true) : this.props.onOk();
this.setState({
taxFilingInfoDialofg: {
...taxFilingInfoDialofg, visible: true,
isEdit, jumpAll, title: fieldForm.name,
taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO
}
});
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
@ -186,9 +207,9 @@ class TaxAgentSlide extends Component {
break;
case 1:
const tmpV = [<Button type="primary" loading={verifyLoading}
onClick={this.handleSaveAndVerify}>{getLabel(544343, "保存并验证")}</Button>];
onClick={() => this.handleSaveAndVerify(false)}>{getLabel(544343, "保存并验证")}</Button>];
const tmpJ = [
<Button type="ghost"
<Button type="ghost" loading={verifyLoading}
onClick={() => this.handleSaveAndVerify(true)}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
<Button type="ghost"
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
@ -218,7 +239,7 @@ class TaxAgentSlide extends Component {
{ key: 2, title: getLabel(124810, "人员范围") }
];
const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props;
const { current, taxAgentId } = this.state;
const { current, taxAgentId, taxFilingInfoDialofg } = this.state;
const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs;
return (
<WeaSlideModal
@ -259,6 +280,19 @@ class TaxAgentSlide extends Component {
{
this.renderChildren()
}
<TaxFilingInfoDialofg
{...taxFilingInfoDialofg}
onCancel={() => {
const { jumpAll } = taxFilingInfoDialofg;
this.setState({
current: jumpAll ? this.state.current + 1 : this.state.current,
taxFilingInfoDialofg: {
...taxFilingInfoDialofg, visible: false,
taxAgentTaxReturnCheckFormDTO: {}
}
}, () => jumpAll && this.props.onCancel(true));
}}
/>
</div>
}
onClose={() => onCancel()}

View File

@ -19,6 +19,7 @@ class TaxDeclarationInfo extends Component {
name: "",
taxCode: "",
city: "",
cityVal: [],
areaCode: null,
passwordType: "TAX_NET_PASSWORD",
account: "",
@ -52,20 +53,26 @@ class TaxDeclarationInfo extends Component {
fieldForm: {
...fieldForm,
..._.reduce(_.keys(fieldForm), (pre, cur) => {
return { ...pre, [cur]: data[cur] };
if (cur !== "city") {
return { ...pre, [cur]: data[cur] };
}
return {
...pre,
cityVal: [{ id: data[cur], name: data["cityname"] }],
[cur]: `${data["nation"]}-${data["province"]}-${data[cur]}`
};
}, {})
}
});
}
});
};
handleChangeValue = (key, value) => {
handleChangeValue = (key, value, cityVal = []) => {
const { fieldForm } = this.state;
this.setState({
fieldForm: {
...fieldForm,
[key]: value
}
fieldForm: !_.isEmpty(cityVal) ? {
...fieldForm, [key]: value, cityVal
} : { ...fieldForm, [key]: value }
}, () => {
if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") {
this.setState({
@ -97,12 +104,16 @@ class TaxDeclarationInfo extends Component {
}
{
type === "SELECT" &&
<WeaBrowser value={fieldForm[key]} type={58} viewAttr={viewAttr}
<WeaBrowser replaceDatas={fieldForm["cityVal"]} type={58} viewAttr={viewAttr}
helpfulTip={getLabel(111, "请展开选择报税所属区域")}
onChange={(__, ___, datas) => {
if (!_.isEmpty(datas)) {
this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`);
this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`, _.map(datas, it => ({
id: it.id,
name: it.name
})));
} else {
this.handleChangeValue(key, "");
this.handleChangeValue(key, "", []);
}
}}
/>

View File

@ -0,0 +1,63 @@
/*
* Author: 黎永顺
* name: 个税申报-异常失败详情
* Description:
* Date: 2023/8/18
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { Button } from "antd";
import { taxFillCondition } from "./constants";
import { getSearchs } from "../../../util";
const { getLabel } = WeaLocaleProvider;
@inject("taxAgentStore")
@observer
class TaxFilingInfoDialofg extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) {
const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm } } = nextProps;
taxfillInfoForm.initFormFields(taxFillCondition);
const fields = _.map(taxFillCondition[0].items, it => {
return it.domkey[0];
});
fields.map(item => {
taxfillInfoForm.updateFields({
[item]: taxAgentTaxReturnCheckFormDTO[item] || ""
});
});
}
}
render() {
const { taxAgentStore: { taxfillInfoForm } } = this.props;
return (
<WeaDialog
{...this.props}
hasScroll className="taxfillingDialog" initLoadCss
buttons={[
<Button type="primary" onClick={this.props.onCancel}>{getLabel(111, "知道了")}</Button>
]}
style={{
width: 850,
height: 606.6,
minHeight: 200,
minWidth: 380,
maxHeight: "50%",
maxWidth: "50%",
overflow: "hidden",
transform: "translate(0px, 0px)"
}}
>
<div className="taxfillingDialogContent">
{getSearchs(taxfillInfoForm, taxFillCondition, 1)}
</div>
</WeaDialog>
);
}
}
export default TaxFilingInfoDialofg;

View File

@ -10,6 +10,7 @@ const { TableStore } = WeaTableNew;
export class TaxAgentStore {
@observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体
@observable taxfillInfoForm = new WeaForm(); //报税信息查看form