295 lines
13 KiB
Plaintext
295 lines
13 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_content.cshtml";
|
||
}
|
||
<script src="/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
|
||
<link href="/Content/themes/blue/easyui.css" rel="stylesheet" />
|
||
<link href="/Content/Site.css" rel="stylesheet" />
|
||
<script src="/Scripts/common.js"></script>
|
||
<link href="/Content/data_grid_list.css" rel="stylesheet" />
|
||
<script src="/Scripts/op/jquery.rewrite.js"></script>
|
||
<style type="text/css">
|
||
.xm-option {
|
||
line-height: 30px;
|
||
}
|
||
|
||
.layui-btn-red {
|
||
background: #FF4D4D;
|
||
}
|
||
</style>
|
||
<div class="layui-fluid" style="padding-left:0px;padding-top:10px;">
|
||
<div class="layui-card" id="topcard" style="width:100%;padding-top:10px;">
|
||
<div class="layui-card-header layui-self-header">
|
||
<div style="float:left;position:relative;">
|
||
新单活动资源池
|
||
</div>
|
||
<div style="float:right;position:relative;">
|
||
@Html.Action("ToolBarNew", "Control", new
|
||
{
|
||
tool = ViewBag.ToolBar as ToolBar,
|
||
otherToolBars = new ToolBarNew[] {
|
||
new ToolBarNew(){ btnColor="", btnName="资源分配" }
|
||
}
|
||
|
||
})
|
||
</div>
|
||
<div class="hrclass" style="position:relative;float: left;"></div>
|
||
</div>
|
||
<div class="layui-card-body " id="contentBody">
|
||
<form class="layui-form selftopwhere" id="myform">
|
||
<div class="layui-form-item">
|
||
客户ID:
|
||
<div class="layui-inline">
|
||
<input type="text" name="resId" required lay-verify="required" placeholder="客户ID" autocomplete="off" class="layui-input">
|
||
</div>
|
||
资源类型:
|
||
<div class="layui-inline">
|
||
<select name="resourceType" id="resourceType" style="height:35px;" lay-filter="resouceSel">
|
||
@foreach (var item in ViewBag.ResourceType as List<SelectListItem>)
|
||
{
|
||
<option value="@item.Value">【@item.Text】</option>
|
||
}
|
||
</select>
|
||
</div>
|
||
<div class="layui-inline">
|
||
<select id="cmbActive" name="cmbActive" class="layui-form-mid">
|
||
</select>
|
||
</div>
|
||
活动名称:
|
||
<div class="layui-inline">
|
||
<input type="text" name="actname" required lay-verify="required" placeholder="活动名称" autocomplete="off" class="layui-input">
|
||
</div>
|
||
活动备注:
|
||
<div class="layui-inline">
|
||
<input type="text" name="extxml" required lay-verify="required" placeholder="活动备注" autocomplete="off" class="layui-input">
|
||
</div>
|
||
时间:
|
||
<div class="layui-inline">
|
||
<input class="layui-input" placeholder="开始日" name="xstime" id="start" style="width:120px;" autocomplete="off" value="@DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")">
|
||
</div>
|
||
<div class="layui-inline">
|
||
<input class="layui-input" placeholder="截止日" name="xetime" id="end" style="width:120px;" autocomplete="off" value="@DateTime.Now.ToString("yyyy-MM-dd")">
|
||
</div>
|
||
<div class="layui-inline" style="width:492px">
|
||
@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_新单活动资源池 })
|
||
</div>
|
||
员工工号:
|
||
<div class="layui-inline">
|
||
<input type="text" name="eid" required lay-verify="required" placeholder="员工工号" autocomplete="off" class="layui-input">
|
||
</div>
|
||
加好友:
|
||
<div class="layui-inline">
|
||
<select name="IsBound">
|
||
<option value="">不限</option>
|
||
<option value="1">是</option>
|
||
<option value="0">否</option>
|
||
</select>
|
||
</div>
|
||
事业部:
|
||
<div class="layui-inline">
|
||
<select name="deptlineid" id="deptlineid" style="height:35px;" lay-filter="resouceSel">
|
||
<option value="">全部</option>
|
||
@foreach (var item in ViewBag.deptList as List<WX.CRM.Model.Entity.BAS_BUSINESSLINES>)
|
||
{
|
||
<option value="@item.BUSINESSID">@item.BUSINESSNAME</option>
|
||
}
|
||
</select>
|
||
</div>
|
||
<div class="layui-inline">
|
||
<input class="layui-btn layui-btn-sm layui-btn-ok" data-method="search" type="button" value="查询" />
|
||
<input class="layui-btn layui-btn-sm layui-btn-reset" data-method="reset" type="reset" value="清空" />
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<table class="layui-hide" id="tab_kefuzhuangtaiyi1" lay-filter="wochao"></table>
|
||
<iframe id="BillOpen" width="0" height="0" scrolling="no" frameborder="0" style="display:none;"></iframe>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!--确定宽度-->
|
||
|
||
<script>
|
||
function onLoadSucced() {
|
||
}
|
||
</script>
|
||
<script>
|
||
layui.use('laydate', function () {
|
||
var laydate = layui.laydate;
|
||
//执行一个laydate实例
|
||
//本月的开始时间
|
||
var nowDate = new Date(); //当前日期;
|
||
laydate.render({
|
||
elem: '#start', //指定元素
|
||
value: '@DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")'
|
||
});
|
||
//执行一个laydate实例
|
||
laydate.render({
|
||
elem: '#end',//指定元素
|
||
value: '@DateTime.Now.ToString("yyyy-MM-dd")'
|
||
});
|
||
});
|
||
var selectRow = {};
|
||
var winindex;
|
||
var layer;
|
||
var rowid;
|
||
//注意:选项卡 依赖 element 模块,否则无法进行功能性操作
|
||
layui.use('element', function () {
|
||
var element = layui.element;
|
||
element.on('tab(tonghuajiankong)', function (n) {
|
||
$(".bodytable").addClass("hidden");
|
||
$("#kefuzhuangtai" + (n.index + 1)).removeClass("hidden");
|
||
});
|
||
element.on('tab(maintab)', function (n) {
|
||
if (n.index == 0)
|
||
$("#bottomcard").removeClass("hidden");
|
||
else
|
||
$("#bottomcard").addClass("hidden");
|
||
});
|
||
});
|
||
layui.use(['laypage', 'layer', 'table', 'laydate', 'form'], function () {
|
||
var form = layui.form;
|
||
var laydate = layui.laydate;
|
||
layer = layui.layer;
|
||
table = layui.table;
|
||
table.render({
|
||
id: 'listReload'//列表别名ID
|
||
, elem: '#tab_kefuzhuangtaiyi1'
|
||
, url: 'GetResActivityHtmlList'
|
||
, method: 'POST'
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: true
|
||
, limit: 10
|
||
, height: "full-160"
|
||
,autoSort:false
|
||
//, size:"sm"
|
||
, cols: [[
|
||
{ field: 'checkobj', type: 'checkbox', fixed: 'left' }
|
||
,{ field: 'numbers', type: 'numbers' }
|
||
, { field: 'DeptName', title: '事业部' }
|
||
, { field: 'ResourceTypeName', title: '类型' }
|
||
, { field: 'ActivityName', title: '活动名称' }
|
||
, { field: 'ActivityRemark', title: '活动备注' }
|
||
, { field: 'CTime', title: '时间' }
|
||
, {
|
||
field: 'ResId', title: '客户ID', width: 180, templet: function (res) {
|
||
if (res.ResId != '' && res.ResId != null) {
|
||
var url = "Csvr/CustomerInfo/CustomerDetail?hgCustomer=1&isFromHg=1&isFromComplaint=1&resid=" + res.ResId + "&name=" + encodeURIComponent(res.CName);
|
||
var title = "客户明细";
|
||
if (res.CNAME) {
|
||
title = res.CNAME + "--客户明细";
|
||
}
|
||
return "<a href=\"javascript:void(0)\" style=\"color:blue\" onclick=\"parent.ChildAddTab('" + title + "','" + url + "')\">" + res.ResId + "</a>";
|
||
} else {
|
||
return ""
|
||
}
|
||
}
|
||
}
|
||
, { field: 'CName', title: '客户姓名' }
|
||
, { field: 'IsBound', title: '加好友' }
|
||
, {
|
||
field: 'gname', title: '销售组', width: 180, templet: function (res) {
|
||
if (res.gname != '' && res.gname != null) {
|
||
return res.gname;
|
||
} else if (res.deptName != null) {
|
||
return res.deptName;
|
||
}
|
||
return "";
|
||
}
|
||
}
|
||
, { field: 'eidInfo', title: '归属客服' }
|
||
|
||
]], where: $("#myform").serializeFormJSON()
|
||
,
|
||
done: function (res, curr, count) {
|
||
$("#isExe").val("");
|
||
$("#fiterUser").val("");
|
||
}
|
||
});
|
||
//监听行单击事件(单击事件为:rowDouble)
|
||
table.on('row(wochao)', function (obj) {
|
||
var data = obj.data;
|
||
//console.log(data);
|
||
//标注选中样式
|
||
obj.tr.addClass('self-table-click').siblings().removeClass('self-table-click');
|
||
selectRow = data;
|
||
});
|
||
table.on('sort(wochao)', function (obj) {
|
||
console.log(obj.field);
|
||
console.log(obj.type);
|
||
table.reload('listReload',
|
||
{
|
||
initSort: obj
|
||
, where: {
|
||
sort: obj.field,
|
||
order: obj.type
|
||
}
|
||
})
|
||
});
|
||
form.on('select(resouceSel)', function (data) {
|
||
var selec = data.value;
|
||
$("#cmbActive").get(0).options.length = 0;//清空历史值
|
||
$("<option>全部</option>").appendTo($("#cmbActive"));
|
||
$.getJSON("/Res/Allocate/ActiveList/" + selec, function (data) {
|
||
$.each(data, function (i, item) {
|
||
$("<option></option>").val(item["ACTIVITYID"]).text(item["ACTIVITYNAME"]).attr("retag", item["RESOURCETAG"]).appendTo($("#cmbActive"));
|
||
});
|
||
layui.form.render("select");
|
||
});
|
||
});
|
||
|
||
var active = {
|
||
other1: function () {
|
||
var qls = "deptId=" + $("#txt_deptId").val() + "&groupIds=" + $("#txt_groupIds").val() + "&userId=" + $("#txt_userId").val();;
|
||
//var queryStr = GetQueryStr();
|
||
//console.log(qls);
|
||
//console.log(queryStr);
|
||
var pkids = "";
|
||
var checkdata = table.checkStatus('listReload');
|
||
var selects = checkdata.data;
|
||
if (selects.length <= 0) {
|
||
layer.msg("请至少选中一条记录!", { icon: 7 });
|
||
return;
|
||
}
|
||
winindex = layer.open({
|
||
type: 2,
|
||
content: '/Res/Allocate/DistbuteNew?' + qls,
|
||
area: ['800px', '600px']
|
||
});
|
||
|
||
}, search: function () {
|
||
//alert($("#myform").serialize());
|
||
//console.log($("#myform").serialize());
|
||
//console.log($("#myform").serializeFormJSON());
|
||
var param = $("#myform").serializeFormJSON();
|
||
table.reload('listReload', {
|
||
where: param,
|
||
page: {
|
||
curr: 1
|
||
}
|
||
});
|
||
}, reset: function () {
|
||
|
||
}
|
||
};
|
||
$('.layui-btn').on('click', function () {
|
||
var othis = $(this), method = othis.data('method');
|
||
console.log(method);
|
||
active[method] ? active[method].call(this, othis) : '';
|
||
|
||
});
|
||
});
|
||
function Closed() {
|
||
layer.close(winindex);
|
||
}
|
||
function TableReload() {
|
||
table.reload('listReload', {
|
||
|
||
});
|
||
}
|
||
function GetResInfo() {
|
||
var checkdata = table.checkStatus('listReload');
|
||
var selects = checkdata.data;
|
||
return selects;
|
||
}
|
||
</script> |