营销系统统计

This commit is contained in:
red-deng-deng 2021-11-26 20:22:53 +08:00
parent c44bd69a5a
commit 8504313606
1 changed files with 44 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import ReactDOM from 'react-dom';
import React, { Component } from 'react';
import { HashRouter as Router, Route, Link } from "react-router-dom";
import { Button } from 'zent';
import { Button,Alert } from 'zent';
import "./list.less"
import {Input,openDialog,closeDialog,RadioGroup,Radio ,Notify,Switch ,Swiper,Dropdown,DropdownPosition,DropdownClickTrigger,Icon,MenuItem,DropdownContent,Menu,Sweetalert } from 'zent';
import "../../../assets/comm.css"
@ -34,7 +34,15 @@ export default class acclist extends React.Component{
phone_list:[],
email_list:[],
cur_item:null,
selectiondata:[],
plan_id:0,
grantTotal:0,
receiveTotal:0,
usageTotal:0,
silentTotal:0,
receive_total:0,
usage_total:0,
silent_total:0
}
}
@ -385,6 +393,31 @@ export default class acclist extends React.Component{
});
}
}
//清空
clearFn(){
this.setState({'selectiondata':[]})
}
//选中表格的选框
selection(selection){
this.setState({selectiondata:selection});
let grantTotal=0;
let receiveTotal=0;
let usageTotal=0;
let silentTotal=0;
let receive_total=0;
let usage_total=0;
let silent_total=0;
selection.forEach(item=>{
grantTotal+=Number(item.grant);
receiveTotal+=Number(item.receive);
usageTotal+=Number(item.usage);
silentTotal+=Number(item.silent);
receive_total+=Number(item.receive_total);
usage_total+=Number(item.usage_total);
silent_total+=Number(item.silent_total);
});
this.setState({grantTotal,receiveTotal,usageTotal,silentTotal,receive_total,usage_total,silent_total});
}
onFilter(e){
console.log(e)
this.setState({page:1})
@ -540,6 +573,15 @@ export default class acclist extends React.Component{
</p>
<Filterbar filterList={this.state.filterList} menuList={this.state.menuList} selectFn={(e)=>{this.onFilter(e)}}></Filterbar>
<div>
{this.state.selectiondata.length>0?(<Alert
type="info"
extraContent={<Button type="primary" onClick={this.clearFn.bind(this)}>清空</Button>}
>
已选择<font color="#296bef" style={{fontWeight:'bold'}}>{this.state.selectiondata.length}</font>key:{this.state.grantTotal},key:{this.state.receiveTotal},使:{this.state.usageTotal},:{this.state.silentTotal},():{this.state.receive_total.toFixed(4)},
已使用总价(预估):{this.state.usage_total.toFixed(4)},
沉默总价(预估):{this.state.silent_total.toFixed(4)}
</Alert>):null
}
<Grid
spliteColor={'#fff'}
tableData={this.state.distdata}
@ -555,9 +597,7 @@ export default class acclist extends React.Component{
this.onCountChange(e)
}
}
checkChange ={(selection)=>{
console.log(11,selection)
}}
checkChange ={this.selection.bind(this)}
ComponentHandler={(com,rowData)=>{
if(com == "dates")
{