ComplianceServer/oldcode/WEB/Views/Res/Allocate/AllocateLog.cshtml

139 lines
6.7 KiB
Plaintext

@using WX.CRM.WebHelper
@{
ViewBag.Title = "bas_salesDepartment";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnExport", "icon-export", "导出", true)
</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()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = "", 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="">-请选择-</option>
</select>
</li>
<li>分配时间:@Html.WdatePickerText("txt_sTime", DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))-@Html.WdatePickerText("txt_eTime", DateTime.Now.ToString("yyyy-MM-dd"))</li>
<li>分配人工号:<input type="text" name="txt_diseid" /></li>
<li>分类:@Html.DropDownList("slt_category", ViewBag.category as IEnumerable<SelectListItem>)</li>
<li>客户ID:<input type="text" name="txt_resId" style="width:200px" /></li>
<li>是否联系:<select id="slt_hasGt" name="slt_hasGt"><option value=""></option><option value="1">是</option><option value="0">否</option></select></li>
<li>是否回收:<select id="slt_isrecycle" name="slt_isrecycle"><option value=""></option><option value="1">是</option><option value="0">否</option></select></li>
<li id="recycletimeLi" style="display:none;">回收时间:@Html.WdatePickerText("txt_r1Time", "")-@Html.WdatePickerText("txt_r2Time", "")</li>
<li><input type="checkbox" value="1" id="IsFirst" name="IsFirst" />是否首次分配</li>
<li>
<input id="txt_HidACTIVITYID" name="txt_ACTIVITYID" type="hidden" value="" />
<input id="txt_HidResourceId" name="txt_resourcetypeid" type="hidden" value="" />
<input id="txt_HidRESOURCETAG" name="txt_RESOURCETAG" type="hidden" value="" />
</li>
</ul>
</div>
@Html.Raw(ViewBag.gridTable)
</div>
<script type="text/javascript">
$(function () {
$("#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) {
$("<option>请选择</option>").appendTo($("#cmbActive1"));
$.each(data, function (i, item) {
$("<option></option>").val(item["ACTIVITYID"]).text(item["ACTIVITYNAME"]).attr("retag", item["RESOURCETAG"]).appendTo($("#cmbActive1"));
});
});
});
var para = getQueryString("resourcetype");
if (para != null) {
$("#txt_HidResourceId").val(para);
$("#ResourctType1").change();
}
$('#tablist').tablegrid({
url: '/Res/Allocate/AllocateLogGetHtmlList',
height: $(window).height() - 110,
loadNow: false,
data: GetControlValue
});
function GetControlValue() {
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), innerUserId: $("#nb1_uc_org_ids").val(), IsFirst: $("#IsFirst").prop("checked") };
}
$("#slt_isrecycle").change(function () {
if (this.value == 1) {
$("#recycletimeLi").show();
}
else {
$("#txt_r1Time").val('');
$("#txt_r2Time").val('');
$("#recycletimeLi").hide();
}
});
$("#btnExport").click(function () {
var url = "/Res/Allocate/AllocateLogExport?";
var query = GetQueryStr();
if (query == "") {
url += "saleDeptId=" + $("#nb1_uc_org_depts").val() + '&groupId=' + $("#nb1_uc_org_groups").val() + '&userId=' + $("#nb1_uc_org_ids").val() + '&IsFirst=' + $("#IsFirst").prop("checked");
}
else {
url += GetQueryStr() + "&saleDeptId=" + $("#nb1_uc_org_depts").val() + '&groupId=' + $("#nb1_uc_org_groups").val() + '&userId=' + $("#nb1_uc_org_ids").val() + '&IsFirst=' + $("#IsFirst").prop("checked");
}
window.open(url);
});
});
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');
//}
</script>