diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 85805d5c..5f74cc6b 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -278,5 +278,23 @@ export const getCompareSobConfig = params => { export const updateSobConfig = params => { return WeaTools.callApi("/api/bs/hrmsalary/salaryacct/updateSobConfig", "GET", params); }; - - +//薪资核算-计算个税 +export const acctresultCalcTax = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTax", params); +}; +//薪资核算-获取个税计算反馈 +export const calcTaxFeedback = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/calcTaxFeedback", params); +}; +//薪资核算-人员异常 +export const listPage4NotDeclare = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctemployee/listPage4NotDeclare", params); +}; +// 核算结果--核算税后工资 +export const afterTaxAccounting = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/acctresult/afterTaxAccounting", params); +}; +// 核算税后工资进度条 +export const getAfterTaxAccountingProgress = (id) => { + return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); +}; diff --git a/pc4mobx/hrmSalary/apis/declare.js b/pc4mobx/hrmSalary/apis/declare.js index 746bcf99..7574b18a 100644 --- a/pc4mobx/hrmSalary/apis/declare.js +++ b/pc4mobx/hrmSalary/apis/declare.js @@ -254,7 +254,7 @@ export const employeedeclareExportTemplate = params => { }; //个税申报表申报数据-下载申报内置算税结果 export const exportGetDeclareTaxResultFeedback = params => { - return postExportFetch("/api/bs/hrmsalary/taxdeclaration/exportGetDeclareTaxResultFeedback", params); + return postExportFetch("/api/bs/hrmsalary/taxdeclaration/exportGetCompanyIncomes", params); }; //个税申报表申报数据-数据导入 export const taxdeclarationImportData = (params) => { diff --git a/pc4mobx/hrmSalary/apis/ledger.js b/pc4mobx/hrmSalary/apis/ledger.js index 9c9d625e..59f898d4 100644 --- a/pc4mobx/hrmSalary/apis/ledger.js +++ b/pc4mobx/hrmSalary/apis/ledger.js @@ -25,6 +25,10 @@ export const deleteLedger = params => { export const getLedgerBasicForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/basic/getForm", "get", params); }; +//薪资帐套基本信息工资类型接口 +export const getIncomeCategoryList = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/incomeCategoryList", "get", params); +}; //保存薪资帐套基本信息 export const saveLedgerBasic = params => { @@ -143,6 +147,10 @@ export const getBackitemForm = params => { export const taxreportruleGetForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxreportrule/getForm", "GET", params); }; +//薪资账套下的个税字段对应-个税字段对应 +export const taxruleGetForm = params => { + return WeaTools.callApi("/api/bs/hrmsalary/salarysob/taxrule/getForm", "GET", params); +}; //薪资账套下的个税申报-累计字段对应 export const addupruleGetForm = params => { return WeaTools.callApi("/api/bs/hrmsalary/salarysob/adduprule/getForm", "GET", params); @@ -151,6 +159,10 @@ export const addupruleGetForm = params => { export const taxreportruleSave = params => { return postFetch("/api/bs/hrmsalary/salarysob/taxreportrule/save", params); }; +//保存薪资账套下的个税字段对应规则 +export const taxruleSave = params => { + return postFetch("/api/bs/hrmsalary/salarysob/taxrule/save", params); +}; //保存薪资账套下的累计字段对应关系 export const addupruleSave = params => { return postFetch("/api/bs/hrmsalary/salarysob/adduprule/save", params); diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index b78fac43..48fcecb2 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; import { convertToUrlString } from "../util/url"; //工资单-工资单发放列表 @@ -244,3 +244,12 @@ export const getSmsSalaryItemSet = (params) => { export const genPdfBeforeExport = (params) => { return WeaTools.callApi("/api/bs/hrmsalary/salaryBill/genPdfBeforeExport", "GET", params); }; +//工资单预览 +export const salaryBillPreview = (params) => { + return postFetch("/api/bs/hrmsalary/salaryBill/preview", params); +}; +// 工资单查看详情导出-重构 +export const exportDetailList_reconfig = (params) => { + return postExportFetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", params); +}; + diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index b5f4f87f..f52953bb 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //通用字典表 {enumClass:""} export const commonEnumList = (params) => { @@ -75,3 +75,7 @@ export const reportGetForm = params => { export const saveSalarySendFeedback = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params); }; +// 数据分析列表导出 +export const exportDataReport = (params) => { + return postExportFetch("/api/bs/hrmsalary/report/statistics/report/exportData", params); +}; diff --git a/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js new file mode 100644 index 00000000..69766076 --- /dev/null +++ b/pc4mobx/hrmSalary/components/custom-title/weaReqTitle/index.js @@ -0,0 +1,17 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaReqTop } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + return ( + } iconBgcolor="#F14A2D" + showDropIcon={false} tabDatas={this.props.tabDatas} {...this.props} + /> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js new file mode 100644 index 00000000..d265c8eb --- /dev/null +++ b/pc4mobx/hrmSalary/components/custom-title/weaTopTitle/index.js @@ -0,0 +1,15 @@ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; + +const getLabel = WeaLocaleProvider.getLabel; + +class Index extends Component { + render() { + return ( + } + iconBgcolor="#F14A2D" {...this.props}/> + ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js index 91f3e690..0afc13f4 100644 --- a/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js +++ b/pc4mobx/hrmSalary/components/importDialog/components/impStep2.js @@ -5,9 +5,11 @@ * Date: 2023/9/5 */ import React, { Component } from "react"; -import { WeaTable } from "ecCom"; +import { WeaLocaleProvider, WeaTable } from "ecCom"; import { postFetch } from "../../../util/request"; +const { getLabel } = WeaLocaleProvider; + class ImpStep2 extends Component { constructor(props) { super(props); @@ -41,9 +43,15 @@ class ImpStep2 extends Component { render() { const { dataSource, columns, loading } = this.state; const { scrollHeight } = this.props; + const pagination = { + showTotal: total => `${getLabel(111, "共")} ${total} ${getLabel(111, "条")}`, + total: dataSource.length, + showSizeChanger: true + }; return ( ); } diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index d2305b86..cd4380b1 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -24,7 +24,7 @@ import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页 // import Payroll from "./pages/payroll"; import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面 import PayrollGrant from "./pages/payroll/payrollGrant"; -import PayrollDetail from "./pages/payroll/payrollDetail"; +import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail"; // import Declare from "./pages/declare"; import DeclareDetail from "./pages/declareDetail"; import DeclareOnlineComparison from "./pages/declareOnlineComparison"; diff --git a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js index d2c71fb3..d1fd2bb9 100644 --- a/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js +++ b/pc4mobx/hrmSalary/pages/adjustSalaryManage/index.js @@ -97,7 +97,7 @@ class Index extends Component { effectiveTime: effectiveTime1 ? `${effectiveTime1},${effectiveTime2}` : "", operateTime: operateTime1 ? `${operateTime1},${operateTime2}` : "" }; - window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_target"); + window.open(`${window.location.origin}/api/bs/hrmsalary/salaryArchive/adjustRecord/exportSalaryItemList?${convertToUrlString(payload)}`, "_blank"); this.handleDebounce = null; }, 500); } diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js index 66538450..3f01a8bf 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/salaryDetails.js @@ -37,7 +37,7 @@ class SalaryDetails extends Component { componentWillReceiveProps(nextProps, nextContext) { if (nextProps.isQuery !== this.props.isQuery) this.setState({ - pageInfo: { ...this.state.pageInfo, current: 1 } + pageInfo: { ...this.state.pageInfo, current: 1 }, updateSum: true }, () => this.getSalaryList(nextProps)); } @@ -56,7 +56,7 @@ class SalaryDetails extends Component { const { pageNum: current, size: pageSize } = params; this.setState({ pageInfo: { ...pageInfo, current, pageSize }, - updateSum: true + updateSum: false }, () => this.getSalaryList(this.props)); } else if (id === "CHECKBOX") { const { selectedRowKeys: checkBox } = params; @@ -99,13 +99,17 @@ class SalaryDetails extends Component { }).catch(() => this.setState({ loading: false })); }; handleExportSalaryList = (key) => { + const { attendanceStore: { tableStore } } = this.props; let { selectedRowKeys, payload } = this.state; if (key === "SELECTED" && selectedRowKeys.length === 0) { message.warning(getLabel(543345, "请选择需要导出的数据!")); return; } WeaLoadingGlobal.start(); - const promise = API.exportSalaryList({ ...payload, ids: key === "SELECTED" ? selectedRowKeys : [] }); + const promise = API.exportSalaryList({ + ...payload, ids: key === "SELECTED" ? selectedRowKeys : [], + columns: _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true" && item.dataIndex !== "acctTimes"), o => o.dataIndex) + }); }; getColumns = () => { const { attendanceStore: { tableStore } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js index 129d9cb7..2380cfae 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/baseInfo.js @@ -5,7 +5,7 @@ * Date: 2023/9/25 */ import React, { Component } from "react"; -import { WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; +import { WeaBrowser, WeaHelpfulTip, WeaLocaleProvider, WeaSearchGroup } from "ecCom"; import cs from "classnames"; import { Col, Row } from "antd"; import "./index.less"; @@ -13,6 +13,48 @@ import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; class EditSalaryBaseInfo extends Component { + componentWillReceiveProps(nextProps, nextContext) { + if (this.props.visible !== nextProps.visible && nextProps.visible && !_.isEmpty(nextProps.baseInfo)) { + nextProps.onChange(_.map(nextProps.baseInfo, it => { + const { fieldValue, canEdit, fieldValueObj } = it; + if (canEdit) { + const { id: value, name: valueSpan } = fieldValueObj || fieldValue; + return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; + } + return { ...it }; + })); + } + } + + renderBrowser = (item) => { + const { fieldType, fieldValue, fieldCode } = item; + const { id: value, name: valueSpan } = fieldValue; + let browserType = {}; + switch (fieldType) { + case "subcompanyBrowser": + browserType = { ...browserType, type: 164, title: getLabel(111, "选择分部") }; + break; + case "departmentBrowser": + browserType = { ...browserType, type: 4, title: getLabel(111, "选择部门") }; + break; + case "jobtitleBrowser": + browserType = { ...browserType, type: 24, title: getLabel(111, "选择岗位") }; + break; + case "jobcallBrowser": + browserType = { ...browserType, type: 260, title: getLabel(111, "选择职称") }; + break; + default: + break; + } + return this.props.onChange(_.map(this.props.baseInfo, it => { + if (fieldCode === it.fieldCode) { + return { ...it, fieldValue: value, fieldValueObj: { id: value, name: valueSpan } }; + } + return { ...it }; + }))}/>; + }; + render() { const { baseInfo } = this.props; return ( @@ -32,7 +74,7 @@ class EditSalaryBaseInfo extends Component { { _.map(baseInfo, (item, index) => { - const { fieldName, fieldValue } = item; + const { fieldName, fieldType, fieldValue, fieldValueObj } = item; return ( {fieldName} - {fieldValue} + + { + fieldType.indexOf("Browser") !== -1 ? + this.renderBrowser({ ...item, fieldValue: fieldValueObj || fieldValue }) : + fieldValue + } + diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js index 16cacd2c..0943bd38 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editSalaryCalcSlide.js @@ -5,7 +5,7 @@ * Date: 2023/9/25 */ import React, { Component } from "react"; -import { Button, message } from "antd"; +import { Button, message, Modal } from "antd"; import { WeaLocaleProvider, WeaSlideModal, WeaTab } from "ecCom"; import EditSalaryBaseInfo from "./baseInfo"; import PayrollItemsTable from "../../../../calculateDetail/payrollItemsTable"; @@ -87,9 +87,16 @@ class EditSalaryCalcSlide extends Component { }; save = () => { const { id: salaryAcctEmpId } = this.props; - const { issuedAndReissueItems, itemsByGroup } = this.state; + const { issuedAndReissueItems, itemsByGroup, baseInfo } = this.state; + if (_.every(baseInfo, it => !it.canEdit || (it.canEdit && !it.fieldValue))) { + Modal.warning({ + title: getLabel(131329, "信息确认"), + content: getLabel(518702, "必要信息不完整,红色*为必填项!") + }); + return; + } const payload = { - salaryAcctEmpId, + salaryAcctEmpId, employeeInfos: baseInfo, items: [ ..._.reduce(itemsByGroup, (pre, cur) => { return [ @@ -133,7 +140,8 @@ class EditSalaryCalcSlide extends Component { top={0} width={60} height={100} measure={"%"} direction={"right"} title={this.renderTitle()} content={
- + this.setState({ baseInfo })}/> this.setState({ selectedKey: v })} datas={!_.isEmpty(issuedAndReissueItems) ? topTab : topTab.slice(0, 1)} diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js index 54081da1..633a5a92 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.js @@ -12,6 +12,7 @@ import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel"; import EditCalcTable from "./editCalcTable"; import SalaryMonthTip from "../salaryMonthTip"; import SalaryCalcLayout from "./salaryCalcLayout"; +import PersonAbnormalDialog from "./personAbnormalDialog"; import cs from "classnames"; import "./index.less"; @@ -22,7 +23,8 @@ class Index extends Component { super(props); this.state = { salarySobCycle: {}, showSearchAd: false, - columnDesc: {}, formulaTd: "", showTotalCell: false + columnDesc: {}, formulaTd: "", showTotalCell: false, + perAbnormalDialog: { visible: false, salaryAcctRecordId: "" } }; } @@ -50,7 +52,7 @@ class Index extends Component { }; render() { - const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state; + const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell, perAbnormalDialog } = this.state; const { routeParams: { salaryAcctRecordId } } = this.props; const formulaObj = _.get(columnDesc, [formulaTd]) || {}; return ( this.onAdSearch(false)}> @@ -65,7 +67,13 @@ class Index extends Component { style={{ marginLeft: 10 }} />
-
+
+
this.setState({ + perAbnormalDialog: { visible: true, salaryAcctRecordId } + })}>{getLabel(111, "未报送人员")}:{salarySobCycle.abnormalEmployeeNum} +
+
@@ -87,6 +95,10 @@ class Index extends Component { this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId} {...this.props} showTotalCell={showTotalCell} onShowFormulaTd={this.handleShowFormulaTa}/> + this.setState({ + perAbnormalDialog: { ...perAbnormalDialog, visible: false } + })}/>
); } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less index 3d23810b..614973f1 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/index.less @@ -14,6 +14,11 @@ padding-bottom: 0; height: 46px; margin-bottom: 0; + + .abnormal-text { + color: #ef9502; + cursor: pointer; + } } .formula-detail-area { diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js new file mode 100644 index 00000000..1498fc02 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/personAbnormalDialog.js @@ -0,0 +1,84 @@ +/* + * Author: 黎永顺 + * name: 薪资核算-人员异常 + * Description: + * Date: 2023/8/18 + */ +import React, { Component } from "react"; +import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom"; +import { listPage4NotDeclare } from "../../../../../apis/calculate"; + +const { getLabel } = WeaLocaleProvider; + +class PersonAbnormalDialog extends Component { + constructor(props) { + super(props); + this.state = { + pageInfo: { current: 1, pageSize: 10, total: 0 }, + loading: false, columns: [], dataSource: [] + }; + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible && nextProps.visible) this.queryList(nextProps); + } + + queryList = (props) => { + const { salaryAcctRecordId } = props, { pageInfo } = this.state; + const payload = { ...pageInfo, recordId: salaryAcctRecordId }; + this.setState({ loading: true }); + listPage4NotDeclare(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { columns, list: dataSource, pageNum: current, pageSize, total } = data; + this.setState({ + dataSource, pageInfo: { ...pageInfo, current, pageSize, total }, columns + }); + } else { + + } + }).catch(() => this.setState({ loading: false })); + }; + + 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 } + }, () => this.queryList(this.props)); + }, + onChange: current => { + this.setState({ + pageInfo: { ...pageInfo, current } + }, () => this.queryList(this.props)); + } + }; + return ( + +
+ +
+
+ ); + } +} + +export default PersonAbnormalDialog; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js index 0d1c87fc..2cea2f68 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/index.js @@ -9,7 +9,7 @@ import { WeaLocaleProvider, WeaReqTop } from "ecCom"; import { Button, Dropdown, Menu, message, Modal } from "antd"; import { inject, observer } from "mobx-react"; import Layout from "./layout"; -import { acctresultAccounting, getCalculateProgress, getExportField } from "../../../apis/calculate"; +import * as API from "../../../apis/calculate"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm"; import SalaryEditCalc from "./components/salaryEditCalc"; @@ -27,7 +27,7 @@ class Index extends Component { constructor(props) { super(props); this.state = { - selectedKey: "person", progressVisible: false, progress: 0, + selectedKey: "person", progressVisible: false, progress: 0, loading: { calcTax: false, feedback: false }, customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] }, salaryImpDialog: { visible: false, title: "", salaryAcctRecordId: "" }, accountExceptInfo: "" //核算报错信息, @@ -60,11 +60,11 @@ class Index extends Component { this.setState({ progress: 0 }); let payload = { salaryAcctRecordId }; if (key === "calc_selected") payload = _.assign(payload, { ids: selectedRowKeys }); - acctresultAccounting(payload).then(() => { + API.acctresultAccounting(payload).then(() => { this.setState({ progressVisible: true }); if (this.timer) clearInterval(this.timer); this.timer = setInterval(() => { - getCalculateProgress(salaryAcctRecordId).then(({ data }) => { + API.getCalculateProgress(salaryAcctRecordId).then(({ data }) => { let progress = data.progress; if (progress === 1 && this.timer) { clearInterval(this.timer); @@ -101,7 +101,7 @@ class Index extends Component { window.open(`${window.ecologyContentPath || ""}${url}`, "_blank"); break; case "export_custom": - getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + API.getExportField({ salaryAcctRecordId }).then(({ status, data }) => { if (status) { const { checkItems, itemsByGroup } = data; this.setState({ @@ -129,8 +129,71 @@ class Index extends Component { break; } }; + acctresultCalcTax = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ loading: { ...this.state.loading, calcTax: true } }); + API.acctresultCalcTax({ salaryAcctRecordId }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, calcTax: false } }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.calc.onAdSearch(false); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, calcTax: false } })); + }; + calcTaxFeedback = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ loading: { ...this.state.loading, feedback: true } }); + API.calcTaxFeedback({ salaryAcctRecordId }).then(({ status, errormsg }) => { + this.setState({ loading: { ...this.state.loading, feedback: false } }); + if (status) { + this.calc.onAdSearch(false); + Modal.confirm({ + title: getLabel(131329, "信息确认"), + content: getLabel(111, "成功获取个税信息,是否继续计算税后工资?"), + onOk: () => this.afterTaxAccounting() + }); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ loading: { ...this.state.loading, feedback: false } })); + }; + afterTaxAccounting = () => { + const { routeParams: { salaryAcctRecordId } } = this.props; + this.setState({ progress: 0 }); + let payload = { salaryAcctRecordId }; + API.afterTaxAccounting(payload).then(() => { + this.setState({ progressVisible: true }); + if (this.timer) clearInterval(this.timer); + this.timer = setInterval(() => { + API.getAfterTaxAccountingProgress(salaryAcctRecordId).then(({ data }) => { + let progress = data.progress; + if (progress === 1 && this.timer) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.success(getLabel(111, "操作完成")); + this.calc.onAdSearch(false); + } else if (!data.status) { + clearInterval(this.timer); + this.timer = null; + this.setState({ + progressVisible: false, + accountExceptInfo: data.message + }); + message.error(data.message); + } + this.setState({ progress: Number(progress) * 100 }); + }); + }, 1000); + }); + }; renderReqBtns = () => { - const { selectedKey, accountExceptInfo } = this.state; + const { selectedKey, accountExceptInfo, loading } = this.state; let reqBtns = []; switch (selectedKey) { case "calc": @@ -151,6 +214,10 @@ class Index extends Component { this.doCacl("ALL")} overlay={menu} type="primary"> {getLabel(543545, "核算所有人")} , + , + , , this.calc.openAdvanceSearch()} onAdvanceSearch={() => this.calc.onAdSearch(false)}/> diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js index 33a90a08..9d2ddfce 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/payrollItemsTable.js @@ -40,7 +40,7 @@ class PayrollItemsTable extends Component { const { canEdit, dataType, pattern } = record; return dataType === "number" ? onChangeIssueReissueValue(record.salaryItemId, value, "itemsByGroup", salarySobItemGroupId)} /> : this.setState({ targetid: "" })} > this.setState({ cumTaxPeriodDialog: { ...cumTaxPeriodDialog, visible: false, title: "", type: "" } })} diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js index cb9ce2fe..7a9046ba 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/constants.js @@ -86,6 +86,18 @@ export const paymentBankConditions = [ value: "", viewAttr: 1, options: [] + }, + { + colSpan: 1, + conditionType: "SELECT", + domkey: ["paymentNumber"], + 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 index 21b924b1..209db04f 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentBtn.js @@ -155,6 +155,12 @@ class PaymentBtn extends Component { value: !_.isEmpty(bankForm) ? bankForm.bank : "", options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.khhhh })) }; + } else if (key === "paymentNumber") { + return { + ...it, + value: !_.isEmpty(bankForm) ? bankForm.bank : "", + options: _.map(feedbacks, o => ({ key: o.sfxyh, showname: o.jkzh })) + }; } return { ...it }; }) @@ -176,15 +182,16 @@ class PaymentBtn extends Component { taxPaymentAgreemenPay = () => { const { paymentDialog } = this.state; const { taxAmount } = paymentDialog; - const { declareStore: { paymentForm } } = this.props; + const { declareStore: { paymentForm }, reportType } = this.props; const { taxCycle: taxYearMonth, taxAgentId } = this.props.declareInfo; paymentForm.validateForm().then(f => { if (f.isValid) { - const { protocolNumber } = paymentForm.getFormParams(); + const { protocolNumber, paymentNumber } = paymentForm.getFormDatas(); const payload = { taxDeclareRecordId: getQueryString("id"), taxYearMonth: taxYearMonth + "-01", - taxAgentId, taxAmount, protocolNumber + taxAgentId, taxAmount, protocolNumber: protocolNumber.value, + reportType, paymentNumber: paymentNumber.valueSpan }; this.setState({ paymentDialog: { diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js index e5ffc64f..20617418 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentDialog.js @@ -28,7 +28,8 @@ class PaymentDialog extends Component { if (key === "protocolNumber") { const { declareStore: { paymentForm } } = this.props; paymentForm.updateFields({ - count: val[key].value + count: val[key].value, + paymentNumber: val[key].value, }); } }; diff --git a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js index a65c2145..9026b928 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/components/paymentFeedbackBtn.js @@ -177,7 +177,9 @@ class PaymentFeedbackBtn extends Component { const { paymentDialog, paymentFeedbackDialog } = this.state; return ( - + {/*个税接口改造*/} + {/**/} + { const [__, taxDeclarationId] = this.state.selectedKey.split("%%"); - window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_target"); + window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/declareDetail/${taxDeclarationId}`, "_blank"); }; handleTabEdit = (tabKey, type) => { if (type === "remove") { diff --git a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js index 881338d2..920d2e12 100644 --- a/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/employeedeclareDetail/index.js @@ -148,7 +148,8 @@ class Index extends Component { "总计": getLabel(523, "总计"), "编辑": getLabel(501169, "编辑"), "操作": getLabel(30585, "操作"), "删除": getLabel(535052, "删除"), "共": getLabel(83698, "共"), "条": getLabel(18256, "条"), - "加载中": getLabel(83698, "加载中"), "作废": getLabel(111, "作废") + "加载中": getLabel(83698, "加载中") + // "作废": getLabel(111, "作废") }; const childFrameObj = document.getElementById("atdTable"); childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/incomeTaxFieldsCorresponding.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/incomeTaxFieldsCorresponding.js new file mode 100644 index 00000000..3df66b4c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/incomeTaxFieldsCorresponding.js @@ -0,0 +1,148 @@ +/* + * + * 个税字段对应 + * @Author: 黎永顺 + * @Date: 2024/6/17 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { WeaLocaleProvider, WeaSearchGroup, WeaTab } from "ecCom"; +import LedgerFieldsItemPopver from "./ledgerFieldsItemPopver"; +import { taxruleGetForm } from "../../../apis/ledger"; +import LedgerFieldsTable from "./ledgerFieldsTable"; +import uuidV4 from "uuid/v4"; + +const { getLabel } = WeaLocaleProvider; + +class IncomeTaxFields extends Component { + constructor(props) { + super(props); + this.state = { + selectedKey: "", tabs: [], + incomeTaxFields: [], keywords: "" + }; + } + + componentDidMount() { + this.taxruleGetForm(); + } + + taxruleGetForm = () => { + const { editId, saveSalarySobId } = this.props; + taxruleGetForm({ id: editId || saveSalarySobId }).then(({ status, data }) => { + if (status && !_.isEmpty(data)) { + this.setState({ + tabs: _.map(data, it => ({ viewcondition: it.incomeCategoryId, title: it.incomeCategoryName })), + selectedKey: _.take(data)[0].incomeCategoryId, + incomeTaxFields: _.map(data, it => ({ + ...it, taxReportRules: _.map(it.taxRules, o => ({ + ...o, canEdit: o.canEdit, id: uuidV4(), reportColumnDataIndex: o.taxIndex, reportColumnName: o.name, + salaryItem: [{ id: o.salaryItemId, name: o.salaryItemName }] + })) + })) + }, () => this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey)); + } + }); + }; + handleChangeSwitch = (visible, id) => { + const { incomeTaxFields, selectedKey } = this.state; + this.setState({ + incomeTaxFields: _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === selectedKey) { + return { + ...it, + taxReportRules: _.map(it.taxReportRules, child => { + if (child.id === id) { + return { ...child, visible }; + } + return { ...child, visible: false }; + }) + }; + } + return { ...it }; + }) + }, () => this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey)); + }; + handleChangeIncomeFieldsItem = (salaryItem, recordRuleId) => { + const { incomeTaxFields, selectedKey } = this.state; + this.setState({ + incomeTaxFields: _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === selectedKey) { + return { + ...it, + taxReportRules: _.map(it.taxReportRules, child => { + if (child.id === recordRuleId) { + return { ...child, visible: false, salaryItem }; + } + return { ...child, visible: false }; + }) + }; + } + return { ...it }; + }) + }, () => { + this.props.onSetTaxreportrule(this.state.incomeTaxFields, this.state.selectedKey); + }); + }; + + render() { + const { editId, saveSalarySobId } = this.props; + const { selectedKey, tabs, incomeTaxFields, keywords } = this.state; + const list = _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === selectedKey) { + return { + ...it, + taxReportRules: _.filter(it.taxReportRules, item => item.reportColumnName.indexOf(keywords) !== -1) + }; + } + return { ...it }; + }); + const dataSource = _.takeWhile(list, it => it.incomeCategoryId === selectedKey); + return ( + + this.setState({ keywords: val })} + /> +
+ } + > + + {getLabel(111, "个税申报表字段")} + {/**/} + , + width: "50%", + dataIndex: "reportColumnName" + }, + { + title: getLabel(111, "对应本账套薪资项目"), + width: "50%", + dataIndex: "salaryItem", + render: (_, record) => ( + + ) + } + ]} + dataSource={dataSource} + /> + + ); + } +} + +export default IncomeTaxFields; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less index bcdacf71..e5971341 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/index.less @@ -9,7 +9,19 @@ } } -.ledgerSlideContent { +.ledgerSlideLayout { + .wea-new-top { + .ant-col-10 { + padding-right: 45px !important; + } + } + + .wea-new-top-req-wapper .wea-new-top-req-title > div:last-child { + right: 45px !important; + } + + .ledgerSlideContent { + } } .copyWrapper { diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js index ad86439e..45022954 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerBaseSetting.js @@ -5,11 +5,11 @@ * Date: 2022/12/9 */ import React, { Component } from "react"; -import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaTextarea } from "ecCom"; +import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaLocaleProvider, WeaSelect, WeaTextarea } from "ecCom"; import { Col, Row } from "antd"; import { inject, observer } from "mobx-react"; import { baseSettingFormItem } from "../config"; -import { getLedgerBasicForm } from "../../../apis/ledger"; +import { getIncomeCategoryList, getLedgerBasicForm } from "../../../apis/ledger"; import { generateBasicInfo, getAddMonthYearMonth, @@ -18,10 +18,12 @@ import { getSubtractMonthYearMonth, prefixAddZero } from "../../../util/date"; -import { commonEnumList } from "../../../apis/ruleconfig"; import moment from "moment"; +import cs from "classnames"; import "./index.less"; +const getLabel = WeaLocaleProvider.getLabel; + @inject("taxAgentStore") @observer class LedgerBaseSetting extends Component { @@ -124,10 +126,7 @@ class LedgerBaseSetting extends Component { }); }; commonEenumList = () => { - const payload = { - enumClass: "com.engine.salary.enums.salarysob.IncomeCategoryEnum" - }; - commonEnumList(payload).then(({ status, data }) => { + getIncomeCategoryList().then(({ status, data }) => { if (status) { const { baseForm } = this.state; this.setState({ @@ -135,7 +134,16 @@ class LedgerBaseSetting extends Component { if (it.key === "taxableItems") { return { ...it, - options: _.map(data, it => ({ key: it.value.toString(), showname: it.defaultLabel })) + options: _.map(data, it => ({ + key: it.value.toString(), + showname:
+ {it.defaultLabel} + + {it.reportTypeName} + +
+ })) }; } return { ...it }; diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js index a1bce538..40887e03 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSalaryItemTable.js @@ -10,6 +10,7 @@ import LedgerSalaryItemEditSlide from "./ledgerSalaryItemEditSlide"; import { getSalaryItemForm } from "../../../apis/ledger"; import { commonEnumList } from "../../../apis/ruleconfig"; import FormalFormModal from "../../salaryItem/formalFormModal"; +import { toDecimal_n } from "../../../util"; const getLabel = WeaLocaleProvider.getLabel; @@ -88,7 +89,7 @@ class LedgerSalaryItemTable extends Component { handleEditSalaryItem = async (record) => { const { salarySobId, dataSource } = this.props, { salaryItemId, id } = record; const { - itemHide: hideDefault, + itemHide: hideDefault, defaultValue, valueType, name, description, roundingMode, formulaId, dataType, useInEmployeeSalary, pattern, canEdit, formulaContent, originFormulaContent, originSqlContent @@ -123,7 +124,7 @@ class LedgerSalaryItemTable extends Component { ...this.state.salaryItemPayload, visible: true, request: { - canEdit, dataType, description, + canEdit, dataType, description, defaultValue, formulaContent, formulaId, name, hideDefault: _.isNil(hideDefault) ? "0" : hideDefault, valueType, roundingMode, pattern, @@ -151,11 +152,12 @@ class LedgerSalaryItemTable extends Component { }); const { salaryItemId } = record; const { - hideDefault, roundingMode, pattern, valueType, - originFormulaContent, originSqlContent, formulaId + hideDefault, roundingMode, pattern, valueType, defaultValue, + originFormulaContent, originSqlContent, formulaId, dataType } = request; this.handleChangeSalaryItem({ itemHide: hideDefault.toString(), + defaultValue: dataType === "number" ? toDecimal_n(defaultValue, parseInt(pattern)) : defaultValue, roundingMode, pattern, valueType, formulaContent: valueType.toString() === "2" ? originFormulaContent : originSqlContent, formulaId: ((valueType.toString() === "3" && (!originSqlContent || originSqlContent === " ")) || (valueType.toString() === "2" && (!originFormulaContent || originFormulaContent === " ")) || valueType.toString() === "1") ? "" : formulaId, diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index 1395aed8..b04bfec4 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -8,20 +8,23 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom"; import { Button, message, Modal } from "antd"; -import SlideModalTitle from "../../../components/slideModalTitle"; import LedgerBaseSetting from "./ledgerBaseSetting"; import LedgerAssociatedPersonnel from "./ledgerAssociatedPersonnel"; import LedgerSalaryAdjustmentRules from "./ledgerSalaryAdjustmentRules"; import LedgerBackCalculatedSalaryItem from "./ledgerBackCalculatedSalaryItem"; import LedgerSalaryItem from "./ledgerSalaryItem"; import IncomeTaxFields from "./incomeTaxFields"; +import IncomeTaxFieldsCorresponding from "./incomeTaxFieldsCorresponding"; import CumulativeFields from "./cumulativeFields"; +import WeaTopTitle from "../../../components/custom-title/weaTopTitle"; +import WeaReqTitle from "../../../components/custom-title/weaReqTitle"; import { addupruleSave, saveAdjustmentRule, saveLedgerBasic, saveLedgerItem, - taxreportruleSave + taxreportruleSave, + taxruleSave } from "../../../apis/ledger"; import "./index.less"; @@ -39,6 +42,7 @@ class LedgerSlide extends Component { baseSettingInfo: {}, adjustRules: [], empFields: [], itemGroups: [], + taxruleFields: [], taxruleKeys: "", //个税字段对应 incomeTaxFields: [], incomeTaxKeys: "", //个税申报字段对应 addupruleFields: [], addupruleKeys: "", //累计字段对应 saveSalarySobId: "", @@ -100,7 +104,6 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success("保存成功"); - this.handleClose(); } else { message.success(errormsg || "保存失败"); } @@ -147,6 +150,46 @@ class LedgerSlide extends Component { } }).catch(() => this.setState({ loading: false })); }; + /* + * Author: 黎永顺 + * Description:个税字段对应-保存 + * Params: + * Date: 2023/8/16 + */ + taxRuleSave = () => { + const { editId } = this.props; + const { taxruleKeys, taxruleFields, saveSalarySobId, taxableItems } = this.state; + const payload = { + salarySobId: editId || saveSalarySobId, + incomeCategoryParams: _.map(taxruleFields, it => { + if (it.incomeCategoryId === taxruleKeys) { + return { + incomeCategory: it.incomeCategoryId, + taxRuleParams: _.map(it.taxReportRules, child => { + return { + taxIndex: child.reportColumnDataIndex, + salaryItemId: _.map(child.salaryItem, o => o.id).join(",") + }; + }) + }; + } + return { + incomeCategory: it.incomeCategoryId, + taxRuleParams: [] + }; + }) + }; + this.setState({ loading: true }); + taxruleSave(payload).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(22619, "保存成功!")); + !editId && (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && this.handleClose(); + } else { + message.error(errormsg || getLabel(22620, "保存失败!")); + } + }).catch(() => this.setState({ loading: false })); + }; /* * Author: 黎永顺 * Description:个税申报字段对应-保存 @@ -154,33 +197,29 @@ class LedgerSlide extends Component { * Date: 2023/8/16 */ taxreportruleSave = () => { - const { taxableItems, incomeTaxKeys, incomeTaxFields, saveSalarySobId } = this.state; const { editId } = this.props; - if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) { - this.saveLedgerAdjustRule(); - } else { - const payload = { - salarySobId: editId || saveSalarySobId, - incomeCategoryParams: _.map(incomeTaxFields, it => { - if (it.incomeCategoryId === incomeTaxKeys) { - return { - incomeCategory: it.incomeCategoryId, - taxReportRuleParams: _.map(it.taxReportRules, child => { - return { - reportColumnDataIndex: child.reportColumnDataIndex, - salaryItemId: _.map(child.salaryItem, o => o.id).join(",") - }; - }) - }; - } + const { incomeTaxKeys, incomeTaxFields, saveSalarySobId } = this.state; + const payload = { + salarySobId: editId || saveSalarySobId, + incomeCategoryParams: _.map(incomeTaxFields, it => { + if (it.incomeCategoryId === incomeTaxKeys) { return { incomeCategory: it.incomeCategoryId, - taxReportRuleParams: [] + taxReportRuleParams: _.map(it.taxReportRules, child => { + return { + reportColumnDataIndex: child.reportColumnDataIndex, + salaryItemId: _.map(child.salaryItem, o => o.id).join(",") + }; + }) }; - }) - }; - this.saveTaxreportrule(payload); - } + } + return { + incomeCategory: it.incomeCategoryId, + taxReportRuleParams: [] + }; + }) + }; + this.saveTaxreportrule(payload); }; saveTaxreportrule = (payload) => { this.setState({ loading: true }); @@ -200,7 +239,10 @@ class LedgerSlide extends Component { * Date: 2023/8/17 */ addupruleSave = () => { - const { taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields, addupruleKeys, saveSalarySobId } = this.state; + const { + taxableItems, incomeTaxFields, incomeTaxKeys, addupruleFields, + addupruleKeys, saveSalarySobId + } = this.state; const { editId } = this.props; if ((!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489")) { const payload = { @@ -250,27 +292,21 @@ class LedgerSlide extends Component { this.setState({ loading: false }); if (status) { message.success(getLabel(22619, "保存成功!")); + !editId && this.handleClose(); } else { message.error(errormsg || getLabel(22620, "保存失败!")); } }).catch(() => this.setState({ loading: false })); } }; - handleChangeSlideTab = (current) => { - this.setState({ current: Number(current) }); - }; - handleClose = () => { - this.setState({ current: 0 }, () => this.props.onCancel()); - }; + handleClose = () => this.setState({ current: 0, baseSettingInfo: {} }, () => this.props.onCancel()); /* * Author: 黎永顺 * Description: 基础信息字段切换 * Params: * Date: 2022/12/9 */ - handleChangeSaveParams = (baseSettingInfo) => { - this.setState({ baseSettingInfo }); - }; + handleChangeSaveParams = (baseSettingInfo) => this.setState({ baseSettingInfo }); /* * Author: 黎永顺 * Description: 薪资项目保存数据 @@ -280,179 +316,138 @@ class LedgerSlide extends Component { handleSaveSalaryItemParams = (empFields, itemGroups) => { this.setState({ empFields, itemGroups }); }; - renderChildren = () => { - const { editId } = this.props; - const { current, saveSalarySobId, taxableItems } = this.state; - let CurrentDom = null; - switch (current) { - case 0: - CurrentDom = this.setState({ taxableItems: val })} - />; - break; - case 1: - CurrentDom = ; - break; - case 2: - CurrentDom = ; - break; - case 3: - CurrentDom = ; - break; - case 4: - CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? - this.setState({ - incomeTaxFields, - incomeTaxKeys: selectedKey - })}/> : - this.setState({ - addupruleFields, - addupruleKeys: selectedKey - })}/>; - break; - case 5: - CurrentDom = (!editId && taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? - this.setState({ adjustRules })}/> : - this.setState({ - incomeTaxFields, - incomeTaxKeys: selectedKey - })}/>; - break; - case 6: - CurrentDom = - this.setState({ adjustRules })}/>; - break; - default: - CurrentDom = null; - break; - } - return CurrentDom; - }; - renderCustomOperate = () => { - const { taxAgentStore: { showOperateBtn }, editId } = this.props; - const { current, loading, taxableItems } = this.state; - let CurrentDom = []; - //管理员操作权限 - if (showOperateBtn) { - switch (current) { - case 0: - CurrentDom = [ - - ]; - break; - case 1: - CurrentDom = !editId ? [ - , - - ] : []; - break; - case 2: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; - break; - case 3: - CurrentDom = !editId ? - [ - , - , - - ] : []; - break; - case 4: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; - break; - case 5: - CurrentDom = !editId ? - [ - , - , - - ] : [ - - ]; - break; - case 6: - CurrentDom = !editId ? - [ - , - - ] : [ - - ]; - break; - default: - break; - } - } - return CurrentDom; - }; render() { + const { visible, editId, taxAgentStore: { showOperateBtn } } = this.props; + const { current, taxableItems, saveSalarySobId, loading } = this.state; let tabs = [ - { key: 0, title: getLabel(82751, "基础设置") }, - { key: 1, title: getLabel(543467, "关联人员") }, - { key: 2, title: getLabel(542362, "薪资项目") }, - { key: 3, title: getLabel(543468, "回算薪资项目") }, - { key: 4, title: getLabel(111, "累计字段对应") }, - { key: 5, title: getLabel(111, "个税申报字段对应") }, - { key: 6, title: getLabel(543469, "调薪计薪规则") } + { + key: 0, title: getLabel(82751, "基础设置"), + createBtns: [ + + ], + editBtns: [ + + ], + children: this.setState({ taxableItems: val })} + /> + }, + { + key: 1, title: getLabel(543467, "关联人员"), + createBtns: [ + , + + ], + editBtns: [], + children: + }, + { + key: 2, title: getLabel(542362, "薪资项目"), + createBtns: [ + , + , + + ], + editBtns: [ + + ], + children: + }, + { + key: 3, title: getLabel(543468, "回算薪资项目"), + createBtns: [ + , + , + + ], + editBtns: [], + children: + }, + { + key: 4, title: getLabel(543469, "调薪计薪规则"), + createBtns: [ + , + , + + ], + editBtns: [ + + ], + children: this.setState({ adjustRules })}/> + }, + { + key: 5, title: getLabel(111, "个税申报配置"), + createBtns: [ + , + , + + ], + editBtns: [], + children: this.setState({ + incomeTaxFields, + incomeTaxKeys: selectedKey + })}/> + }, + { + key: 6, title: getLabel(111, "同步个税配置"), + createBtns: + !(taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") ? + [ + , + , + + ] : [ + , + + ], + editBtns: [], + children: this.setState({ + taxruleFields, taxruleKeys: selectedKey + })}/> + }, + { + key: 7, title: getLabel(111, "累计字段对应"), + createBtns: [ + , + + ], + editBtns: [], + children: this.setState({ + addupruleFields, addupruleKeys: selectedKey + })}/> + } ]; - const { title, visible, editId, taxAgentStore: { showOperateBtn } } = this.props; - const { current, taxableItems } = this.state; - (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && (tabs = _.filter(tabs, o => o.key !== 4)); + (taxableItems && taxableItems.toString() !== "1" && taxableItems.toString() !== "489") && + (tabs = _.map(_.filter(tabs, o => o.key !== 7), (k, j) => ({ ...k, key: j }))); return ( { - }} - selectedTab={current} - customOperate={this.renderCustomOperate()} - subItemChange={this.handleChangeSlideTab} - /> + !editId ? current === o.key).createBtns}/> : + current === o.key).editBtns : []} + tabDatas={tabs} selectedKey={String(current)} + onChange={cur => this.setState({ current: parseInt(cur) })}/> } content={
@@ -486,9 +473,7 @@ class LedgerSlide extends Component { } } - { - this.renderChildren() - } + {_.find(tabs, o => current === o.key).children}
} onClose={this.handleClose} diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/index.less b/pc4mobx/hrmSalary/pages/ledgerPage/index.less index 2fc10db7..182042bf 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/index.less +++ b/pc4mobx/hrmSalary/pages/ledgerPage/index.less @@ -1,13 +1,3 @@ -.ledgerOuter { - .wea-new-top { - .ant-col-10 { - & > span:nth-child(2) { - margin-top: -6px; - } - } - } -} - .ledgerWrapper { height: 100%; diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js new file mode 100644 index 00000000..82c06533 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.js @@ -0,0 +1,27 @@ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { Button } from "antd"; +import { WeaInputSearch, WeaLocaleProvider } from "ecCom"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("payrollStore") +@observer +class Index extends Component { + render() { + const { payrollStore: { detailListConditionForm } } = this.props; + return ( +
+ detailListConditionForm.updateFields({ username: v })} + onSearch={this.props.onAdvanceSearch} + /> + +
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less new file mode 100644 index 00000000..1a3d7283 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/advanceInputBtn/index.less @@ -0,0 +1,28 @@ +.advance-search { + display: flex; + align-items: center; + position: relative; + top: -2.5px; + + .wea-advanced-search { + top: 2px; + left: -1px; + height: 28px; + line-height: 1; + border-radius: 0; + position: relative; + color: #474747; + padding: 4px 15px; + } + + .wea-advanced-search:hover { + border: 1px solid #dadada; + color: #474747; + } + + .text-elli { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } +} diff --git a/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js new file mode 100644 index 00000000..3c5e23b5 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/payroll/payrollDetail/components/salaryDetailList/index.js @@ -0,0 +1,145 @@ +/* + * + * 查看工资单详情-列表 + * @Author: 黎永顺 + * @Date: 2024/7/15 + * @Wechat: + * @Email: 971387674@qq.com + * @description: +*/ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; +import { WeaLocaleProvider } from "ecCom"; +import { Spin } from "antd"; +import { WeaTableNew } from "comsMobx"; +import * as API from "../../../../../apis/payroll"; +import { getQueryString } from "../../../../../util/url"; + +const getLabel = WeaLocaleProvider.getLabel; +const WeaTableComx = WeaTableNew.WeaTable; + +@inject("payrollStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + loading: false, dataSource: [], visible: false, updateSum: true, payload: {}, + pageInfo: { current: 1, pageSize: 10, total: 0 } + }; + } + + componentDidMount() { + window.addEventListener("message", this.handleReceive, false); + } + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.isQuery !== this.props.isQuery) this.setState({ updateSum: true }, () => this.getPayrollDetailList()); + } + + handleReceive = async ({ data }) => { + const { type, payload: { id, params } = {} } = data; + if (type === "init") { + this.getPayrollDetailList(); + } else if (type === "turn") { + switch (id) { + case "PAGEINFO": + const { pageNum: current, size: pageSize } = params; + this.setState({ + pageInfo: { ...this.state.pageInfo, current, pageSize }, + updateSum: false + }, () => this.getPayrollDetailList()); + break; + default: + break; + } + } + }; + getPayrollDetailList = () => { + const { pageInfo } = this.state; + const salarySendId = getQueryString("id"); + const { payrollStore: { detailListConditionForm: form, salaryTableStore } } = this.props; + const payload = { + salarySendId, ...pageInfo, ...form.getFormParams(), + departmentIds: form.getFormParams().departmentIds ? form.getFormParams().departmentIds.split(",") : [], + subCompanyIds: form.getFormParams().subCompanyIds ? form.getFormParams().subCompanyIds.split(",") : [] + }; + this.setState({ loading: true }); + API.getPayrollDetailList(payload).then(({ status, data }) => { + this.setState({ loading: false }); + if (status) { + const { dataKey, pageInfo: pageResult, datas: dataSource } = data; + const { datas } = dataKey; + const { pageNum: current, pageSize, total } = pageResult; + salaryTableStore.getDatas(datas); + this.setState({ payload, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } }); + } + }); + }; + getColumns = () => { + const { payrollStore: { salaryTableStore }, showTotalCell } = this.props; + const { dataSource, pageInfo, selectedRowKeys, payload, updateSum } = this.state; + const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true"); + const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryBill/send/sum" : ""; + if (!_.isEmpty(columns)) { + this.postMessageToChild({ + dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, + tableScrollHeight: pageInfo.total === 0 ? 90 : 156, + sumRowlistUrl, payload: { ...payload, updateSum }, + columns: _.map(columns, (it, idx) => ({ + ...it, width: it.oldWidth, fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "", + ellipsis: true + })) + }); + } + return []; + }; + postMessageToChild = (payload) => { + const i18n = { + "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), + "总计": getLabel(523, "总计") + }; + const childFrameObj = document.getElementById("atdTable"); + childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); + }; + handleSetCustomCols = () => { + const { payrollStore: { salaryTableStore } } = this.props; + this.setState({ updateSum: true }, () => { + salaryTableStore.setColSetVisible(true); + salaryTableStore.tableColSet(true); + }); + }; + + + render() { + const { payrollStore: { salaryTableStore } } = this.props; + const { loading, pageInfo } = this.state; + const { pageSize, total } = pageInfo; + const columnNum = total > 10 ? pageSize + 1 : total + 1; + return ( +
+ +