bonusDetail.jsx 7.2 KB

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