content.jsx 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. import React, { Component } from 'react';
  2. import '../content.less';
  3. import './content.less';
  4. import LeftTab from '../leftTab';
  5. import { getMenu } from '../publicMenu.js'
  6. class Content extends Component {
  7. constructor() {
  8. super();
  9. this.state = {
  10. loading: false,
  11. component: <div></div>,
  12. };
  13. }
  14. componentWillMount() {
  15. var ids = window.location.href.indexOf('rid=');
  16. var idk = window.location.href.substr(ids + 4);
  17. var rid = idk.split('#');
  18. let menu = getMenu(rid);
  19. let curry;
  20. if (menu[0].subMenus.length > 0) {
  21. curry = menu[0].subMenus[0].url.split('#');
  22. } else {
  23. curry = menu[0].url.split('#');
  24. };
  25. if (window.location.hash) {
  26. this.getKey(window.location.hash.substr(1));
  27. } else {
  28. this.getKey(curry[1]);
  29. };
  30. }
  31. getKey(key) {
  32. switch (key) {
  33. //科技服务订单
  34. case "myService":
  35. require.ensure([], () => {
  36. const MyService = require("./myOrder/servicesOrder/myService")
  37. .default;
  38. this.setState({
  39. component: <MyService />,
  40. });
  41. });
  42. break;
  43. //催款列表
  44. case "pressList":
  45. require.ensure([], () => {
  46. const PressList = require("./orderNew/pressList").default;
  47. this.setState({
  48. component: <PressList />,
  49. });
  50. });
  51. break;
  52. //开单与签单
  53. case "billing":
  54. require.ensure([], () => {
  55. const Billing = require("./orderNew/billing").default;
  56. this.setState({
  57. component: <Billing />,
  58. });
  59. });
  60. break;
  61. //订单审核新
  62. case "examine":
  63. require.ensure([], () => {
  64. const Examine = require("./orderNew/examine").default;
  65. this.setState({
  66. component: <Examine />,
  67. });
  68. });
  69. break;
  70. //外包审核列表
  71. case "outsourcingList":
  72. require.ensure([], () => {
  73. const OutsourcingList = require("./orderNew/outsourcingList").default;
  74. this.setState({
  75. component: <OutsourcingList />,
  76. });
  77. });
  78. break;
  79. //外包项目审核列表
  80. case "outsourcingPro":
  81. require.ensure([], () => {
  82. const OutsourcingPro = require("./orderNew/OutsourcingPro").default;
  83. this.setState({
  84. component: <OutsourcingPro />,
  85. });
  86. });
  87. break;
  88. //外包审核列表
  89. case "checkOutsourcing":
  90. require.ensure([], () => {
  91. const CheckOutsourcing = require("./orderNew/checkOutsourcing")
  92. .default;
  93. this.setState({
  94. component: <CheckOutsourcing />,
  95. });
  96. });
  97. break;
  98. //驳回管理新
  99. case "reject":
  100. require.ensure([], () => {
  101. const Reject = require("./orderNew/reject").default;
  102. this.setState({
  103. component: <Reject />,
  104. });
  105. });
  106. break;
  107. //退单管理新
  108. case "chargeback":
  109. require.ensure([], () => {
  110. const Chargeback = require("./orderNew/chargeback").default;
  111. this.setState({
  112. component: <Chargeback />,
  113. });
  114. });
  115. break;
  116. //退单管理新
  117. case "approveds":
  118. require.ensure([], () => {
  119. const Approveds = require("./orderNew/approveds").default;
  120. this.setState({
  121. component: <Approveds />,
  122. });
  123. });
  124. break;
  125. //合同变更审核
  126. case "contractChangeYxy":
  127. require.ensure([], () => {
  128. const ContractChangeYxy = require("./orderNew/contractChangeYxy")
  129. .default;
  130. this.setState({
  131. component: <ContractChangeYxy />,
  132. });
  133. });
  134. break;
  135. //合同变更审核
  136. case "contractChangeYxgly":
  137. require.ensure([], () => {
  138. const ContractChangeYxgly = require("./orderNew/contractChangeYxgly")
  139. .default;
  140. this.setState({
  141. component: <ContractChangeYxgly />,
  142. });
  143. });
  144. break;
  145. //合同变更审核
  146. case "contractChangeZc":
  147. require.ensure([], () => {
  148. const ContractChangeZc = require("./orderNew/contractChangeZc")
  149. .default;
  150. this.setState({
  151. component: <ContractChangeZc />,
  152. });
  153. });
  154. break;
  155. //合同变更审核
  156. case "contractChangeDsz":
  157. require.ensure([], () => {
  158. const ContractChangeDsz = require("./orderNew/contractChangeDsz")
  159. .default;
  160. this.setState({
  161. component: <ContractChangeDsz />,
  162. });
  163. });
  164. break;
  165. //订单查询新
  166. case "inquiry":
  167. require.ensure([], () => {
  168. const Inquiry = require("./orderNew/inquiry").default;
  169. this.setState({
  170. component: <Inquiry />,
  171. });
  172. });
  173. break;
  174. //催款统计新
  175. case "press":
  176. require.ensure([], () => {
  177. const Press = require("./orderNew/press").default;
  178. this.setState({
  179. component: <Press />,
  180. });
  181. });
  182. break;
  183. case "arrearsList":
  184. require.ensure([], () => {
  185. const ArrearsList = require("./orderNew/arrearsList").default;
  186. this.setState({
  187. component: <ArrearsList />,
  188. });
  189. });
  190. break;
  191. case "orderStatistics":
  192. require.ensure([], () => {
  193. const OrderStatistics = require("./orderStatistics/orderStatistics")
  194. .default;
  195. this.setState({
  196. component: <OrderStatistics />,
  197. });
  198. });
  199. break;
  200. case "serviceManage":
  201. require.ensure([], () => {
  202. const ServiceManage = require("./departmentOrder/servicesOrder/serviceManage")
  203. .default;
  204. this.setState({
  205. component: <ServiceManage />,
  206. });
  207. });
  208. break;
  209. case "public":
  210. require.ensure([], () => {
  211. const PublicOrder = require("./orderManagement/publicOrder/publicOrder")
  212. .default;
  213. this.setState({
  214. component: <PublicOrder />,
  215. });
  216. });
  217. break;
  218. case "approved":
  219. require.ensure([], () => {
  220. const ApproveOrder = require("./orderManagement/approveOrder/approveOrder")
  221. .default;
  222. this.setState({
  223. component: <ApproveOrder />,
  224. });
  225. });
  226. break;
  227. case "mySettlement":
  228. require.ensure([], () => {
  229. const MySettlement = require("./settlementOrder/mySettlement/mySettlement")
  230. .default;
  231. this.setState({
  232. component: <MySettlement />,
  233. });
  234. });
  235. break;
  236. case "settlementManage":
  237. require.ensure([], () => {
  238. const SettlementManage = require("./settlementOrder/settlementManage/settlementManagement")
  239. .default;
  240. this.setState({
  241. component: <SettlementManage />,
  242. });
  243. });
  244. break;
  245. case "myBill":
  246. require.ensure([], () => {
  247. const MyBill = require("./flowSettlement/myBill/myBill.jsx").default;
  248. this.setState({
  249. component: <MyBill />,
  250. });
  251. });
  252. break;
  253. case "billManage":
  254. require.ensure([], () => {
  255. const MyBill = require("./flowSettlement/billManage/myBill.jsx")
  256. .default;
  257. this.setState({
  258. component: <MyBill />,
  259. });
  260. });
  261. break;
  262. case "billQuery":
  263. require.ensure([], () => {
  264. const MyBill = require("./flowSettlement/billQuery/myBill.jsx")
  265. .default;
  266. this.setState({
  267. component: <MyBill />,
  268. });
  269. });
  270. break;
  271. case "billManagement":
  272. require.ensure([], () => {
  273. const MyBill = require("./flowSettlement/billManagement/myBill.jsx")
  274. .default;
  275. this.setState({
  276. component: <MyBill />,
  277. });
  278. });
  279. break;
  280. //奖金
  281. case "yxBouns":
  282. require.ensure([], () => {
  283. const MyBill = require("./bonus/yxBonus.jsx").default;
  284. this.setState({
  285. component: <MyBill />,
  286. });
  287. });
  288. break;
  289. //订单新增空白
  290. default:
  291. require.ensure([], () => {
  292. const Module = require("../module").default;
  293. this.setState({
  294. component: <Module />,
  295. });
  296. });
  297. };
  298. window.location.hash = key;
  299. }
  300. render() {
  301. return (
  302. <div className="manage-content">
  303. <LeftTab handlekey={this.getKey.bind(this)} />
  304. <div className="content-right">
  305. {this.state.component}
  306. </div>
  307. </div>
  308. )
  309. }
  310. }
  311. export default Content;