import React from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { WeaHelpfulTip, WeaTab, WeaTop } from "ecCom"; import { Button, Menu } from "antd"; import "./index.less"; import { getQueryString } from "../../../util/url"; import { getSearchs } from "../../../util"; import CustomPaginationTable from "../../../components/customPaginationTable"; @inject("payrollStore") @observer export default class PayrollDetail extends React.Component { constructor(props) { super(props); this.state = { currentId: "", current: 1 }; this.pageInfo = { current: 1, pageSize: 10 }; } componentWillMount() { let id = getQueryString("id"); this.setState({ currentId: id }); const { payrollStore: { getPayrollInfo, getPayrollDetailList, getPayrollDetailSa } } = this.props; getPayrollInfo(id); getPayrollDetailList({ salarySendId: id }); getPayrollDetailSa(); } // 撤回 handleWithdraw(record) { const { payrollStore } = this.props; const { withdrawPayroll, getInfoList } = payrollStore; withdrawPayroll({ ids: [record.id], salarySendId: this.state.currentId }).then(() => { getInfoList({ salarySendId: this.state.currentId }); }); } // 发送 handleGrant(record) { const { payrollStore } = this.props; const { grantPayroll, getInfoList } = payrollStore; grantPayroll({ ids: [record.id], salarySendId: this.state.currentId }).then(() => { getInfoList({ salarySendId: this.state.currentId }); }); } getColumns() { const { payrollStore } = this.props; const { salarySendDetailTableStore } = payrollStore; const { columns } = salarySendDetailTableStore; if (!columns) { return []; } let result = columns.filter(item => item.hide == "false").map(item => { item = { ...item }; if (item.dataIndex == "operation") { item.render = (text, record) => { if (text == "ALREADYSEND") { return ( { this.handleWithdraw(record); }}>撤回 ); } else { return ( { this.handleGrant(record); }}>发送 ); } }; } return item; }); return result; } // 导出所选 handleExportSelected() { } // 导出全部 handleExportAll = () => { // const { payrollStore } = this.props; // const { exportDetailList } = payrollStore // exportDetailList({salarySendId: this.state.currentId}) const url = `${window.location.origin}/api/bs/hrmsalary/salaryBill/send/exportDetailList?salarySendId=${this.state.currentId}`; window.open(url, "_self"); }; getSearchsAdQuick() { const handleMenuClick = (e) => { switch (e.key) { case "1": this.handleExportSelected(); break; } }; const menu = (
); return ( //