index.jsx 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. import React, { Component } from "react";
  2. import { Select, } from "antd";
  3. /**
  4. * 驳回位置选择
  5. */
  6. class SelectReject extends Component {
  7. constructor(props) {
  8. super(props);
  9. this.state = {
  10. selValue: 0,
  11. // 0 退单退款
  12. theArr0: [
  13. { value: 0, lable: "营销员", },
  14. { value: 1, lable: "营销经理", },
  15. { value: 2, lable: "营销管理员", },
  16. { value: 3, lable: "技术员", },
  17. { value: 4, lable: "技术经理", },
  18. { value: 5, lable: "技术总监", },
  19. { value: 6, lable: "财务专员", },
  20. { value: 7, lable: "财务总监", },
  21. { value: 8, lable: "公司/部门管理", },
  22. { value: 9, lable: "董事长", },
  23. ],
  24. // 1 项目&金额
  25. theArr1: [
  26. { value: 0, lable: "营销员", },
  27. { value: 1, lable: "营销经理", },
  28. { value: 2, lable: "营销管理员", },
  29. { value: 3, lable: "技术员", },
  30. { value: 4, lable: "技术经理", },
  31. { value: 5, lable: "技术总监", },
  32. { value: 6, lable: "财务专员", },
  33. { value: 7, lable: "财务总监", },
  34. { value: 8, lable: "公司/部门管理", },
  35. ],
  36. // 2 仅项目
  37. theArr2: [
  38. { value: 0, lable: "营销员", },
  39. { value: 1, lable: "营销经理", },
  40. { value: 2, lable: "营销管理员", },
  41. { value: 3, lable: "技术员", },
  42. { value: 4, lable: "技术经理", },
  43. { value: 5, lable: "技术总监", },
  44. { value: 6, lable: "财务专员", },
  45. { value: 7, lable: "财务总监", },
  46. { value: 8, lable: "公司/部门管理", },
  47. ],
  48. // 3 仅金额
  49. theArr3: [
  50. { value: 0, lable: "营销员", },
  51. { value: 1, lable: "营销经理", },
  52. { value: 2, lable: "营销管理员", },
  53. { value: 5, lable: "技术总监", },
  54. { value: 6, lable: "财务专员", },
  55. { value: 7, lable: "财务总监", },
  56. { value: 8, lable: "公司/部门管理", },
  57. ],
  58. // 4 重报
  59. theArr4: [
  60. { value: 0, lable: "营销员", },
  61. { value: 1, lable: "营销经理", },
  62. { value: 2, lable: "营销管理员", },
  63. { value: 3, lable: "技术员", },
  64. { value: 4, lable: "技术经理", },
  65. { value: 6, lable: "财务专员", },
  66. { value: 7, lable: "财务总监", },
  67. { value: 8, lable: "公司/部门管理", },
  68. ],
  69. // 5 赠送
  70. theArr5: [
  71. { value: 0, lable: "营销员", },
  72. { value: 1, lable: "营销经理", },
  73. { value: 2, lable: "营销管理员", },
  74. { value: 6, lable: "财务专员", },
  75. { value: 8, lable: "公司/部门管理", },
  76. ],
  77. // 6 退单不退款
  78. theArr6: [
  79. { value: 0, lable: "营销员", },
  80. { value: 1, lable: "营销经理", },
  81. { value: 2, lable: "营销管理员", },
  82. { value: 3, lable: "技术员", },
  83. { value: 4, lable: "技术经理", },
  84. { value: 5, lable: "技术总监", },
  85. { value: 6, lable: "财务专员", },
  86. { value: 7, lable: "财务总监", },
  87. { value: 8, lable: "公司/部门管理", },
  88. ],
  89. // 7 仅变更合同
  90. theArr7: [
  91. { value: 0, lable: "营销员", },
  92. { value: 2, lable: "营销管理员", },
  93. ],
  94. // 8 框架协议
  95. theArr8: [
  96. { value: 0, lable: "营销员", },
  97. { value: 1, lable: "营销经理", },
  98. { value: 2, lable: "营销管理员", },
  99. { value: 6, lable: "财务专员", },
  100. ],
  101. };
  102. this.onChange = this.onChange.bind(this);
  103. }
  104. componentDidMount() {
  105. }
  106. componentWillUnmount() {
  107. }
  108. componentWillReceiveProps(nextProps) {
  109. }
  110. onChange(e) {
  111. const { onSelect } = this.props
  112. this.setState({
  113. selValue: e
  114. })
  115. onSelect(e)
  116. }
  117. render() {
  118. const { selValue, theArr0, theArr1, theArr2, theArr3, theArr4, theArr5, theArr6, theArr7, theArr8 } = this.state
  119. const { processState, type } = this.props
  120. const opList = type == 0
  121. ? theArr0 : type == 1
  122. ? theArr1 : type == 2
  123. ? theArr2 : type == 3
  124. ? theArr3 : type == 4
  125. ? theArr4 : type == 5
  126. ? theArr5 : type == 6
  127. ? theArr6 : type == 7
  128. ? theArr7 : type == 8 && theArr8
  129. return (
  130. opList.length > 0 &&
  131. <Select
  132. value={selValue}
  133. style={{ width: 120 }}
  134. onChange={this.onChange}
  135. >
  136. {
  137. opList.map(item =>
  138. <Option
  139. value={item.value}
  140. key={item.value}
  141. style={{ display: processState > item.value ? "block" : "none", }}
  142. >{item.lable}</Option>
  143. )
  144. }
  145. </Select>
  146. );
  147. }
  148. }
  149. export default SelectReject;