272 lines
12 KiB
Plaintext
272 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.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
|
@{
|
|
var ddl = new List<SelectListItem>();
|
|
if (ViewBag.IsAllocateQueryAll)
|
|
{
|
|
ddl.Add(new SelectListItem() { Text = "全部", Value = string.Empty, Selected = true });
|
|
ddl.Add(new SelectListItem() { Text = "是", Value = "1" });
|
|
ddl.Add(new SelectListItem() { Text = "否", Value = "0" });
|
|
}
|
|
else
|
|
{
|
|
ddl.Add(new SelectListItem() { Text = "全部", Value = string.Empty });
|
|
ddl.Add(new SelectListItem() { Text = "是", Value = "1" });
|
|
ddl.Add(new SelectListItem() { Text = "否", Value = "0", Selected = true });
|
|
}
|
|
|
|
var ddl2 = new List<SelectListItem>();
|
|
if (ViewBag.IsAllocateQueryAll)
|
|
{
|
|
ddl2.Add(new SelectListItem() { Text = "全部", Value = "-1", Selected = true });
|
|
ddl2.Add(new SelectListItem() { Text = "是", Value = "1" });
|
|
ddl2.Add(new SelectListItem() { Text = "否", Value = "0" });
|
|
}
|
|
else
|
|
{
|
|
ddl2.Add(new SelectListItem() { Text = "全部", Value = "-1" });
|
|
ddl2.Add(new SelectListItem() { Text = "是", Value = "1" });
|
|
ddl2.Add(new SelectListItem() { Text = "否", Value = "0", Selected = true });
|
|
}
|
|
|
|
var ddlTH = new List<SelectListItem>();
|
|
ddlTH.AddRange(ddl);
|
|
|
|
var ddlGD = new List<SelectListItem>();
|
|
ddlGD.AddRange(ddl);
|
|
|
|
var ddlNew = new List<SelectListItem>();
|
|
ddlNew.AddRange(ddl2);
|
|
|
|
var ddlHY = new List<SelectListItem>();
|
|
ddlHY.AddRange(ddl2);
|
|
}
|
|
</div>
|
|
<div class="bas_datagrid">
|
|
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
|
<ul class="toolBar_ul">
|
|
@*<li>@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", isShowDismiss = "1", type = "0", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid, isSelf = "0", currentRight = WX.CRM.WebHelper.InitRights.CONST_主管资源分配 })</li>*@
|
|
<li>@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_主管资源分配 })</li>
|
|
<li>
|
|
资源类型:
|
|
@Html.DropDownList("ResourctType1", null, new { style = "width:200px" })
|
|
<select id="cmbActive1" name="cmbActive1" style="width:200px">
|
|
<option value="0">-请选择-</option>
|
|
</select>
|
|
活动备注:<input type="text" id="txt_extxml" name="txt_extxml" />
|
|
</li>
|
|
<li>分配时间:@Html.WdatePickerText("txt_stimeFP", string.Empty)~@Html.WdatePickerText("txt_etimeFP", string.Empty)</li>
|
|
<li>创建时间:@Html.WdatePickerText("txt_AllocateTime1", string.Empty)~@Html.WdatePickerText("txt_AllocateTime2", string.Empty)</li>
|
|
<li>客户ID:<input type="text" name="txt_resId" style="width:200px" /> </li>
|
|
<li>客户分类:@Html.DropDownList("slt_category", ViewBag.category as IEnumerable<SelectListItem>)</li>
|
|
<li>
|
|
<input id="txt_HidACTIVITYID" name="txt_HidACTIVITYID" type="hidden" value="" />
|
|
<input id="txt_HidResourceId" name="txt_HidResourceId" type="hidden" value="" />
|
|
<input id="txt_HidRESOURCETAG" name="txt_HidRESOURCETAG" type="hidden" value="" />
|
|
</li>
|
|
<li>是否通话:@Html.DropDownList("slt_hasTH", ddlTH)</li>
|
|
<li id="liTH" style="display:none;">最后通话时间:@Html.WdatePickerText("txt_stimeTH", string.Empty, true, "style='width:150px;'")~@Html.WdatePickerText("txt_etimeTH", string.Empty, true, "style='width:150px;'")</li>
|
|
<li>是否工单:@Html.DropDownList("slt_hasGD", ddlGD)</li>
|
|
<li id="liGD" style="display:none;">最后工单时间:@Html.WdatePickerText("txt_stimeGD", string.Empty, true, "style='width:150px;'")~@Html.WdatePickerText("txt_etimeGD", string.Empty, true, "style='width:150px;'")</li>
|
|
<li style="display:none">是否付费客户:@Html.DropDownList("slt_isNew", ddlNew)</li>
|
|
<li id="liCP">
|
|
@*产品大类:<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>*@
|
|
最后登录时间:@Html.WdatePickerText("txt_stimeKT", string.Empty, true, "style='width:150px;'")~@Html.WdatePickerText("txt_etimeKT", string.Empty, true, "style='width:150px;'")
|
|
</li>
|
|
<li>加好友:@Html.DropDownList("slt_isView", ddlHY)</li>
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.gridTable)
|
|
</div>
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
$('#tablist').tablegrid({
|
|
url: '/Res/Allocate/ChargeAllocatedResGetHtmlList2',
|
|
height: $(window).height() - 110,
|
|
loadNow: false,
|
|
isCheckMore: true,
|
|
//data: GetControlValue
|
|
});
|
|
$("#btnQuery").click(function () {//搜索按钮点击事件
|
|
$("#txt_HidRESOURCETAG").val();
|
|
$("#txt_HidACTIVITYID").val();
|
|
$("#txt_HidResourceId").val();
|
|
$("#txt_HidRESOURCETAG").val($("#cmbActive1 option:selected").attr("retag"));
|
|
$("#txt_HidACTIVITYID").val($("#cmbActive1").val());
|
|
$("#txt_HidResourceId").val($("#ResourctType1").val());
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
$(window).resize(function () {//自动适应大小
|
|
$('#tablist').tablegrid('resize', {
|
|
height: $(window).height() - 110
|
|
});
|
|
});
|
|
|
|
$("#ResourctType1").change(function () {
|
|
var selec = $("#ResourctType1").val();
|
|
$("#cmbActive1").get(0).options.length = 0;//清空历史值
|
|
$("<option>全部</option>").appendTo($("#cmbActive1"));
|
|
$.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($("#cmbActive1"));
|
|
});
|
|
});
|
|
});
|
|
|
|
$("#slt_hasTH").change(function () {
|
|
if (this.value == 1) {
|
|
$("#liTH").show();
|
|
}
|
|
else {
|
|
$("#liTH").hide();
|
|
$("#txt_stimeTH").val("");
|
|
$("#txt_etimeTH").val("");
|
|
}
|
|
});
|
|
|
|
$("#slt_hasGD").change(function () {
|
|
if (this.value == 1) {
|
|
$("#liGD").show();
|
|
}
|
|
else {
|
|
$("#liGD").hide();
|
|
$("#txt_stimeGD").val("");
|
|
$("#txt_etimeGD").val("");
|
|
}
|
|
});
|
|
|
|
$("#slt_isNew").change(function () {
|
|
if (this.value == 1) {
|
|
$("#liCP").show();
|
|
}
|
|
else {
|
|
$("#liCP").hide();
|
|
$("#slt_productId").val("");
|
|
$("#slt_subProductId").val("");
|
|
$("#txt_stimeKT").val("");
|
|
$("#txt_etimeKT").val("");
|
|
}
|
|
});
|
|
|
|
});
|
|
function onLoadSucced() {
|
|
|
|
}
|
|
function LoadSelf() {
|
|
$('#tablist').tablegrid("Search");
|
|
}
|
|
function GetControlValue() {
|
|
//var gId = $("#nb1_combox_innerGroup").combotree("getValue");
|
|
//alert(gId);
|
|
//var uId = $("#nb1_combox_user").val();
|
|
//alert(uId);
|
|
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val() };
|
|
}
|
|
function frameReturnByReload(flag) {
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
</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 Export_Click() {
|
|
if ($('#ResourctType1').val() == 0 || $('#cmbActive1').val() == 0) {
|
|
$.messager.alert("警告", "请选择资源类型", "error");
|
|
return;
|
|
}
|
|
window.open("/Res/Allocate/Export?" + GetQueryStr() + "&Ieguid=" + GetGuid());
|
|
//$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Res/Allocate/Export?" + GetQueryStr() + "&groupId=" + $("#nb1_uc_org_groups").val() + "&userId=" + $("#nb1_uc_org_ids").val())));
|
|
//$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
|
}
|
|
function ExportPhone_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
window.open("/Res/Allocate/ExportTxtMobile?DISTRIBUTEID=" + row.map_PKID + "&Ieguid=" + GetGuid());
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
function AllocateRes_Click() {
|
|
var qls = "saleDeptId=" + $("#txt_deptId").val() + "&groupId=" + $("#txt_groupIds").val() + "&userId=" + $("#txt_userId").val();
|
|
//var queryStr = GetQueryStr();
|
|
//console.log(qls);
|
|
//console.log(queryStr);
|
|
var pkids = "";
|
|
var selects = $('#tablist').tablegrid('getSelections');
|
|
if (selects != null) {
|
|
$(selects).each(function (i, n) {
|
|
pkids += n.PKID + ",";
|
|
});
|
|
pkids = pkids.substring(0, pkids.length - 1);
|
|
//console.log(pkids);
|
|
}
|
|
$("#modalwindow").html(GetIframeHtml("/Res/Allocate/Distbute2?" + qls + "&" + GetQueryStr() + "&pkids=" + pkids));
|
|
{ title: '资源分配', width: 900, height: 600, iconCls: 'icon-details' }).window('open');
|
|
}
|
|
function CloseDistbuteWin() {
|
|
$("#modalwindow").window("close", true);
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
//function changeselect(productId) {
|
|
// var nb1defaultIndex = 0;
|
|
// if (productId == 0) {
|
|
// $("#slt_subProductId").unbind();
|
|
// $("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
// return;
|
|
// }
|
|
// $.r_post("/SzzyOrder/GetAllSubProductList?productId=" + productId, function (data) {
|
|
// $("#slt_subProductId").unbind();
|
|
|
|
// $("#slt_subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
|
|
// $(data).each(function (n, m) {
|
|
// /*if (nb1defaultIndex == 0) {
|
|
// $("#slt_subProductId").append("<option value='" + m.Value + "' selected='selected'>" + m.Text + "</option>");
|
|
// }
|
|
// else {*/
|
|
// $("#slt_subProductId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
|
|
|
|
// //}
|
|
// });
|
|
// nb1defaultIndex++;
|
|
// }, "json");
|
|
//}
|
|
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>
|