import React, { Component } from "react"; import { connect } from "dva"; import '../financialWallet.less'; import { withRouter } from 'dva/router'; import * as ajax from '../../../services/api'; import $modal from '../modal'; import { gup } from '../../../utils/utils'; import dff from '../../../assets/images/wallet/dff1.png'; import ffsb from '../../../assets/images/wallet/ffsb1.png'; import ffcg from '../../../assets/images/wallet/ffcg2.png'; import ffze from '../../../assets/images/wallet/ffze1.png'; import axios from 'axios'; import store from 'store'; import { Alert, Input, Button, Table, Icon, Form, Select, Modal } from "antd"; import moment from "moment"; const { Option } = Select; @connect(state => ({ profile: state.profile })) @withRouter @Form.create() export default class Messages extends Component { constructor(props, context) { super(props, context); this.state = { totalInfo: null, grantInfo: null, // 搜索部分 searchData: { // 表格数据请求参数 comGrantId: gup('comGrantId'), keyword: '', //关键字 pageNumber: '1', // 页 pageSize: '10' //条目 }, keyword: '', //关键字 // 表格部分 tableList: [], // 表格数据 pagination: { //分页数据 total: 1, current: 1, pageSize: 10, showSizeChanger: true, showQuickJumper: true, }, canAddData: false, // 操作记录 operationVisibale: false, operationPagination: { total: 1, current: 1, pageSize: 10, showSizeChanger: true, showQuickJumper: true }, operationList: [], }; } componentDidMount() { //获取薪资代发记录汇总 ajax.selectGrantDetailTotalMap({ comGrantId: gup('comGrantId') }).then(res => { this.setState({ totalInfo: res.data }); }); //【薪资代发】根据id获取薪资代发记录 ajax.getComGrantInfoById({ comGrantId: gup('comGrantId') }).then(res => { this.setState({ grantInfo: res.data }); }); this.getTable(this.state.searchData, list => { list.length != 0 && this.setState({ canAddData: true }); }); } // 获取操作记录 getOperationTable = (data, cb) => { ajax.getComOperRecordList(data).then(res => { this.setState({ operationList: res.data, operationPagination: { ...this.state.operationPagination, total: res.data.total, current: res.data.pageNumber, pageSize: res.data.pageSize } }, () => { cb && cb(res.data.data); }); }); } // 获取表格信息 getTable = (data, cb) => { ajax.pageSuccessComGrantDetailList(data).then(res => { this.setState({ tableList: res.data.data, pagination: { ...this.state.pagination, total: res.data.total, current: res.data.pageNumber, pageSize: res.data.pageSize } }, () => { cb && cb(res.data.data); }); }); } // 操作记录表格渲染 renderOperationList = () => { const columns = [ { title: '时间', dataIndex: 'createTime', key: 'createTime' }, { title: '操作人', dataIndex: 'createUserName', key: 'createUserName' }, { title: '操作功能', dataIndex: 'operGrantFuncType', key: 'operGrantFuncType' }, { title: '操作结果', dataIndex: 'operResult', key: 'operResult' } ]; return (
{ pagination.comGrantId = gup('comGrantId'); this.setState({ operationSearchData: { pageNumber: pagination.current, // 页 pageSize: pagination.pageSize } }, () => { this.getOperationTable(pagination); }); }} /> ); }; // 表格渲染 renderOrderList = () => { const columns = [ { title: '收款人姓名', dataIndex: 'name', key: 'name' }, { title: '身份证号码', dataIndex: 'idCardNo', key: 'idCardNo' }, { title: '手机号码', dataIndex: 'mobilePhone', key: 'mobilePhone' }, { title: '钱包账户号', dataIndex: 'walletAccountNo', key: 'walletAccountNo' }, { title: '应发工资(元)', dataIndex: 'amount', key: 'amount' }, { title: '状态', dataIndex: 'grantStatus', key: 'grantStatus', render: text => {text} }, { title: '交易流水号', dataIndex: 'bizOrderNo', key: 'bizOrderNo' }, { title: '交易时间', dataIndex: 'createTime', key: 'createTime' } ]; return (
{ const searchData = { // 搜索数据 ...this.state.searchData, pageNumber: pagination.current, // 页 pageSize: pagination.pageSize }; this.setState({ searchData }, () => { this.getTable(searchData); }); }} // rowSelection={{ // onChange: (selectedRowKeys, selectedRows) => { // this.setState({ // selectedRows, // selectedRowKeys // }); // }, // selectedRowKeys: this.state.selectedRowKeys // }} /> ); }; render() { return (
{ this.state.grantInfo && {this.state.grantInfo.title} ({gup('comGrantId')}) }
1、发放工资:发放前请确认发放人数、发放总额、企业钱包余额是否充足,若不足,请 { this.props.history.push('/finance/business-wallet'); }}>充值
2、未开通钱包服务的员工,请提醒其在APP端进行开通,否则无法向其发放工资。
} type="warning" showIcon style={{ marginBottom: '15px' }} /> { this.state.totalInfo &&
{ this.props.history.push(`/finance/salary-proxy-list?comGrantId=${gup('comGrantId')}`); }} >

待发放总额

{this.state.totalInfo.toTotalAmount}

待发放总笔数:{this.state.totalInfo.toTotalSize}

+
{ this.props.history.push(`/finance/salary-proxy-fail?comGrantId=${gup('comGrantId')}`); }} >

发放失败总额

{this.state.totalInfo.failTotalAmount}

发放总笔数:{this.state.totalInfo.failTotalSize}

+

发放成功总额

{this.state.totalInfo.successTotalAmount}

发放总笔数:{this.state.totalInfo.successTotalSize}

=
{ // if (this.state.listStatus == 3) { // return 'active_uint statistics_uint'; // } // return 'statistics_uint'; // })() // } // onClick={() => { // this.setState({ // listStatus: 3 // }); // }} >

发放总额

{this.state.totalInfo.totalAmount}

发放总笔数:{this.state.totalInfo.totalSize}

}
{ this.state.canAddData && }
{this.renderOrderList()}
{/* 操作记录 */} { this.setState({ operationVisibale: false }); }} visible={this.state.operationVisibale} > {this.renderOperationList()} ); } }