jsBonusDetail.jsx 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 {getTaskStatus,getProjectName,getLiquidationStatus,getJsyPaymentType,getBonusState} from '@/tools.js';
  6. import {splitUrl} from "../../../tools";
  7. import OrderItemStatus from "../../../common/orderItemStatus";
  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. xiangqing(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. if (data.error.length || data.data.list == "") {
  41. if (data.error && data.error.length) {
  42. message.warning(data.error[0].message);
  43. }
  44. } else {
  45. let thisdata = data.data;
  46. this.setState({
  47. deleteSign:thisdata.deleteSign,
  48. });
  49. }
  50. }.bind(this),
  51. }).always(
  52. function () {
  53. }.bind(this)
  54. );
  55. },
  56. componentWillReceiveProps(nextProps) {
  57. if(nextProps.data.orderNo){
  58. this.setState({data:nextProps.data});
  59. this.xiangqing(nextProps.data.orderNo);
  60. }
  61. this.state.visible=nextProps.showDesc;
  62. },
  63. render() {
  64. const theData = this.state.data || {};
  65. const FormItem = Form.Item;
  66. const formItemLayout = {
  67. labelCol: { span: 10 },
  68. wrapperCol: { span: 12 },
  69. };
  70. return (
  71. <div className="user-content" >
  72. <Modal maskClosable={false} visible={this.state.visible}
  73. onOk={this.onShow} onCancel={this.onCancel}
  74. width='800px'
  75. title='任务详情'
  76. footer=''
  77. className="admin-desc-content">
  78. <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} >
  79. <Spin spinning={this.state.loading}>
  80. <div className="clearfix">
  81. <div style={{position:"absolute",top:'-52px',left:'81px',zIndex:10000}}>
  82. <OrderItemStatus deleteSign={this.state.deleteSign}/>
  83. </div>
  84. <FormItem className="half-item" {...formItemLayout} label="任务编号">
  85. <span>{theData.tid}</span>
  86. </FormItem>
  87. <FormItem className="half-item" {...formItemLayout} label="订单编号">
  88. <span>{theData.orderNo}</span>
  89. </FormItem>
  90. <FormItem className="half-item" {...formItemLayout} label="任务名称">
  91. <span>{theData.commodityName}</span>
  92. </FormItem>
  93. <FormItem className="half-item" {...formItemLayout} label="任务负责人">
  94. <span>{theData.targetName}</span>
  95. </FormItem>
  96. <FormItem className="half-item" {...formItemLayout} label="任务状态">
  97. <span>{getTaskStatus(theData.taskStatus)}</span>
  98. </FormItem>
  99. <FormItem className="half-item" {...formItemLayout} label="任务数量">
  100. <span>{theData.commodityQuantity}</span>
  101. </FormItem>
  102. <FormItem className="half-item" {...formItemLayout} label="项目状态">
  103. <span>{getProjectName(theData.projectStatus)}</span>
  104. </FormItem>
  105. <FormItem className="half-item" {...formItemLayout} label="受理日期">
  106. <span>{theData.acceptTime}</span>
  107. </FormItem>
  108. <FormItem className="half-item" {...formItemLayout} label="评审日期">
  109. <span>{theData.reviewTime}</span>
  110. </FormItem>
  111. <FormItem className="half-item" {...formItemLayout} label="下证日期">
  112. <span>{theData.licenceTime}</span>
  113. </FormItem>
  114. <FormItem className="half-item" {...formItemLayout} label="订单结算状态">
  115. <span>{getLiquidationStatus(theData.liquidationStatus)}</span>
  116. </FormItem>
  117. <FormItem className="half-item" {...formItemLayout} label="发放类型">
  118. <span>{getJsyPaymentType(theData.bonusSubject)}</span>
  119. </FormItem>
  120. <FormItem className="half-item" {...formItemLayout} label="发放状态">
  121. <span>{getBonusState(theData.grantStatus)}</span>
  122. </FormItem>
  123. </div>
  124. </Spin>
  125. </Form>
  126. </Modal>
  127. </div>
  128. );
  129. }
  130. });
  131. export default Form.create()(BonusDetail);