import React from 'react' import { inject, observer } from 'mobx-react'; import { toJS } from 'mobx'; import { WeaInputSearch, WeaHelpfulTip, WeaTable, WeaTab, WeaTop } from 'ecCom' import { dataSource, payrollColumns } from '../columns'; import { Menu, Button, Dropdown, Table } from 'antd' import CustomTab from '../../../components/customTab' import "./index.less" import { getQueryString } from '../../../util/url' import { renderNoright, getSearchs } from '../../../util'; @inject('payrollStore') @observer export default class PayrollDetail extends React.Component { constructor(props) { super(props); this.state = { currentId: "" } } 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}) } getSearchsAdQuick() { const handleMenuClick = (e) => { switch(e.key) { case "1": this.handleExportSelected() break; } } const menu = ( 导出所选 ); return ( {this.handleExportAll()}}>导出全部 ) } render() { const {payrollStore} = this.props; const { setDetailListShowSearchAd, detailListShowSearchAd, getPayrollDetailList, detailListCondition, detailListConditionForm, salarySendDetailBaseInfo, salarySendDetailTableStore, salarySendDetailDataSource } = payrollStore; return (
} // 左侧图标 iconBgcolor='#F14A2D' // 左侧图标背景色 showDropIcon={true} // 是否显示下拉按钮 buttons={[this.getSearchsAdQuick()]} > setDetailListShowSearchAd(bool)} //高级搜索面板受控 searchsAd={getSearchs(detailListConditionForm, toJS(detailListCondition), 2)} // 高级搜索内部数据 // buttonsAd={adBtn} // 高级搜索内部按钮 onSearch={getPayrollDetailList} // 点搜索按钮时的回调 // searchsAdQuick={this.getSearchsAdQuick()} onSearchChange={v => detailListConditionForm.updateFields({ username: v })} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值 searchsBaseValue={detailListConditionForm.getFormParams().username} // 外部input搜索值受控: 这里和高级搜索的requestname同步 />
薪资所属月:{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.year}-{salarySendDetailBaseInfo.salaryMonth && salarySendDetailBaseInfo.salaryMonth.monthValue} 工资单模板:{salarySendDetailBaseInfo.template}
已发放:{salarySendDetailBaseInfo.sendNum}/{salarySendDetailBaseInfo.sendTotal}
) } }