diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 89c47341..a7641065 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -126,3 +126,11 @@ export const employeeDelete = (params) => { export const employeedeclareDeclare = (params) => { return postFetch("/api/bs/hrmsalary/employeedeclare/declare", params); }; + +//个税在线对接-获取个税申报记录下的个税申报表TAB +export const getTaxDeclarationTab = params => { + return WeaTools.callApi("/api/bs/hrmsalary/taxdeclaration/getTaxDeclarationTab", "GET", params); +}; + + + diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 008aba13..f5c32c4d 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -20,6 +20,7 @@ import Payroll from "./pages/payroll"; import PayrollGrant from "./pages/payroll/payrollGrant"; import PayrollDetail from "./pages/payroll/payrollDetail"; import Declare from "./pages/declare"; +import DeclareDetail from "./pages/declareDetail"; import Employeedeclare from "./pages/employeedeclare"; import EmployeedeclareDetail from "./pages/employeedeclareDetail"; import TaxRate from "./pages/taxRate"; @@ -157,6 +158,7 @@ const Routes = ( component={TemplatePreview} /> + { + saveDeclare({ + salaryMonth: moment(date).startOf("month").format("YYYY-MM-DD"), + taxAgentId, + description + }).then(() => { this.setState({ loading: false }); this.props.onGenerate(); }).catch(() => { diff --git a/pc4mobx/hrmSalary/pages/declare/index.js b/pc4mobx/hrmSalary/pages/declare/index.js index 57e37c37..91b7ea6d 100644 --- a/pc4mobx/hrmSalary/pages/declare/index.js +++ b/pc4mobx/hrmSalary/pages/declare/index.js @@ -154,13 +154,10 @@ export default class Declare extends React.Component { render: (text, record) => { return ( - { - window.open( - "/spa/hrmSalary/static/index.html#/main/hrmSalary/generateDeclarationDetail?id=" + - record.id - ); - }}> + 查看 { diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/declareResultDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/declareResultDialog.js new file mode 100644 index 00000000..9b5fa4bf --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/declareResultDialog.js @@ -0,0 +1,82 @@ +/* + * Author: 黎永顺 + * name: 个税申报-异常、失败详情 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { Button, Col, Row } from "antd"; + +const { getLabel } = WeaLocaleProvider; + +class DeclareResultDialog extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, columns: [], dataSource: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + } + + + render() { + const { loading, columns, dataSource, pageInfo } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => { + }); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => { + }); + } + }; + return ( + + + {this.props.title} + + + + + )} + style={{ + width: 1150, + height: 606.6, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > +
+ +
+
+ ); + } +} + +export default DeclareResultDialog; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js new file mode 100644 index 00000000..1717b1a7 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/taxDeclarationInfo.js @@ -0,0 +1,71 @@ +/* + * Author: 黎永顺 + * name: 个税申报表详情-基本信息 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider } from "ecCom"; +import DeclareResultDialog from "./declareResultDialog"; + +const { getLabel } = WeaLocaleProvider; + +class TaxDeclarationInfo extends Component { + constructor(props) { + super(props); + this.state = { + resDialog: { + visible: false, title: "" + } + }; + } + + handleSeeResult = (type, title) => { + this.setState({ + resDialog: { ...this.state.resDialog, visible: true, title: `${title}${getLabel(111, "详情")}` } + }); + }; + + render() { + const { resDialog } = this.state; + const { declareInfo } = this.props; + const infoItem = [ + { 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, "已缴金额") } + ]; + return ( +
+
+ { + _.map(infoItem, item => { + return
+ {item["label"]} + {declareInfo[item["key"]]} +
; + }) + } +
+
+ this.handleSeeResult("abnormal", getLabel(111, "申报校验异常"))}>{getLabel(111, "申报校验异常")}(0) + this.handleSeeResult("fail", getLabel(111, "申报失败数据"))}>{getLabel(111, "申报失败数据")}(0) + { + this.setState({ + resDialog: { ...resDialog, visible: false, title: "" } + }); + }} + /> +
+
+ ); + } +} + +export default TaxDeclarationInfo; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js new file mode 100644 index 00000000..f483dff9 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -0,0 +1,122 @@ +/* + * Author: 黎永顺 + * name: 个税查看详情页面 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTab, WeaTable } from "ecCom"; +import { Button } from "antd"; +import TaxDeclarationInfo from "./components/taxDeclarationInfo"; +import { getDeclareInfo, getDetailList, getTaxDeclarationTab } from "../../apis/declare"; +import { getQueryString } from "../../util/url"; +import "./index.less"; + +const { getLabel } = WeaLocaleProvider; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + tabs: [], selectedKey: "", columns: [], + loading: { query: false }, dataSource: [], + declareInfo: {}, pageInfo: { current: 0, pageSize: 10, total: 0 } + }; + } + + + componentDidMount() { + const promise = this.init(); + } + + init = async () => { + const [tabsResult, infoResult] = await Promise.all([this.getTaxDeclarationTab(), this.getDeclareInfo()]); + const { data: tabDataSource, status: tabStatus } = tabsResult; + const { data: infoDataSource, status: infoStatus } = infoResult; + 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 + }); + this.getDetailList(); + }; + refresh = async () => { + }; + getTaxDeclarationTab = () => { + return getTaxDeclarationTab({ id: getQueryString("id") }); + }; + getDeclareInfo = () => { + return getDeclareInfo({ id: getQueryString("id") }); + }; + getDetailList = () => { + const { loading, pageInfo, selectedKey } = this.state; + const [incomeCategory, taxDeclarationId] = selectedKey.split("%%"); + const payload = { + ...pageInfo, incomeCategory, taxDeclarationId, + taxDeclareRecordId: getQueryString("id") + }; + this.setState({ loading: { ...loading, query: true } }); + getDetailList(payload).then(({ status, data }) => { + this.setState({ loading: { ...loading, query: false } }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, + columns: _.map(columns, (it, idx) => { + if (idx <= 1) { + return { ...it, width: 150, fixed: "left" }; + } + return { ...it, width: 150 }; + }) + }); + } + }).catch(() => this.setState({ loading: { ...loading, query: false } })); + }; + + render() { + const { tabs, selectedKey, columns, pageInfo, dataSource, loading, declareInfo } = this.state; + const pagination = { + ...pageInfo, + showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, + showQuickJumper: true, + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"], + onShowSizeChange: (current, pageSize) => { + this.setState({ + pageInfo: { ...pageInfo, current, pageSize } + }, () => this.getDetailList()); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.getDetailList()); + } + }; + return ( +
+ +
+ {getLabel(17416, "导出")}, + , + + ]} + /> + +
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.less b/pc4mobx/hrmSalary/pages/declareDetail/index.less new file mode 100644 index 00000000..fc345f7d --- /dev/null +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.less @@ -0,0 +1,84 @@ +.declareDetail-layout { + .declareDetail-layout-content { + padding: 0 16px; + } +} + +.taxDeclarationInfo_layout { + border-bottom: 1px solid #e5e5e5; + height: 48px; + padding: 0 16px; + font-size: 12px; + color: #111; + display: flex; + justify-content: space-between; + align-items: center; + + .base-info { + display: flex; + align-items: center; + justify-content: flex-start; + + .info-item { + margin-right: 25px; + + .label { + color: #666; + } + + .value { + color: #111; + } + } + } + + .weapp-salary-btn-flex { + display: flex; + align-items: center; + justify-content: flex-end; + cursor: auto; + } + + .tools-line { + font-size: 12px; + display: flex; + align-items: center; + color: #111; + + .item { + margin-left: 8px; + cursor: pointer; + } + } +} + +.declareResultDialog { + .declareResultDialogTitle { + display: flex; + align-items: center; + + .declareResultDialogTitle-left { + text-align: left; + + .title { + color: #111; + font-weight: 700; + } + } + + .declareResultDialogTitle-right { + text-align: right; + } + } + + .declareResultDialogContent { + height: 100%; + padding: 16px; + background: #f6f6f6; + + .declareTable { + background: #FFF; + } + + } +} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemSelectDialog.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemSelectDialog.js index 137b8067..424f3294 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemSelectDialog.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemSelectDialog.js @@ -15,7 +15,7 @@ class LedgerSalaryItemSelectDialog extends Component { constructor(props) { super(props); this.state = { - pageInfo: { current: 1, pageSize: 10, total: 0 }, + pageInfo: { current: 1, pageSize: 20, total: 0 }, loading: false, columns: [], dataSource: [], keywords: "" }; @@ -57,7 +57,7 @@ class LedgerSalaryItemSelectDialog extends Component { showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, showSizeChanger: true, - pageSizeOptions: ["10", "20", "50", "100"], + pageSizeOptions: ["20", "50", "100"], onShowSizeChange: (current, pageSize) => { this.setState({ pageInfo: { ...pageInfo, current, pageSize } @@ -89,7 +89,7 @@ class LedgerSalaryItemSelectDialog extends Component { )} style={{ - width: 600, + width: 850, height: 606.6, minHeight: 200, minWidth: 380,