content.jsx 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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 "paiDan": //派单管理
  34. require.ensure([], () => {
  35. let Module = require("./distribute/paiDan").default;
  36. this.setState({
  37. component: <Module />,
  38. });
  39. });
  40. break;
  41. case "approvedOutsourcing": //外包列表
  42. require.ensure([], () => {
  43. let Module = require("./distribute/approvedOutsourcing").default;
  44. this.setState({
  45. component: <Module />,
  46. });
  47. });
  48. break;
  49. case "outsourcingPaiDan": //外包派单
  50. require.ensure([], () => {
  51. let Module = require("./distribute/outsourcingPaiDan").default;
  52. this.setState({
  53. component: <Module />,
  54. });
  55. });
  56. break;
  57. case "outOutsourcingList": //外省外包列表
  58. require.ensure([], () => {
  59. let Module = require("./distribute/outOutsourcingList").default;
  60. this.setState({
  61. component: <Module />,
  62. });
  63. });
  64. break;
  65. case "outInvoiceQuery": //省外开票查询
  66. require.ensure([], () => {
  67. let Module = require("./distribute/outInvoiceQuery").default;
  68. this.setState({
  69. component: <Module />,
  70. });
  71. });
  72. break;
  73. case "invoiceApplyList": //省内开票管理
  74. require.ensure([], () => {
  75. let Module = require("./distribute/invoiceApplyList").default;
  76. this.setState({
  77. component: <Module />,
  78. });
  79. });
  80. break;
  81. case "invoiceApplyListQuery": //省内开票查询
  82. require.ensure([], () => {
  83. let Module = require("./distribute/invoiceApplyListQuery").default;
  84. this.setState({
  85. component: <Module />,
  86. });
  87. });
  88. break;
  89. case "invoiceApplyListWai": //省外开票管理
  90. require.ensure([], () => {
  91. let Module = require("./distribute/invoiceApplyListWai").default;
  92. this.setState({
  93. component: <Module />,
  94. });
  95. });
  96. break;
  97. case "inSpecial": //省内特批
  98. require.ensure([], () => {
  99. let Module = require("./distribute/inSpecial").default;
  100. this.setState({
  101. component: <Module />,
  102. });
  103. });
  104. break;
  105. case "outSpecial": //省外特批
  106. require.ensure([], () => {
  107. let Module = require("./distribute/outSpecial").default;
  108. this.setState({
  109. component: <Module />,
  110. });
  111. });
  112. break;
  113. case "shouKuang": //收款管理
  114. require.ensure([], () => {
  115. let Module = require("./distribute/shouKuang").default;
  116. this.setState({
  117. component: <Module />,
  118. });
  119. });
  120. break;
  121. case "contractChangeCwzy": //订单变更审核列表
  122. require.ensure([], () => {
  123. let Module = require("./distribute/contractChangeCwzy").default;
  124. this.setState({
  125. component: <Module />,
  126. });
  127. });
  128. break;
  129. case "contractChangeCwzj": //订单变更审核列表
  130. require.ensure([], () => {
  131. let Module = require("./distribute/contractChangeCwzj").default;
  132. this.setState({
  133. component: <Module />,
  134. });
  135. });
  136. break;
  137. case "contractChangeCwjl": //订单变更审核列表
  138. require.ensure([], () => {
  139. let Module = require("./distribute/contractChangeCwjl").default;
  140. this.setState({
  141. component: <Module />,
  142. });
  143. });
  144. break;
  145. case "tuiDan": //退单管理
  146. require.ensure([], () => {
  147. let Module = require("./distribute/tuiDan").default;
  148. this.setState({
  149. component: <Module />,
  150. });
  151. });
  152. break;
  153. case "myWater": //我的订单流水
  154. require.ensure([], () => {
  155. let Module = require("./flowWater/myWater").default;
  156. this.setState({
  157. component: <Module />,
  158. });
  159. });
  160. break;
  161. case "departWater": //部门订单流水
  162. require.ensure([], () => {
  163. let Module = require("./flowWater/departWater").default;
  164. this.setState({
  165. component: <Module />,
  166. });
  167. });
  168. break;
  169. case "yxBonus": //营销员奖金
  170. require.ensure([], () => {
  171. let Module = require("./bonus/yxBonus").default;
  172. this.setState({
  173. component: <Module />,
  174. });
  175. });
  176. break;
  177. case "yxBonusAll": //营销员奖金查看
  178. require.ensure([], () => {
  179. let Module = require("./bonus/yxBonusAll").default;
  180. this.setState({
  181. component: <Module />,
  182. });
  183. });
  184. break;
  185. case "jsBonus": //技术员奖金
  186. require.ensure([], () => {
  187. let Module = require("./bonus/jsBonus").default;
  188. this.setState({
  189. component: <Module />,
  190. });
  191. });
  192. break;
  193. case "jsBonusAll": //技术员奖金查看
  194. require.ensure([], () => {
  195. let Module = require("./bonus/jsBonusAll").default;
  196. this.setState({
  197. component: <Module />,
  198. });
  199. });
  200. break;
  201. case "jsBonus": //技术员奖金
  202. require.ensure([], () => {
  203. let Module = require("./bonus/jsBonus").default;
  204. this.setState({
  205. component: <Module />,
  206. });
  207. });
  208. break;
  209. case "huiKuan": //回款
  210. require.ensure([], () => {
  211. let Module = require("./distribute/huiKuan").default;
  212. this.setState({
  213. component: <Module />,
  214. });
  215. });
  216. break;
  217. case "huiKuanLook": //回款查看
  218. require.ensure([], () => {
  219. let Module = require("./distribute/huiKuanLook").default;
  220. this.setState({
  221. component: <Module />,
  222. });
  223. });
  224. break;
  225. case "shouKuanAll": //全部收款列表
  226. require.ensure([], () => {
  227. let Module = require("./distribute/shouKuanAll").default;
  228. this.setState({
  229. component: <Module />,
  230. });
  231. });
  232. break;
  233. case "approvedOutsourcingAll": //全部外包收款列表
  234. require.ensure([], () => {
  235. let Module = require("./distribute/approvedOutsourcingAll").default;
  236. this.setState({
  237. component: <Module />,
  238. });
  239. });
  240. break;
  241. //催款统计新
  242. case "press":
  243. require.ensure([], () => {
  244. const Press = require("../order/orderNew/press").default;
  245. this.setState({
  246. component: <Press />,
  247. });
  248. });
  249. break;
  250. case "arrearsList":
  251. require.ensure([], () => {
  252. const ArrearsList = require("../order/orderNew/arrearsList").default;
  253. this.setState({
  254. component: <ArrearsList />,
  255. });
  256. });
  257. break;
  258. //成本付款申请列表(财务专员查看)
  259. case "costAuditList":
  260. require.ensure([], () => {
  261. const CostAuditList = require("../order/orderNew/costAuditList").default;
  262. this.setState({
  263. component: <CostAuditList />,
  264. });
  265. });
  266. break;
  267. //成本付款申请列表(财务经理与总监查看)
  268. case "glCostAuditList":
  269. require.ensure([], () => {
  270. const GlCostAuditList = require("../order/orderNew/glCostAuditList").default;
  271. this.setState({
  272. component: <GlCostAuditList />,
  273. });
  274. });
  275. break;
  276. default:
  277. require.ensure([], () => {
  278. let Module = require("../module").default;
  279. this.setState({
  280. component: <Module />,
  281. });
  282. });
  283. };
  284. window.location.hash = key;
  285. }
  286. render() {
  287. return (
  288. <div className="manage-content">
  289. <LeftTab handlekey={this.getKey.bind(this)} />
  290. <div className="content-right">
  291. {this.state.component}
  292. </div>
  293. </div>
  294. )
  295. }
  296. }
  297. export default Content;