index.jsx 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. class SignatureStatistics extends Component{
  8. constructor(props) {
  9. super(props);
  10. this.state={
  11. columns: [
  12. {
  13. title: "序号",
  14. dataIndex: "key",
  15. key: "key",
  16. width: 120,
  17. },
  18. {
  19. title: "省份",
  20. dataIndex: "province",
  21. key: "province",
  22. width: 120,
  23. },
  24. {
  25. title: "签单人数(人)",
  26. dataIndex: "counts",
  27. key: "counts",
  28. width: 120,
  29. className: 'projectTable',
  30. onCellClick :(record, event)=>{
  31. event.stopPropagation();
  32. this.setState({
  33. visible:true,
  34. recordInfor:record
  35. })
  36. }
  37. },
  38. {
  39. title: "总单量(个)",
  40. dataIndex: "quantity",
  41. key: "quantity",
  42. className: 'projectTable',
  43. width: 120,
  44. onCellClick :(record, event)=>{
  45. event.stopPropagation();
  46. this.setState({
  47. visible:true,
  48. recordInfor:record
  49. })
  50. }
  51. },
  52. {
  53. title: "总签单额(万元)",
  54. dataIndex: "total",
  55. key: "total",
  56. className: 'projectTable',
  57. width: 120,
  58. onCellClick :(record, event)=>{
  59. event.stopPropagation();
  60. this.setState({
  61. visible:true,
  62. recordInfor:record
  63. })
  64. }
  65. },
  66. ],
  67. }
  68. }
  69. searchList(){
  70. let arr = [
  71. {
  72. type:'departmentSelect',
  73. dataKey:'depId',
  74. placeholder:'请选择部门'
  75. },
  76. {
  77. type:'times',
  78. title:'下单时间',
  79. dataKey:['startCreate','endCreate'],
  80. },
  81. {
  82. type:'times',
  83. title:'合同时间',
  84. dataKey:['startSign','endSign'],
  85. },
  86. //0签单额 1签单数 2签单人数
  87. {
  88. type:'select',
  89. dataKey:'sort',
  90. placeholder:'请选择排序',
  91. selectList:[
  92. {
  93. value:'0',
  94. label:'按签单额排序'
  95. },
  96. {
  97. value:'1',
  98. label:'按签单数排序'
  99. },
  100. {
  101. value:'2',
  102. label:'按签单人数排序'
  103. },
  104. ]
  105. },
  106. {
  107. type:'select',
  108. dataKey:'province',
  109. placeholder:'请选择省份',
  110. selectOptionList:()=>{
  111. let Province = [];
  112. provinceList.map(function(item) {
  113. let id = String(item.id)
  114. Province.push(
  115. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  116. )
  117. });
  118. return Province
  119. },
  120. }
  121. ]
  122. return arr;
  123. }
  124. render() {
  125. return (
  126. <div className="user-content signatureStatistics">
  127. <div className="content-title">
  128. <span>
  129. 签单统计表
  130. </span>
  131. </div>
  132. <TabelContent
  133. scroll={{ x: 0, y: 200 }}
  134. searchList={this.searchList()}
  135. columns={this.state.columns}
  136. tabelApi={'/api/admin/newOrder/statisticsList'}
  137. exportApi={'/api/admin/newOrder/statisticsListExprot'}
  138. exportExecProcessing={(data)=>{
  139. if(data.province){
  140. let arr = provinceList.filter(v=>String(v.id) === String(data.province))
  141. data.provinceName = arr[0].name
  142. }
  143. return data;
  144. }}
  145. dataProcessing={(data)=>{
  146. let theArr = [];
  147. for (let i = 0; i < data.data.length; i++) {
  148. let thisdata = data.data[i];
  149. thisdata.key=i + 1;
  150. theArr.push(thisdata);
  151. }
  152. return theArr;
  153. }}
  154. />
  155. {this.state.visible ? <DetailedList
  156. visible={this.state.visible}
  157. recordInfor={this.state.recordInfor}
  158. onCancel={()=>{
  159. this.setState({
  160. visible:false,
  161. recordInfor:{}
  162. })
  163. }}/> : null}
  164. </div>
  165. )
  166. }
  167. }
  168. export default SignatureStatistics;