feature/V2-dev合并多语言

This commit is contained in:
黎永顺 2023-12-14 09:27:34 +08:00
parent 6e193e028c
commit f66a075441
2 changed files with 16 additions and 15 deletions

View File

@ -9,6 +9,7 @@ import { WeaLocaleProvider } from "ecCom";
import { message, Modal, Spin } from "antd";
import { inject, observer } from "mobx-react";
import { acctResultList, updateLockStatus } from "../../../../../apis/calculate";
import { sysConfCodeRule } from "../../../../../apis/ruleconfig";
import ProgressModal from "../../../../../components/progressModal";
import EditSalaryCalcSlide from "./editSalaryCalcSlide";
@ -22,7 +23,7 @@ class EditCalcTable extends Component {
this.state = {
loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 },
selectedRowKeys: [], progressVisible: false, progress: 0,
salaryCalcSlide: { visible: false, id: "" }
salaryCalcSlide: { visible: false, id: "" }, showTotalCell: false
};
this.timerLock = null;
}
@ -34,7 +35,10 @@ class EditCalcTable extends Component {
handleReceive = async ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
this.queryCalcResultList();
const confCode = await sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" });
this.setState({ showTotalCell: confCode.data === "1" }, () => {
this.queryCalcResultList();
});
} else if (type === "turn") {
switch (id) {
case "PAGEINFO":
@ -158,10 +162,10 @@ class EditCalcTable extends Component {
const { columns, pageInfo: list } = data;
const { list: dataSource, pageNum: current, pageSize, total } = list;
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
const { pageInfo, selectedRowKeys } = this.state;
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
const { pageInfo, selectedRowKeys, showTotalCell } = this.state;
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";
this.postMessageToChild({
dataSource, pageInfo, selectedRowKeys, showTotalCell: this.props.showTotalCell, sumRowlistUrl, payload,
dataSource, pageInfo, selectedRowKeys, showTotalCell, sumRowlistUrl, payload,
columns: _.every(traverse(columns), (it, idx) => !it.fixed) ? _.map(traverse(columns), (it, idx) => ({
...it,
fixed: idx < 2 ? "left" : false

View File

@ -7,7 +7,6 @@
import React, { Component } from "react";
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
import { getColumnDesc, getSalarySobCycle } from "../../../../../apis/calculate";
import { sysConfCodeRule } from "../../../../../apis/ruleconfig";
import EditCalcAdvanceSearchPannel from "./editCalcAdvanceSearchPannel";
import EditCalcTable from "./editCalcTable";
import SalaryMonthTip from "../salaryMonthTip";
@ -21,7 +20,7 @@ class Index extends Component {
super(props);
this.state = {
salarySobCycle: {}, showSearchAd: false,
columnDesc: {}, formulaTd: "", showTotalCell: false
columnDesc: {}, formulaTd: ""
};
}
@ -36,21 +35,20 @@ class Index extends Component {
};
init = async () => {
const { routeParams: { salaryAcctRecordId } } = this.props;
const [salarySobCycle, columnDesc, confCode] = await Promise.all([
getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId }),
sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })
const [salarySobCycle, columnDesc] = await Promise.all([
getSalarySobCycle({ salaryAcctRecordId }), getColumnDesc({ salaryAcctRecordId })
]);
if (salarySobCycle.status && columnDesc.status && confCode.status) {
if (salarySobCycle.status && columnDesc.status) {
this.setState({
salarySobCycle: salarySobCycle.data,
columnDesc: columnDesc.data, showTotalCell: confCode.data === "1"
columnDesc: columnDesc.data
});
}
};
handleShowFormulaTa = (dataIndex) => this.setState({ formulaTd: dataIndex });
render() {
const { salarySobCycle, showSearchAd, formulaTd, columnDesc, showTotalCell } = this.state;
const { salarySobCycle, showSearchAd, formulaTd, columnDesc } = this.state;
const { routeParams: { salaryAcctRecordId } } = this.props;
const formulaObj = _.get(columnDesc, [formulaTd]) || {};
return (
@ -82,8 +80,7 @@ class Index extends Component {
/>
</div>
<EditCalcTable ref={dom => this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId}
{...this.props} showTotalCell={showTotalCell}
onShowFormulaTd={this.handleShowFormulaTa}/>
{...this.props} onShowFormulaTd={this.handleShowFormulaTa}/>
</div>
);
}