import React from "react"; import { inject, observer } from "mobx-react"; import { Dropdown, Menu, message, Tag } from "antd"; import moment from "moment"; import CustomPaginationTable from "../../components/customPaginationTable"; import "../calculate/index.less"; @inject("payrollStore", "taxAgentStore") @observer export default class SalarySendList extends React.Component { constructor(props) { super(props); this.searchParams = { salaryYearMonth: this.props.salaryYearMonth }; this.pageInfo = { current: 1, pageSize: 10 }; } componentDidMount() { const { payrollStore: { getPayrollList } } = this.props; getPayrollList(this.searchParams); } // 发放回调 handleGrant(record) { window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollGrant?id=${record.id}&ackFeedbackStatus=${record.ackFeedbackStatus}`); } // 查看详情 handleShowDetail(record) { window.open( "/spa/hrmSalary/static/index.html#/main/hrmSalary/payrollDetail?id=" + record.id ); } // 更新模板 handleUpdateTemplate = (record) => { let templateRecord = {}; templateRecord.id = record.templateId; if (!record.templateId) { message.warning("请设置默认模板"); return; } this.props.onEditTemplate && this.props.onEditTemplate(templateRecord); }; // 获取表头数据 getColumns = () => { const { payrollStore: { salarySendTableStore }, taxAgentStore: { showOperateBtn } } = this.props; const { columns } = salarySendTableStore; if (!columns) return []; let result = columns.filter(item => (item.hide === "false" && item.dataIndex !== "acctTimes")); result.map(item => { if (item.dataIndex === "salaryYearMonth") { item.render = (text, record) => { return ( {moment(parseInt(text)).format("YYYY-MM")} ); }; } else if (item.dataIndex === "lastSendTime") { item.render = (text, record) => { return ( {moment(parseInt(text)).format("YYYY-MM-DD HH:mm:ss")} ); }; } else if (item.dataIndex === "salarySob") { item.width = 300; item.render = (text, record) => { return