/* * 薪酬报表-薪酬明细 * 模板管理弹框 * @Author: 黎永顺 * @Date: 2024/12/4 * @Wechat: * @Email: 971387674@qq.com * @description: */ import React, { Component } from "react"; import { WeaButtonIcon, WeaLocaleProvider } from "ecCom"; import CustomTransferDialog from "../../../components/CustomBrowser/components/customTransferDialog"; import SalaryTempAdminDialog from "./salaryTempAdminDialog"; import SalaryDetailsTempDialog from "./salaryDetailsTempDialog"; const getLabel = WeaLocaleProvider.getLabel; class SalaryTempMangerDialog extends Component { constructor(props) { super(props); this.state = { selectedRowKeys: [], tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } }, tempDialog: { visible: false, setting: [], heads: [], id: "", template: {} } }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.isQuery !== this.props.isQuery) this.setState({ selectedRowKeys: [] }, () => this.tempManageRef.getData()); } handleTempAdminCols = (params = {}) => this.setState({ tempAdminDialog: { visible: true, dataParams: { ...this.state.tempAdminDialog.dataParams, ...params } } }); handelAddTemp = (id = "", setting = [], heads = []) => { this.setState({ tempDialog: { visible: true, setting, heads, id, template: _.find(this.tempManageRef.state.listDatas, o => o.id === id) } }); }; render() { const { selectedRowKeys, tempAdminDialog, tempDialog } = this.state; return ( this.tempManageRef = dom} {...this.props} buttons={[]} title={getLabel(111, "模板管理")} onSelect={v => this.setState({ selectedRowKeys: v })} tableOpts={{ title: getLabel(111, "操作"), dataIndex: "options", width: 120, render: (text, record) => ( { record.canEdit && this.handleTempAdminCols({ id: record.id })} style={{ marginRight: 10 }}>{getLabel(111, "编辑")} } { record.canEdit && this.props.onDelete([record.id])}>{getLabel(111, "删除")} } ) }}>
this.handleTempAdminCols()}/> this.props.onDelete(selectedRowKeys)} disabled={_.isEmpty(selectedRowKeys)}/>
{/*模板管理*/} this.setState({ tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } } })}/> {/*薪资明细模板设置*/} this.setState({ tempDialog: { ...tempDialog, visible: false, setting: [], heads: [] } }, () => callback && callback())} onSuccess={() => this.setState({ tempAdminDialog: { visible: false, dataParams: { page: "salary_details_report" } } }, () => { this.props.onSuccess(); this.tempManageRef.getData(); })}/>
); } } export default SalaryTempMangerDialog;