ComplianceServer/oldcode/Core.Web/Views/HgComplaint/Index.cshtml

392 lines
16 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 Core.Web.WebHelper
@{
ViewBag.Title = "BasicsProductList";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
.self-table-click td {
background-color: #f3ebbc;
}
.keyword {
color: #ff6a00 !important;
}
</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 Core.Web.WebHelper.ToolBar[]{
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other1, "人工标记", " " ,"",true),
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other2, "修改状态", " " ,"",true),
new Core.Web.WebHelper.ToolBar(ToolBarConfig.CONST_Other3, "导出", "layui-btn-normal","",true) ,
}
}
)
</div>
<div id="mytoolbar">
事业部:
<div class="layui-inline">
<div id="deptid" style="width: 400px"></div>
</div>
客户编号:
<div class="layui-inline">
<input type="text" name="txt_UMID" placeholder="请输入" autocomplete="off" class="layui-input" style="width:150px;">
</div>
@*<div class="layui-inline">
<input type="text" name="txt_ResId" placeholder="请输入" autocomplete="off" class="layui-input" style="width:150px;">
</div>*@
客户姓名:
<div class="layui-inline">
<input type="text" name="txt_UName" placeholder="请输入" autocomplete="off" class="layui-input" style="width:120px;">
</div>
标记方法:
<div class="layui-inline">
<select name="txt_SignWay" style="height:35px;">
<option value="">全部</option>
<option value="1">人工标记</option>
<option value="2"> 系统标记</option>
<option value="3">客户投诉</option>
</select>
</div>
标记类型:
<div class="layui-inline">
<select name="txt_SignType" style="height:35px;">
<option value="">全部</option>
<option value="1">电话</option>
<option value="2">违规关键词</option>
<option value="3">投诉连接</option>
</select>
</div>
状态:
<div class="layui-inline">
<select name="txt_Status" style="height:35px;">
<option value="">全部</option>
<option value="0">待跟进</option>
<option value="1">跟进中</option>
<option value="2">已完结</option>
<option value="-1">待跟进(已超时)</option>
</select>
</div>
成交状态:
<div class="layui-inline">
<select name="txt_HasOrder" style="height:35px;">
<option value="">全部</option>
<option value="false">未成交</option>
<option value="true">已成交</option>
</select>
</div>
分配状态:
<div class="layui-inline">
<select name="txt_HasAssign" style="height:35px;">
<option value="">全部</option>
<option value="false">未分配</option>
<option value="true">已分配</option>
</select>
</div>
标记时间:
<div class="layui-inline">
<input class="layui-input" placeholder="开始日" name="txt_STime" id="start" style="width:120px;" autocomplete="off">
</div>
<div class="layui-inline">
<input class="layui-input" placeholder="截止日" name="txt_ETime" id="end" style="width:120px;" autocomplete="off">
</div>
<button class="layui-btn" data-type="reload" id="search">搜索</button>
<input type="button" class="layui-btn layui-btn-normal" id="clear" value="清空" />
</div>
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
</div>
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
<script>
var apiPath = '@ViewBag.apiPath';
var selectRow = {};
var table;
var winindex;
var hgcrmHost = "@Html.Raw(ViewBag.hgServiceHost)";
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({ elem: '#start' });
//执行一个laydate实例
laydate.render({ elem: '#end' });
});
layui.use(['table', 'form','layer'], function () {
table = layui.table;
var layer = layui.layer;
var form = layui.form;
var param2 = GetParams("mytoolbar");
console.log(param2);
table.render({
id: 'testReload',//列表别名ID
elem: '#tabl1',//表ID
url: apiPath +'/Complaint/page',
method: 'Get',
request: {
pageName: 'PageIndex' //页码的参数名称默认page
,limitName: 'PageSize' //每页数据量的参数名默认limit
},
response: {
statusName: 'code' //规定数据状态的字段名称默认code
, statusCode: 0 //规定成功的状态码默认0
, msgName: 'message' //规定状态信息的字段名称默认msg
},
parseData: function (res) { //res 即为原始返回的数据
return {
"code": res.code, //解析接口状态
"msg": res.message, //解析提示文本
"count": res.data.total, //解析数据长度
"data": res.data.data //解析数据列表
};
},
cols: [[
{
field: 'deptName', fixed: 'left', title: '事业部', width: 120
},
//{
// field: 'belongEname', fixed: 'left', title: '更进员工', width: 100
//},
{
field: 'UMID', title: '客户ID', width: 180, fixed: 'left', templet: function (res) {
if (res.resId != '' && res.resId != null) {
var url = hgcrmHost + "Csvr/CustomerInfo/CustomerDetail?hgCustomer=1&isFromHg=1&resid=" + res.umid + "&name=" + encodeURIComponent(res.uname);
var title = "客户明细";
if (res.CNAME) {
title = res.CNAME + "--客户明细";
}
return "<a href=\"javascript:void(0)\" style=\"color:blue\" onclick=\"parent.AddNewTab('" + title + "','" + url + "')\">" + res.umid + "</a>";
} else {
return ""
}
}
}
, { field: 'uname', title: '客户姓名', width: 100 }
, {
field: 'content', title: '潜在投诉内容', width: 400, templet: function (res) {
if (res.keywords != null && res.keywords != '') {
var kw = res.keywords.split(';');
$.each(kw, function (i, e) {
res.content = res.content.replace(e, "<span class='keyword'>" + e + "</span>");
});
}
return res.content;
}
}
, { field: 'signWayStr', title: '标记方式', width: 100 }
, { field: 'signTypeStr', title: '标记类型', width: 120 }
, { field: 'sourceStr', title: '来源', width: 120 }
, { field: 'ctime', title: '标记时间', width: 180 }
, {
field: 'statusStr', title: '状态', width: 100, templet: function (res) {
if (res.statusStr == "待跟进") {
return "<span style='color:orange'>" + res.statusStr + "</span>"
} else if (res.statusStr == "跟进中") {
return "<span style='color:yellow'>" + res.statusStr + "</span>"
} else if (res.statusStr == "已完结") {
return "<span style='color:blue'>" + res.statusStr + "</span>"
} else {
return "<span style='color:red'>" + res.statusStr + "</span>"
}
return res.statusStr;
}
}
, { field: 'countDown', title: '倒计时', width: 150 }
, { field: 'followContent', title: '跟进工单内容', width: 220 }
, { field: 'followTime', title: '跟进时间', width: 180 }
, { field: 'eName', title: '跟进人', width: 100 }
, { field: 'clue', title: '销售线索', templet: '#clueTpl', fixed: 'right', width: 88 }
, { field: 'orderlist', title: '订单情况', fixed: 'right', templet: '#orderTpl', width: 88 }
, { field: 'other', templet: '#other', fixed: 'right', title: '详情', width: 60 }
]]
, page: { //支持传入 laypage 组件的所有参数某些参数除外jump/elem - 详见文档
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip', 'refresh'] //自定义分页布局
//,curr: 5 //设定初始在第 5 页
, groups: 5 //只显示 1 个连续页码
}
, where: param2
});
$('#mytoolbar #search').on('click', function (data) {
var param = GetParams("mytoolbar");
table.reload('testReload', {
page: {
curr: 1 //重新从第 1 页开始
},
where: param
});
});
//清空
$("#clear").on('click', function (e) {
selectChannel.reset();
allChannel.forEach(function (item) {
item.selected = false;
})
selectChannel = xmSelect.render(optionsChannel);
selectChannel.update({ data: allChannel });
$("#mytoolbar input[type='text']").val("");
$("#mytoolbar select").val("");
form.render("select");
});
//监听行单击事件
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;
});
//点击事件
var active = {
//标记客户
other1: function () {
layer.open({
title: '人工标记',
type: 2,
content: '/HgComplaint/Add',
area: ['850px', '600px']
});
},
//修改状态
other2: function () {
if (selectRow.id === "undefined" || selectRow.id == null) {
layer.alert("请先选中一条记录!", { title: '提示' });
return;
}
winindex = layer.open({
title: '修改状态',
type: 2,
content: '/HgComplaint/ChangeStatus?udid=' + selectRow.id,
area: ['600px', '400px']
});
}, other3: function () {
var param = GetParams("mytoolbar");
var hastime = $("#hastime").is(':checked');
console.log("hastime:" + hastime);
if (hastime) {
param["hastime"] = 1;
}
else {
param["hastime"] = 0;
}
if (param.UMID == "" && param.orderId == "" && param.isacturalrefund == "-3" && param.channel == "" && param.price == "" && param.stime == "" && param.etime == "" && param.innamelist == "") {
layer.msg("筛选条件不能全为空");
return;
}
layer.open({
title: '<i class="layui-icon layui-icon-export" style="font-size: 20px; color: #1E9FFF;"></i>&nbsp;导出',
type: 2,
content: "/Control/ExcelExport_cookie?Query=" + encodeURIComponent("/HgComplaint/ExportData?param=" + JSON.stringify(param)),
area: ['850px', '400px']
});
}
};
$('.layui-btn-group .layui-btn').on('click', function () {
var othis = $(this), method = othis.data('method');
active[method] ? active[method].call(this, othis) : '';
});
});
var optionsChannel = {
el: '#deptid',
name: 'txt_deptid',//表单的name属性
layVerify: '',
tips: '请选择事业部',
toolbar: {//工具条,全选,清空,反选,自定义
show: true,
list: [
'CLEAR'
]
},
data: []
};
var selectChannel = xmSelect.render(optionsChannel);
var allChannel = @Html.Raw(ViewBag.AllChannel);
selectChannel.update({ data: allChannel });
function TableReload() {
var param = GetParams("mytoolbar");
table.reload('testReload', {
page: {
curr: Number($(".layui-laypage-em").next().html())//的前页面
},
where: param
});
}
function showInfo(id) {
layui.use('layer', function () {
var layer = layui.layer;
layer.open({
title: '查看情况',
type: 2,
content: '/HgComplaint/ComplaintInfo?complaintLogId=' + id,
area: ['80%', '80%']
});
});
}
function showClue(appid, appuserid) {
debugger
$.r_ajax({
url: "/InComplaint/GetSalesLeadUrl",
type: "Post",
data: { appid: appid, appuserid: appuserid },
dataType: "json",
loading: true,
success: function (rep) {
if (rep.result) {
if (rep.retmsg != null && rep.retmsg.length > 0) {
layui.use('layer', function () {
var layer = layui.layer;
layer.open({
title: '销售线索',
type: 2,
content: rep.retmsg,
area: ['450px', '80%']
});
});
}
}
else {
alert("失败了!");
}
}
});
@* layui.use('layer', function () {
var layer = layui.layer;
layer.open({
title: '销售线索',
type: 2,
content: 'http://sc.soft.dn8188.com/dev.html?appid=' + appid + '&appuserid=' + appuserid,
area: ['450px', '80%']
});
});*@
}
function show(umid) {
parent.gotoOrderListByRes(umid)
}
</script>
<script type="text/html" id="other">
<a href="javascript:void(0)" onclick="showInfo('{{d.id}}')" style="color:blue">查看</a>
</script>
<script type="text/html" id="orderTpl">
{{# if(d.resId != null && d.resId !=''){ }}
<a href="javascript:void(0)" onclick="show('{{d.umid}}')" style="color:blue">查看订单</a>
{{# } }}
</script>
<script type="text/html" id="clueTpl">
{{# if(d.appuserid != null && d.appuserid !=''&& d.appid!=''&& d.appid!=null){ }}
<a href="javascript:void(0)" onclick="showClue('{{d.appid}}','{{d.appuserid}}')" style="color:blue">查看</a>
{{# } }}
</script>