ComplianceServer/oldcode/Core.Web/Views/AiRecord/AiService.cshtml

232 lines
9.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using CRM.Core.Model.Entity
@using Core.Web.WebHelper
@{
/**/
ViewBag.Title = "AiService";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
.self-table-click td {
background-color: #f3ebbc;
}
.playClass {
width: 18px;
margin: 0;
display: initial;
cursor: pointer;
}
#ExportData {
display: inline-block;
vertical-align: middle;
height: 38px;
line-height: 38px;
border: 1px solid transparent;
padding: 0 18px;
background-color: #009688;
color: #fff;
white-space: nowrap;
text-align: center;
font-size: 14px;
border-radius: 2px;
cursor: pointer;
}
</style>
<div class="x-body">
<div class="layui-btn-group" style="padding-bottom:10px;">
@Html.Action("ToolBar", "Home",
new
{
area = "",
rightcode = (ViewBag.rightCode as string),
otherToolBars = new ToolBar[]
{
//new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Add, "创建", " ","",true),
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Edit, "编辑", " " ,"",true)
}
}
)
</div>
<div id="mytoolbar">
AI话术
<div class="layui-inline">
<select name="txt_robot" style="height:35px;">
<option value="-3">全部</option>
@foreach (var item in ViewBag.robotList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
</div>
任务描述:
<div class="layui-inline">
<input type="text" name="txt_robotRemark" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
客户Id
<div class="layui-inline">
<input type="text" name="txt_resId" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
</div>
订单号:
<div class="layui-inline">
<input type="text" name="txt_orderId" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
</div>
客户姓名:
<div class="layui-inline">
<input type="text" name="txt_cname" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
</div>
@*事业部:
<div class="layui-inline">
<select name="txt_channel" style="height:35px;">
<option value="">请选择</option>
@foreach (var item in ViewBag.companyList as List<Bas_CompanyVirtual>)
{
<option value="@item.Channel">@item.CompanyName</option>
}
</select>
</div>*@
AI外呼日期
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="txt_xstime" id="xstart" style="width:120px;" autocomplete="off">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="截止日" name="txt_xetime" id="xend" style="width:120px;" autocomplete="off">
</div>
<button class="layui-btn" data-type="reload">查询</button>
</div>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
<iframe id="BillOpen" width="0" height="0" scrolling="no" frameborder="0" style="display:none;"></iframe>
</div>
<script>
var selectRow = {};
var winindex;
layui.use('layer', function () {
var layer = layui.layer;
var active = {
add: function () {
winindex = layer.open({
type: 2,
content: '/AiRecord/AiServiceEdit',
area: ['1050px', '700px']
});
},
edit: function () {
if (selectRow.RobotName === "undefined" || selectRow.RobotName == null) {
layer.alert("请先选中一条记录!", { title: '提示' });
return;
}
winindex = layer.open({
type: 2,
content: '/AiRecord/AiServiceEdit?key=' + selectRow.RobotName,
area: ['1050px', '700px']
});
},
};
$('.layui-btn-group .layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method].call(this, othis) : '';
});
});
function Closed() {
layer.close(winindex);
}
function TableReload() {
selectRow = {};
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
}
});
}
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({ elem: '#start' });
//执行一个laydate实例
laydate.render({ elem: '#end' });
laydate.render({ elem: '#xstart' });
laydate.render({ elem: '#xend' });
});
layui.use(['table', 'form'], function () {
var table = layui.table;
var form = layui.form;
var param2 = GetParams("mytoolbar");
console.log("param2:" + param2);
table.render({
id: 'testReload',//列表别名ID
elem: '#tabl1',//表ID
url: '/AiRecord/AiService',
method: 'POST',
even: true, //开启隔行背景
cols: [[
{ field: 'RobotName', title: 'AI话术', width: 120 }
, { field: 'Remark', title: '任务描述', width: 120}
, { field: 'WaitCount', title: '待外呼人次', width: 120 }
, { field: 'DoneCount', title: '已外呼人次', width: 120 }
, { field: 'UnConnectCount', title: '未接通人次', width: 120 }
, { field: 'CallCount', title: '已接通人次', width: 120 }
, { field: 'FailCount', title: '失败(未答完)人次', width: 180 }
, { field: 'FailConnectCount', title: '失败(挂断)人次', width: 180 }
, { field: 'SuccessCount', title: '外呼成功人次', width: 120 }
, { field: 'CallPercent', title: '外呼接通率', width: 120 }
, { field: 'CallCompletePercent', title: '外呼完成率', width: 120 }
, { field: 'SuccessPercent', title: '外呼成功率', width: 120 }
, { field: 'WaitOrder', title: '待外呼订单数', width: 120 }
, { field: 'DoneOrder', title: '已外呼订单数', width: 120}
, { field: 'CallOrder', title: '已接通订单数', width: 120}
, { field: 'SuccessOrder', title: '已成功订单数', width: 120}
, { field: 'SuccessOrderPercent', title: '订单完成率', width: 120 }
, { field: 'OrderCompletePercent', title: '订单成功率', width: 120 }
, { field: 'Sms', title: '外呼前是否发短信', width: 120}
, { field: 'detail', title: '查看', templet: '#viewRecordTpl', width: 120, fixed: 'right'}
]]
, page: { //支持传入 laypage 组件的所有参数某些参数除外jump/elem - 详见文档
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
//,curr: 5 //设定初始在第 5 页
, groups: 5 //只显示 1 个连续页码
}
, where: param2
});
//监听行单击事件
table.on('row(tabl1)', function (obj) {
var data = obj.data;
//console.log(data);
//标注选中样式
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
selectRow = data;
});
$('#mytoolbar .layui-btn').on('click', function (data) {
var param = GetParams("mytoolbar");
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
},
where: param
});
});
$('#ExportData').on('click', function (data) {
debugger
var param = GetParams("mytoolbar");
$("#BillOpen").attr("src", "/AiRecord/ExportData?channel=" + param.channel + "&resId=" + param.resId + "&orderId=" + param.orderId + "&cname=" + param.cname + "&aistatus=" + param.aistatus);
});
});
function Detail(robotid) {
parent.gotoAiRecord(robotid, 2)
@* layui.use('layer', function () {
var layer = layui.layer;
layer.open({
title: '外呼明细',
type: 2,
content: '/AiRecord/Index?robotId=' + robotid+"&"+"type=2",
area: ['80%', '80%']
});
});*@
}
</script>
<script type="text/html" id="viewRecordTpl" style="width:100px">
<a href="javascript:void(0)" style="color:blue" onclick="Detail('{{d.Robot}}')">查看外呼明细</a>
</script>