index.jsx 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. searchConfig:{}
  68. }
  69. }
  70. searchList(){
  71. let arr = [
  72. // {
  73. // type:'autoComplete',
  74. // dataKey:'orderNo',
  75. // dataTitle:'orderNoTitle',
  76. // api:'/api/admin/customer/listAdminByName',
  77. // search:'adminName',
  78. // placeholder:'请输入客户名称'
  79. // },
  80. {
  81. type:'departmentSelect',
  82. dataKey:'depId',
  83. placeholder:'请选择部门'
  84. },
  85. {
  86. type:'times',
  87. title:'下单时间',
  88. dataKey:['startCreate','endCreate'],
  89. },
  90. {
  91. type:'times',
  92. title:'合同时间',
  93. dataKey:['startSign','endSign'],
  94. },
  95. //0签单额 1签单数 2签单人数
  96. {
  97. type:'select',
  98. dataKey:'sort',
  99. placeholder:'请选择排序',
  100. selectList:[
  101. {
  102. value:'0',
  103. label:'按签单额排序'
  104. },
  105. {
  106. value:'1',
  107. label:'按签单数排序'
  108. },
  109. {
  110. value:'2',
  111. label:'按签单人数排序'
  112. },
  113. ]
  114. },
  115. {
  116. type:'select',
  117. dataKey:'province',
  118. placeholder:'请选择省份',
  119. selectOptionList:()=>{
  120. let Province = [];
  121. provinceList.map(function(item) {
  122. let id = String(item.id)
  123. Province.push(
  124. <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
  125. )
  126. });
  127. return Province
  128. },
  129. }
  130. ]
  131. return arr;
  132. }
  133. render() {
  134. return (
  135. <div className="user-content signatureStatistics">
  136. <div className="content-title">
  137. <span>
  138. 签单统计表
  139. </span>
  140. </div>
  141. <TabelContent
  142. scroll={{ x: 0, y: 1000 }}
  143. searchList={this.searchList()}
  144. columns={this.state.columns}
  145. searchOperation={(value)=>{
  146. for(let i of Object.keys(value)){
  147. if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
  148. delete value[i]
  149. }
  150. }
  151. this.setState({searchConfig:value})}
  152. }
  153. tabelApi={'/api/admin/newOrder/statisticsList'}
  154. exportApi={'/api/admin/newOrder/statisticsListExprot'}
  155. exportExecProcessing={(data)=>{
  156. if(data.province){
  157. let arr = provinceList.filter(v=>String(v.id) === String(data.province))
  158. data.provinceName = arr[0].name
  159. }
  160. return data;
  161. }}
  162. dataProcessing={(data)=>{
  163. let theArr = [];
  164. for (let i = 0; i < data.data.length; i++) {
  165. let thisdata = data.data[i];
  166. thisdata.key=i + 1;
  167. theArr.push(thisdata);
  168. }
  169. return theArr;
  170. }}
  171. />
  172. {this.state.visible ? <DetailedList
  173. searchConfig={this.state.searchConfig}
  174. visible={this.state.visible}
  175. recordInfor={this.state.recordInfor}
  176. onCancel={()=>{
  177. this.setState({
  178. visible:false,
  179. recordInfor:{}
  180. })
  181. }}/> : null}
  182. </div>
  183. )
  184. }
  185. }
  186. export default SignatureStatistics;