diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index c9c0e3cf..8632db09 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -30,6 +30,7 @@ import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail"; import CompareDetail from "./pages/calculateDetail/compareDetail"; import DoCalcDetail from "./pages/calculate/doCalc"; import OfflineCompare from "./pages/calculate/calcOc"; +import CalcView from "./pages/calculate/calcView"; import GenerateDeclarationDetail from "./pages/declare/generateDeclarationDetail"; import TemplatePreview from "./pages/payroll/templatePreview"; import PayrollTemplatePreview from "./pages/payroll/templatePreview/tmpPreview"; //重构的工资单模板预览页面 @@ -82,6 +83,7 @@ const DataAcquisition = (props) => props.children; // calculate 薪资核算 // calculateDetail 核算详情 // DoCalcDetail 核算详情页面-新 +// CalcView 核算查看页面-新 // OfflineCompare 薪资核算线下对比-新 // placeOnFileDetail 核算归档详情 // compareDetail 线下线上对比 @@ -145,7 +147,8 @@ const Routes = ( - + + diff --git a/pc4mobx/hrmSalary/pages/calculate/calcView/index.js b/pc4mobx/hrmSalary/pages/calculate/calcView/index.js new file mode 100644 index 00000000..6728c9a1 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcView/index.js @@ -0,0 +1,107 @@ +/* + * Author: 黎永顺 + * name: 薪资核算查看 + * Description: + * Date: 2023/12/7 + */ +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; +import { WeaLocaleProvider, WeaTop } from "ecCom"; +import { Dropdown, Menu, message } from "antd"; +import Layout from "../doCalc/layout"; +import SalaryEditCalc from "../doCalc/components/salaryEditCalc"; +import AdvanceInputBtn from "../doCalc/components/advanceInputBtn"; +import { convertToUrlString } from "../../../util/url"; +import { getExportField } from "../../../apis/calculate"; +import CustomCalcExportDialog from "../doCalc/components/customCalcExportDialog"; +import "./index.less"; + +const getLabel = WeaLocaleProvider.getLabel; + +@inject("calculateStore") +@observer +class Index extends Component { + constructor(props) { + super(props); + this.state = { + showChildren: false, + customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] } + }; + this.calc = null; + } + + init = () => this.setState({ showChildren: true }); + + handleMenuClick = ({ key }) => { + const { calculateStore: { ECSearchForm }, routeParams: { salaryAcctRecordId } } = this.props; + const { consolidatedTaxation, ...extra } = ECSearchForm.getFormParams(); + const payload = { ...extra, consolidatedTaxation: consolidatedTaxation === "0" ? "" : consolidatedTaxation }; + switch (key) { + case "exportAll": + const url = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=&${convertToUrlString(payload)}`; + window.open(`${window.ecologyContentPath || ""}${url}`, "_blank"); + break; + case "export_selected": + const { calcTableRef: { wrappedInstance: { state: { selectedRowKeys } } } } = this.calc; + if (selectedRowKeys.length === 0) { + message.warning(getLabel(543306, "未选择条目")); + return; + } + const url1 = `/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=${salaryAcctRecordId}&ids=${selectedRowKeys.join(",")}&${convertToUrlString(payload)}`; + window.open(`${window.ecologyContentPath || ""}${url1}`, "_blank"); + break; + case "export_custom": + getExportField({ salaryAcctRecordId }).then(({ status, data }) => { + if (status) { + const { checkItems, itemsByGroup } = data; + this.setState({ + customExpDialog: { + ...this.state.customExpDialog, visible: true, salaryAcctRecordId, + checkItems, itemsByGroup + } + }); + } + }); + break; + default: + break; + } + }; + + render() { + const { showChildren, customExpDialog } = this.state; + const btns = [ + this.handleMenuClick({ key: "exportAll" })} + overlay={ this.handleMenuClick(e)}> + {getLabel(543715, "导出所选")} + {getLabel(544270, "自定义导出")} + }>{getLabel(81272, "导出全部")}, + this.calc.openAdvanceSearch()} + onAdvanceSearch={() => this.calc.onAdSearch(false)} + /> + ]; + return ( + + } iconBgcolor="#F14A2D" + showDropIcon={false} buttons={btns} + > +
+ {showChildren && this.calc = dom}/>} + {/* 薪资核算-自定义导出*/} + { + this.setState({ + customExpDialog: { ...customExpDialog, visible: false } + }); + }} + /> +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/calculate/calcView/index.less b/pc4mobx/hrmSalary/pages/calculate/calcView/index.less new file mode 100644 index 00000000..182d61f0 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/calculate/calcView/index.less @@ -0,0 +1,8 @@ +.salary-calculate-view { + width: 100%; + height: 100%; + background-color: #f1f1f1; + position: relative; + z-index: 0; + padding: 8px 16px; +} diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index 8f886557..72f348fe 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -123,7 +123,7 @@ class Calculate extends Component { break; case "3": //查看详情 - window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/placeOnFileDetail/${id}?id=${id}`); + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calcView/${id}`); break; case "4": //重新核算 diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 7c0124f9..2b9c4133 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -177,7 +177,10 @@ class EditCalcTable extends Component { }; queryCalcResultList = () => { const { pageInfo } = this.state; - const { calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId } } = this.props; + const { + calculateStore: { ECSearchForm, otherConditions }, routeParams: { salaryAcctRecordId }, + calcDetail = false + } = this.props; const { subcompanyIds, departmentIds, positionIds, statuses, ...extra } = ECSearchForm.getFormParams(); const payload = { salaryAcctRecordId, ...pageInfo, ...extra, otherConditions, @@ -196,12 +199,12 @@ class EditCalcTable extends Component { const { pageInfo, selectedRowKeys } = this.state; const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : ""; this.postMessageToChild({ - dataSource, pageInfo, selectedRowKeys, payload, - showTotalCell: this.props.showTotalCell, sumRowlistUrl, - columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.map(traverse(columns), (it, idx) => ({ + dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload, + calcDetail, + columns: _.every(traverse(columns, calcDetail), (it, idx) => !it.fixed) ? _.map(traverse(columns, calcDetail), (it, idx) => ({ ...it, fixed: idx < 2 ? "left" : false - })) : traverse(columns) + })) : traverse(columns, calcDetail) }); }); } @@ -253,18 +256,18 @@ class EditCalcTable extends Component { export default EditCalcTable; -const traverse = (arr) => { +const traverse = (arr, calcDetail) => { return _.map(arr, item => { if (!_.isEmpty(item.children)) { return { title: item.text, width: item.width + "px", ellipsis: true, - dataIndex: item.column, children: traverse(item.children), + dataIndex: item.column, children: traverse(item.children, calcDetail), fixed: item.fixed || false, dataType: item.dataType, align: "center" }; } else { return { title: item.text, width: item.width + "px", fixed: item.fixed || false, - dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus, + dataIndex: item.column, ellipsis: true, lockStatus: item.lockStatus, calcDetail, pattern: item.pattern, dataType: item.dataType, align: "center" }; } diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js index 9a802bfb..15fa78ed 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/layout.js @@ -25,10 +25,14 @@ class Layout extends Component { if (isOpenDevolution) { const { routeParams: { salaryAcctRecordId } } = this.props; salaryacctAcctresultCheckAuth({ salaryAcctRecordId }).then(({ status, data }) => { - this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }); + this.setState({ store: { ...this.state.store, loading: false, hasRight: status && data } }, () => { + this.state.store.hasRight && this.props.init && this.props.init(); + }); }); } else { - this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }); + this.setState({ store: { ...this.state.store, loading: false, hasRight: true } }, () => { + this.props.init && this.props.init(); + }); } }).catch(() => this.setState({ store: { ...this.state.store, loading: false } })); }; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index 4cdd5a9c..448d49f7 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -163,7 +163,7 @@ export default class PlaceOnFileDetail extends React.Component { }; return ( - + //
this.setState({ slideVisiable: false })}/> }
-
+ //
); } }