index.jsx 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. className: 'projectTable',
  28. onCellClick: (record, event) => {
  29. event.stopPropagation();
  30. record.type = 1;
  31. this.setState({
  32. visible: true,
  33. recordInfor: record,
  34. })
  35. },
  36. },
  37. {
  38. title: "老客户签单数/金额",
  39. dataIndex: "useQuantity",
  40. key: "useQuantity",
  41. render:(text, record)=>(
  42. text + '/' + record.useTotal
  43. ),
  44. className: 'projectTable',
  45. onCellClick: (record, event) => {
  46. event.stopPropagation();
  47. record.type = 1;
  48. this.setState({
  49. visible: true,
  50. recordInfor: record,
  51. })
  52. },
  53. },
  54. {
  55. title: "老客户面谈率",
  56. dataIndex: "useRatio",
  57. key: "useRatio",
  58. render:(text)=>(
  59. parseFloat((parseFloat(text) * 100).toFixed(2)) + '%'
  60. ),
  61. className: 'projectTable',
  62. onCellClick: (record, event) => {
  63. event.stopPropagation();
  64. record.type = 1;
  65. this.setState({
  66. visible: true,
  67. recordInfor: record,
  68. })
  69. },
  70. },
  71. {
  72. title: "新客户面谈数",
  73. dataIndex: "newInterview",
  74. key: "newInterview",
  75. className: 'projectTable',
  76. onCellClick: (record, event) => {
  77. event.stopPropagation();
  78. record.type = 2;
  79. this.setState({
  80. visible: true,
  81. recordInfor: record,
  82. })
  83. },
  84. },
  85. {
  86. title: "新客户签单数/金额",
  87. dataIndex: "newQuantity",
  88. key: "newQuantity",
  89. render:(text, record)=>(
  90. text + '/' + record.newTotal
  91. ),
  92. className: 'projectTable',
  93. onCellClick: (record, event) => {
  94. event.stopPropagation();
  95. record.type = 2;
  96. this.setState({
  97. visible: true,
  98. recordInfor: record,
  99. })
  100. },
  101. },
  102. {
  103. title: "新客户面谈率",
  104. dataIndex: "newRatio",
  105. key: "newRatio",
  106. render:(text)=>(
  107. parseFloat((parseFloat(text) * 100).toFixed(2)) + '%'
  108. ),
  109. className: 'projectTable',
  110. onCellClick: (record, event) => {
  111. event.stopPropagation();
  112. record.type = 2;
  113. this.setState({
  114. visible: true,
  115. recordInfor: record,
  116. })
  117. },
  118. },
  119. {
  120. title: "总面数",
  121. dataIndex: "totalInterview",
  122. key: "totalInterview",
  123. className: 'projectTable',
  124. onCellClick: (record, event) => {
  125. event.stopPropagation();
  126. record.type = 0;
  127. this.setState({
  128. visible: true,
  129. recordInfor: record,
  130. })
  131. },
  132. },
  133. {
  134. title: "总签单数/金额",
  135. dataIndex: "totalQuantity",
  136. key: "totalQuantity",
  137. render:(text, record)=>(
  138. text + '/' + record.total
  139. ),
  140. className: 'projectTable',
  141. onCellClick: (record, event) => {
  142. event.stopPropagation();
  143. record.type = 0;
  144. this.setState({
  145. visible: true,
  146. recordInfor: record,
  147. })
  148. },
  149. },
  150. {
  151. title: "总面谈率",
  152. dataIndex: "totalRatio",
  153. key: "totalRatio",
  154. render:(text)=>(
  155. parseFloat((parseFloat(text) * 100).toFixed(2)) + '%'
  156. ),
  157. className: 'projectTable',
  158. onCellClick: (record, event) => {
  159. event.stopPropagation();
  160. record.type = 0;
  161. this.setState({
  162. visible: true,
  163. recordInfor: record,
  164. })
  165. },
  166. },
  167. ],
  168. searchConfig:{}
  169. }
  170. }
  171. searchList(){
  172. let arr = [
  173. {
  174. type:'departmentSelect',
  175. dataKey:'depId',
  176. placeholder:'请选择部门'
  177. },
  178. {
  179. type:'select',
  180. dataKey:'province',
  181. placeholder:'请选择省份',
  182. selectOptionList:()=>{
  183. let Province = [];
  184. provinceList.map(function(item) {
  185. let id = String(item.id)
  186. Province.push(
  187. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  188. )
  189. });
  190. return Province
  191. },
  192. },
  193. //0 总数量 1总金额 2总面谈
  194. {
  195. type:'select',
  196. dataKey:'sort',
  197. placeholder:'请选择排序',
  198. selectList:[
  199. {
  200. value:'0',
  201. label:'按总数量排序'
  202. },
  203. {
  204. value:'1',
  205. label:'按总金额排序'
  206. },
  207. {
  208. value:'2',
  209. label:'按总面谈排序'
  210. },
  211. ]
  212. },
  213. {
  214. type:'times',
  215. title:'公出时间',
  216. dataKey:'date',
  217. format: 'YYYY/MM',
  218. },
  219. ]
  220. return arr;
  221. }
  222. render() {
  223. return (
  224. <div className="user-content interviewStatistics">
  225. <div className="content-title">
  226. <span>
  227. 公出面谈表<span style={{fontSize:'10px',color:'#0f2be5',marginLeft:'10px'}}>注:通过公出打卡,同一家公司,多次面谈数只计算1次</span>
  228. </span>
  229. </div>
  230. <TabelContent
  231. searchList={this.searchList()}
  232. columns={this.state.columns}
  233. searchConfig={{
  234. date:moment().subtract(1, 'months').format("YYYY-MM")
  235. }}
  236. searchOperation={(value)=>{
  237. for(let i of Object.keys(value)){
  238. if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
  239. delete value[i]
  240. }
  241. }
  242. this.setState({searchConfig:value})}
  243. }
  244. tabelApi={'/api/admin/followStatisticsList'}
  245. exportApi={'/api/admin/followStatisticsListExport'}
  246. onRowClick={()=>{}}
  247. exportExecProcessing={(data)=>{
  248. if(data.province){
  249. let arr = provinceList.filter(v=>String(v.id) === String(data.province))
  250. data.provinceName = arr[0].name
  251. }
  252. return data;
  253. }}
  254. dataProcessing={(data)=>{
  255. let theArr = [];
  256. for (let i = 0; i < data.data.length; i++) {
  257. let thisdata = data.data[i];
  258. thisdata.key=i + 1;
  259. theArr.push(thisdata);
  260. }
  261. return theArr;
  262. }}
  263. />
  264. {this.state.visible ? <DetailedList
  265. searchConfig={this.state.searchConfig}
  266. visible={this.state.visible}
  267. recordInfor={this.state.recordInfor}
  268. onCancel={()=>{
  269. this.setState({
  270. visible:false,
  271. recordInfor:{}
  272. })
  273. }}/> : null}
  274. </div>
  275. )
  276. }
  277. }
  278. export default InterviewStatistics;