diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index da1099df..746bcf99 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -16,9 +16,13 @@ export const saveDeclare = 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 => { - 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 export const getTaxDeclarationTab = params => { - return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", "GET", params); + return postFetch("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", params); }; //个税在线对接-个税申报表是否已经生成 diff --git a/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js b/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js index ff40a205..43916c7f 100644 --- a/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js +++ b/pc4mobx/hrmSalary/pages/bankVoucherDetail/index.js @@ -31,7 +31,7 @@ class Index extends Component { const payload = { taxDeclareRecordId: getQueryString("taxDeclareRecordId"), taxAgentId: getQueryString("taxAgentId"), - taxYearMonth: getQueryString("taxYearMonth") + "-01", + taxYearMonth: getQueryString("taxYearMonth"), checkFeedback: 0 }; this.setState({ loading: true }); diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js new file mode 100644 index 00000000..0703aa07 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/leftTab.js @@ -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 ( +
+ { + this.setState({ selectedKeys: key }, () => { + onChangeTab(_.find(dataSource, o => String(o.id) === key).reportType, true); + }); + }} + > + { + _.map(dataSource, item => { + const { reportType, id } = item; + return {reportTypeNameMap[reportType]}; + }) + } + +
+ ); + } +} + +export default LeftTab; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js index 986a05ae..4f6ad59f 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js @@ -262,7 +262,8 @@ class PaymentBtn extends Component { const { taxAgentId, taxCycle: taxYearMonth } = this.props.declareInfo; const payload = { taxDeclareRecordId: getQueryString("id"), - taxAgentId, taxYearMonth: taxYearMonth + "-01" + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.props.reportType }; taxPaymentVoucherCancel(payload).then(({ status, errormsg }) => { if (status) { diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js index bfc15a46..ec5edc9c 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js @@ -46,11 +46,11 @@ class TaxDeclarationInfo extends Component { const { declareInfo, onOperate } = this.props; const { abnormalSize, declareFailSize } = declareInfo; const infoItem = [ + { key: "taxCycle", label: getLabel(542240, "税款所属期") }, { key: "salaryMonth", label: getLabel(542604, "薪资所属月") }, { key: "taxAgentName", label: getLabel(537996, "个税扣缴义务人") }, { key: "declareTypeDesc", label: getLabel(111, "申报类型") }, { key: "declareStatusDesc", label: getLabel(111, "申报状态") }, - { key: "taxCycle", label: getLabel(542240, "税款所属期") }, { key: "taxPaidAmount", label: getLabel(111, "已缴金额") } ]; let dropMenuDatas = []; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/confirm.js b/pc4mobx/hrmSalary/pages/declareDetail/confirm.js index a64db297..39c6c2d5 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/confirm.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/confirm.js @@ -2,7 +2,7 @@ import { WeaLocaleProvider } from "ecCom"; import { Modal } from "antd"; const { getLabel } = WeaLocaleProvider; -export const confirmDialog = (type, callback) => { +export const confirmDialog = (type, callback, reportType) => { let content = ""; switch (type) { case "refresh": @@ -15,7 +15,7 @@ export const confirmDialog = (type, callback) => { content = getLabel(111, "申报作废,只有申报成功,无需缴款/申报成功,未缴款的状态才能作废,当作废成功时,企业状态会变成未申报;当作废失败时,企业状态还是原来的未缴款或无需缴款的状态。"); break; case "declare": - content = getLabel(111, "解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报;解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。是否确认申报?"); + content = reportType === 1 ? getLabel(111, "解除劳动合同一次性补偿金、全年一次性奖金所得,不能单独申报,需要同正常工资薪金一起申报;解除劳动合同一次性补偿金、稿酬所得,由于税务规则需要,解除劳动合同一次性补偿金、稿酬所得必须填写免税附表。是否确认申报?") : getLabel(111, "确认申报?"); break; default: break; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index 280bfc5b..cf369c11 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -5,7 +5,7 @@ * Date: 2023/8/18 */ import React, { Component } from "react"; -import { WeaLocaleProvider, WeaTab } from "ecCom"; +import { WeaLeftRightLayout, WeaLocaleProvider, WeaTab } from "ecCom"; import { Button, message, Modal, Spin } from "antd"; import TaxDeclarationInfo from "./components/taxDeclarationInfo"; import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; @@ -25,13 +25,13 @@ import { taxdeclarationRefreshData, taxdeclaratioUpdateCancel, taxdeclaratioUpdateDeclare, - taxPaymentVoucherStatusSync, - taxPaymentWithheldVoucherGet + taxPaymentVoucherStatusSync } from "../../apis/declare"; import { convertToUrlString, getQueryString } from "../../util/url"; import IncomeTaxDeclarationPersonnelSlide from "./components/incomeTaxDeclarationPersonnelSlide"; import TaxDeclareDetailImportDialog from "./components/taxDeclareDetailImportDialog"; import TabEditDialog from "./components/tabEditDialog"; +import LeftTab from "./components/leftTab"; import { confirmDialog } from "./confirm"; import "./index.less"; @@ -60,7 +60,8 @@ class Index extends Component { visible: false, title: getLabel(1421, "新增"), taxDeclarationId: "", id: "" }, 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.taxDeclareRef = null; @@ -75,7 +76,8 @@ class Index extends Component { } 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: infoDataSource, status: infoStatus } = infoResult; const { data: calcSalaryStatus, status: calcStatus } = calcResult; @@ -101,10 +103,12 @@ class Index extends Component { this.getDetailList(); }; getTaxDeclarationTab = () => { - return getTaxDeclarationTab({ id: getQueryString("id") }); + const { reportType } = this.state; + return getTaxDeclarationTab({ taxDeclareRecordId: getQueryString("id"), reportType }); }; getDeclareInfo = () => { - return getDeclareInfo({ id: getQueryString("id") }); + const { reportType } = this.state; + return getDeclareInfo({ taxDeclareRecordId: getQueryString("id"), reportType }); }; apiflowBillingConfigStatus = () => { return apiflowBillingConfigStatus(); @@ -183,7 +187,7 @@ class Index extends Component { } }).catch(() => this.setState({ loading: { ...loading, query: false } })); }; - handleOperateDeclare = (type) => { + handleOperateDeclare = (type, params = {}) => { const loadingTxt = { refresh: getLabel(111, "刷新中..."), //刷新数据 declare: getLabel(111, "申报中..."), //在线申报 @@ -207,7 +211,7 @@ class Index extends Component { cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈 }; this.setState({ loading: { ...this.state.loading, [type]: true } }); - APIFox[type]({ taxDeclareRecordId: getQueryString("id") }) + APIFox[type]({ taxDeclareRecordId: getQueryString("id"), ...params }) .then(async ({ status, data, errormsg }) => { if (status) { message.destroy(); @@ -247,7 +251,8 @@ class Index extends Component { const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; const payload = { taxDeclareRecordId: getQueryString("id"), - taxAgentId, taxYearMonth: taxYearMonth + "-01" + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.state.reportType }; this.setState({ loading: { ...this.state.loading, refreshingPay: true } }); taxPaymentVoucherStatusSync(payload).then(({ status, errormsg }) => { @@ -264,17 +269,19 @@ class Index extends Component { const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; const payload = { taxDeclareRecordId: getQueryString("id"), - taxAgentId, taxYearMonth: taxYearMonth + "-01" + taxAgentId, taxYearMonth: taxYearMonth + "-01", + reportType: this.state.reportType }; - this.setState({ loading: { ...this.state.loading, issuance: true } }); - taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => { - this.setState({ loading: { ...this.state.loading, issuance: false } }); - if (status && !_.isEmpty(data.vouchers)) { - window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`); - } else { - message.error(errormsg || ""); - } - }).catch(() => this.setState({ loading: { ...this.state.loading, issuance: false } })); + window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`); + // this.setState({ loading: { ...this.state.loading, issuance: true } }); + // taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => { + // this.setState({ loading: { ...this.state.loading, issuance: false } }); + // if (status && !_.isEmpty(data.vouchers)) { + // window.open(`${window.ecologyContentPath || ""}/spa/hrmSalary/static/index.html#/main/hrmSalary/enterprisePayCertificationDetail?${convertToUrlString(payload)}`); + // } else { + // message.error(errormsg || ""); + // } + // }).catch(() => this.setState({ loading: { ...this.state.loading, issuance: false } })); }; export = () => { const [incomeCategory, taxDeclarationId] = this.state.selectedKey.split("%%"); @@ -294,9 +301,10 @@ class Index extends Component { }, () => callback && this.getDetailList()); }; exportGetDeclareTaxResultFeedback = () => { + const { reportType } = this.state; message.destroy(); message.loading(getLabel(111, "下载中..."), 0); - exportGetDeclareTaxResultFeedback({ id: getQueryString("id") }) + exportGetDeclareTaxResultFeedback({ id: getQueryString("id"), reportType }) .then(async () => { message.destroy(); message.success(getLabel(111, "下载成功!")); @@ -338,12 +346,13 @@ class Index extends Component { render() { const { tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide, - editTabVisible + editTabVisible, reportType, showLeft } = this.state; const [__, taxDeclarationId] = selectedKey.split("%%"); let btns = [ , - , @@ -355,30 +364,30 @@ class Index extends Component { //申报状态:申报中 declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, )); + onClick={() => this.handleOperateDeclare("feedback", { reportType })}>{getLabel(111, "申报反馈")})); //申报状态:缴款中 declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2)); //申报状态:已缴款 declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2, )); + onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")})); //申报状态:申报成功,无需缴款 declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" && (btns.splice(1, 2, , + onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}, + onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")} )); //申报状态:申报成功,未缴款 declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" && (btns.splice(1, 2, , + onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}, , + onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}, @@ -404,7 +413,7 @@ class Index extends Component { } if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) { btns.push( - , + , ); } @@ -413,41 +422,49 @@ class Index extends Component { onClick={this.getEnterprisePayCertificate}>{getLabel(111, "开具企业完税证明")}); } return ( -
- this[fun]()}/> -
- this.setState({ selectedKey: v }, () => this.getDetailList())} - searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")} - onSearchChange={keyword => this.setState({ keyword })} - onSearch={this.getDetailList} - /> - {/*个税申报表-新增编辑框*/} - this.handleTaxDescPerSlide({ visible: false, id: "", callback })} - /> - {/*个税申报表导入*/} - this.taxDeclareRef = dom} - onSuccess={this.declare} - /> - {/*个税申报表-新增tab弹框*/} - this.setState({ editTabVisible: false }, () => isRefresh && this.init(false))}/> -
-
- -