bonusDetail.jsx 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import React from 'react';
  2. import ajax from 'jquery/src/ajax/xhr.js';
  3. import $ from 'jquery/src/ajax';
  4. import { Form, Spin, message, Modal } from 'antd';
  5. import {getProjectName,getNewOrderStatus,getJsyPaymentType} from '@/tools.js';
  6. import OrderItemStatus from "../../../common/orderItemStatus";
  7. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  8. const BonusDetail=React.createClass({
  9. getInitialState() {
  10. return {
  11. loading: false,
  12. visible:false,
  13. showDesc:false,
  14. };
  15. },
  16. onCancel(){
  17. this.setState({
  18. visible:false
  19. })
  20. this.props.closeDesc(false,false);
  21. },
  22. onShow() {
  23. this.setState({
  24. visible: false,
  25. });
  26. this.props.closeDesc(false, true);
  27. },
  28. componentWillMount() {
  29. },
  30. xiangqings(orderNo) {
  31. $.ajax({
  32. method: "get",
  33. dataType: "json",
  34. crossDomain: false,
  35. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  36. data: {
  37. orderNo,
  38. },
  39. success: function (data) {
  40. let thisdata = data.data;
  41. if (data.error.length || data.data.list == "") {
  42. if (data.error && data.error.length) {
  43. message.warning(data.error[0].message);
  44. }
  45. } else {
  46. this.setState({
  47. deleteSign:thisdata.deleteSign,
  48. orderUid: thisdata.uid,
  49. });
  50. }
  51. }.bind(this),
  52. }).always(
  53. function () {
  54. this.setState({
  55. loading: false,
  56. });
  57. }.bind(this)
  58. );
  59. },
  60. componentWillReceiveProps(nextProps) {
  61. if(nextProps.data.orderNo){
  62. this.setState({data:nextProps.data});
  63. this.xiangqings(nextProps.data.orderNo);
  64. }
  65. this.state.visible=nextProps.showDesc;
  66. },
  67. render() {
  68. const theData = this.props.data || {};
  69. const FormItem = Form.Item;
  70. const formItemLayout = {
  71. labelCol: { span: 10 },
  72. wrapperCol: { span: 12 },
  73. };
  74. return (
  75. <div className="user-content" >
  76. <Modal maskClosable={false} visible={this.state.visible}
  77. onOk={this.onShow} onCancel={this.onCancel}
  78. width='800px'
  79. title='订单详情'
  80. footer=''
  81. className="admin-desc-content">
  82. <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} >
  83. <Spin spinning={this.state.loading}>
  84. <div className="clearfix">
  85. <div style={{position:"absolute",top:'-52px',left:'81px',zIndex:10000}}>
  86. <OrderItemStatus deleteSign={this.state.deleteSign}/>
  87. </div>
  88. <FormItem className="half-item" {...formItemLayout} label="订单编号">
  89. <span>{theData.orderNo}</span>
  90. </FormItem>
  91. <FormItem className="half-item" {...formItemLayout} label="签单时间">
  92. <span>{theData.signTime}</span>
  93. </FormItem>
  94. <FormItem className="half-item" {...formItemLayout} label="订单负责人">
  95. <span>{theData.salesName}</span>
  96. </FormItem>
  97. <FormItem className="half-item" {...formItemLayout} label="客户名称">
  98. <span>
  99. {theData.buyName}
  100. <EnterpriseNameChange
  101. type='journal'
  102. style={{ marginLeft: 10 }}
  103. enterpriseId={this.state.orderUid}/>
  104. </span>
  105. </FormItem>
  106. <FormItem className="half-item" {...formItemLayout} label="签单金额(万元)">
  107. <span>{theData.totalAmount}</span>
  108. </FormItem>
  109. <FormItem className="half-item" {...formItemLayout} label="首付款(万元)">
  110. <span>{theData.firstAmount}</span>
  111. </FormItem>
  112. <FormItem className="half-item" {...formItemLayout} label="已收(万元)">
  113. <span>{theData.settlementAmount}</span>
  114. </FormItem>
  115. <FormItem className="half-item" {...formItemLayout} label="已退(万元)">
  116. <span>{theData.refundAmount}</span>
  117. </FormItem>
  118. <FormItem className="half-item" {...formItemLayout} label="订单状态">
  119. <span>{getNewOrderStatus(theData.orderStatus)}</span>
  120. </FormItem>
  121. <FormItem className="half-item" {...formItemLayout} label="项目状态">
  122. <span>{getProjectName(theData.projectStatus)}</span>
  123. </FormItem>
  124. <FormItem className="half-item" {...formItemLayout} label="发放类型">
  125. <span>{getJsyPaymentType(theData.bonusSubject)}</span>
  126. </FormItem>
  127. <FormItem className="half-item" {...formItemLayout} label="校对后单量">
  128. <span>{theData.proofCount}</span>
  129. </FormItem>
  130. <FormItem className="half-item" {...formItemLayout} label="当月认证项目数量">
  131. <span>{theData.renzm}</span>
  132. </FormItem>
  133. <FormItem className="half-item" {...formItemLayout} label="当月科技项目数量">
  134. <span>{theData.kejim}</span>
  135. </FormItem>
  136. <FormItem className="half-item" {...formItemLayout} label="年度认证项目数量">
  137. <span>{theData.renzy}</span>
  138. </FormItem>
  139. <FormItem className="half-item" {...formItemLayout} label="年度科技项目数量">
  140. <span>{theData.kejiy}</span>
  141. </FormItem>
  142. </div>
  143. </Spin>
  144. </Form>
  145. </Modal>
  146. </div>
  147. );
  148. }
  149. });
  150. export default Form.create()(BonusDetail);