/* * Author: 黎永顺 * name: 默认调差弹框 * Description: * Date: 2022/12/27 */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Alert, message } from "antd"; import { WeaSlideModal, WeaTable } from "ecCom"; import SlideModalTitle from "../../../../components/slideModalTitle"; import { compensationConfigSave } from "../../../../apis/standingBook"; import "./index.less"; @inject("taxAgentStore") @observer class AdjustmentDefaultSlide extends Component { constructor(props) { super(props); this.state = { loading: false }; } handleSaveDefAdjustment = () => { const { dataSource } = this.props; const payload = _.map(dataSource, it => { return { paymentOrganization: it.paymentOrganization, categoryType: it.categoryType, welfareType: it.welfareType, target: it.targetOptions[0].key, adjustTo: it.adjustTo, employeeId: it.employeeId }; }); this.setState({ loading: true }); compensationConfigSave(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { message.success("保存成功"); } else { message.error(errormsg || "保存失败"); } }).catch(() => this.setState({ loading: false })); }; render() { const { visible, onCancel, taxAgentStore: { showOperateBtn }, dataSource } = this.props; const { loading } = this.state; const columns = [ { dataIndex: "target", title: "调差对象", render: (text, record) => { return ( {_.map(record.targetOptions, it => it.showname).join(",")} ); } }, { dataIndex: "welfareType", title: "统计调差福利", render: (text, record) => { return ( 社保 ); } }, { dataIndex: "categoryType", title: "统计调差福利类型(单位)", render: (text, record) => { return ( {_.map(record.categoryTypeOptions, it => it.showname).join(",")} ); } }, { dataIndex: "adjustTo", title: "调差到(单位)", render: (text, record) => { return ( {_.find(record.adjustToOptions, it => it.key === record.adjustTo).showname} ); } } ]; return ( } content={
} onClose={onCancel} /> ); } } export default AdjustmentDefaultSlide;