123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- 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 (
- <div>
- {
- record.status === 4 ? text : (
- record.chooseType === 2 ? text : (text + '-' + record.tpcId) +
- (text !== record.tpcName && record.tpcName ? '(' + record.tpcName + ')' : '')
- )
- }
- </div>
- )
- },
- },
- {
- title: '支付类型',
- dataIndex: 'chooseType',
- key: 'chooseType',
- render: (text, record) => {
- return (
- <div>
- {text === 0 ? '第三方' : text === 1 ? '催款' : '官费'}
- </div>
- )
- },
- },
- {
- title: '申请支付金额(万元)',
- dataIndex: 'applicationAmount',
- key: 'applicationAmount',
- render: (text, record) => {
- return (
- <div>
- {/*类型为官费时显示申请支付金额与申请支付数量*/}
- {/*{*/}
- {/* !(this.props.projectType === 2 || (this.props.projectType === 1 && record.patentType === 0)) || record.chooseType === 2 ?*/}
- {/* text :*/}
- {/* '/'*/}
- {/*}*/}
- {text}
- </div>
- )
- }
- },
- {
- title: '申请支付数量',
- dataIndex: 'quantity',
- key: 'quantity',
- render: (text, record) => {
- return (
- <div>
- {/*类型为官费时显示申请支付金额与申请支付数量*/}
- {/*{*/}
- {/* this.props.projectType === 2 || (this.props.projectType === 1 &&record.patentType === 0) || record.chooseType === 2?*/}
- {/* text :*/}
- {/* '/'*/}
- {/*}*/}
- {text}
- </div>
- )
- }
- },
- {
- title: '申请时间',
- dataIndex: 'createTimes',
- key: 'createTimes',
- },
- {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- render: (text, record) => {
- return (
- <div className="gutter-box" style={{
- width: '100%',
- display: 'flex',
- }}>
- <div className="operation">
- {(!!record.financeName && text === 0) ? record.financeName : ""}
- {
- text === 0 ? '审核中' :
- text === 1 ? '审核通过' :
- text === 2 ? '已驳回' :
- text === 3 ? '支付完成' :
- text === 4 ? '已取消' : ''
- }
- </div>
- <Button type="primary" size='small' style={{ marginLeft: '10px' }} onClick={() => {
- this.setState({
- payRecordVisible: true,
- orderPaymentsId: record.id,
- })
- }}>
- {this.operationJudgmentName(text)}
- </Button>
- </div>
- )
- },
- },
- ]
- }
- this.getSelectOrderPayment = this.getSelectOrderPayment.bind(this);
- }
- componentDidMount() {
- if (this.props.tid) {
- this.getSelectOrderPayment();
- }
- }
-
- 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 (
- <Modal
- maskClosable={false}
- className="customeDetails"
- footer={false}
- title="支付记录"
- width="1200px"
- visible={this.props.visible}
- onOk={() => {
- this.props.onSuccess && this.props.onSuccess();
- }}
- onCancel={() => {
- this.props.onCancer && this.props.onCancer();
- }}
- >
- <Spin spinning={this.state.loading}>
- <Table
- pagination={false}
- columns={this.state.ContactsListsNew}
- dataSource={this.state.selectOrderPayments}
- onRowClick={this.tableRowClickOne}
- style={{
- cursor: 'pointer',
- }}
- scroll={{ x: 'max-content', y: 0 }}
- bordered
- size="small"
- />
- </Spin>
- {this.state.payRecordVisible ? <PayRecord
- {...this.props}
- payId={this.state.orderPaymentsId}
- visible={this.state.payRecordVisible}
- tid={this.props.tid}
- isAuditPayment={this.props.isAuditPayment}
- projectType={this.props.projectType}
- changeVisible={() => {
- this.getSelectOrderPayment();
- this.setState({
- payRecordVisible: false,
- orderPaymentsId: 0,
- })
- }}
- /> : <div />}
- </Modal>
- )
- }
- }
- export default OrderPaymentModal;
|