orderDescTab.jsx 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import React from 'react';
  2. import { Modal, Tabs} from 'antd';
  3. import OrderDetaiel from './orderDetail';
  4. class DemandDesc extends React.Component {
  5. constructor(props) {
  6. super(props);
  7. this.state = {
  8. loading: false,
  9. showState:false
  10. };
  11. }
  12. getInitialState() {
  13. return {
  14. modKey:'1',
  15. loading: false,
  16. pagination: {
  17. defaultCurrent: 1,
  18. defaultPageSize: 10,
  19. showQuickJumper: true,
  20. pageSize: 10,
  21. onChange: function (page) {
  22. this.loadData(page);
  23. }.bind(this),
  24. showTotal: function (total) {
  25. return '共' + total + '条数据';
  26. }
  27. },
  28. columns: [
  29. {
  30. title: '订单编号',
  31. dataIndex: 'orderNo',
  32. key: 'orderNo',
  33. fixed: 'left'
  34. }, {
  35. title: '合同编号',
  36. dataIndex: 'contractNo',
  37. key: 'contractNo',
  38. }, {
  39. title: '下单时间',
  40. dataIndex: 'createTime',
  41. key: 'createTime',
  42. }, {
  43. title: '签单时间',
  44. dataIndex: 'signTime',
  45. key: 'signTime',
  46. },
  47. {
  48. title: '签单客户',
  49. dataIndex: 'buyerName',
  50. key: 'buyerName',
  51. render:(text)=>{
  52. return (text&&text.length>8?text.substr(0,8)+'...':text)
  53. }
  54. },
  55. {
  56. title: '外包公司',
  57. dataIndex: 'outsourceName',
  58. key: 'outsourceName',
  59. render:(text)=>{
  60. return (text&&text.length>8?text.substr(0,8)+'...':text)
  61. }
  62. },
  63. {
  64. title: '流程状态',
  65. dataIndex: 'processStatus',
  66. key: 'processStatus',
  67. render: text => { return getProcessStatus(text)}
  68. },
  69. {
  70. title: '订单部门',
  71. dataIndex: 'departmentName',
  72. key: 'departmentName',
  73. render:(text)=>{
  74. return (text&&text.length>8?text.substr(0,8)+'...':text)
  75. }
  76. },
  77. {
  78. title: '订单总金额(万)',
  79. dataIndex: 'signTotalAmount',
  80. key: 'signTotalAmount'
  81. },
  82. {
  83. title: '是否特批',
  84. dataIndex: 'approval',
  85. key: 'approval',
  86. render: text => { return getApproval(text)}
  87. },
  88. {
  89. title: '订单负责人',
  90. dataIndex: 'sellerName',
  91. key: 'sellerName'
  92. },
  93. {
  94. title:'操作',
  95. dataIndex: 'caozuo',
  96. key: 'caouzo',
  97. render:(text,recard)=>{
  98. return <div>
  99. {this.judgeFenpai(recard)}
  100. </div>
  101. }
  102. }
  103. ],
  104. dataSource: [],
  105. searchTime: [,]
  106. }
  107. }
  108. callBack(){
  109. this.setState({
  110. modKey:'2'
  111. })
  112. }
  113. handleCancel() {
  114. this.setState({
  115. visible: false,
  116. });
  117. this.props.closeDesc(false, false);
  118. }
  119. handOk() {
  120. this.setState({
  121. visible: false,
  122. });
  123. this.props.closeDesc(false, true);
  124. }
  125. componentWillReceiveProps(nextProps) {
  126. this.state.visible = nextProps.showDesc;
  127. }
  128. render() {
  129. let data = this.props.data || {releaseStatus:0};
  130. const { TabPane } = Tabs
  131. return (
  132. <div className="patent-desc">
  133. <Modal
  134. maskClosable={false}
  135. visible={this.state.visible}
  136. onOk={this.handOk.bind(this)}
  137. onCancel={this.handleCancel.bind(this)}
  138. width="800px"
  139. title=''
  140. footer=""
  141. className="admin-desc-content"
  142. >
  143. <Tabs onChange={this.callBack} type='card' activeKey={this.state.modKey}>
  144. <TabPane tab="项目概况" key="1">
  145. <div>
  146. <div>
  147. <OrderDetaiel
  148. closeDesc={this.handleCancel.bind(this)}
  149. data={this.props.data}
  150. visible={this.state.visible}
  151. handOk={this.handOk.bind(this)}
  152. />
  153. </div>
  154. </div>
  155. </TabPane>
  156. <TabPane tab="外包详情" key="2">
  157. </TabPane>
  158. </Tabs>
  159. </Modal>
  160. </div>
  161. );
  162. }
  163. }
  164. export default DemandDesc;