diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index a6d4dd2a..8a0e3e08 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -163,4 +163,59 @@ export const taxdeclarationDelete = (params) => { return postFetch("/api/bs/hrmsalary/taxdeclaration/delete", params); }; +//个税申报表申报数据-获取在线申报反馈 +export const taxdeclarationGetDeclareFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/getDeclareFeedback", params); +}; + +//个税申报表申报数据-更正申报 +export const taxdeclaratioUpdateDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/updateDeclare", params); +}; + +//个税申报表申报数据-作废申报 +export const taxdeclaratioUpdateCancel = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/cancel", params); +}; + +//个税申报表申报数据-获取作废反馈 +export const taxdeclaratioGetCancelFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxdeclaration/getCancelFeedback", params); +}; + +//个税申报表申报数据-三方协议缴款反馈 +export const taxPaymentAgreementPayFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/agreement/pay/feedback", params); +}; + +//个税申报表申报数据-应缴税额查询 +export const taxPaymentTaxAmount = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/tax/amount", params); +}; + +//个税申报表申报数据-获取企业的三方信息 +export const taxPaymentgetAgreement = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/getAgreement", params); +}; + +//个税申报表申报数据-获取企业的三方信息查询反馈 +export const taxPaymentgetAgreementFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/getAgreementFeedback", params); +}; + +//个税申报表申报数据-同步缴款状态 +export const taxPaymentVoucherStatusSync = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/voucher/status/sync", params); +}; + +//个税申报表申报数据-三方缴款,最终支付 +export const taxPaymentAgreemenPay = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/agreement/pay", params); +}; + +//个税申报表申报数据-开具企业缴税完税证明 +export const taxPaymentWithheldVoucherGet = (params) => { + return postFetch("/api/bs/hrmsalary/taxPayment/withheldVoucher/get", params); +}; + diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index f5c32c4d..2da05983 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -22,6 +22,7 @@ import PayrollDetail from "./pages/payroll/payrollDetail"; import Declare from "./pages/declare"; import DeclareDetail from "./pages/declareDetail"; import Employeedeclare from "./pages/employeedeclare"; +import EnterprisePayCertificationDetail from "./pages/enterprisePayCertificationDetail"; import EmployeedeclareDetail from "./pages/employeedeclareDetail"; import TaxRate from "./pages/taxRate"; import TaxAgents from "./pages/taxAgent"; @@ -160,6 +161,8 @@ const Routes = ( + - 查看 + {getLabel(83110, "查看详情")} { showWithDrawBtn && diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js new file mode 100644 index 00000000..483d987c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js @@ -0,0 +1,93 @@ +export const paymentFeedbackConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["type"], + fieldcol: 12, + label: "缴款方式", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3, + detailtype: 3, + options: [] + } + ], + defaultshow: true + } +]; +export const paymentTripartiteConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["taxAgent"], + fieldcol: 12, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["amount"], + fieldcol: 12, + label: "应缴金额", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + }, + { + colSpan: 1, + conditionType: "INPUT", + domkey: ["personNum"], + fieldcol: 12, + label: "申报人数", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1 + } + ], + defaultshow: true + } +]; +export const paymentBankConditions = [ + { + items: [ + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["protocolNumber"], + fieldcol: 12, + label: "开户行", + lanId: 111, + labelcol: 6, + value: "", + rules: "required", + viewAttr: 3, + options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["count"], + fieldcol: 12, + label: "开户行号", + lanId: 111, + labelcol: 6, + value: "", + viewAttr: 1, + options: [] + } + ], + defaultshow: true + } +]; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js new file mode 100644 index 00000000..552d07e2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js @@ -0,0 +1,256 @@ +/* + * Author: 黎永顺 + * name: 在线申报-缴款按钮 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { inject, observer } from "mobx-react"; +import { Button, Dropdown, Menu, message, Modal } from "antd"; +import PaymentDialog from "./paymentDialog"; +import { + taxPaymentAgreemenPay, + taxPaymentgetAgreement, + taxPaymentgetAgreementFeedback, + taxPaymentTaxAmount +} from "../../../apis/declare"; +import { getQueryString } from "../../../util/url"; +import { paymentBankConditions, paymentTripartiteConditions } from "./constants"; + +const { getLabel } = WeaLocaleProvider; + +@inject("declareStore") +@observer +class PaymentBtn extends Component { + constructor(props) { + super(props); + this.state = { + paymentDialog: { + visible: false, title: "", + buttons: [], conditions: [], + taxAmount: "" + } + }; + this.timer = null; + } + + handleTripartiteContributions = () => { + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content:
+
{getLabel(111, "确定要进行三方缴款吗?")}
+
{getLabel(111, "若申请过银行缴款,点击确定,将自动作废银行缴款凭证。并进行三方缴款。 ")}
+
, + onOk: () => { + taxPaymentTaxAmount({ taxDeclareRecordId: getQueryString("id") }) + .then(({ status, data, errormsg }) => { + if (status) { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, + title: getLabel(111, "应缴纳"), taxAmount: data.amount, + buttons: [ + + ], + conditions: _.map(paymentTripartiteConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + const key = it["domkey"][0]; + return { + ...it, + value: data[key] + }; + }) + }; + }) + } + }); + } else { + message.error(errormsg); + } + }); + } + }); + }; + taxPaymentgetAgreement = () => { + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentgetAgreement(payload).then(({ status, data, errormsg }) => { + if (status) { + this.handleCancel(); + this.getBankAccountInfo({ ...payload, requestId: data }); + } else { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + message.error(errormsg); + } + }).catch(() => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + }); + }; + getBankAccountInfo = (payload) => { + let loop = () => { + clearTimeout(this.timer); + this.timer = setTimeout(async () => { + let response = await taxPaymentgetAgreementFeedback(payload); + const { data, status, errormsg } = response; + if (status) { + const { finish, form } = data; + if (finish) { + const { feedbacks, bankForm } = form; + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, + title: getLabel(111, "银行账号信息"), + buttons: [ + + ], + conditions: _.map(paymentBankConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + const key = it["domkey"][0]; + if (key === "protocolNumber") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.yhhbmc })) + }; + } else if (key === "count") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.khhhh })) + }; + } + return { ...it }; + }) + }; + }) + } + }); + } else { + loop(); + } + } else { + message.warning(errormsg); + clearTimeout(this.timer); + } + }, 800); + }; + loop(); + }; + taxPaymentAgreemenPay = () => { + const { paymentDialog } = this.state; + const { taxAmount } = paymentDialog; + const { declareStore: { paymentForm } } = this.props; + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + paymentForm.validateForm().then(f => { + if (f.isValid) { + const { protocolNumber } = paymentForm.getFormParams(); + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth, taxAmount, protocolNumber + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentAgreemenPay(payload).then(({ status, errormsg }) => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + if (status) { + message.success(getLabel(111, "缴款处理中,请稍后点击缴款反馈按钮获取缴款信息")); + this.handleCancel(); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + })); + } else { + f.showErrors(); + } + }); + }; + handleCancel = () => { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: false, + title: "", buttons: [], conditions: [] + } + }); + }; + + render() { + const { paymentDialog } = this.state; + return ( + + + {getLabel(111, "银行端凭证缴款")} + {getLabel(111, "作废缴款凭证")} + + } + type="ghost">{getLabel(111, "三方缴款")} + + + ); + } +} + +export default PaymentBtn; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js new file mode 100644 index 00000000..e5ffc64f --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js @@ -0,0 +1,51 @@ +/* + * Author: 黎永顺 + * name: 在线申报-缴款弹框 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaDialog } from "ecCom"; +import { getSearchs } from "../../../util"; + +@inject("declareStore") +@observer +class PaymentDialog extends Component { + componentWillReceiveProps(nextProps, nextContext) { + const { declareStore: { paymentForm, changePaymentForm }, conditions } = nextProps; + if (nextProps.visible !== this.props.visible && nextProps.visible && nextProps.conditions) { + paymentForm.initFormFields(conditions); + } + if (nextProps.visible !== this.props.visible && !nextProps.visible) { + paymentForm.resetForm(); + changePaymentForm(); + } + } + + handleChange = (val) => { + const key = Object.keys(val)[0]; + if (key === "protocolNumber") { + const { declareStore: { paymentForm } } = this.props; + paymentForm.updateFields({ + count: val[key].value + }); + } + }; + + render() { + const { conditions, declareStore: { paymentForm } } = this.props; + return ( + +
+ {!_.isEmpty(conditions) && getSearchs(paymentForm, conditions, 1, false, this.handleChange)} +
+
+ ); + } +} + +export default PaymentDialog; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedBackDetail.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedBackDetail.js new file mode 100644 index 00000000..9dad86e6 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedBackDetail.js @@ -0,0 +1,42 @@ +/* + * Author: 黎永顺 + * name: 在线申报-三方缴款详情 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider } from "ecCom"; + +const { getLabel } = WeaLocaleProvider; + +class PaymentFeedBackDetail extends Component { + + render() { + const { showData } = this.props; + return ( + +
+
{getLabel(111, "缴款成功")}
+
+
{getLabel(111, "状态:")}
+
{getLabel(111, "申报成功,已缴款")}
+
+
+
{getLabel(111, "实缴金额:")}
+
{showData.payAmount}      {parseFloat(showData.otherAmount) > 0 ? `(含滞纳金等{${showData.otherAmount}元)` : ""}
+
+
+
{getLabel(111, "申报人数:")}
+
{showData.personNum}
+
+
+
+ ); + } +} + +export default PaymentFeedBackDetail; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js new file mode 100644 index 00000000..e35f7400 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js @@ -0,0 +1,158 @@ +/* + * Author: 黎永顺 + * name: 在线申报-缴款反馈按钮 + * Description: + * Date: 2023/8/22 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import { Button, message } from "antd"; +import { inject, observer } from "mobx-react"; +import PaymentDialog from "./paymentDialog"; +import PaymentFeedBackDetail from "./paymentFeedBackDetail"; +import { paymentFeedbackConditions } from "./constants"; +import { getQueryString } from "../../../util/url"; +import { taxPaymentAgreementPayFeedback } from "../../../apis/declare"; + +const { getLabel } = WeaLocaleProvider; + +@inject("declareStore") +@observer +class PaymentFeedbackBtn extends Component { + constructor(props) { + super(props); + this.state = { + paymentDialog: { + visible: false, title: "", + buttons: [], conditions: null + }, + paymentFeedbackDialog: { + visible: false, title: "", showData: {} + }, + loading: false + }; + } + + getFeedback = () => { + const { declareStore: { paymentForm } } = this.props; + paymentForm.validateForm().then(f => { + const { type } = paymentForm.getFormParams(); + if (f.isValid) { + if (type === "WITHHOLDING_PAY") { + // 三方缴款 弹窗,打印新开页面 + this.taxPaymentAgreementPayFeedback(); + } else { + } + } else { + f.showErrors(); + } + }); + }; + taxPaymentAgreementPayFeedback = () => { + const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth + }; + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + taxPaymentAgreementPayFeedback(payload).then(({ status, data, errormsg }) => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + if (status) { + this.handleCancel(); + this.setState({ + paymentFeedbackDialog: { + ...this.state.paymentFeedbackDialog, + visible: true, title: getLabel(111, "三方缴款详情"), + showData: data + } + }); + } else { + message.error(errormsg || getLabel(111, "缴款反馈失败!")); + } + }).catch(() => { + this.setState({ + paymentDialog: { + ...this.state.paymentDialog, + buttons: [ + + ] + } + }); + }); + }; + handlePaymentFeedback = () => { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: true, + title: getLabel(111, "获取反馈"), + buttons: [ + + ], + conditions: _.map(paymentFeedbackConditions, item => { + return { + ...item, + items: _.map(item.items, it => { + return { + ...it, + options: [ + { key: "WITHHOLDING_PAY", showname: getLabel(111, "三方缴款") }, + { key: "WITHHOLDING_VOUCHER", showname: getLabel(111, "缴款凭证打印") } + ] + }; + }) + }; + }) + } + }); + }; + handleCancel = () => { + const { paymentDialog } = this.state; + this.setState({ + paymentDialog: { + ...paymentDialog, visible: false, + title: "", buttons: [], conditions: null + } + }); + }; + + render() { + const { paymentDialog, paymentFeedbackDialog } = this.state; + return ( + + + + { + this.setState({ + paymentFeedbackDialog: { + ...paymentFeedbackDialog, + visible: false, title: "", showData: {} + } + }, () => this.props.updateDeclare()); + }} + /> + + ); + } +} + +export default PaymentFeedbackBtn; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js index 1bdef10b..c21c438c 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js @@ -47,6 +47,10 @@ class TaxDeclarationInfo extends Component { return
{item["label"]}: {declareInfo[item["key"]]} + { + item.key === "taxPaidAmount" && + {getLabel(111, "元")} + }
; }) } diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index c47d1fcc..9c8b0ccc 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -8,25 +8,48 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTab, WeaTable } from "ecCom"; import { Button, message } from "antd"; import TaxDeclarationInfo from "./components/taxDeclarationInfo"; +import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings"; +import PaymentBtn from "./components/paymentBtn"; +import PaymentFeedbackBtn from "./components/paymentFeedbackBtn"; import { getDeclareInfo, getDetailList, getTaxDeclarationTab, + taxdeclaratioGetCancelFeedback, taxdeclarationDeclare, + taxdeclarationGetDeclareFeedback, taxdeclarationGetRate, - taxdeclarationRefreshData + taxdeclarationRefreshData, + taxdeclaratioUpdateCancel, + taxdeclaratioUpdateDeclare, + taxPaymentVoucherStatusSync, + taxPaymentWithheldVoucherGet } from "../../apis/declare"; -import { getQueryString } from "../../util/url"; +import { convertToUrlString, getQueryString } from "../../util/url"; import "./index.less"; const { getLabel } = WeaLocaleProvider; +const APIFox = { + refresh: taxdeclarationRefreshData, //刷新数据 + declare: taxdeclarationDeclare, //在线申报 + feedback: taxdeclarationGetDeclareFeedback,//申报反馈 + correct: taxdeclaratioUpdateDeclare,//更正申报 + cancel: taxdeclaratioUpdateCancel,//作废申报 + cancelFeedback: taxdeclaratioGetCancelFeedback//作废反馈 +}; + class Index extends Component { constructor(props) { super(props); this.state = { tabs: [], selectedKey: "", columns: [], dataSource: [], - loading: { query: false, refresh: false, declare: false }, + loading: { + query: false, refresh: false, declare: false, feedback: false, + correct: false, cancel: false, cancelFeedback: false, refreshingPay: false, + issuance: false + }, + intelCalcSalaryStatus: false, //智能算薪 总开关是否开启 declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 } }; this.timer = null; @@ -37,16 +60,18 @@ class Index extends Component { } init = async () => { - const [tabsResult, infoResult] = await Promise.all([this.getTaxDeclarationTab(), this.getDeclareInfo()]); + 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; this.setState({ tabs: tabStatus ? _.map(tabDataSource, it => ({ viewcondition: `${it.incomeCategory}%%${it.taxDeclarationId}`, title: it.tabName })) : this.state.tabs, selectedKey: tabStatus ? `${_.take(tabDataSource)[0].incomeCategory}%%${_.take(tabDataSource)[0].taxDeclarationId}` : this.state.selectedKey, - declareInfo: infoStatus ? infoDataSource : this.state.declareInfo + declareInfo: infoStatus ? infoDataSource : this.state.declareInfo, + intelCalcSalaryStatus: calcStatus && calcSalaryStatus }); this.getDetailList(); }; @@ -64,6 +89,9 @@ class Index extends Component { getDeclareInfo = () => { return getDeclareInfo({ id: getQueryString("id") }); }; + apiflowBillingConfigStatus = () => { + return apiflowBillingConfigStatus(); + }; taxdeclarationGetRate = (index) => { return taxdeclarationGetRate({ index }); }; @@ -91,84 +119,116 @@ class Index extends Component { } }).catch(() => this.setState({ loading: { ...loading, query: false } })); }; - taxdeclarationRefreshData = () => { - this.setState({ loading: { ...this.state.loading, refresh: true } }); - taxdeclarationRefreshData({ taxDeclareRecordId: getQueryString("id") }).then(async ({ status, data, errormsg }) => { - this.setState({ loading: { ...this.state.loading, refresh: false } }); - if (status) { - 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) { + handleOperateDeclare = (type) => { + const loadingTxt = { + refresh: getLabel(111, "刷新中..."), //刷新数据 + declare: getLabel(111, "申报中..."), //在线申报 + feedback: getLabel(111, "反馈中..."),//申报反馈 + correct: getLabel(111, "更正申报中..."),//更正申报 + cancel: getLabel(111, "作废申报中..."),//作废申报 + cancelFeedback: getLabel(111, "作废反馈中...")//作废反馈 + }, successTxt = { + refresh: getLabel(111, "刷新数据成功!"), //刷新数据 + declare: getLabel(111, "在线申报成功!"), //在线申报 + feedback: getLabel(111, "申报反馈成功!"),//申报反馈 + correct: getLabel(111, "更正申报成功!"),//更正申报 + cancel: getLabel(111, "作废申报成功!"),//作废申报 + cancelFeedback: getLabel(111, "作废反馈成功!")//作废反馈 + }, failTxt = { + refresh: getLabel(111, "刷新数据失败!"), //刷新数据 + declare: getLabel(111, "在线申报失败!"), //在线申报 + feedback: getLabel(111, "申报反馈失败!"),//申报反馈 + correct: getLabel(111, "更正申报失败!"),//更正申报 + cancel: getLabel(111, "作废申报失败!"),//作废申报 + cancelFeedback: getLabel(111, "作废反馈失败!")//作废反馈 + }; + this.setState({ loading: { ...this.state.loading, [type]: true } }); + APIFox[type]({ taxDeclareRecordId: getQueryString("id") }) + .then(async ({ status, data, errormsg }) => { + if (status) { + message.destroy(); + message.loading(loadingTxt[type], 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) { + this.setState({ loading: { ...this.state.loading, [type]: false } }); + clearInterval(this.timer); + message.destroy(); + message.success(successTxt[type]); + const promise = type === "refresh" ? await this.init() : await this.declare(); + } + } else { + this.setState({ loading: { ...this.state.loading, [type]: false } }); clearInterval(this.timer); message.destroy(); - message.success(getLabel(111, "刷新数据成功!")); - const promise = this.init(); + message.warning(msg || failTxt[type]); + const promise = type === "refresh" ? await this.init() : await this.declare(); } - } 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(() => { + }, 1000); + } else { + this.setState({ loading: { ...this.state.loading, [type]: false } }); + clearInterval(this.timer); + message.destroy(); + message.warning(errormsg); + } + }).catch(() => { message.destroy(); clearInterval(this.timer); - this.setState({ loading: { ...this.state.loading, refresh: false } }); + this.setState({ loading: { ...this.state.loading, [type]: 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 } }); + taxPaymentVoucherStatusSync = () => { + const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth + }; + this.setState({ loading: { ...this.state.loading, refreshingPay: true } }); + taxPaymentVoucherStatusSync(payload).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, refreshingPay: false } }); if (status) { - 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); + message.success(getLabel(111, "刷新成功!")); + const promise = this.declare(); } else { - clearInterval(this.timer); - message.destroy(); - message.warning(errormsg); + message.error(errormsg || getLabel(111, "刷新失败!")); } - }).catch(() => { - message.destroy(); - clearInterval(this.timer); - this.setState({ loading: { ...this.state.loading, declare: false } }); - }); + }).catch(() => this.setState({ loading: { ...this.state.loading, refreshingPay: false } })); + }; + getEnterprisePayCertificate = () => { + const { taxAgentId, taxCycle: taxYearMonth } = this.state.declareInfo; + const payload = { + taxDeclareRecordId: getQueryString("id"), + taxAgentId, taxYearMonth + }; + 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 } })); }; render() { - const { tabs, selectedKey, columns, pageInfo, dataSource, loading, declareInfo } = this.state; + const { + tabs, + selectedKey, + columns, + pageInfo, + dataSource, + loading, + declareInfo, + intelCalcSalaryStatus + } = this.state; let btns = [ , - , - ]; const pagination = { @@ -188,8 +248,54 @@ class Index extends Component { }, () => this.getDetailList()); } }; + //申报状态:作废中 + declareInfo.declareStatus === "DECLARE_CANCELLING" && (btns.splice(1, 2, )); + //申报状态:申报中 declareInfo.declareStatus === "DECLARING" && (btns.splice(1, 2, )); + type="ghost" loading={loading.feedback} + onClick={() => this.handleOperateDeclare("feedback")}>{getLabel(111, "申报反馈")})); + //申报状态:缴款中 + declareInfo.declareStatus === "DECLARE_SUCCESS_PAYING" && (btns.splice(1, 2)); + //申报状态:已缴款 + declareInfo.declareStatus === "DECLARE_SUCCESS_PAID" && (btns.splice(1, 2, + )); + //申报状态:申报成功,无需缴款 + declareInfo.declareStatus === "DECLARE_SUCCESS_NO_PAY" && + (btns.splice(1, 2, + , + + )); + //申报状态:申报成功,未缴款 + declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID" && + (btns.splice(1, 2, + , + , + + )); + if (!intelCalcSalaryStatus) { + if (["NOT_DECLARE", "DECLARE_FAIL"].includes(declareInfo.declareStatus)) { + btns.splice(1, 1); + } + } + if (intelCalcSalaryStatus && (declareInfo.declareStatus === "DECLARE_SUCCESS_UNPAID")) { + btns.push(, ); + } + if (intelCalcSalaryStatus && declareInfo.taxPaidAmount && parseFloat(declareInfo.taxPaidAmount) > 0) { + btns.push(); + } return (
diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.less b/pc4mobx/hrmSalary/pages/declareDetail/index.less index fd68c885..17bbe3aa 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.less +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.less @@ -113,3 +113,64 @@ } } + +.paymentDialog { + .ant-modal-title { + .text-elli { + color: #111; + font-weight: 700; + } + } + + .paymentDialogContent { + padding: 16px 25px; + background: #f6f6f6; + + .wea-search-group { + border: 1px solid #e5e5e5; + padding: 0; + border-bottom: none; + + .ant-row, .ant-col-24 { + padding: 0; + } + + .wea-form-item { + padding: 5px 16px; + background: #fff; + border-bottom: 1px solid #e5e5e5; + } + } + } + + .with-holding-pay-detail { + display: flex; + flex-direction: column; + padding: 16px; + + & > div { + line-height: 32px; + } + + .status { + height: 32px; + display: flex; + align-items: center; + justify-content: center; + color: #8ED36E; + } + + .line { + display: flex; + height: 32px; + align-items: center; + + .label { + width: 30%; + flex-grow: 0; + flex-shrink: 0; + } + + } + } +} diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js index 66cd64fe..97da8170 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js @@ -119,7 +119,7 @@ class Index extends Component { } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - this.setState({ pageInfo: { ...pageInfo, current, pageSize } }); + this.setState({ pageInfo: { ...this.state.pageInfo, current, pageSize } }); } else if (id === "EDIT") { this.setState({ declareEditDialog: { diff --git a/pc4mobx/hrmSalary/pages/enterprisePayCertificationDetail/index.js b/pc4mobx/hrmSalary/pages/enterprisePayCertificationDetail/index.js new file mode 100644 index 00000000..2be080e2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/enterprisePayCertificationDetail/index.js @@ -0,0 +1,58 @@ +/* + * Author: 黎永顺 + * name: 在线申报-个税开具证明查看页面 + * Description: + * Date: 2023/8/23 + */ +import React, { Component } from "react"; +import { message } from "antd"; +import { getQueryString } from "../../util/url"; +import { taxPaymentWithheldVoucherGet } from "../../apis/declare"; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, + dataSource: [] + }; + } + + componentDidMount() { + this.getEnterprisePayCertificate(); + } + + getEnterprisePayCertificate = () => { + const payload = { + taxDeclareRecordId: getQueryString("taxDeclareRecordId"), + taxAgentId: getQueryString("taxAgentId"), + taxYearMonth: getQueryString("taxYearMonth") + }; + this.setState({ loading: true }); + taxPaymentWithheldVoucherGet(payload).then(({ status, data, errormsg }) => { + this.setState({ loading: false }); + if (status && !_.isEmpty(data.vouchers)) { + this.setState({ + dataSource: data.vouchers + }); + } else { + message.error(errormsg || ""); + } + }).catch(() => this.setState({ loading: false })); + }; + + render() { + const { dataSource, loading } = this.state; + return ( +
+ { + !_.isEmpty(dataSource) && +