/* * Author: 黎永顺 * name: 个税对应字段-薪资项目选择弹框 * Description: * Date: 2023/8/17 */ import React, { Component } from "react"; import { WeaDialog, WeaInputSearch, WeaLocaleProvider } from "ecCom"; import { Button, Col, Row, Table } from "antd"; import { commonBrowserData } from "../../../apis"; const { getLabel } = WeaLocaleProvider; class LedgerSalaryItemSelectDialog extends Component { constructor(props) { super(props); this.state = { pageInfo: { current: 1, pageSize: 20, total: 0 }, loading: false, columns: [], dataSource: [], keywords: "" }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.commonBrowserData(nextProps); } commonBrowserData = (props) => { const { salarySobId } = props; const { keywords, pageInfo } = this.state; const payload = { type: "salaryItemBrowser", jsonParam: JSON.stringify({ salarySobId, key: keywords }), ...pageInfo }; this.setState({ loading: true }); commonBrowserData(payload).then(({ status, data }) => { this.setState({ loading: false }); if (status) { const { list: dataSource, columns, pageNum: current, pageSize, total } = data; this.setState({ dataSource, columns, pageInfo: { ...pageInfo, current, pageSize, total } }); } }).catch(() => this.setState({ loading: false })); }; handleRowClick = (record) => { this.props.onCancel(); this.props.handleClickItem(record); }; render() { const { loading, columns, dataSource, pageInfo, keywords } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showQuickJumper: true, showSizeChanger: true, pageSizeOptions: ["20", "50", "100"], onShowSizeChange: (current, pageSize) => { this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.commonBrowserData(this.props)); }, onChange: current => { this.setState({ pageInfo: { ...pageInfo, current } }, () => this.commonBrowserData(this.props)); } }; return ( this.incomeRef = dom} buttons={[ ]} title={( {getLabel(543598, "请选择薪资项目")}