/* * Author: 黎永顺 * name: 手动输入补缴金额 * Description: * Date: 2023/1/3 */ import React, { Component } from "react"; import { WeaInputNumber, WeaSearchGroup, WeaTable } from "ecCom"; class InputPaymentAmount extends Component { renderInputItem = (dataSource = [], type) => { const columns = [ { dataIndex: "insuranceName", title: "福利项" }, { dataIndex: "per", title: "个人缴纳金额", render: (text, record) => { return ( this.handleChangeBaseItem(record, val, type, "per")} /> ); } }, { dataIndex: "com", title: "单位缴纳金额", render: (text, record) => { return ( this.handleChangeBaseItem(record, val, type, "com")} /> ); } } ]; return ; }; handleChangeBaseItem = (item, value, type, paymentType) => { const { onChangeInputItem, socialPayment, fundPayment, otherPayment } = this.props; _.map(this.props[type], it => { const key = `${it.insuranceId}_${paymentType}`; if (item.insuranceId === it.insuranceId) { _.assign(it, { [key]: value }); } }); onChangeInputItem(socialPayment, fundPayment, otherPayment); }; render() { const { socialPayment, fundPayment, otherPayment } = this.props; return (
{ !_.isEmpty(socialPayment) && {this.renderInputItem(socialPayment, "socialPayment")} } { !_.isEmpty(fundPayment) && {this.renderInputItem(fundPayment, "fundPayment")} } { !_.isEmpty(otherPayment) && {this.renderInputItem(otherPayment, "otherPayment")} }
); } } export default InputPaymentAmount;