ComplianceServer/oldcode/WEB/Views/QH/CustomerSaleUser/Index.cshtml

141 lines
5.5 KiB
Plaintext

@using WX.CRM.WebHelper;
@{
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>资金账户:<input type="text" name="txt_userAccount" />&nbsp;</li>
<li>客服工号:<input type="text" name="txt_userId" />&nbsp;</li>
<li>
分配状态:<select id="slt_bindType" name="slt_bindType" style="height: 22px;">
<option value="2">全部</option>
<option value="0" selected>未分配</option>
<option value="1">已分配</option>
</select>
</li>
</ul>
</div>
@Html.Raw(ViewBag.List)
</div>
<script type="text/javascript">
$(function () {
$('#tablist').tablegrid({
url: '/QH/CustomerSaleUser/GetHtml',
height: $(window).height() - 110,
loadNow: true,
onLoadError: function () {
$.messager.alert("警告", "信息加载失败!", "error");
}
});
$("#btnQuery").click(function () {//搜索按钮点击事件
$('#tablist').tablegrid("Search");
});
$(window).resize(function () {//自动适应大小
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
});
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
//提交
function Save_Click() {
var inputValue = [];
$("input[name='CustomerSaleUser']")
.each(function () {
if ($(this).attr("oldTUser") !== "" || $(this).val() !== "") {
inputValue.push({
UserAccount: $(this).attr("useraccount"),
OldUserId: $(this).attr("oldTUser"),
NewUserId: $(this).val()
});
}
});
if (inputValue.length > 0) {
$.r_post("/QH/CustomerSaleUser/Save", { 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.PropertyName + ":" + j.Message + ",";
});
$.messageBox5s('提示', msg);
}
}, "json");
}
else {
$.messageBox5s('提示', '请输入要变更的工号');
}
}
//重新绑定
function Bind_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/QH/CustomerSaleUser/Bind?userAccount=" + row.USERACCOUNT + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '重新绑定', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function BatchBind_Click() {
$("#modalwindow").html(GetIframeHtml("/QH/CustomerSaleUser/BatchBind?Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '批量重新绑定售后', width: 900, height: 700, iconCls: 'icon-edit' }).window('open');
}
function Recover_Click()
{
var row = $('#tablist').tablegrid('getSelected');
if (row != null)
{
$.messager.confirm('提示', '确定回收?', function (r) {
if (r) {
var id = row.INNERUSERID;
if (id.indexOf("客服") >= 0) {
$.messager.alert("警告", "不能操作未分配的单据");
}
else
{
$.r_post("/QH/CustomerSaleUser/Recover?userAccount=" + row.USERACCOUNT, function (data) {
$("#tablist").tablegrid('Load');
$.messageBox5s("提示", data.message);
}, "json");
}
}
});
}else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
//获取datagrid头部及字段
function getDataGridHeader() {
var columns = $('#tablist').tablegrid("getHead");
return columns;
}
function export_Click() {
var parm = GetQueryStr();
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/QH/CustomerSaleUser/Export?" + parm)));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
}
</script>