TG.WXCRM.V4/WEB/Views/WeiXin/DealCustomer/List.cshtml

369 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 WX.CRM.WebHelper
@{
ViewBag.Title = "成交客户跟进列表";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<style>
body {
overflow: hidden
}
.tip-icon {
padding: 0px 4px;
border-radius: 2px;
background-color: #ff6a00;
color: aliceblue;
}
#statbox{
display:flex;
width:100%;
}
#statbox .stat-item {
text-align: center;
padding: 5px 26px 5px 0px;
}
</style>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnExport", "icon-export", "导出", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="bas_datagrid">
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
<ul class="toolBar_ul">
<li>
<span>客户id</span>
<input type="text" id="txt_umid" name="txt_umid" style="width:130px">
</li>
<li>
<span>客户姓名:</span>
<input type="text" id="txt_cnname" name="txt_cnname" style="width:130px">
</li>
<li>
<span>资金量:</span>
<select name="txt_amount_type_id" id="txt_amount_type_id">
<option value="">全部</option>
<option value="0">未知</option>
<option value="1">10万以下</option>
<option value="2">10-20万</option>
<option value="3">20-30万</option>
</select>
</li>
<li>
<span>在期状态:</span>
<select name="txt_is_overdate" id="txt_is_overdate">
<option value="">全部</option>
<option value="10">过期</option>
<option value="20">在期</option>
</select>
</li>
<li>
<span>最新订单产品:</span>
<select id="slt_midproductId" name="slt_midproductId" style="width:150px;" onChange="changeMidProduct(this.value)" placeholder="请选中产品大类">
<option value="">--请选中产品大类--</option>
@foreach (var item in ViewBag.midproductList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
<select id="slt_subproductids" name="slt_subproductids" style="width:180px;" placeholder="请选中产品小类">
<option value="0">--请选中产品小类--</option>
</select>
</li>
<li>
<span>订单金额:</span>
<input type="text" id="txt_arrivalpay_from" name="txt_arrivalpay_from" style="width:80px">-
<input type="text" id="txt_arrivalpay_to" name="txt_arrivalpay_to" style="width:80px">
</li>
<li>
<span>累计金额范围:</span>
@if (ViewBag.DeptList != null)
{
<select id="txt_arrivalpay_deptids" name="txt_arrivalpay_deptids">
<option value="">请选择</option>
@foreach (var item in ViewBag.DeptList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
}
</li>
<li>
<span>累计金额:</span>
<input type="text" id="txt_arrivaltotal_from" name="txt_arrivaltotal_from" style="width:80px">-
<input type="text" id="txt_arrivaltotal_to" name="txt_arrivaltotal_to" style="width:80px">
</li>
@*<li>
<span>成交事业部:</span>
@if (ViewBag.DeptList != null)
{
<select id="txt_order_share_deptids" name="txt_order_share_deptids">
<option value="">请选择</option>
@foreach (var item in ViewBag.DeptList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
}
</li>*@
<li>
<span>成交</span>@*txt_order_share_groupids*@
@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_订单列表 })
</li>
@*<li>
<span>成交客服:</span>
<select name="txt_order_share_eids">
<option value="">全部</option>
</select>
</li>*@
<li>
<span>最后跟进事业部:</span>
@if (ViewBag.DeptList != null)
{
<select id="txt_follow_deptids" name="txt_follow_deptids">
<option value="">请选择</option>
@foreach (var item in ViewBag.DeptList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
}
</li>
@*<li>
<span>最后跟进组别:</span>
<select name="txt_follow_groupids">
<option value="">全部</option>
</select>
</li>
<li>
<span>最后跟进客服:</span>
<select name="txt_follow_eids">
<option value="">全部</option>
</select>
</li>*@
<li>
<span>跟进类型:</span>
<select name="txt_follow_type" id="txt_follow_type">
<option value="">全部</option>
<option value="10">坐席电话</option>
<option value="20">微信互动</option>
</select>
</li>
<li>
<span>最后跟进日期:</span>
<input type="text" id="txt_follow_date_from" name="txt_follow_date_from" value='' style="width: 100px;" onfocus="stimeFocus(this)" />-
<input type="text" id="txt_follow_date_to" name="txt_follow_date_to" value='' onclick="" style="width: 100px;" onfocus="etimeFocus(this)" />
</li>
<li>
<span>排除权限:</span>
<select id="slt_exclude_moduleid" name="slt_exclude_moduleid" style="width:150px;" placeholder="请选中权限">
<option value="">--请选中权限--</option>
<option value="1010">擒龙版1010</option>
</select>
</li>
</ul>
</div>
<div id="statbox">
<div class="stat-item title">数据汇总</div>
<div class="stat-item">成交客户数:<span class="dealCustomerTotal">0</span></div>
<div class="stat-item">客户跟进数:<span class="followCustomerTotal">0</span></div>
<div class="stat-item">客户跟进率:<span class="followCustomerRate">0</span></div>
<div class="stat-item">在期客户数:<span class="effectiveCustomerTotal">0</span></div>
<div class="stat-item">在期客户跟进数:<span class="effectiveFollowCustomerTotal">0</span></div>
<div class="stat-item">在期客户跟进率:<span class="effectiveFollowCustomerRate">0</span></div>
<div class="stat-item">过期客户数:<span class="ineffectiveCustomerTotal">0</span></div>
<div class="stat-item">过期客户跟进数:<span class="ineffectiveFollowCustomerTotal">0</span></div>
<div class="stat-item">过期客户跟进率:<span class="ineffectiveFollowCustomerRate">0</span></div>
</div>
@Html.Raw(ViewBag.gridTable)
</div>
<script type="text/javascript">
$(function () {
//LoadData();
$(window).resize(function () {
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
LoadStatistics();
});
$("#btnExport").click(function () {
BtnExportAll_Click();
});
var CurTimeAmount = $(".grid_table_head th[field='CurTimeAmount']");
//console.dir(CurTimeAmount);
$(CurTimeAmount).css("color", "red");
});
function onLoadSucced() {
LoadData();
LoadStatistics();
}
function getPageOptions(gridID) {
var option = $("#tablist").tablepage('getPagination');
var str = "rows=" + option.rows + "&page=" + option.page + "&order=" + option.order + "&sort=" + option.sort;
return str;
}
function LoadData() {
$("#tablist").tablegrid({
url: '/weixin/DealCustomer/QueryList',
height: $(window).height() - 110,
loadNow: true,
isPage: true,
data: GetControlValue(),
onLoadSuccess: function (data) {
// $(".layui-table-page").hide();
}
});
}
function LoadStatistics(){
$.ajax({
type: "POST",
url: '/weixin/DealCustomer/DealStat',
data: GetControlValue(),
success: function (da) {
if (da.s) {
var data = da.d;
$("#statbox .dealCustomerTotal").text(data.dealCustomerTotal);
$("#statbox .followCustomerTotal").text(data.followCustomerTotal);
$("#statbox .followCustomerRate").text(data.followCustomerRate);
$("#statbox .effectiveCustomerTotal").text(data.effectiveCustomerTotal);
$("#statbox .effectiveFollowCustomerTotal").text(data.effectiveFollowCustomerTotal);
$("#statbox .effectiveFollowCustomerRate").text(data.effectiveFollowCustomerRate);
$("#statbox .ineffectiveCustomerTotal").text(data.ineffectiveCustomerTotal);
$("#statbox .ineffectiveFollowCustomerTotal").text(data.ineffectiveFollowCustomerTotal);
$("#statbox .ineffectiveFollowCustomerRate").text(data.ineffectiveFollowCustomerRate);
}
},
error: function (e) {
console.log(e);
}
});
}
function GetControlValue() {
return {
umid: $("#txt_umid").val(),
resid: $("#txt_resid").val(),
cnname: $("#txt_cnname").val(),
amount_type_id: $('#txt_amount_type_id option:checked').val(),
is_overdate: $("#txt_is_overdate option:checked").val(),
subproductids: ($("#slt_subproductids").val() == "0" ? "" : $("#slt_subproductids").val()),
exclude_moduleids: ($("#slt_exclude_moduleid").val() == "0" ? "" : $("#slt_exclude_moduleid").val()), //排除权限
arrivalpay_from: $("#txt_arrivalpay_from").val(),
arrivalpay_to: $("#txt_arrivalpay_to").val(),
arrivalpay_deptids: $("#txt_arrivalpay_deptids").val(),
arrivaltotal_from: $("#txt_arrivaltotal_from").val(),
arrivaltotal_to: $("#txt_arrivaltotal_to").val(),
//order_share_deptids: $("#txt_order_share_deptids").val(),
//order_share_groupids: $("#txt_order_share_groupids").val() ,
//order_order_share_eids: $("#txt_order_share_eids").val(),
order_follow_deptids: $("#txt_follow_deptids option:checked").val(),
follow_type: $("#txt_follow_type").val(),
follow_date_from: $("#txt_follow_date_from").val(),
follow_date_to: $("#txt_follow_date_to").val()
};
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
//获取datagrid头部及字段
function getDataGridHeader() {
var columns = $('#tablist').tablegrid("getHead");
return columns;
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0' src='" + src + "'></iframe>";
}
function BtnExportAll_Click() {
var param = "&resid=" + $("#txt_resid").val()
+ "&cnname=" + $('#txt_cnname').val()
+ "&amount_type_id=" + $('#txt_amount_type_id option:checked').val()
+ "&is_overdate=" + $('#txt_is_overdate option:checked').val()
+ "&subproductids=" + $('#slt_midproductId').val()
+ "&arrivalpay_from=" + $('#txt_arrivalpay_from').val()
+ "&arrivalpay_to=" + $('#txt_arrivalpay_to').val()
+ "&arrivalpay_deptids=" + $('#txt_arrivalpay_deptids').val()
+ "&arrivaltotal_from=" + $('#txt_arrivaltotal_from').val()
+ "&arrivaltotal_to=" + $('#txt_arrivaltotal_to').val()
+ "&order_share_deptids=" + $('#txt_order_share_deptids').val()
//+ "&order_share_groupids=" + $('#txt_order_share_groupids').val()
//+ "&order_order_share_eids=" + $('#txt_order_share_eids').val()
+ "&order_follow_deptids=" + $('#txt_follow_deptids option:checked').val()
+ "&follow_type=" + $('#txt_follow_type').val()
+ "&follow_date_from=" + $('#follow_date_from').val()
+ "&follow_date_to=" + $('#follow_date_to').val();
var option = $("#tablist").tablepage('getPagination');
//全部导出
param += "&rows=" + option.totalRows + "&page=1&order=" + option.order + "&sort=" + option.sort;
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/WeiXin/DealCustomer/Export?" + GetQueryStr() + param)));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
}
//时间
function stimeFocus(ele) {
WdatePicker({
el: ele, dateFmt: 'yyyy-MM-dd', maxDate: '#F{$dp.$D(\'txt_follow_date_to\')}',
onpicked: function (p) { PickedFunc() },
onpicking: function (p) { PickeingFunc() }
})
}
function etimeFocus(ele) {
WdatePicker({
el: ele, dateFmt: 'yyyy-MM-dd', minDate: '#F{$dp.$D(\'txt_follow_date_from\')}',
onpicked: function (p) { PickedFunc() },
onpicking: function (p) { PickeingFunc() }
})
}
//结果
var o_s, o_e;
function PickedFunc() {
var s = new Date($("#stime").val());
var e = new Date($("#etime").val());
if (Math.abs(s - e) > (1000 * 60 * 60 * 24 * 62)) {
alert("时间范围不超过62天");
$("#stime").val(o_s);
$("#etime").val(o_e);
}
}
function stimePicked() {
}
//结果前
function PickeingFunc() {
o_e = $("#etime").val();
o_s = $("#stime").val();
}
function changeMidProduct(productId) {
if (productId == 0) {
//$("#slt_subproductids").unbind();
$("#slt_subproductids").html("<option value='0'>--请选中产品小类--</option>");
return;
}
$.r_post("/JzOrder/GetAllSubProductList?productId=0&midproductId=" + productId, function (data) {
//$("#slt_subproductids").unbind();
$("#slt_subproductids").html("<option value='0'>--请选中产品小类--</option>");
$(data).each(function (n, m) {
$("#slt_subproductids").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
});
}, "json");
}
</script>