/* * Author: 黎永顺 * name: 社保方案重构-方案设置列表 * Description: * Date: 2024/2/5 */ import React, { Component } from "react"; import { WeaCheckbox, WeaHelpfulTip, WeaInputNumber, WeaLocaleProvider, WeaSelect, WeaTableEdit } from "ecCom"; import PaymentPeriodModal from "../../../programme/paymentPeriodModal"; const getLabel = WeaLocaleProvider.getLabel; class PlanSetTable extends Component { constructor(props) { super(props); this.state = { datas: [], paymentPeriodModal: { visible: false, record: {}, cycleSetting: "000000000000" } }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.selectedKey !== this.props.selectedKey || nextProps.dataSource !== this.props.dataSource) { this.setState({ datas: _.filter(nextProps.dataSource, o => String(o.paymentScopeValue) === nextProps.selectedKey) }); } } /* * Author: 黎永顺 * Description: 缴纳周期-自定义设置 * Params: * Date: 2024/2/6 */ handleSetPaymentPeriod = (cycleSetting) => { const { datas, paymentPeriodModal } = this.state; const { record: { id } } = paymentPeriodModal; let cycleObj = { 1: "0", 2: "0", 3: "0", 4: "0", 5: "0", 6: "0", 7: "0", 8: "0", 9: "0", 10: "0", 11: "0", 12: "0" }; if (!_.isEmpty(cycleSetting)) { _.forEach(cycleSetting, item => { _.assign(cycleObj, { [item]: "1" }); }); } else { _.forEach(Object.keys(cycleObj), item => { _.assign(cycleObj, { [item]: "0" }); }); } const tmpVStr = _.reduce(Object.values(cycleObj), (pre, cur) => { return pre + cur; }, ""); this.setState({ datas: _.map(datas, o => { if (id === o.id) { return { ...o, cycleSetting: tmpVStr }; } else { return o; } }) }, () => this.props.onPlanSet(this.state.datas)); }; render() { const { datas, paymentPeriodModal } = this.state; const { showOperateBtn } = this.props; const columns = [ { title: getLabel(15795, "类型名称"), dataIndex: "insuranceName", key: "insuranceName", width: 120, fixed: "left", com: [{ type: "custom", key: "custom", render: text => ({text}) }] }, { title: getLabel(543168, "是否缴费"), dataIndex: "isPayment", key: "isPayment", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, isPayment: isPayment === "1" }, index, key: "custom" })}/> ) }] }, { title: getLabel(543169, "缴纳对象"), dataIndex: "paymentScope", key: "paymentScope", width: 120, com: [{ type: "custom", key: "custom", render: text => ({text}) }] }, { title: , dataIndex: "paymentCycle", key: "paymentCycle", width: 200, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => (
onEdit({ record: { ...record, paymentCycle, accountType: paymentCycle }, index, key: "custom" })}/> { showOperateBtn && text === "1" && this.setState({ paymentPeriodModal: { record: record, visible: true, cycleSetting: record.cycleSetting || "000000000000" } })}>{getLabel(30747, "设置")} }
) }] }, { title: getLabel(543170, "核算方式"), dataIndex: "accountType", key: "accountType", width: 200, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, accountType }, index, key: "custom" })}/>) }] }, { title: getLabel(543171, "基数下限"), dataIndex: "lowerLimit", key: "lowerLimit", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, lowerLimit }, index, key: "custom" })}/>) }] }, { title: getLabel(543172, "基数上限"), dataIndex: "upperLimit", key: "upperLimit", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, upperLimit }, index, key: "custom" })}/>) }] }, { title: getLabel(543173, "缴纳比例%"), dataIndex: "paymentProportion", key: "paymentProportion", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, paymentProportion }, index, key: "custom" })}/>) }] }, { title: getLabel(543174, "固定费用"), dataIndex: "fixedCost", key: "fixedCost", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, fixedCost }, index, key: "custom" })}/>) }] }, { title: getLabel(543175, "有效小数位"), dataIndex: "validNum", key: "validNum", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, validNum }, index, key: "custom" })}/>) }] }, { title: getLabel(543176, "进位规则"), dataIndex: "rententionRule", key: "rententionRule", width: 120, com: [{ type: "custom", key: "custom", render: (text, record, index, onEdit) => ( onEdit({ record: { ...record, rententionRule }, index, key: "custom" })}/>) }] } ]; return ( this.setState({ datas }, () => this.props.onPlanSet(this.state.datas))} /> this.setState({ paymentPeriodModal: { visible: false, record: {}, cycleSetting: "000000000000" } })} onSetPaymentPeriod={this.handleSetPaymentPeriod} /> ); } } export default PlanSetTable; const PaymentCycleTitle = () => (
{getLabel(543158, "缴纳周期")}
{getLabel(544738, "例:养老保险缴纳周期选择3/6/9/12;")}

{ getLabel(544739, "若:核算方式选择基数求和*比例;则数据核算逻辑为:\n" + " 账单月1月2月时,养老保险不会被核算;\n" + " 账单月3月时,养老保险核算金额为:养老保险月缴纳基数*3*缴纳比例+固定费用*3\n" + " (3代表1月2月3月 3个月,*3代表3个月基数相加和固定费用相加)") }

{ getLabel(544740, "若:核算方式选择基数*比例再求和;则数据核算逻辑为:\n" + " 账单月1月2月时,养老保险不会被核算;\n" + " 账单月3月时,养老保险核算金额为:\n" + " 将1~3月算出来的【养老保险月缴纳基数*缴纳比例+固定费用】求和") }

{getLabel(544741, "若:缴纳周期选择选择月缴,则核算方式默认为【基数*比例+固定费用】,不可修改")}
} placement="topLeft" /> );