index.jsx 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. import React,{ Component } from 'react';
  2. import {Select} from "antd";
  3. import { provinceList} from '@/NewDicProvinceList';
  4. import './index.less';
  5. import TabelContent from '../../../../common/tabelContent'
  6. import DetailedList from './detailedList';
  7. import moment from "moment";
  8. class InterviewStatistics extends Component{
  9. constructor(props) {
  10. super(props);
  11. this.state={
  12. columns: [
  13. {
  14. title: "序号",
  15. dataIndex: "key",
  16. key: "key",
  17. },
  18. {
  19. title: "省份",
  20. dataIndex: "name",
  21. key: "name",
  22. },
  23. {
  24. title: "老客户面谈数",
  25. dataIndex: "useInterview",
  26. key: "useInterview",
  27. },
  28. {
  29. title: "老客户签单数/金额",
  30. dataIndex: "useQuantity",
  31. key: "useQuantity",
  32. render:(text, record)=>(
  33. text + '/' + record.useTotal
  34. )
  35. },
  36. {
  37. title: "老客户面谈率",
  38. dataIndex: "useRatio",
  39. key: "useRatio",
  40. render:(text)=>(
  41. parseFloat(text) * 100 + '%'
  42. )
  43. },
  44. {
  45. title: "新客户面谈数",
  46. dataIndex: "newInterview",
  47. key: "newInterview",
  48. },
  49. {
  50. title: "新客户签单数/金额",
  51. dataIndex: "newQuantity",
  52. key: "newQuantity",
  53. render:(text, record)=>(
  54. text + '/' + record.newTotal
  55. )
  56. },
  57. {
  58. title: "新客户面谈率",
  59. dataIndex: "newRatio",
  60. key: "newRatio",
  61. render:(text)=>(
  62. parseFloat(text) * 100 + '%'
  63. )
  64. },
  65. {
  66. title: "总面数",
  67. dataIndex: "totalInterview",
  68. key: "totalInterview",
  69. },
  70. {
  71. title: "总签单数/金额",
  72. dataIndex: "totalQuantity",
  73. key: "totalQuantity",
  74. render:(text, record)=>(
  75. text + '/' + record.total
  76. )
  77. },
  78. {
  79. title: "总面谈率",
  80. dataIndex: "totalRatio",
  81. key: "totalRatio",
  82. render:(text)=>(
  83. parseFloat(text) * 100 + '%'
  84. )
  85. },
  86. ],
  87. searchConfig:{}
  88. }
  89. }
  90. searchList(){
  91. let arr = [
  92. {
  93. type:'departmentSelect',
  94. dataKey:'depId',
  95. placeholder:'请选择部门'
  96. },
  97. {
  98. type:'select',
  99. dataKey:'province',
  100. placeholder:'请选择省份',
  101. selectOptionList:()=>{
  102. let Province = [];
  103. provinceList.map(function(item) {
  104. let id = String(item.id)
  105. Province.push(
  106. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  107. )
  108. });
  109. return Province
  110. },
  111. },
  112. //0 总数量 1总金额 2总面谈
  113. {
  114. type:'select',
  115. dataKey:'sort',
  116. placeholder:'请选择排序',
  117. selectList:[
  118. {
  119. value:'0',
  120. label:'按总数量排序'
  121. },
  122. {
  123. value:'1',
  124. label:'按总金额排序'
  125. },
  126. {
  127. value:'2',
  128. label:'按总面谈排序'
  129. },
  130. ]
  131. },
  132. {
  133. type:'times',
  134. title:'公出时间',
  135. dataKey:'date',
  136. format: 'YYYY/MM',
  137. },
  138. ]
  139. return arr;
  140. }
  141. render() {
  142. return (
  143. <div className="user-content interviewStatistics">
  144. <div className="content-title">
  145. <span>
  146. 公出面谈表<span style={{fontSize:'10px',color:'#0f2be5',marginLeft:'10px'}}>注:通过公出打卡,同一家公司,多次面谈数只计算1次</span>
  147. </span>
  148. </div>
  149. <TabelContent
  150. searchList={this.searchList()}
  151. columns={this.state.columns}
  152. searchConfig={{
  153. date:moment().subtract(1, 'months').format("YYYY-MM")
  154. }}
  155. searchOperation={(value)=>{
  156. for(let i of Object.keys(value)){
  157. if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
  158. delete value[i]
  159. }
  160. }
  161. this.setState({searchConfig:value})}
  162. }
  163. tabelApi={'/api/admin/followStatisticsList'}
  164. exportApi={'/api/admin/followStatisticsListExport'}
  165. onRowClick={(row)=>{
  166. this.setState({
  167. visible: true,
  168. recordInfor: row,
  169. })
  170. }}
  171. exportExecProcessing={(data)=>{
  172. if(data.province){
  173. let arr = provinceList.filter(v=>String(v.id) === String(data.province))
  174. data.provinceName = arr[0].name
  175. }
  176. return data;
  177. }}
  178. dataProcessing={(data)=>{
  179. let theArr = [];
  180. for (let i = 0; i < data.data.length; i++) {
  181. let thisdata = data.data[i];
  182. thisdata.key=i + 1;
  183. theArr.push(thisdata);
  184. }
  185. return theArr;
  186. }}
  187. />
  188. {this.state.visible ? <DetailedList
  189. searchConfig={this.state.searchConfig}
  190. visible={this.state.visible}
  191. recordInfor={this.state.recordInfor}
  192. onCancel={()=>{
  193. this.setState({
  194. visible:false,
  195. recordInfor:{}
  196. })
  197. }}/> : null}
  198. </div>
  199. )
  200. }
  201. }
  202. export default InterviewStatistics;