orderDescTab.jsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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, record) => {
  68. return getProcessStatus(text, record.examineName, record.approval);
  69. },
  70. },
  71. {
  72. title: '订单部门',
  73. dataIndex: 'departmentName',
  74. key: 'departmentName',
  75. render: (text) => {
  76. return (text && text.length > 8 ? text.substr(0, 8) + '...' : text)
  77. }
  78. },
  79. {
  80. title: '订单总金额(万)',
  81. dataIndex: 'signTotalAmount',
  82. key: 'signTotalAmount'
  83. },
  84. {
  85. title: '是否特批',
  86. dataIndex: 'approval',
  87. key: 'approval',
  88. render: text => { return getApproval(text) }
  89. },
  90. {
  91. title: '订单负责人',
  92. dataIndex: 'sellerName',
  93. key: 'sellerName'
  94. },
  95. {
  96. title: '操作',
  97. dataIndex: 'caozuo',
  98. key: 'caouzo',
  99. render: (text, recard) => {
  100. return <div>
  101. {this.judgeFenpai(recard)}
  102. </div>
  103. }
  104. }
  105. ],
  106. dataSource: [],
  107. searchTime: [,]
  108. }
  109. }
  110. callBack() {
  111. this.setState({
  112. modKey: '2'
  113. })
  114. }
  115. handleCancel() {
  116. this.setState({
  117. visible: false,
  118. });
  119. this.props.closeDesc(false, false);
  120. }
  121. handOk() {
  122. this.setState({
  123. visible: false,
  124. });
  125. this.props.closeDesc(false, true);
  126. }
  127. componentWillReceiveProps(nextProps) {
  128. this.state.visible = nextProps.showDesc;
  129. }
  130. render() {
  131. let data = this.props.data || { releaseStatus: 0 };
  132. const { TabPane } = Tabs
  133. return (
  134. <div className="patent-desc">
  135. <Modal
  136. maskClosable={false}
  137. visible={this.state.visible}
  138. onOk={this.handOk.bind(this)}
  139. onCancel={this.handleCancel.bind(this)}
  140. width="800px"
  141. title=''
  142. footer=""
  143. className="admin-desc-content"
  144. >
  145. <Tabs onChange={this.callBack} type='card' activeKey={this.state.modKey}>
  146. <TabPane tab="项目概况" key="1">
  147. <div>
  148. <div>
  149. <OrderDetaiel
  150. closeDesc={this.handleCancel.bind(this)}
  151. data={this.props.data}
  152. visible={this.state.visible}
  153. handOk={this.handOk.bind(this)}
  154. />
  155. </div>
  156. </div>
  157. </TabPane>
  158. <TabPane tab="外包详情" key="2">
  159. </TabPane>
  160. </Tabs>
  161. </Modal>
  162. </div>
  163. );
  164. }
  165. }
  166. export default DemandDesc;