content.jsx 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. import React from 'react';
  2. import { Button, Radio } from 'antd';
  3. import './content.less';
  4. import { getTime, getProportion } from '../../../../tools';
  5. import CompanyDetail from './companyDetail';
  6. const Content = React.createClass({
  7. getInitialState() {
  8. return {
  9. loading: false,
  10. component: CompanyDetail
  11. };
  12. },
  13. returnFoster() {
  14. this.props.returnBtn();
  15. },
  16. onChange(e) {
  17. switch (e.target.value) {
  18. case 'companyDetail':
  19. this.setState({
  20. component: CompanyDetail,
  21. radioValue: 'companyDetail'
  22. });
  23. break;
  24. case 'orgTechCenter':
  25. require.ensure([], () => {
  26. const OrgTechCenter = require('./orgTechCenter').default;
  27. this.setState({
  28. component: OrgTechCenter,
  29. radioValue: 'orgTechCenter'
  30. });
  31. });
  32. break;
  33. case 'activity':
  34. require.ensure([], () => {
  35. const Activity = require('./activity').default;
  36. this.setState({
  37. component: Activity,
  38. radioValue: 'activity'
  39. });
  40. });
  41. break;
  42. case 'activityCostList':
  43. require.ensure([], () => {
  44. const ActivityCostList = require('./activityCostList').default;
  45. this.setState({
  46. component: ActivityCostList,
  47. radioValue: 'activityCostList'
  48. });
  49. });
  50. break;
  51. case 'techProduct':
  52. require.ensure([], () => {
  53. const TechProduct = require('./techProduct').default;
  54. this.setState({
  55. component: TechProduct,
  56. radioValue: 'techProduct'
  57. });
  58. });
  59. break;
  60. case 'intellectual':
  61. require.ensure([], () => {
  62. const Intellectual = require('./intellectual').default;
  63. this.setState({
  64. component: Intellectual,
  65. radioValue: 'intellectual'
  66. });
  67. });
  68. break;
  69. case 'achievement':
  70. require.ensure([], () => {
  71. const Achievement = require('./achievement').default;
  72. this.setState({
  73. component: Achievement,
  74. radioValue: 'achievement'
  75. });
  76. });
  77. break;
  78. case 'ratepay':
  79. require.ensure([], () => {
  80. const Ratepay = require('./ratepay').default;
  81. this.setState({
  82. component: Ratepay,
  83. radioValue: 'ratepay'
  84. });
  85. });
  86. break;
  87. case 'finance':
  88. require.ensure([], () => {
  89. const Finance = require('./finance').default;
  90. this.setState({
  91. component: Finance,
  92. radioValue: 'finance'
  93. });
  94. });
  95. break;
  96. case 'hrSituation':
  97. require.ensure([], () => {
  98. const HrSituation = require('./hrSituation').default;
  99. this.setState({
  100. component: HrSituation,
  101. radioValue: 'hrSituation'
  102. });
  103. });
  104. break;
  105. case 'honorList':
  106. require.ensure([], () => {
  107. const HonorList = require('./honorList').default;
  108. this.setState({
  109. component: HonorList,
  110. radioValue: 'honorList'
  111. });
  112. });
  113. break;
  114. case 'standard':
  115. require.ensure([], () => {
  116. const Standard = require('./standard').default;
  117. this.setState({
  118. component: Standard,
  119. radioValue: 'standard'
  120. });
  121. });
  122. break;
  123. case 'innovationAbility':
  124. require.ensure([], () => {
  125. const InnovationAbility = require('./innovationAbility').default;
  126. this.setState({
  127. component: InnovationAbility,
  128. radioValue: 'innovationAbility'
  129. });
  130. });
  131. break;
  132. case 'annualReport':
  133. require.ensure([], () => {
  134. const AnnualReport = require('./annualReport').default;
  135. this.setState({
  136. component: AnnualReport,
  137. radioValue: 'annualReport'
  138. });
  139. });
  140. break;
  141. };
  142. },
  143. componentWillReceiveProps(nextProps) {
  144. if (nextProps.style === "block") {
  145. let e = { target: { value: "companyDetail" } }
  146. this.onChange(e);
  147. };
  148. if (nextProps.data) {
  149. let _me = this;
  150. getProportion(nextProps.data.uid, function (data) {
  151. let s = 0;
  152. s = (
  153. (data.institution ? 5 : 0)
  154. + (data.activity ? 15 : 0)
  155. + (data.activityCost ? 15 : 0)
  156. + (data.techProject ? 10 : 0)
  157. + (data.intellectualProperty ? 15 : 0)
  158. + (data.achievement ? 10 : 0)
  159. + (data.ratepay ? 5 : 0)
  160. + (data.finance ? 5 : 0)
  161. + (data.humanResource ? 5 : 0)
  162. + (data.honorDatum ? 5 : 0)
  163. + (data.ability ? 5 : 0)
  164. + (data.standard ? 5 : 0))
  165. _me.setState({
  166. progressNumber: s
  167. });
  168. });
  169. };
  170. },
  171. render() {
  172. if (this.props.data) {
  173. return (
  174. <div className="foster-desc" style={{ display: this.props.style }}>
  175. <div className="content-tabs">
  176. <div className="foster-title">
  177. <span className="company-name">{this.props.data.unitName}</span>
  178. <span className="company-number">{this.props.data.certificateNumber || ''}</span>
  179. {this.props.data.issuingDate ?
  180. <span className="company-time"> 有效期 {getTime(this.props.data.issuingDate)} 至 {getTime(this.props.data.issuingDate, 36)} </span> : ''
  181. }
  182. <span className="company-number">当前进度: </span>
  183. <span className="progress-bar">
  184. <i style={{ width: this.state.progressNumber + '%' }}></i>
  185. </span>
  186. <span className="progress-num">{this.state.progressNumber}%</span>
  187. <Button className="foster-return" type="primary" onClick={this.returnFoster}>返回高企培育列表</Button>
  188. </div>
  189. <div className="clearfix foster-component">
  190. <Radio.Group onChange={this.onChange} value={this.state.radioValue}>
  191. <Radio.Button value="companyDetail">企业基本信息</Radio.Button>
  192. <Radio.Button value="orgTechCenter">企业研发机构</Radio.Button>
  193. <Radio.Button value="activity">研发活动</Radio.Button>
  194. <Radio.Button value="activityCostList">研发活动费用详情</Radio.Button>
  195. <Radio.Button value="techProduct">高新技术产品</Radio.Button>
  196. <Radio.Button value="intellectual">知识产权</Radio.Button>
  197. <Radio.Button value="achievement">科技成果转化</Radio.Button>
  198. <Radio.Button value="ratepay">企业所得税纳税申报表</Radio.Button>
  199. <Radio.Button value="finance">财务报表</Radio.Button>
  200. <Radio.Button value="hrSituation">企业人员情况</Radio.Button>
  201. <Radio.Button value="honorList">企业荣誉及其他证明材料</Radio.Button>
  202. <Radio.Button value="standard">标准制定情况</Radio.Button>
  203. <Radio.Button value="innovationAbility">企业创新能力</Radio.Button>
  204. <Radio.Button value="annualReport">年报</Radio.Button>
  205. <Radio.Button><a href={globalConfig.context + "/admin/servicesManage/highTechInfo.html?uid=" + this.props.data.uid} target="_blank">高企信息导出</a></Radio.Button>
  206. </Radio.Group>
  207. </div>
  208. </div>
  209. <div className="content-desc">
  210. <this.state.component data={this.props.data} />
  211. </div>
  212. </div>
  213. )
  214. } else {
  215. return (
  216. <div></div>
  217. )
  218. }
  219. }
  220. });
  221. export default Content;