|
@@ -1,33 +1,20 @@
|
|
|
import React,{Component} from 'react';
|
|
|
import {
|
|
|
- AutoComplete,
|
|
|
Button,
|
|
|
- Cascader,
|
|
|
- DatePicker, Form,
|
|
|
- Icon,
|
|
|
Input,
|
|
|
message,
|
|
|
- Modal,
|
|
|
Select,
|
|
|
Spin,
|
|
|
Table,
|
|
|
- Tabs,
|
|
|
- Tag
|
|
|
} from "antd";
|
|
|
-import { citySelect, provinceList } from '@/NewDicProvinceList';
|
|
|
-import {getSocialAttribute, beforeUploadFile, getLevel, ShowModal} from "@/tools.js";
|
|
|
-import moment from "moment";
|
|
|
+import './index.less';
|
|
|
import $ from "jquery/src/ajax";
|
|
|
-import IntentionDetail from "../../NEW/intentionCustomer/intentionDetail/intentionDetail";
|
|
|
-
|
|
|
-const {TabPane} = Tabs;
|
|
|
-const { RangePicker } = DatePicker;
|
|
|
+import CustomerDetails from './customerDetails';
|
|
|
|
|
|
class DepartmentStatistics extends Component{
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state={
|
|
|
- releaseDate: [],
|
|
|
superId:'',
|
|
|
nameSearch: '',
|
|
|
|
|
@@ -36,17 +23,27 @@ class DepartmentStatistics extends Component{
|
|
|
title: "部门",
|
|
|
dataIndex: "name",
|
|
|
key: "name",
|
|
|
- width: '40%',
|
|
|
+ width: '25%',
|
|
|
},
|
|
|
{
|
|
|
title: "客户总数",
|
|
|
dataIndex: "userCount",
|
|
|
key: "userCount",
|
|
|
+ className: 'tableRowStyle',
|
|
|
render: (text, record) => {
|
|
|
return (
|
|
|
- <div style={{cursor:"pointer"}} onClick={(e)=>{
|
|
|
- e.stopPropagation();
|
|
|
- }}>
|
|
|
+ <div
|
|
|
+ className={record.aid ? 'receiveCount' : ''}
|
|
|
+ onClick={(e)=>{
|
|
|
+ if(record.aid){
|
|
|
+ e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ customerVisible: true,
|
|
|
+ aid: record.aid,
|
|
|
+ type: 0,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}>
|
|
|
{text}
|
|
|
</div>
|
|
|
);
|
|
@@ -56,11 +53,21 @@ class DepartmentStatistics extends Component{
|
|
|
title: "成交客户总数",
|
|
|
dataIndex: "completeCount",
|
|
|
key: "completeCount",
|
|
|
+ className: 'tableRowStyle',
|
|
|
render: (text, record) => {
|
|
|
return (
|
|
|
- <div style={{cursor:"pointer"}} onClick={(e)=>{
|
|
|
- e.stopPropagation();
|
|
|
- }}>
|
|
|
+ <div
|
|
|
+ className={record.aid ? 'receiveCount' : ''}
|
|
|
+ onClick={(e)=>{
|
|
|
+ if(record.aid){
|
|
|
+ e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ customerVisible: true,
|
|
|
+ aid: record.aid,
|
|
|
+ type: 3,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}>
|
|
|
{text}
|
|
|
</div>
|
|
|
);
|
|
@@ -70,11 +77,21 @@ class DepartmentStatistics extends Component{
|
|
|
title: "新增客户数",
|
|
|
dataIndex: "inputCount",
|
|
|
key: "inputCount",
|
|
|
+ className: 'tableRowStyle',
|
|
|
render: (text, record) => {
|
|
|
return (
|
|
|
- <div style={{cursor:"pointer"}} onClick={(e)=>{
|
|
|
- e.stopPropagation();
|
|
|
- }}>
|
|
|
+ <div
|
|
|
+ className={record.aid ? 'receiveCount' : ''}
|
|
|
+ onClick={(e)=>{
|
|
|
+ if(record.aid){
|
|
|
+ e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ customerVisible: true,
|
|
|
+ aid: record.aid,
|
|
|
+ type: 1,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}>
|
|
|
{text}
|
|
|
</div>
|
|
|
);
|
|
@@ -84,11 +101,21 @@ class DepartmentStatistics extends Component{
|
|
|
title: "新增面谈数",
|
|
|
dataIndex: "interviewCount",
|
|
|
key: "interviewCount",
|
|
|
+ className: 'tableRowStyle',
|
|
|
render: (text, record) => {
|
|
|
return (
|
|
|
- <div style={{cursor:"pointer"}} onClick={(e)=>{
|
|
|
- e.stopPropagation();
|
|
|
- }}>
|
|
|
+ <div
|
|
|
+ className={record.aid ? 'receiveCount' : ''}
|
|
|
+ onClick={(e)=>{
|
|
|
+ if(record.aid){
|
|
|
+ e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ customerVisible: true,
|
|
|
+ aid: record.aid,
|
|
|
+ type: 4,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }}>
|
|
|
{text}
|
|
|
</div>
|
|
|
);
|
|
@@ -98,14 +125,19 @@ class DepartmentStatistics extends Component{
|
|
|
title: "新增领取客户数",
|
|
|
dataIndex: "receiveCount",
|
|
|
key: "receiveCount",
|
|
|
+ className: 'tableRowStyle',
|
|
|
render: (text, record) => {
|
|
|
return (
|
|
|
<div
|
|
|
- className={'receiveCount'}
|
|
|
- style={{cursor:record.aid ? "pointer" : "default"}}
|
|
|
+ className={record.aid ? 'receiveCount' : ''}
|
|
|
onClick={(e)=>{
|
|
|
if(record.aid){
|
|
|
e.stopPropagation();
|
|
|
+ this.setState({
|
|
|
+ customerVisible: true,
|
|
|
+ aid: record.aid,
|
|
|
+ type: 2,
|
|
|
+ })
|
|
|
}
|
|
|
}}>
|
|
|
{text}
|
|
@@ -117,6 +149,10 @@ class DepartmentStatistics extends Component{
|
|
|
contactsOption:null,
|
|
|
loading: false,
|
|
|
ispage: 1,
|
|
|
+
|
|
|
+ aid:'',
|
|
|
+ type:'',
|
|
|
+ visible:false,
|
|
|
};
|
|
|
this.loadData = this.loadData.bind(this);
|
|
|
this.reset = this.reset.bind(this);
|
|
@@ -128,17 +164,24 @@ class DepartmentStatistics extends Component{
|
|
|
this.selectSuperId();
|
|
|
}
|
|
|
|
|
|
- loadData(pageNo) {
|
|
|
+ loadData() {
|
|
|
this.setState({
|
|
|
loading: true,
|
|
|
});
|
|
|
let api = '/api/admin/customer/selectAllUser';
|
|
|
+ let data = {};
|
|
|
+ if(this.state.superId){
|
|
|
+ data.depId = this.state.superId;
|
|
|
+ }
|
|
|
+ if(this.state.nameSearch){
|
|
|
+ data.aName = this.state.nameSearch;
|
|
|
+ }
|
|
|
$.ajax({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
url: globalConfig.context + api,
|
|
|
- data: {},
|
|
|
+ data: data,
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
|
if (data.error.length !== 0) {
|
|
@@ -147,8 +190,9 @@ class DepartmentStatistics extends Component{
|
|
|
}
|
|
|
} else {
|
|
|
data.data.children = data.data.list;
|
|
|
+ data.data.children = data.data.children.concat(data.data.aList);
|
|
|
theArr.push(data.data);
|
|
|
- theArr = this.handleTabsInfor(theArr.concat(data.data.aList));
|
|
|
+ theArr = this.handleTabsInfor(theArr);
|
|
|
console.log(theArr,'表格数据')
|
|
|
this.setState({
|
|
|
ispage: data.data.pageNo,
|
|
@@ -175,6 +219,7 @@ class DepartmentStatistics extends Component{
|
|
|
for(let c=0;c<infor[i].children.length;c++){
|
|
|
infor[i].children[c].key = infor[i].children[c].id;
|
|
|
infor[i].children[c].children = infor[i].children[c].list;
|
|
|
+ if(infor[i].children[c].aName){infor[i].children[c].name = infor[i].children[c].aName}
|
|
|
if(infor[i].children[c].aList && Array.isArray(infor[i].children[c].aList) && infor[i].children[c].aList.length){
|
|
|
if(infor[i].children[c].children && Array.isArray(infor[i].children[c].children)){
|
|
|
for(let t of infor[i].children[c].aList){
|
|
@@ -193,7 +238,6 @@ class DepartmentStatistics extends Component{
|
|
|
|
|
|
reset(){
|
|
|
this.setState({
|
|
|
- releaseDate: [],
|
|
|
superId:'',
|
|
|
nameSearch: '',
|
|
|
},()=>{
|
|
@@ -251,22 +295,6 @@ class DepartmentStatistics extends Component{
|
|
|
<span>指导意见</span>
|
|
|
</div>
|
|
|
<div className="user-search" style={{display:'flex',alignItems:'center'}}>
|
|
|
- <RangePicker
|
|
|
- style={{
|
|
|
- marginTop: '10px',
|
|
|
- }}
|
|
|
- value={[
|
|
|
- this.state.releaseDate[0]
|
|
|
- ? moment(this.state.releaseDate[0])
|
|
|
- : null,
|
|
|
- this.state.releaseDate[1]
|
|
|
- ? moment(this.state.releaseDate[1])
|
|
|
- : null,
|
|
|
- ]}
|
|
|
- onChange={(data, dataString) => {
|
|
|
- this.setState({ releaseDate: dataString });
|
|
|
- }}
|
|
|
- />
|
|
|
<div>
|
|
|
<Select placeholder="请选择部门"
|
|
|
style={{ width:200,marginLeft:10}}
|
|
@@ -303,6 +331,18 @@ class DepartmentStatistics extends Component{
|
|
|
/>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
+ {this.state.customerVisible ? <CustomerDetails
|
|
|
+ aid={this.state.aid}
|
|
|
+ type={this.state.type}
|
|
|
+ visible={this.state.customerVisible}
|
|
|
+ onCancel={()=>{
|
|
|
+ this.setState({
|
|
|
+ customerVisible: false,
|
|
|
+ aid: '',
|
|
|
+ type: '',
|
|
|
+ })
|
|
|
+ }}
|
|
|
+ /> : <div/>}
|
|
|
</div>
|
|
|
)
|
|
|
}
|