137 lines
6.6 KiB
Plaintext
137 lines
6.6 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)
|
|
</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 = "0", type = "0", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid, 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>
|
|
</li>
|
|
<li>
|
|
是否新资源:@Html.DropDownList("slt_isNew", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="是",Value="1",Selected=true},
|
|
new SelectListItem(){ Text="否",Value="0"}
|
|
})
|
|
</li>
|
|
<li>
|
|
是否查看:@Html.DropDownList("slt_isView", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="是",Value="1"},
|
|
new SelectListItem(){ Text="否",Value="0"}
|
|
})
|
|
</li>
|
|
<li>客户ID:<input type="text" name="txt_resId" style="width:200px" /> </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.WdatePickerText("txt_AllocateTime1", DateTime.Now.ToString("yyyy-MM-dd 00:00:00"), true, "style='width:180px;'")~@Html.WdatePickerText("txt_AllocateTime2", DateTime.Now.ToString("yyyy-MM-dd 23:59:59"), true, "style='width:180px;'")</li>
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.gridTable)
|
|
</div>
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
$('#tablist').tablegrid({
|
|
url: '/Res/Allocate/ChargeAllocatedResGetHtmlList',
|
|
height: $(window).height() - 110,
|
|
loadNow: false,
|
|
isCheckMore: true,
|
|
data: GetControlValue
|
|
});
|
|
function GetControlValue() {
|
|
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val() };
|
|
}
|
|
$("#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;//清空历史值
|
|
$.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"));
|
|
});
|
|
});
|
|
});
|
|
});
|
|
function onLoadSucced() {
|
|
$('#tablist').tablegrid("Search");
|
|
}
|
|
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 = "isZhuguan=true&saleDeptId=" + $("#nb1_uc_org_depts").val() + "&groupId=" + $("#nb1_uc_org_groups").val() + "&userId=" + $("#nb1_uc_org_ids").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/Distbute?" + qls + "&" + GetQueryStr() + "&pkids=" + pkids));
|
|
$("#modalwindow").window({ title: '资源分配', width: 700, height: 400, iconCls: 'icon-details' }).window('open');
|
|
}
|
|
</script>
|