content.jsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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. case "investment": //投资审核
  34. require.ensure([], () => {
  35. let Investment = require("./amiba/investment").default;
  36. this.setState({
  37. component: <Investment type="cwzy" />,
  38. });
  39. });
  40. break;
  41. case "projectvip": //会员项目审核
  42. require.ensure([], () => {
  43. let ProjectVip = require("./distribute/projectvip").default;
  44. this.setState({
  45. component: <ProjectVip />,
  46. });
  47. });
  48. break;
  49. case "projectvipall": //会员项目
  50. require.ensure([], () => {
  51. let ProjectVipAll = require("./distribute/projectvipall").default;
  52. this.setState({
  53. component: <ProjectVipAll />,
  54. });
  55. });
  56. break;
  57. case "paiDan": //派单管理
  58. require.ensure([], () => {
  59. let Module = require("./distribute/paiDan").default;
  60. this.setState({
  61. component: <Module />,
  62. });
  63. });
  64. break;
  65. case "approvedOutsourcing": //外包列表
  66. require.ensure([], () => {
  67. let Module = require("./distribute/approvedOutsourcing").default;
  68. this.setState({
  69. component: <Module />,
  70. });
  71. });
  72. break;
  73. case "outsourcingPaiDan": //外包派单
  74. require.ensure([], () => {
  75. let Module = require("./distribute/outsourcingPaiDan").default;
  76. this.setState({
  77. component: <Module />,
  78. });
  79. });
  80. break;
  81. case "outOutsourcingList": //外省外包列表
  82. require.ensure([], () => {
  83. let Module = require("./distribute/outOutsourcingList").default;
  84. this.setState({
  85. component: <Module />,
  86. });
  87. });
  88. break;
  89. case "outInvoiceQuery": //省外开票查询
  90. require.ensure([], () => {
  91. let Module = require("./distribute/outInvoiceQuery").default;
  92. this.setState({
  93. component: <Module />,
  94. });
  95. });
  96. break;
  97. case "invoiceApplyList": //省内开票管理
  98. require.ensure([], () => {
  99. let Module = require("./distribute/invoiceApplyList").default;
  100. this.setState({
  101. component: <Module />,
  102. });
  103. });
  104. break;
  105. case "invoiceApplyListQuery": //省内开票查询
  106. require.ensure([], () => {
  107. let Module = require("./distribute/invoiceApplyListQuery").default;
  108. this.setState({
  109. component: <Module />,
  110. });
  111. });
  112. break;
  113. case "invoiceApplyListWai": //省外开票管理
  114. require.ensure([], () => {
  115. let Module = require("./distribute/invoiceApplyListWai").default;
  116. this.setState({
  117. component: <Module />,
  118. });
  119. });
  120. break;
  121. case "inSpecial": //省内特批
  122. require.ensure([], () => {
  123. let Module = require("./distribute/inSpecial").default;
  124. this.setState({
  125. component: <Module />,
  126. });
  127. });
  128. break;
  129. case "outSpecial": //省外特批
  130. require.ensure([], () => {
  131. let Module = require("./distribute/outSpecial").default;
  132. this.setState({
  133. component: <Module />,
  134. });
  135. });
  136. break;
  137. case "shouKuang": //收款管理
  138. require.ensure([], () => {
  139. let Module = require("./distribute/shouKuang").default;
  140. this.setState({
  141. component: <Module />,
  142. });
  143. });
  144. break;
  145. case "contractChangeCwzy": //订单变更审核列表
  146. require.ensure([], () => {
  147. let Module = require("./distribute/contractChangeCwzy").default;
  148. this.setState({
  149. component: <Module />,
  150. });
  151. });
  152. break;
  153. case "contractChangeCwzj": //订单变更审核列表
  154. require.ensure([], () => {
  155. let Module = require("./distribute/contractChangeCwzj").default;
  156. this.setState({
  157. component: <Module />,
  158. });
  159. });
  160. break;
  161. case "contractChangeCwjl": //订单变更审核列表
  162. require.ensure([], () => {
  163. let Module = require("./distribute/contractChangeCwjl").default;
  164. this.setState({
  165. component: <Module />,
  166. });
  167. });
  168. break;
  169. case "tuiDan": //退单管理
  170. require.ensure([], () => {
  171. let Module = require("./distribute/tuiDan").default;
  172. this.setState({
  173. component: <Module />,
  174. });
  175. });
  176. break;
  177. case "myWater": //我的订单流水
  178. require.ensure([], () => {
  179. let Module = require("./flowWater/myWater").default;
  180. this.setState({
  181. component: <Module />,
  182. });
  183. });
  184. break;
  185. case "departWater": //部门订单流水
  186. require.ensure([], () => {
  187. let Module = require("./flowWater/departWater").default;
  188. this.setState({
  189. component: <Module />,
  190. });
  191. });
  192. break;
  193. case "yxBonus": //营销员奖金
  194. require.ensure([], () => {
  195. let Module = require("./bonus/yxBonus").default;
  196. this.setState({
  197. component: <Module />,
  198. });
  199. });
  200. break;
  201. case "yxBonusAll": //营销员奖金查看
  202. require.ensure([], () => {
  203. let Module = require("./bonus/yxBonusAll").default;
  204. this.setState({
  205. component: <Module />,
  206. });
  207. });
  208. break;
  209. case "jsBonus": //技术员奖金
  210. require.ensure([], () => {
  211. let Module = require("./bonus/jsBonus").default;
  212. this.setState({
  213. component: <Module />,
  214. });
  215. });
  216. break;
  217. case "jsBonusAll": //技术员奖金查看
  218. require.ensure([], () => {
  219. let Module = require("./bonus/jsBonusAll").default;
  220. this.setState({
  221. component: <Module />,
  222. });
  223. });
  224. break;
  225. case "jsBonus": //技术员奖金
  226. require.ensure([], () => {
  227. let Module = require("./bonus/jsBonus").default;
  228. this.setState({
  229. component: <Module />,
  230. });
  231. });
  232. break;
  233. case "huiKuan": //回款
  234. require.ensure([], () => {
  235. let Module = require("./distribute/huiKuan").default;
  236. this.setState({
  237. component: <Module />,
  238. });
  239. });
  240. break;
  241. case "huiKuanLook": //回款查看
  242. require.ensure([], () => {
  243. let Module = require("./distribute/huiKuanLook").default;
  244. this.setState({
  245. component: <Module />,
  246. });
  247. });
  248. break;
  249. case "shouKuanAll": //全部收款列表
  250. require.ensure([], () => {
  251. let Module = require("./distribute/shouKuanAll").default;
  252. this.setState({
  253. component: <Module />,
  254. });
  255. });
  256. break;
  257. case "approvedOutsourcingAll": //全部外包收款列表
  258. require.ensure([], () => {
  259. let Module = require("./distribute/approvedOutsourcingAll").default;
  260. this.setState({
  261. component: <Module />,
  262. });
  263. });
  264. break;
  265. //催款统计新
  266. case "press":
  267. require.ensure([], () => {
  268. const Press = require("../order/orderNew/press").default;
  269. this.setState({
  270. component: <Press />,
  271. });
  272. });
  273. break;
  274. case "arrearsList":
  275. require.ensure([], () => {
  276. const ArrearsList = require("../order/orderNew/arrearsList").default;
  277. this.setState({
  278. component: <ArrearsList />,
  279. });
  280. });
  281. break;
  282. //成本付款申请列表(财务专员查看)
  283. case "costAuditList":
  284. require.ensure([], () => {
  285. const CostAuditList = require("../order/orderNew/costAuditList").default;
  286. this.setState({
  287. component: <CostAuditList />,
  288. });
  289. });
  290. break;
  291. //成本付款申请列表(财务经理与总监查看)
  292. case "glCostAuditList":
  293. require.ensure([], () => {
  294. const GlCostAuditList = require("../order/orderNew/glCostAuditList").default;
  295. this.setState({
  296. component: <GlCostAuditList />,
  297. });
  298. });
  299. break;
  300. // 报销审核列表
  301. case "accountExamine":
  302. require.ensure([], () => {
  303. const AccountExamine = require("./account/accountExamine").default;
  304. this.setState({
  305. component: <AccountExamine />,
  306. });
  307. });
  308. break;
  309. // 报销列表查看
  310. case "accountView":
  311. require.ensure([], () => {
  312. const AccountView = require("./account/accountView").default;
  313. this.setState({
  314. component: <AccountView />,
  315. });
  316. });
  317. break;
  318. // 报销统计
  319. case "accountstatistics":
  320. require.ensure([], () => {
  321. const AccountStatistics = require("./account/accountStatistics").default;
  322. this.setState({
  323. component: <AccountStatistics />,
  324. });
  325. });
  326. break;
  327. // 报销总计
  328. case "accountTotal":
  329. require.ensure([], () => {
  330. const AccountTotal = require("./account/accountTotal").default;
  331. this.setState({
  332. component: <AccountTotal />,
  333. });
  334. });
  335. break;
  336. // 公出&报销
  337. case "publicityAccount":
  338. require.ensure([], () => {
  339. const PublicityAccount = require("./account/publicityAccount").default;
  340. this.setState({
  341. component: <PublicityAccount />,
  342. });
  343. });
  344. break;
  345. // 费用单列表
  346. case "accountlist":
  347. require.ensure([], () => {
  348. const AccountList = require("./account/accountlist").default;
  349. this.setState({
  350. component: <AccountList />,
  351. });
  352. });
  353. break;
  354. // 费用明细表
  355. case "accountDetaillist":
  356. require.ensure([], () => {
  357. const AccountDetailList = require("./account/accountDetaillist").default;
  358. this.setState({
  359. component: <AccountDetailList />,
  360. });
  361. });
  362. break;
  363. default:
  364. require.ensure([], () => {
  365. let Module = require("../module").default;
  366. this.setState({
  367. component: <Module />,
  368. });
  369. });
  370. };
  371. window.location.hash = key;
  372. }
  373. render() {
  374. return (
  375. <div className="manage-content">
  376. <LeftTab handlekey={this.getKey.bind(this)} />
  377. <div className="content-right">
  378. {this.state.component}
  379. </div>
  380. </div>
  381. )
  382. }
  383. }
  384. export default Content;