feature/2.9.42309.01-薪资核算详情页面列表改造(页面编辑)

This commit is contained in:
黎永顺 2023-09-18 19:34:16 +08:00
parent cf38c91be8
commit 9084c20717
2 changed files with 82 additions and 1 deletions

View File

@ -0,0 +1,65 @@
/*
* Author: 黎永顺
* name: 薪资核算-导入
* Description:
* Date: 2023/9/18
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { Badge, Button } from "antd";
import ImportDialog from "../../../../../components/importDialog";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
salaryItemIds: "", //选择的导入表单项
importDialog: {
visible: false, title: "", nextloading: false,
link: "", importResult: {}, imageId: ""
}
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible) {
this.setState({
importDialog: {
...this.state.importDialog,
visible: nextProps.visible, title: nextProps.title
}
});
}
}
/*
* Author: 黎永顺
* Description:表单选项
* Params:
* Date: 2023/9/18
*/
renderFormComponent = () => {
return <Badge
count={!_.isEmpty(this.state.salaryItemIds) ? this.state.salaryItemIds.split(",").length : 0}>
<Button onClick={this.handleSelectedField}>{getLabel(520897, "请选择表单字段")}</Button>
</Badge>;
};
render() {
const { importDialog } = this.state;
return (
<ImportDialog
{...importDialog} onCancel={this.props.onCancel}
importParams={this.renderFormComponent()}
onResetImportResult={() => this.setState(({
importDialog: { ...importDialog, importResult: {}, imageId: "" }
}))}
nextCallback={imageId => this.handleImport({ imageId })}
/>
);
}
}
export default Index;

View File

@ -15,6 +15,7 @@ import SalaryCalcPersonConfirm from "./components/salaryCalcPersonConfirm";
import SalaryEditCalc from "./components/salaryEditCalc";
import ProgressModal from "../../../components/progressModal";
import CustomCalcExportDialog from "./components/customCalcExportDialog";
import SalaryEditCalcImport from "./components/salaryEditCalcImport";
import { convertToUrlString } from "../../../util/url";
import "./index.less";
@ -28,6 +29,7 @@ class Index extends Component {
this.state = {
selectedKey: "person", progressVisible: false, progress: 0,
customExpDialog: { visible: false, salaryAcctRecordId: "", checkItems: [], itemsByGroup: [] },
salaryImpDialog: { visible: false, title: "" },
accountExceptInfo: "" //核算报错信息,
};
@ -115,6 +117,11 @@ class Index extends Component {
}
});
break;
case "import":
this.setState({
salaryImpDialog: { ...this.state.salaryImpDialog, visible: true, title: getLabel(111, "薪资导入") }
});
break;
default:
break;
}
@ -173,7 +180,7 @@ class Index extends Component {
{ key: "person", title: getLabel(543547, "人员确认") },
{ key: "calc", title: getLabel(538011, "薪资核算") }
];
const { selectedKey, progressVisible, progress, customExpDialog } = this.state;
const { selectedKey, progressVisible, progress, customExpDialog, salaryImpDialog } = this.state;
return (
<Layout {...this.props}>
<div className="salary-calculate-do-calc">
@ -203,6 +210,15 @@ class Index extends Component {
});
}}
/>
{/* 薪资核算-导入*/}
<SalaryEditCalcImport
{...salaryImpDialog}
onCancel={(isFresh) => {
this.setState({
salaryImpDialog: { ...salaryImpDialog, visible: false }
});
}}
/>
</WeaReqTop>
</div>
</Layout>