import React from "react"; import { Modal, Button, Row, Col, Radio } from "antd"; import { WeaSelect, WeaBrowser } from "ecCom"; import { inject, observer } from "mobx-react"; import RequiredLabelTip from "../../components/requiredLabelTip"; const objectOptions = [ { key: "EMPLOYEE", showname: "人员", selected: false, }, { key: "SUBCOMPANY", showname: "分部", selected: false, }, { key: "DEPT", showname: "部门", selected: false, }, { key: "POSITION", showname: "岗位", selected: false, }, ]; @inject("ledgerStore") @observer export default class AddUserModal extends React.Component { constructor(props) { super(props); this.state = { selectedKey: "EMPLOYEE", radioValue: "ALL", ids: "", }; } onRadioChange(e) { this.setState({ radioValue: e.target.value }); } // 保存 handleSave() { const { ledgerStore: { saveLedgerPersonRange, salarySobId, includeType }, } = this.props; saveLedgerPersonRange({ salarySobId: salarySobId, includeType: includeType, employeeStatus: this.state.radioValue, targetParams: this.state.ids .split(",") .map((id) => ({ targetType: this.state.selectedKey, targetId: id })), }); } // 重置 handleReset() { this.setState({ selectedKey: "EMPLOYEE", radioValue: "ALL", ids: "", }); } render() { return ( { this.props.onCancel(); }} width={600} title="关联人员" footer={
}>
对象类型
{ this.setState({ selectedKey: value, ids: "" }); }} />
{this.state.selectedKey == "EMPLOYEE" && ( { this.setState({ ids }); }} /> )} {this.state.selectedKey == "DEPT" && ( { this.setState({ ids }); }} /> )} {this.state.selectedKey == "SUBCOMPANY" && ( { this.setState({ ids }); }} /> )} {this.state.selectedKey == "POSITION" && ( { this.setState({ ids }); }} /> )}
选择员工状态 this.onRadioChange(e)} value={this.state.radioValue}> 全部 在职 离职
); } }