| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../css/init.css" />
- <title>点击任务管理</title>
- <style type="text/css">
- .zt, .cz {
- display: block;
- height: 20px;
- width: 20px;
- margin: 0 auto;
- }
- .zt {
- background: url(../img/bf1.png) no-repeat;
- }
- .cz {
- background: url(../img/sz1.png) no-repeat;
- }
- .jia {
- display: inline-block;
- height: 16px;
- width: 16px;
- background: url(../img/jia.png) no-repeat;
- vertical-align: sub;
- margin-right: 3px;
- }
- .tool {
- margin: 20px 0;
- }
- .search input {
- width: 99%;
- height: 98%;
- border: 0;
- outline: none;
- padding-left: 10px;
- }
- .secon {
- width: 80%;
- height: 30px;
- }
- .secl {
- width: 90%;
- height: 100%;
- float: left;
- margin: 0;
- border: 1px solid #eee;
- }
- .stb {
- display: block;
- width: 10%;
- background-color: #1ab394;
- background-image: url(../img/sear1.png);
- background-position: center center;
- background-repeat: no-repeat;
- height: 100%;
- float: left;
- border: 0;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- }
- .cz_down {
- position: absolute;
- top: 130%;
- left: -42px;
- z-index: 9999;
- display: none;
- float: left;
- list-style: none;
- text-shadow: none;
- margin: 0px;
- background: #fff;
- border: 1px solid #e5e5e5;
- text-align: left;
- padding: 5px;
- }
- .cz_down li > a {
- padding: 6px 0 6px 13px;
- color: #333;
- text-decoration: none;
- display: block;
- clear: both;
- font-weight: normal;
- line-height: 18px;
- white-space: nowrap;
- }
- .cz_down li:hover {
- background: #eee;
- }
- .cz_down .divider {
- height: 1px;
- margin: 9px 1px;
- overflow: hidden;
- background-color: #e5e5e5;
- border-bottom: 1px solid #e5e5e5;
- }
- .ztColor {
- padding: 2px;
- color: #fff;
- }
- .taskName {
- cursor: pointer;
- }
- .ztc {
- background: #fcb322;
- }
- .clw {
- background: #3cc051;
- }
- .clz {
- background: #57b5e3;
- }
- .dzx {
- background: #ed4e2a;
- }
- .ysc {
- background: #ef2e18;
- }
- </style>
- </head>
- <body>
- <div class="container-fluid">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn>
- <i class="syIcon"></i>位置:
- <a id="ReIndex" href="javaScript:;">首页</a>>
- <a href="javaScript:;">外呼管理</a>>
- <a href="javaScript:;">点击外呼管理</a>>
- <a href="javaScript:;" style="color: #000;">外呼任务管理</a>
- </sapn>
- </div>
- </div>
- <div class="tcon">
- <div class="tool clearfix">
- <div class="search col-sm-7">
- <div class="secon clearfix">
- <p class="secl"><input type="text" placeholder="请输入任务名称" class="searCon" /></p>
- <button href="javaScript:;" class="stb"></button>
- </div>
- </div>
- <div class="search col-sm-5" style="text-align: right;">
- <button class="btns refresh">刷新</button>
- <button class="btns addTask"><i class="jia"></i>添加任务</button>
- </div>
- </div>
- <table id="table1" data-row-style="rowStyle" data-classes="table table-no-bordered" data-query-params="queryParams" data-height="480">
- <thead>
- <tr>
- <!--<th data-align="center" data-formatter="setCode"></th>-->
- <th data-field="id" data-align="center">标志Id</th>
- <th data-field="name" data-align="center">任务名称</th>
- <th data-field="tasktype" data-align="center">任务类型</th>
- <th data-field="deptname" data-align="center">任务所属</th>
- <th data-field="allcount" data-align="center">号码数</th>
- <th data-field="calledcount" data-align="center">已呼叫数量</th>
- <th data-field="callleftcount" data-align="center">剩余</th>
- <th data-field="calledrate" data-align="center">呼出率</th>
- <th data-field="connected" data-align="center">接通数</th>
- <th data-field="connectedrate" data-align="center">接通率</th>
- <th data-field="addagent" data-align="center">创建人</th>
- <th data-field="addtime" data-align="center">创建时间</th>
- <th data-field="state" data-align="center" data-formatter="oper">状态</th>
- <th data-formatter="CZ" data-align="center">操作</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <script>
- var sear;
- var token = $.cookie("token");
- var table = $('#table1');
- $('.addTask').click(function () {
- top.$("iframe:visible")[0].src = "clickcall/add.html";
- })
- //搜索功能
- $('.stb').click(function () {
- sear = $('.searCon').val();
- initTable(token, sear);
- });
- initTable(token)
- function initTable(token, sear) {
- //先销毁表格
- table.bootstrapTable('destroy');
- //初始化表格,动态从服务器加载数据
- table.bootstrapTable({
- method: "get", //使用get请求到服务器获取数据
- url: huayi.config.callcenter_url + "CallPlan/GetList", //获取数据的Servlet地址
- contentType: "application/x-www-form-urlencoded", striped: true,
- striped: true, //表格显示条纹
- pagination: true, //启动分页
- pageSize: 10, //每页显示的记录数
- pageNumber: 1, //当前第几页
- pageList: [10, 15, 25], //记录数可选列表
- search: false, //是否启用查询
- showColumns: false, //显示下拉框勾选要显示的列
- showRefresh: false, //显示刷新按钮
- sidePagination: "server", //表示服务端请求
- //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
- //设置为limit可以获取limit, offset, search, sort, order
- queryParamsType: "undefined",
- queryParams: function queryParams(params) { //设置查询参数
- var param = {
- pageindex: params.pageNumber,
- pagesize: params.pageSize,
- token: token,
- name: sear,
- tasktype: 1
- };
- return param;
- },
- onLoadSuccess: function () { //加载成功时执行
- //layer.msg("加载成功");
- },
- onLoadError: function () { //加载失败时执行
- //layer.msg("加载数据失败", { time: 1500, icon: 2 });
- }
- });
- }
- //任务名称跳转
- function turnGoAdd(id) {
- top.$("iframe:visible")[0].src = "clickcall/taskDetail.html?id=" + id;
- }
- function oper(val, row) {
- if (val == '暂停') {
- return '<span class="ztColor ztc">' + val + '</span>'
- } else if (val == '处理完成') {
- return '<span class="ztColor clw">' + val + '</span>'
- } else if (val == '处理中') {
- return '<span class="ztColor clz">' + val + '</span>'
- } else if (val == '已删除') {
- return '<span class="ztColor ysc">' + val + '</span>'
- }
- }
- function CZ(val, row) {
- return '<div style="position:relative;" class="tools" onclick= cc(this)>' +
- '<a class="cza" title="操作" style="display:block;" ><i class="cz"></i></a>' +
- '<ul class="cz_down">' +
- '<li><a href="./phonelist.html?id=' + row.id + '"><i class="fa fa-eye tub"></i>查看号码</a></li>' +
- '<li class="divider"></li>' +
- '<li><a href="javaScript:;" onclick= Update("' + row.id + '","' + 1 + '")><i class="fa fa-play tub"></i>开始</a></li>' +
- '<li><a href="javaScript:;" onclick= Update("' + row.id + '","' + 2 + '")><i class="fa fa-pause tub"></i>暂停</a></li>' +
- '<li><a href="javaScript:;" onclick= Update("' + row.id + '","' + 3 + '")><i class="fa fa-stop tub"></i>手工关闭</a></li>' +
- '<li class="divider"></li>' +
- '<li><a href="javaScript:;" onclick= expjt("' + row.id + '","' + 2 + '")><i class="fa fa-arrow-down tub"></i>导出已接通</a></li>' +
- '<li><a href="javaScript:;" onclick= expjt("' + row.id + '","' + 1 + '")><i class="fa fa-arrow-down tub"></i>导出未接通</a></li>' +
- '<li><a href="javaScript:;" class="bianji" onclick= edit("' + row.id + '")><i class="fa fa-pencil tub"></i>编辑</a></li>' +
- '<li><a href="javaScript:;" onclick= Update("' + row.id + '","' + -1 + '")><i class="fa fa-remove tub"></i>删除</a></li>' +
- '<li><a href="javaScript:;" class="empty" onclick= empty("' + row.id + '") ><i class="fa fa-remove tub"></i>清空号码</a></li>' +
- '</ul>' +
- '</div>'
- }
- function cc(obj) {
- $(obj).find('.cz_down').toggle();
- $(obj).parent().parent().siblings().find('.cz_down').hide();
- }
- //刷新表格
- $('.refresh').click(function () {
- table.bootstrapTable('refresh');
- })
- //跳转编辑页面
- function edit(ids) {
- top.$("iframe:visible")[0].src = "clickcall/edit.html?id=" + ids;
- }
- //清空号码
- function empty(idd) {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "CallPlan/ClearPhone",
- async: true,
- dataType: 'json',
- data: {
- token: token,
- id: idd
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- layer.msg(data.message);
- }
- }
- });
- }
- //导出已接通或者未接通 1=导出未接通号码 2=导出已接通号码
- function expjt(tid, type) {
- window.open(huayi.config.callcenter_url + "CallPlan/ExportData?taskId=" + tid + "&type=" + type);
- }
- // 更新外呼状态 -1 删除 0 手工关闭 1 开始 2暂停
- function Update(uid, num) {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "CallPlan/UpdateState",
- async: true,
- dataType: 'json',
- data: {
- token: token,
- ids: uid,
- state: num
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- top.$("iframe:visible")[0].src = location.href;
- }
- }
- });
- }
- </script>
- </body>
- </html>
|