index.jsx 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import React,{ Component } from 'react';
  2. import './index.less';
  3. import TabelContent from '../../../../common/tabelContent'
  4. import DetailedList from './detailedList';
  5. class ReceivablesStatistics extends Component{
  6. constructor(props) {
  7. super(props);
  8. this.state={
  9. columns: [
  10. {
  11. title: "序号",
  12. dataIndex: "key",
  13. key: "key",
  14. width: 120,
  15. },
  16. {
  17. title: "催收省份",
  18. dataIndex: "provinceName",
  19. key: "provinceName",
  20. width: 120,
  21. },
  22. {
  23. title: "签单数/签单额(万元)",
  24. dataIndex: "quantity",
  25. key: "quantity",
  26. width: 120,
  27. className: 'projectTable',
  28. render: (text, record) => {
  29. return(
  30. text + '/' + record.totalAmount
  31. )
  32. },
  33. onCellClick :(record, event)=>{
  34. event.stopPropagation();
  35. this.setState({
  36. visible:true,
  37. recordInfor:record
  38. })
  39. }
  40. },
  41. {
  42. title: "应收款(万元)",
  43. dataIndex: "receivables",
  44. key: "receivables",
  45. className: 'projectTable',
  46. width: 120,
  47. onCellClick :(record, event)=>{
  48. event.stopPropagation();
  49. this.setState({
  50. visible:true,
  51. recordInfor:record
  52. })
  53. }
  54. },
  55. ],
  56. searchConfig:{}
  57. }
  58. }
  59. searchList(){
  60. let arr = [
  61. {
  62. type:'departmentSelect',
  63. dataKey:'depId',
  64. placeholder:'请选择部门'
  65. },
  66. {
  67. type:'times',
  68. title:'催收时间',
  69. dataKey:['startDate','endDate'],
  70. },
  71. ]
  72. return arr;
  73. }
  74. render() {
  75. return (
  76. <div className="user-content receivablesStatistics">
  77. <div className="content-title">
  78. <span>
  79. 全国应收款表<span style={{fontSize:'10px',color:'#0f2be5',marginLeft:'10px'}}>应收款:达到收款节点未收到的款</span>
  80. </span>
  81. </div>
  82. <TabelContent
  83. scroll={{ x: 0, y: 200 }}
  84. searchList={this.searchList()}
  85. columns={this.state.columns}
  86. searchOperation={(value)=>{
  87. for(let i of Object.keys(value)){
  88. if(i === 'sort' || i === 'pageNo' || i === 'pageSize'){
  89. delete value[i]
  90. }
  91. }
  92. this.setState({searchConfig:value})}
  93. }
  94. tabelApi={'/api/admin/newOrderDun/selectOrderDunAll'}
  95. exportApi={'/api/admin/newOrderDun//selectOrderDunAllExprot'}
  96. dataProcessing={(data)=>{
  97. let theArr = [];
  98. for (let i = 0; i < data.data.length; i++) {
  99. let thisdata = data.data[i];
  100. thisdata.key=i + 1;
  101. theArr.push(thisdata);
  102. }
  103. return theArr;
  104. }}
  105. />
  106. {this.state.visible ? <DetailedList
  107. searchConfig={JSON.parse(JSON.stringify(this.state.searchConfig))}
  108. visible={this.state.visible}
  109. recordInfor={this.state.recordInfor}
  110. onCancel={()=>{
  111. this.setState({
  112. visible:false,
  113. recordInfor:{}
  114. })
  115. }}/> : null}
  116. </div>
  117. )
  118. }
  119. }
  120. export default ReceivablesStatistics;