import React from 'react'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import moment from 'moment'; import '@/manageCenter/financialManage/distribute/public.less'; import { Button, Spin, DatePicker, Radio, message, Icon } from 'antd'; import { getToday, ShowModal } from '@/tools'; import ShowModalDiv from "@/showModal.jsx"; import './index.less'; const RadioButton = Radio.Button; const RadioGroup = Radio.Group; const { RangePicker } = DatePicker const Outbound = React.createClass({ getInitialState() { return { status: 1, releaseDate: getToday(1), dataList: [], htmlMenus: [], } }, componentWillMount() { this.loadData(); this.mainMenu(); }, mainMenu() { $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/selectNavList", data: {}, success: function (data) { if (!data.data) { if (data.error && data.error.length) { message.warning(data.error[0].message); return; } } let menu = data.data; this.setState({ htmlMenus: menu, }); }.bind(this), }).always( function (data) { this.setState({ loading: false, }); }.bind(this) ); }, loadData() { const { releaseDate } = this.state this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/statistics/salesTeam", data: { startTime: releaseDate[0], endTime: releaseDate[1], }, success: function (data) { ShowModal(this); this.setState({ loading: false, }); if (data.error && data.error.length === 0) { this.setState({ dataList: data.data }) } else { message.warning(data.error[0].message); } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, clean() { this.setState({ loading: true, }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/statistics/salesTeam/clean", success: function (data) { if (data.error && data.error.length === 0) { ShowModal(this); this.setState({ loading: false, }); this.loadData(); } else { message.warning(data.error[0].message); } }.bind(this), }).always( function () { this.setState({ loading: false, }); }.bind(this) ); }, search() { this.loadData(); }, reset() { this.state.releaseDate = [] this.loadData(); }, getNewUrl(url, cd) { const { htmlMenus = [] } = this.state let id = '' htmlMenus.map(function (item) { if (item.url == url) { id = item.id; } }); return `${url}?rid=${id}#${cd}` }, isTime(second) { let time = "0秒" if (second > 3600) { time = moment.utc(second * 1000).format('h小时m分s秒') } else if (second > 60) { time = moment.utc(second * 1000).format('m分s秒') } else if (second > 0) { time = moment.utc(second * 1000).format('s秒') } return time }, setParametersInCookies(params) { for (let paramName in params) { if (params.hasOwnProperty(paramName)) { let paramValue = params[paramName]; let expires = ""; let now = new Date(); let date = new Date(now.getTime() + 5 * 1000); expires = "; expires=" + date.toUTCString(); document.cookie = paramName + "=" + encodeURIComponent(paramValue) + expires + "; path=/"; } } }, onOpen(teamId) { // const url = "outboundDetail" // this.props.handlekey(url) const { releaseDate } = this.state const params = { teamId, startTime: releaseDate[0], endTime: releaseDate[1] }; this.setParametersInCookies(params) const url = this.getNewUrl("/admin/customer.html", `outboundDetail`) window.open(url, '_blank') }, render() { const { status, dataList } = this.state return (
{ this.setState({ showModal: false }) }} />
外呼统计
{ this.setState({ status: e.target.value }) if (e.target.value == 0) { this.setState({ releaseDate: [] }) } else { this.setState({ releaseDate: getToday(e.target.value) }, () => { this.loadData() }) } }} > 今日 昨日 近7日 近15日 近30日 自定义 { status == 0 && { this.setState({ releaseDate: dataString }) }} /> }
{ dataList.map(item =>
{item.name}
({["", "一级", "二级", "三级"][item.lvl]})
• 团队人数: {item.teamPeopleSum}
• 拨出次数: {item.teamCallSum}
• 接通次数: {item.teamConnectSum}
• 有效次数: {item.teamValidSum}
) }
); }, }); export default Outbound;