389 lines
18 KiB
Plaintext
389 lines
18 KiB
Plaintext
@using WX.CRM.WebHelper
|
|
@{
|
|
ViewBag.Title = "bas_salesDepartment";
|
|
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
|
}
|
|
<div class="mvctool">
|
|
<div class="mvctool_mytitle">
|
|
员工管理
|
|
</div>
|
|
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
|
@if (Request.QueryString["type"] == null)
|
|
{
|
|
@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>销售组:<input type="text" name="innerGroupId" id="innerGroupId" style="width:160px;" /><input type="hidden" name="txt_innerGroupId" id="txt_innerGroupId" value="" /> </li>
|
|
<li>部门:<input type="text" id="innerDept" style="width:160px;" /><input type="hidden" name="txt_innerDeptId" id="txt_innerDeptId" /> </li>
|
|
<li>工号:<input type="text" name="txt_eID" /> </li>
|
|
<li>姓名:<input type="text" name="txt_uName" /> </li>
|
|
@*<li style="display:none;">
|
|
是否:@Html.DropDownList("slt_futures", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="是",Value="1"},
|
|
new SelectListItem(){ Text="否",Value="0"}
|
|
})
|
|
</li>
|
|
<li style="display:none;">
|
|
是否:@Html.DropDownList("slt_trader", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="是",Value="1"},
|
|
new SelectListItem(){ Text="否",Value="0"}
|
|
})
|
|
</li>
|
|
<li style="display:none;">
|
|
是否:@Html.DropDownList("slt_tutor", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="是",Value="1"},
|
|
new SelectListItem(){ Text="否",Value="0"}
|
|
})
|
|
</li>
|
|
<li style="display:none;">
|
|
是否客服经理:@Html.DropDownList("slt_Manager", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="是",Value="1"},
|
|
new SelectListItem(){ Text="否",Value="0"}
|
|
})
|
|
</li>*@
|
|
<li>
|
|
性别:@Html.DropDownList("slt_gender", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="0"},
|
|
new SelectListItem(){ Text="男",Value="m"},
|
|
new SelectListItem(){ Text="女",Value="f"}
|
|
})
|
|
</li>
|
|
<li>
|
|
是否停用:@Html.DropDownList("slt_isDismiss", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="否",Value="0",Selected=true},
|
|
new SelectListItem(){ Text="是",Value="1"},
|
|
})
|
|
</li>
|
|
@*<li>
|
|
离职类型:@Html.DropDownList("slt_dismissType", new List<SelectListItem>() {
|
|
new SelectListItem(){ Text="全部",Value="-1"},
|
|
new SelectListItem(){ Text="正常离职",Value="1"},
|
|
new SelectListItem(){ Text="其他离职",Value="0"},
|
|
})
|
|
</li>*@
|
|
<li>停用时间:@Html.WdatePickerText("txt_dismissTime1", "")~@Html.WdatePickerText("txt_dismissTime2", "")</li>
|
|
<li>入职时间:@Html.WdatePickerText("txt_EntryDate1", "")~@Html.WdatePickerText("txt_EntryDate2", "")</li>
|
|
@*<li>转正时间:@Html.WdatePickerText("txt_PositiveTime1", "")~@Html.WdatePickerText("txt_PositiveTime2", "")</li>*@
|
|
@*<li>时分秒:@Html.WdatePickerText("txt_dismissTime2", "", true)</li>
|
|
<li>月份:<input id="txtDate" name="txtDate" class="Wdate" type="text" value="" onclick="WdatePicker({ dateFmt: 'yyyy-M', isShowToday: false, isShowClear: false })" realvalue="2020-03-01"></li>*@
|
|
</ul>
|
|
</div>
|
|
@Html.Raw(ViewBag.gridTable)
|
|
</div>
|
|
<script type="text/javascript">
|
|
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";
|
|
}
|
|
|
|
$(function () {
|
|
$("[field='map_POSITIVETIME']").remove();
|
|
$("#innerGroupId").combotree({
|
|
url: "/Base/InnerGroup/GetTreeList?type=1",
|
|
height: 28,
|
|
onSelect: function (node) {
|
|
var groups = GetGroups();
|
|
$("#txt_innerGroupId").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');
|
|
}
|
|
}
|
|
});
|
|
$("#innerDept").combotree({
|
|
url: "/Base/salesDepartment/GetTreeList",
|
|
height: 28,
|
|
onSelect: function (node) {
|
|
var tree = $(this).tree;
|
|
var isLeaf = tree('isLeaf', node.target);
|
|
var deptidvalues = node.id.toString() + ",";
|
|
if (!isLeaf) {//不是最底层
|
|
var child = $("#innerDept").combotree("tree").tree("getChildren", node.target);
|
|
if (node.id != 0 && child != null) {
|
|
for (var i = 0; i < child.length; i++) {
|
|
deptidvalues += child[i].id + ","
|
|
}
|
|
}
|
|
}
|
|
$("#txt_innerDeptId").val(deptidvalues.substr(0, deptidvalues.length - 1));
|
|
}
|
|
});
|
|
|
|
$('#tablist').tablegrid({
|
|
url: '/Base/Inneruser/GetHtmlList',
|
|
height: $(window).height() - 110,
|
|
loadNow: true,
|
|
isPage: true,
|
|
isCheckMore: true,
|
|
onLoadSuccess: function (data) {
|
|
$("[field='map_POSITIVETIME']").remove();
|
|
}
|
|
});
|
|
$("#btnQuery").click(function () {//搜索按钮点击事件
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
$(window).resize(function () {//自动适应大小
|
|
$('#tablist').tablegrid('resize', {
|
|
height: $(window).height() - 110
|
|
});
|
|
});
|
|
|
|
//$('#tablist').fixedHeaderTable({
|
|
// autoShow: true
|
|
//});
|
|
$("#Other5").hide();
|
|
$("#Other6").hide();
|
|
});
|
|
function frameReturnByClose() {
|
|
$("#modalwindow").window('close');
|
|
}
|
|
function frameReturnByReload(flag) {
|
|
$("#tablist").tablegrid("Load");
|
|
}
|
|
function frameReturnByMes(mes) {
|
|
$.messageBox5s('提示', mes);
|
|
}
|
|
function getPageOptions(gridID) {
|
|
var option = $("#tablist").tablepage('getPagination');
|
|
var str = "rows=" + option.rows + "&page=" + option.page + "&order=" + option.order + "&sort=" + option.sort;
|
|
return str;
|
|
}
|
|
//获取datagrid头部及字段
|
|
function getDataGridHeader() {
|
|
var columns = $('#tablist').tablegrid("getHead");
|
|
return columns;
|
|
}
|
|
|
|
|
|
</script>
|
|
@*ToolBar事件处理*@
|
|
<script type="text/javascript">
|
|
function GetIframeHtml(src) {
|
|
return "<iframe id='ifymbc' width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
|
}
|
|
function Create_Click() {
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/Edit"));
|
|
var height = $(window).height()*0.9;
|
|
$("#modalwindow").window({ title: '新增', width: 700, height: height, iconCls: 'icon-add' }).window('open');
|
|
//ShoLayoutWindow();
|
|
}
|
|
function Edit_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
var height = $(window).height() * 0.9;
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/Edit?id=" + row.pkid));
|
|
$("#modalwindow").window({ title: '编辑', width: 700, height: height, iconCls: 'icon-edit' }).window('open');
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
function Details_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
var height = $(window).height() * 0.9;
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/Details?id=" + row.pkid));
|
|
$("#modalwindow").window({ title: '详细', width: 500, height: height, iconCls: 'icon-details' }).window('open');
|
|
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
|
}
|
|
function Delete_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
|
|
if (r) {
|
|
$.r_post("/Base/Inneruser/Delete?id=" + row.pkid, function (data) {
|
|
if (data.type == 1) {
|
|
$("#tablist").tablegrid('Load');
|
|
}
|
|
$.messageBox5s('提示', data.message);
|
|
}, "json");
|
|
}
|
|
});
|
|
} else {
|
|
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
|
}
|
|
}
|
|
|
|
//员工组分配
|
|
function FenPei_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/ChangeUserGroup?id=" + row.pkid));
|
|
$("#modalwindow").window({ title: '修改组', width: 500, height: 500, iconCls: 'icon-lookup' }).window('open');
|
|
} else {
|
|
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
|
}
|
|
}
|
|
|
|
function ExtendChange_Click() {
|
|
window.parent.ChildAddTab("查看扩张属性变动日志", "/Base/InnerUserExtLog/Index");
|
|
}
|
|
|
|
function DiaoDong_Click() {
|
|
window.parent.ChildAddTab("员工组别调动日志", "/Base/UserGroupChangerLog/Index");
|
|
}
|
|
|
|
function ExportOnePage_Click() {
|
|
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Inneruser/ExportCurrentPage?" + GetQueryStr() + "&" + getPageOptions("tablist"))));
|
|
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
|
}
|
|
|
|
function ExportAllPage_Click() {
|
|
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Inneruser/ExportCurrentAllPage?" + GetQueryStr())));
|
|
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
|
}
|
|
|
|
function ExportAll_Click() {
|
|
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Base/Inneruser/ExportAll?" + GetQueryStr())));
|
|
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
|
}
|
|
|
|
//离职按钮
|
|
function DismissChange_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/EditDismiss?id=" + row.pkid));
|
|
$("#modalwindow").window({ title: '编辑', width: 700, height: 500, iconCls: 'icon-edit' }).window('open');
|
|
|
|
} else {
|
|
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
|
}
|
|
}
|
|
//客服状态
|
|
function UserCustomer_Click() {
|
|
var row = $('#tablist').tablegrid('getSelected');
|
|
if (row != null) {
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/EditUserCustomer?id=" + row.pkid + "&eid=" + row.map_eID));
|
|
$("#modalwindow").window({ title: '编辑', width: 700, height: 300, iconCls: 'icon-edit' }).window('open');
|
|
|
|
} else {
|
|
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
|
}
|
|
}
|
|
//设置按钮
|
|
function Setting_Click() {
|
|
var selects = $("#tablist").tablegrid("getSelections");
|
|
var pkids = "";
|
|
$(selects).each(function (i, n) {
|
|
pkids += "" + n.pkid + ",";
|
|
});
|
|
if (pkids.length === 0) {
|
|
$.messageBox5s('提示', "未勾选可执行选项");
|
|
}
|
|
pkids = pkids.substr(0, pkids.length - 1);
|
|
if (pkids != "") {
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/EditSetting?pkids=" + pkids));
|
|
$("#modalwindow").window({ title: '编辑', width: 700, height: 500, iconCls: 'icon-edit' }).window('open');
|
|
|
|
} else {
|
|
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
|
}
|
|
}
|
|
//修改密码按钮
|
|
function ChangePassWord_Click() {
|
|
var selects = $("#tablist").tablegrid("getSelections");
|
|
var pkids = "";
|
|
$(selects).each(function (i, n) {
|
|
pkids += "" + n.pkid + ",";
|
|
});
|
|
if (pkids.length === 0) {
|
|
$.messageBox5s('提示', "未勾选可执行选项");
|
|
}
|
|
pkids = pkids.substr(0, pkids.length - 1);
|
|
if (pkids != "") {
|
|
$("#modalwindow").html(GetIframeHtml("/Base/Inneruser/EditPassWord?pkids=" + pkids));
|
|
$("#modalwindow").window({ title: '编辑', width: 700, height: 500, iconCls: 'icon-edit' }).window('open');
|
|
|
|
} else {
|
|
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
|
}
|
|
}
|
|
</script>
|
|
<script>
|
|
function SaveChildPage() {
|
|
document.getElementById('ifymbc').contentWindow.SaveChild();
|
|
}
|
|
function ShoLayoutWindow() {
|
|
//var nhtml = '<div class="easyui-layout" data-options="fit:true">'
|
|
// + '<div data-options="region:\'west\',split:true" style="width: 60px; border-left: none; border-top: none; border-bottom: none; background-color: #d2e0f2;">'
|
|
// + '<table style="height:100%;width:100%" id="zhetamacaodan"><tr><td>'
|
|
// + '<input value="保存" type="button" onclick="SaveChildPage()" /><br />'
|
|
// + '<input value="关闭" type="button" onclick="$(\'#wmnn\').window(\'close\')" /><br />'
|
|
// + '<input value="移动" type="button" onclick="DraggableWindow()" />'
|
|
// + '</td></tr></table>'
|
|
// + '</div><div data-options="region:\'center\'"><iframe width="100%" height=\'98%\' scrolling=\'no\' frameborder=\'0\' id="ifymbc" src=\'/Base/Inneruser/Edit\'></iframe></div>';
|
|
//$("#modalwindow111").html(nhtml);
|
|
//$("#modalwindow111").window({ title: '新增', width: 700, height: 400, iconCls: 'icon-add' }).window('open');
|
|
|
|
var tablehtml = '<table style="height:100%;width:100%;background-color: #d2e0f2;" id="zhetamacaodan"><tr><td>'
|
|
+ '<input value="保存" type="button" class="btn btn-primary" onclick="SaveChildPage()" /><br />'
|
|
+ '<input value="关闭" type="button" onclick="$(\'#modalwindow\').window(\'close\')" /><br />'
|
|
+ '</td></tr></table>';
|
|
var iframeHtml = GetIframeHtml("/Base/Inneruser/Edit");
|
|
$("#modalwindow").html("<div id=\"AllLayout\"></div>");
|
|
var modalwindow = $("#modalwindow").window({ title: '新增', width: 700, height: 400, iconCls: 'icon-add' });
|
|
$(modalwindow).window("open");
|
|
$("#AllLayout").layout({
|
|
fit: true
|
|
});
|
|
$('#AllLayout').layout('add', {
|
|
region: 'center',
|
|
split: true,
|
|
content: iframeHtml
|
|
});
|
|
$('#AllLayout').layout('add', {
|
|
region: 'west',
|
|
width: 60,
|
|
content: tablehtml,
|
|
split: true
|
|
});
|
|
$("#AllLayout").parent().parent().draggable({
|
|
handle: '#zhetamacaodan'
|
|
});
|
|
|
|
}
|
|
|
|
function UserAttrChange_Click() {
|
|
$.r_ajax({
|
|
url: "/Base/Inneruser/RecoveryCommissionRule",
|
|
type: "Post",
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.result == 1) {
|
|
$.messageBox5s('提示', "员工分成规则校验成功!");
|
|
} else {
|
|
$.messageBox5s('提示', data.msg);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
</script>
|