import React, { Component } from 'react'; import { Button, message, Modal, Spin, Table } from "antd"; import $ from "jquery"; import PayRecord from "../../../../components/checkProject/payRecord"; class OrderPaymentModal extends Component { constructor(props) { super(props); this.state = { loading: false, selectOrderPayments: [], payRecordVisible: false, orderPaymentsId: 0, ContactsListsNew: [ { title: '编号', dataIndex: 'id', key: 'id', }, { title: '供应商名称', dataIndex: 'companyName', key: 'companyName', render: (text, record) => { return (
{ record.status === 4 ? text : ( record.chooseType === 2 ? text : (text + '-' + record.tpcId) + (text !== record.tpcName && record.tpcName ? '(' + record.tpcName + ')' : '') ) }
) }, }, { title: '支付类型', dataIndex: 'chooseType', key: 'chooseType', render: (text, record) => { return (
{text === 0 ? '第三方' : text === 1 ? '催款' : '官费'}
) }, }, { title: '申请支付金额(万元)', dataIndex: 'applicationAmount', key: 'applicationAmount', render: (text, record) => { return (
{/*类型为官费时显示申请支付金额与申请支付数量*/} {/*{*/} {/* !(this.props.projectType === 2 || (this.props.projectType === 1 && record.patentType === 0)) || record.chooseType === 2 ?*/} {/* text :*/} {/* '/'*/} {/*}*/} {text}
) } }, { title: '申请支付数量', dataIndex: 'quantity', key: 'quantity', render: (text, record) => { return (
{/*类型为官费时显示申请支付金额与申请支付数量*/} {/*{*/} {/* this.props.projectType === 2 || (this.props.projectType === 1 &&record.patentType === 0) || record.chooseType === 2?*/} {/* text :*/} {/* '/'*/} {/*}*/} {text}
) } }, { title: '申请时间', dataIndex: 'createTimes', key: 'createTimes', }, { title: '状态', dataIndex: 'status', key: 'status', render: (text, record) => { return (
{(!!record.financeName && text === 0) ? record.financeName : ""} { text === 0 ? '审核中' : text === 1 ? '审核通过' : text === 2 ? '已驳回' : text === 3 ? '支付完成' : text === 4 ? '已取消' : '' }
) }, }, ] } this.getSelectOrderPayment = this.getSelectOrderPayment.bind(this); } componentDidMount() { if (this.props.tid) { this.getSelectOrderPayment(); } } //0审核 1待支付 2驳回 3已支付 4取消 operationJudgmentName(id) { if (this.props.isAuditPayment) { //财务 return id === 0 ? '待审核' : id === 1 ? '待支付' : id === 2 ? '查看详情' : '查看详情' } else { return id === 0 ? '待审核' : id === 1 ? '待支付' : id === 2 ? '查看详情' : '查看详情' } } //支付列表 getSelectOrderPayment() { $.ajax({ method: 'get', dataType: 'json', crossDomain: false, url: globalConfig.context + '/api/admin/company/selectOrderPayment', data: { id: this.props.tid, }, success: function (data) { if (data.error.length) { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { this.setState({ selectOrderPayments: data.data }) } }.bind(this), }).always( function () { }.bind(this) ) } render() { return ( { this.props.onSuccess && this.props.onSuccess(); }} onCancel={() => { this.props.onCancer && this.props.onCancer(); }} > {this.state.payRecordVisible ? { this.getSelectOrderPayment(); this.setState({ payRecordVisible: false, orderPaymentsId: 0, }) }} /> :
} ) } } export default OrderPaymentModal;