282 lines
12 KiB
Plaintext
282 lines
12 KiB
Plaintext
@using WX.CRM.WebHelper;
|
|
@{
|
|
ViewBag.Title = "我的分配资源";
|
|
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
|
}
|
|
|
|
<div class="mvctool">
|
|
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
|
@*@Html.ToolButton("btnSave", "icon-details", "提交", true)
|
|
@Html.ToolButton("Other2", "icon-details", "重新分配", 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>客户ID:<input type="text" name="txt_resId" style="width:200px" /> </li>
|
|
<li>分配状态:<select id="slt_isDistribute" name="slt_isDistribute"><option value="">全部</option><option value="1">已分配</option><option value="0" selected="selected">未分配</option></select></li>
|
|
@*<li>是否退款:<select name="slt_isRefund"><option value="">全部</option><option value="1">是</option><option value="0" selected="selected">否</option></select></li>*@
|
|
<li>客户姓名:<input type="text" name="txt_cname" id="txt_cname" /> </li>
|
|
<li style="display:none">
|
|
产品大类:<select id="slt_midproductId" name="slt_midproductId" style="width:150px;height:22px" onChange="changeMidProduct(this.value)">
|
|
<option value="0">--请选中产品大类--</option>
|
|
@foreach (var item in ViewBag.midproductList as List<SelectListItem>)
|
|
{
|
|
<option value="@item.Value">@item.Text</option>
|
|
}
|
|
</select>
|
|
产品小类:
|
|
<select id="slt_subProductId" name="slt_subProductId" style="width:180px;height:22px">
|
|
<option value="0">--请选中产品小类--</option>
|
|
</select>
|
|
</li>
|
|
<li>开通时间:@Html.WdatePickerText("txt_openStartTime", "")~@Html.WdatePickerText("txt_openEndTime", "")</li>
|
|
<li>分配时间:@Html.WdatePickerText("txt_fenpeiSTime", "")~@Html.WdatePickerText("txt_fenpeiETime", "")</li>
|
|
<li id="liEid">工号:<input type="text" id="txt_eid" name="txt_eid" /></li>
|
|
@*<li>销售组:<input type="text" name="innerGroupId" id="innerGroupId" style="width:160px;" /><input type="hidden" name="txt_groupId" id="txt_groupId" value="" /> </li>*@
|
|
<li>
|
|
@*@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", isShowDismiss = "1", type = "2", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid })*@
|
|
@*<input type="hidden" value="CustomerZJL03" id="txt_amounttypeid" name="txt_amounttypeid" />*@@*默认是20W以上*@
|
|
@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_客服部资源分配 })
|
|
</li>
|
|
<li>
|
|
资金量:
|
|
<select id="slt_amounttypeid" name="slt_amounttypeid">
|
|
@{ IEnumerable<SelectListItem> itemlist = ViewBag.ZJL as IEnumerable<SelectListItem>;}
|
|
<option value="">--请选择--</option>
|
|
@foreach (SelectListItem item in itemlist)
|
|
{
|
|
@* <option value="@item.Value" @Html.Raw(item.Value == "CustomerZJL03" ? "selected=\"selected\"" : "")>@item.Text</option>*@
|
|
<option value="@item.Value">@item.Text</option>
|
|
}
|
|
</select>
|
|
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.gridTable)
|
|
</div>
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
//$("#innerGroupId").combotree({
|
|
// url: "/Base/InnerGroup/GetTreeList?type=1",
|
|
// height: 28,
|
|
// onSelect: function (node) {
|
|
// var groups = GetGroups();
|
|
// $("#txt_groupId").val(groups);//获取组
|
|
// //if (node.id.toString().indexOf("sale_") == -1 && node.id.toString().indexOf("com_") == -1 && node.attributes != null) {
|
|
// // $("#innerDept").combotree("setValues", [node.attributes])
|
|
// //} else if (!(node.id.toString().indexOf("sale_") == -1 && node.id.toString().indexOf("com_") == -1)) {
|
|
|
|
// // //$('#txt_innerGroupId').combotree('clear');
|
|
// //}
|
|
// }
|
|
//});
|
|
//function GetGroups() {
|
|
// var node = $("#innerGroupId").combotree("tree").tree('getSelected');
|
|
// var tree = $("#innerGroupId").tree;
|
|
// var isLeaf = tree('isLeaf', node.target);
|
|
// var gorupidvalues = "";
|
|
// if (node.id.toString().indexOf("com_") == -1 && node.id.toString().indexOf("sale_") == -1)
|
|
// gorupidvalues = node.id.toString() + ",";
|
|
// if (!isLeaf) {//不是最底层
|
|
// var child = $("#innerGroupId").combotree("tree").tree("getChildren", node.target);
|
|
// if (node.id != 0 && child != null) {
|
|
// for (var i = 0; i < child.length; i++) {
|
|
// if (child[i].id.toString().indexOf("com_") == -1 && child[i].id.toString().indexOf("sale_") == -1)
|
|
// gorupidvalues += child[i].id + ","
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// if (gorupidvalues.length > 0)
|
|
// return gorupidvalues.substr(0, gorupidvalues.length - 1);
|
|
// else
|
|
// return "-1";
|
|
//}
|
|
$('#tablist').tablegrid({
|
|
url: '/Res/AllocateKFB/SeniorDistribution',
|
|
height: $(window).height() - 110,
|
|
loadNow: false,
|
|
isCheckMore: false,
|
|
data: GetControlValue
|
|
});
|
|
$("#btnQuery").click(function () {//搜索按钮点击事件
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
$(window).resize(function () {//自动适应大小
|
|
$('#tablist').tablegrid('resize', {
|
|
height: $(window).height() - 110
|
|
});
|
|
});
|
|
|
|
//$("#btnSave").click(function () {
|
|
// var inputValue = [];
|
|
// $("input[name='sales']")
|
|
// .each(function () {
|
|
// if ($(this).val() !== "") {
|
|
// inputValue.push({
|
|
// UserId: $(this).val(),
|
|
// ResId: $(this).attr("resid")
|
|
// });
|
|
// }
|
|
|
|
// });
|
|
// //alert(JSON.stringify(inputValue));
|
|
// if (inputValue.length > 0) {
|
|
// $.r_post("/Res/AllocateKFB/ExeSeniordistributeByResId", { data: JSON.stringify(inputValue) }, function (data) {
|
|
// if (data.type === 1) {
|
|
// $("#tablist").tablegrid('Load');
|
|
// $.messageBox5s('提示', data.message);
|
|
// }
|
|
// else if (data.type === 0) {
|
|
// $.messageBox5s('提示', data.message);
|
|
// }
|
|
// else if (data.type === 10) {
|
|
// var msg = "";
|
|
// $.each(data.errors, function (i, j) {
|
|
// msg += j.Message + ",";
|
|
// });
|
|
// $.messageBox5s('提示', msg);
|
|
// }
|
|
// }, "json");
|
|
// }
|
|
// else {
|
|
// $.messageBox5s('提示', '请输入要变更的工号');
|
|
// }
|
|
//});
|
|
|
|
//$("#Other2").click(function () {
|
|
// AllocateRes_Click();
|
|
//});
|
|
|
|
//$("#slt_isDistribute").change(function () {
|
|
// if ($("#slt_isDistribute").val() == 1) {
|
|
// $("#liEid").show();
|
|
// }
|
|
// else {
|
|
// $("#txt_eid").val("");
|
|
// $("#liEid").hide();
|
|
// }
|
|
//});
|
|
|
|
//$("#btnExport").click(function () {
|
|
// window.open("/Res/AllocateKFB/SeniorDistributionExport?" + GetQueryStr());
|
|
//});
|
|
|
|
});
|
|
function Export_Click() {
|
|
window.open("/Res/AllocateKFB/SeniorDistributionExport?" + GetQueryStr());
|
|
}
|
|
|
|
function ReBindAll_Click() {
|
|
$("#modalwindow").html(GetIframeHtml("/Res/AllocateKFB/SeniordistributeBatchBind?Ieguid=" + GetGuid()));
|
|
$("#modalwindow").window({ title: '批量重新绑定', width: 900, height: 700, iconCls: 'icon-edit' }).window('open');
|
|
}
|
|
function Save_Click() {
|
|
var inputValue = [];
|
|
$("input[name='sales']")
|
|
.each(function () {
|
|
if ($(this).val() !== "") {
|
|
inputValue.push({
|
|
UserId: $(this).val(),
|
|
ResId: $(this).attr("resid")
|
|
});
|
|
}
|
|
|
|
});
|
|
//alert(JSON.stringify(inputValue));
|
|
if (inputValue.length > 0) {
|
|
$.r_post("/Res/AllocateKFB/ExeSeniordistributeByResId", { data: JSON.stringify(inputValue) }, function (data) {
|
|
if (data.type === 1) {
|
|
$("#tablist").tablegrid('Load');
|
|
$.messageBox5s('提示', data.message);
|
|
}
|
|
else if (data.type === 0) {
|
|
$.messageBox5s('提示', data.message);
|
|
}
|
|
else if (data.type === 10) {
|
|
var msg = "";
|
|
$.each(data.errors, function (i, j) {
|
|
msg += j.Message + ",";
|
|
});
|
|
$.messageBox5s('提示', msg);
|
|
}
|
|
}, "json");
|
|
}
|
|
else {
|
|
$.messageBox5s('提示', '请输入要变更的工号');
|
|
}
|
|
}
|
|
function onLoadSucced() {
|
|
$('#tablist').tablegrid("Search");
|
|
}
|
|
function GetControlValue() {
|
|
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val(), dayType: $("#txt_Daytype").val() };
|
|
}
|
|
|
|
function frameReturnByReload(flag) {
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
function changeMidProduct(productId) {
|
|
if (productId == 0) {
|
|
//$("#slt_subProductId").unbind();
|
|
$("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
return;
|
|
}
|
|
$.r_post("/JzOrder/GetAllSubProductList?productId=0&midproductId=" + productId, function (data) {
|
|
//$("#slt_subProductId").unbind();
|
|
|
|
$("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
|
|
$(data).each(function (n, m) {
|
|
$("#slt_subProductId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
|
|
});
|
|
|
|
}, "json");
|
|
}
|
|
</script>
|
|
@*ToolBar事件处理*@
|
|
<script type="text/javascript">
|
|
function GetIframeHtml(src) {
|
|
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
|
}
|
|
//获取datagrid头部及字段
|
|
function getDataGridHeader() {
|
|
var columns = $('#tablist').tablegrid("getAllHead");
|
|
return columns;
|
|
}
|
|
|
|
function ReBind_Click() {
|
|
//var qls = "saleDeptId=" + $("#nb1_uc_org_depts").val() + "&groupId=" + $("#nb1_uc_org_groups").val() + "&userId=" + $("#nb1_uc_org_ids").val();
|
|
|
|
var pkids = "";
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
$("#modalwindow").html(GetIframeHtml("/Res/AllocateKFB/SeniordistributeBind?resid=" + row.Res));
|
|
$("#modalwindow").window({ title: '重新绑定', width: 900, height: 600, iconCls: 'icon-details' }).window('open');
|
|
} else { $.messageBox5s('提示', '请选择要操作的记录!'); }
|
|
}
|
|
function CloseDistbuteWin() {
|
|
$("#modalwindow").window("close", true);
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
|
|
function changeMidProduct(midproductId) {
|
|
if (midproductId == 0) {
|
|
return;
|
|
}
|
|
$.r_post("/JzOrder/GetAllSubProductList?productId=1008&midproductId=" + midproductId, function (data) {
|
|
//$("#subProductId").unbind();
|
|
|
|
$("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
|
|
$(data).each(function (n, m) {
|
|
$("#slt_subProductId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
|
|
});
|
|
}, "json");
|
|
}
|
|
</script>
|