content.jsx 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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 "pressMoney":
  63. require.ensure([], () => {
  64. const PressMoney = require("./pressMoney").default;
  65. this.setState({
  66. component: <PressMoney />,
  67. });
  68. });
  69. break;
  70. //订单审核新
  71. case "examine":
  72. require.ensure([], () => {
  73. const Examine = require("./orderNew/examine").default;
  74. this.setState({
  75. component: <Examine />,
  76. });
  77. });
  78. break;
  79. //外包审核列表
  80. case "outsourcingList":
  81. require.ensure([], () => {
  82. const OutsourcingList = require("./orderNew/outsourcingList").default;
  83. this.setState({
  84. component: <OutsourcingList />,
  85. });
  86. });
  87. break;
  88. //外包项目审核列表
  89. case "outsourcingPro":
  90. require.ensure([], () => {
  91. const OutsourcingPro = require("./orderNew/OutsourcingPro").default;
  92. this.setState({
  93. component: <OutsourcingPro />,
  94. });
  95. });
  96. break;
  97. //外包审核列表
  98. case "checkOutsourcing":
  99. require.ensure([], () => {
  100. const CheckOutsourcing = require("./orderNew/checkOutsourcing")
  101. .default;
  102. this.setState({
  103. component: <CheckOutsourcing />,
  104. });
  105. });
  106. break;
  107. //驳回管理新
  108. case "reject":
  109. require.ensure([], () => {
  110. const Reject = require("./orderNew/reject").default;
  111. this.setState({
  112. component: <Reject />,
  113. });
  114. });
  115. break;
  116. //退单管理新
  117. case "chargeback":
  118. require.ensure([], () => {
  119. const Chargeback = require("./orderNew/chargeback").default;
  120. this.setState({
  121. component: <Chargeback />,
  122. });
  123. });
  124. break;
  125. //退单管理新
  126. case "approveds":
  127. require.ensure([], () => {
  128. const Approveds = require("./orderNew/approveds").default;
  129. this.setState({
  130. component: <Approveds />,
  131. });
  132. });
  133. break;
  134. //合同变更审核
  135. case "contractChangeYxy":
  136. require.ensure([], () => {
  137. const ContractChangeYxy = require("./orderNew/contractChangeYxy")
  138. .default;
  139. this.setState({
  140. component: <ContractChangeYxy />,
  141. });
  142. });
  143. break;
  144. //合同变更审核
  145. case "contractChangeYxgly":
  146. require.ensure([], () => {
  147. const ContractChangeYxgly = require("./orderNew/contractChangeYxgly")
  148. .default;
  149. this.setState({
  150. component: <ContractChangeYxgly />,
  151. });
  152. });
  153. break;
  154. //合同变更审核
  155. case "contractChangeZc":
  156. require.ensure([], () => {
  157. const ContractChangeZc = require("./orderNew/contractChangeZc")
  158. .default;
  159. this.setState({
  160. component: <ContractChangeZc />,
  161. });
  162. });
  163. break;
  164. //合同变更审核
  165. case "contractChangeDsz":
  166. require.ensure([], () => {
  167. const ContractChangeDsz = require("./orderNew/contractChangeDsz")
  168. .default;
  169. this.setState({
  170. component: <ContractChangeDsz />,
  171. });
  172. });
  173. break;
  174. //订单查询新
  175. case "inquiry":
  176. require.ensure([], () => {
  177. const Inquiry = require("./orderNew/inquiry").default;
  178. this.setState({
  179. component: <Inquiry />,
  180. });
  181. });
  182. break;
  183. //催款统计新
  184. case "press":
  185. require.ensure([], () => {
  186. const Press = require("./orderNew/press").default;
  187. this.setState({
  188. component: <Press />,
  189. });
  190. });
  191. break;
  192. case "arrearsList":
  193. require.ensure([], () => {
  194. const ArrearsList = require("./orderNew/arrearsList").default;
  195. this.setState({
  196. component: <ArrearsList />,
  197. });
  198. });
  199. break;
  200. case "orderStatistics":
  201. require.ensure([], () => {
  202. const OrderStatistics = require("./orderStatistics/orderStatistics")
  203. .default;
  204. this.setState({
  205. component: <OrderStatistics />,
  206. });
  207. });
  208. break;
  209. case "serviceManage":
  210. require.ensure([], () => {
  211. const ServiceManage = require("./departmentOrder/servicesOrder/serviceManage")
  212. .default;
  213. this.setState({
  214. component: <ServiceManage />,
  215. });
  216. });
  217. break;
  218. case "public":
  219. require.ensure([], () => {
  220. const PublicOrder = require("./orderManagement/publicOrder/publicOrder")
  221. .default;
  222. this.setState({
  223. component: <PublicOrder />,
  224. });
  225. });
  226. break;
  227. case "approved":
  228. require.ensure([], () => {
  229. const ApproveOrder = require("./orderManagement/approveOrder/approveOrder")
  230. .default;
  231. this.setState({
  232. component: <ApproveOrder />,
  233. });
  234. });
  235. break;
  236. case "mySettlement":
  237. require.ensure([], () => {
  238. const MySettlement = require("./settlementOrder/mySettlement/mySettlement")
  239. .default;
  240. this.setState({
  241. component: <MySettlement />,
  242. });
  243. });
  244. break;
  245. case "settlementManage":
  246. require.ensure([], () => {
  247. const SettlementManage = require("./settlementOrder/settlementManage/settlementManagement")
  248. .default;
  249. this.setState({
  250. component: <SettlementManage />,
  251. });
  252. });
  253. break;
  254. case "myBill":
  255. require.ensure([], () => {
  256. const MyBill = require("./flowSettlement/myBill/myBill.jsx").default;
  257. this.setState({
  258. component: <MyBill />,
  259. });
  260. });
  261. break;
  262. case "billManage":
  263. require.ensure([], () => {
  264. const MyBill = require("./flowSettlement/billManage/myBill.jsx")
  265. .default;
  266. this.setState({
  267. component: <MyBill />,
  268. });
  269. });
  270. break;
  271. case "billQuery":
  272. require.ensure([], () => {
  273. const MyBill = require("./flowSettlement/billQuery/myBill.jsx")
  274. .default;
  275. this.setState({
  276. component: <MyBill />,
  277. });
  278. });
  279. break;
  280. case "billManagement":
  281. require.ensure([], () => {
  282. const MyBill = require("./flowSettlement/billManagement/myBill.jsx")
  283. .default;
  284. this.setState({
  285. component: <MyBill />,
  286. });
  287. });
  288. break;
  289. //奖金
  290. case "yxBouns":
  291. require.ensure([], () => {
  292. const MyBill = require("./bonus/yxBonus.jsx").default;
  293. this.setState({
  294. component: <MyBill />,
  295. });
  296. });
  297. break;
  298. //订单新增空白
  299. default:
  300. require.ensure([], () => {
  301. const Module = require("../module").default;
  302. this.setState({
  303. component: <Module />,
  304. });
  305. });
  306. };
  307. window.location.hash = key;
  308. }
  309. render() {
  310. return (
  311. <div className="manage-content">
  312. <LeftTab handlekey={this.getKey.bind(this)} />
  313. <div className="content-right">
  314. {this.state.component}
  315. </div>
  316. </div>
  317. )
  318. }
  319. }
  320. export default Content;