waterDetail.jsx 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import React from 'react';
  2. import ajax from 'jquery/src/ajax/xhr.js';
  3. import $ from 'jquery/src/ajax';
  4. import { Form,Button, Input, Spin, message, Modal, Upload } from 'antd';
  5. import {getTransactionChannel,getTransactionProject,splitUrl} from '@/tools.js';
  6. const WaterDetail=React.createClass({
  7. loadData(record) {
  8. this.state.data = [];
  9. this.setState({
  10. loading: true
  11. });
  12. $.ajax({
  13. method: "get",
  14. dataType: "json",
  15. crossDomain: false,
  16. url: globalConfig.context + '/api/admin/financial/selectOneRefundFlow',
  17. data: {
  18. billNo:record?record.billNo:this.props.data.billNo
  19. },
  20. success: function (data) {
  21. let theArr = [];
  22. if (!data.data) {
  23. if (data.error && data.error.length) {
  24. message.warning(data.error[0].message);
  25. };
  26. } else {
  27. this.setState({
  28. data:data.data,
  29. })
  30. }
  31. }.bind(this),
  32. }).always(function () {
  33. this.setState({
  34. loading: false
  35. });
  36. }.bind(this));
  37. },
  38. getInitialState() {
  39. return {
  40. loading: false,
  41. visible:false,
  42. showDesc:false,
  43. };
  44. },
  45. onCancel(){
  46. this.setState({
  47. visible:false
  48. })
  49. this.props.closeDesc(false,false);
  50. },
  51. onShow() {
  52. this.setState({
  53. visible: false,
  54. });
  55. this.props.closeDesc(false, true);
  56. },
  57. componentWillMount() {
  58. },
  59. componentWillReceiveProps(nextProps) {
  60. if(nextProps.data.billNo){
  61. this.loadData(nextProps.data);
  62. }
  63. this.state.visible=nextProps.showDesc;
  64. },
  65. render() {
  66. const theData = this.state.data || {};
  67. const FormItem = Form.Item;
  68. const formItemLayout = {
  69. labelCol: { span: 10 },
  70. wrapperCol: { span: 12 },
  71. };
  72. return (
  73. <div className="user-content" >
  74. <Modal maskClosable={false} visible={this.state.visible}
  75. onOk={this.onShow} onCancel={this.onCancel}
  76. width='800px'
  77. title='流水详情'
  78. footer=''
  79. className="admin-desc-content">
  80. <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} >
  81. <Spin spinning={this.state.loading}>
  82. <div className="clearfix">
  83. <FormItem className="half-item" {...formItemLayout} label="平台流水编号">
  84. <span>{theData.billNo}</span>
  85. </FormItem>
  86. <FormItem className="half-item" {...formItemLayout} label="财务流水时间">
  87. <span>{theData.financialPayTimes ? theData.financialPayTimes.slice(0,theData.financialPayTimes.length - 2) : ''}</span>
  88. </FormItem>
  89. <FormItem className="half-item" {...formItemLayout} label="金额(万元)">
  90. <span>{theData.transactionAmount}</span>
  91. </FormItem>
  92. <FormItem className="half-item" {...formItemLayout} label="流水科目">
  93. <span>{getTransactionProject(theData.transactionSubject)}</span>
  94. </FormItem>
  95. <FormItem className="half-item" {...formItemLayout} label="付款方">
  96. <span>{theData.payerName}</span>
  97. </FormItem>
  98. <FormItem className="half-item" {...formItemLayout} label="收款方">
  99. <span>{theData.payeeName}</span>
  100. </FormItem>
  101. <FormItem className="half-item" {...formItemLayout} label="交易外联">
  102. <span>{getTransactionChannel(theData.transactionChannel)}</span>
  103. </FormItem>
  104. <FormItem className="half-item" {...formItemLayout} label="订单编号">
  105. <span>{theData.orderNo}</span>
  106. </FormItem>
  107. <FormItem className="half-item" {...formItemLayout} label="财务流水编号">
  108. <span>{theData.financialPayNo}</span>
  109. </FormItem>
  110. <FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 16 }} label="备注">
  111. <span>{theData.remarks}</span>
  112. </FormItem>
  113. </div>
  114. </Spin>
  115. </Form>
  116. </Modal>
  117. </div>
  118. );
  119. }
  120. });
  121. export default Form.create()(WaterDetail);