import React, { Component } from "react";
import {
AutoComplete,
Button,
DatePicker,
Input,
message,
Modal,
Select,
Spin,
Table,
Tabs,
Tag,
Tooltip,
} from "antd";
import { ShowModal, getPercentage } from "@/tools";
import { salesList, } from "@/dataDic"
import { ChooseList } from "../../order/orderNew/chooseList";
import $ from "jquery/src/ajax";
import "./index.less";
import moment from "moment";
import DetailList from "./detaillist";
const { TabPane } = Tabs;
const { RangePicker } = DatePicker;
class SignStatistics extends Component {
constructor(props) {
super(props);
this.state = {
pageNo: 1,
loading: false,
changeList: undefined,
columns: [
{
title: "营销员",
dataIndex: "name",
key: "name",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
this.setState({
showDetail: true,
rowData: cellData,
})
},
},
{
title: "签单客户",
dataIndex: "userCount",
key: "userCount",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
this.setState({
showDetail: true,
rowData: cellData,
})
},
},
{
title: "签单个数",
dataIndex: "orderCount",
key: "orderCount",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{text}
},
{
title: "签单总金额(万元)",
dataIndex: "totalAmount",
key: "totalAmount",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
this.setState({
showDetail: true,
rowData: cellData,
})
},
},
{
title: "新签数",
dataIndex: "newSignNumber",
key: "newSignNumber",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
cellData["orderType"] = "1"
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{text}
},
{
title: "新签率",
dataIndex: "newRatio",
key: "newRatio",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
cellData["orderType"] = "1"
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{getPercentage(text)}
},
{
title: "复购数",
dataIndex: "repeatSignNumber",
key: "repeatSignNumber",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
cellData["orderType"] = "2"
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{text}
},
{
title: "复购率",
dataIndex: "repeatRatio",
key: "repeatRatio",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
cellData["orderType"] = "2"
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{getPercentage(text)}
},
{
title: "渠道签单数",
dataIndex: "channelSignNumber",
key: "channelSignNumber",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
cellData["orderType"] = "3"
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{text}
},
{
title: "渠道签单率",
dataIndex: "channelRatio",
key: "channelRatio",
onCellClick: (r) => {
let cellData = {};
cellData["aid"] = r.id
cellData["aname"] = r.name
cellData["orderType"] = "3"
this.setState({
showDetail: true,
rowData: cellData,
})
},
render: (text) =>
{getPercentage(text)}
},
],
pagination: {
defaultCurrent: 1,
defaultPageSize: 10,
showQuickJumper: true,
pageSize: 99999,
onChange: function (page) {
this.loadData(page);
}.bind(this),
showTotal: function (total) {
return "共" + total + "条数据";
},
},
dataSource: [],
searchInfor: {},
params: {},
showDetail: false,
companyList: [],
};
this.loadData = this.loadData.bind(this);
this.resetAll = this.resetAll.bind(this);
this.changeList = this.changeList.bind(this);
this.selectSuperId = this.selectSuperId.bind(this);
this.supervisor = this.supervisor.bind(this);
this.httpChange = this.httpChange.bind(this);
this.blurChange = this.blurChange.bind(this);
this.selectAuto = this.selectAuto.bind(this);
this.exportExec = this.exportExec.bind(this);
}
//获取上级组织
selectSuperId() {
$.ajax({
method: "get",
dataType: "json",
crossDomain: false,
url: globalConfig.context + "/api/admin/organization/selectSuperId",
data: {},
success: function (data) {
let theArr = [];
if (data.error && data.error.length === 0) {
for (let i = 0; i < data.data.length; i++) {
let theData = data.data[i];
theArr.push(