jsBonusDetail.jsx 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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,getProjectStatus,getLiquidationStatus,getJsyPaymentType,getBonusState} from '@/tools.js';
  6. const BonusDetail=React.createClass({
  7. getInitialState() {
  8. return {
  9. loading: false,
  10. visible:false,
  11. showDesc:false,
  12. };
  13. },
  14. onCancel(){
  15. this.setState({
  16. visible:false
  17. })
  18. this.props.closeDesc(false,false);
  19. },
  20. onShow() {
  21. this.setState({
  22. visible: false,
  23. });
  24. this.props.closeDesc(false, true);
  25. },
  26. componentWillMount() {
  27. },
  28. componentWillReceiveProps(nextProps) {
  29. if(nextProps.data.orderNo){
  30. this.setState({data:nextProps.data});
  31. }
  32. this.state.visible=nextProps.showDesc;
  33. },
  34. render() {
  35. const theData = this.state.data || {};
  36. const FormItem = Form.Item;
  37. const formItemLayout = {
  38. labelCol: { span: 10 },
  39. wrapperCol: { span: 12 },
  40. };
  41. return (
  42. <div className="user-content" >
  43. <Modal maskClosable={false} visible={this.state.visible}
  44. onOk={this.onShow} onCancel={this.onCancel}
  45. width='800px'
  46. title='任务详情'
  47. footer=''
  48. className="admin-desc-content">
  49. <Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} >
  50. <Spin spinning={this.state.loading}>
  51. <div className="clearfix">
  52. <FormItem className="half-item" {...formItemLayout} label="任务编号">
  53. <span>{theData.tid}</span>
  54. </FormItem>
  55. <FormItem className="half-item" {...formItemLayout} label="订单编号">
  56. <span>{theData.orderNo}</span>
  57. </FormItem>
  58. <FormItem className="half-item" {...formItemLayout} label="任务负责人">
  59. <span>{theData.targetName}</span>
  60. </FormItem>
  61. <FormItem className="half-item" {...formItemLayout} label="任务状态">
  62. <span>{getTaskStatus(theData.taskStatus)}</span>
  63. </FormItem>
  64. <FormItem className="half-item" {...formItemLayout} label="任务数量">
  65. <span>{theData.commodityQuantity}</span>
  66. </FormItem>
  67. <FormItem className="half-item" {...formItemLayout} label="项目状态">
  68. <span>{getProjectStatus(theData.projectStatus)}</span>
  69. </FormItem>
  70. <FormItem className="half-item" {...formItemLayout} label="受理日期">
  71. <span>{theData.acceptTime?(new Date(theData.acceptTime)).toLocaleString():''}</span>
  72. </FormItem>
  73. <FormItem className="half-item" {...formItemLayout} label="评审日期">
  74. <span>{theData.reviewTime?(new Date(theData.reviewTime)).toLocaleString():''}</span>
  75. </FormItem>
  76. <FormItem className="half-item" {...formItemLayout} label="下证日期">
  77. <span>{theData.licenceTime?(new Date(theData.licenceTime)).toLocaleString():''}</span>
  78. </FormItem>
  79. <FormItem className="half-item" {...formItemLayout} label="订单结算状态">
  80. <span>{getLiquidationStatus(theData.liquidationStatus)}</span>
  81. </FormItem>
  82. <FormItem className="half-item" {...formItemLayout} label="发放类型">
  83. <span>{getJsyPaymentType(theData.bonusSubject)}</span>
  84. </FormItem>
  85. <FormItem className="half-item" {...formItemLayout} label="发放状态">
  86. <span>{getBonusState(theData.grantStatus)}</span>
  87. </FormItem>
  88. </div>
  89. </Spin>
  90. </Form>
  91. </Modal>
  92. </div>
  93. );
  94. }
  95. });
  96. export default Form.create()(BonusDetail);