ComplianceServer/oldcode/WEB/Views/Res/SalesGroupPromotion/Index.cshtml

233 lines
8.2 KiB
Plaintext

@using WX.CRM.WebHelper
@{
ViewBag.Title = "";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnAdd", "icon-add", "添加", true)
@Html.ToolButton("btnEdit", "icon-edit", "修改", true)
@Html.ToolButton("btnDelete", "icon-remove", "删除", 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>
分组:<select id="slt_groupId" name="slt_groupId">
<option value=""></option>
@foreach (var item in ViewBag.groupList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
</li>
<li>
标签:<select id="slt_tag" name="slt_tag">
<option value=""></option>
@foreach (var item in ViewBag.tagList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
</li>
<li>工号:<input type="text" value="" name="txt_eid"/>&nbsp;</li>
<li>工作微信号:<input type="text" value="" name="txt_alias"/>&nbsp;</li>
</ul>
</div>
@Html.Raw(ViewBag.gridTable)
</div>
<div id="dlg4" class="easyui-dialog" closed="true" style="width: 600px; height: 400px; padding: 10px;">
<table class="table1">
<tr>
<td align="right">分组:</td>
<td>
<select id="groupId" name="groupId">
<option value="请选择"></option>
@foreach (var item in ViewBag.groupList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
</td>
</tr>
<tr>
<td align="right">标签:</td>
<td>
<select id="tag" name="tag">
<option value="请选择"></option>
@foreach (var item in ViewBag.tagList as List<SelectListItem>)
{
<option value="@item.Value">@item.Text</option>
}
</select>
</td>
</tr>
<tr>
<td align="right">工号:</td>
<td><input id="eid" name="eid" type="text" /></td>
</tr>
<tr>
<td align="right">工作微信号:</td>
<td><input id="alias" name="alias" type="text" /></td>
</tr>
<tr>
<td></td>
<td>
<input id="action" name="action" type="hidden" value="" />
<input id="BtnSave" name="BtnSave" type="button" value="确认" onclick="BtnSave()" />
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(function () {
$('#tablist').tablegrid({
url: '/res/SalesGroupPromotion/Index',
height: $(window).height() - 130,
loadNow: true,
isPage: false,
//isCheckMore: true
});
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
});
$("#btnAdd").click(function () {
$('#dlg4').dialog({
title: "添加",
width: 550,
height: 250,
closed: false,
cache: false,
modal: true
});
});
$("#btnEdit").click(function () {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
var eidArr = row.EID.split('-');
$("#groupId").val(row.GROUPID);
$("#tag").val(row.TAG);
$("#eid").val(eidArr[0]);
$("#alias").val(row.ALIAS);
$("#action").val("update");
$('#dlg4').dialog({
title: "修改",
width: 550,
height: 250,
closed: false,
cache: false,
modal: true
});
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
});
$("#btnDelete").click(function () {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
if(confirm("确认删除吗?"))
{
var alias = row.ALIAS;
$.r_post("/res/SalesGroupPromotion/Delete", { alias: alias }, function (data) {
if (data.result == "success") {
$("#tablist").tablegrid('Load');
$.messageBox5s('提示', "删除成功");
$('#dlg4').dialog("close");
}
else {
$.messageBox5s('提示', "删除失败");
}
}, "json");
}
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
});
});
function onLoadSucced() {
$("#tablist").tablegrid("Search");
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
function BtnSave() {
var groupId = $("#groupId").val();
var tag = $("#tag").val();
var eid = $("#eid").val();
var alias = $("#alias").val();
var action = $("#action").val();
if (groupId == "")
{
alert("请选择组!");
return;
}
if (tag == "")
{
alert("请选择标签!");
return;
}
if (eid == "")
{
alert("工号不能为空!");
return;
}
if (alias == "")
{
alert("微信号不能为空!");
return;
}
if (action == "update") {
$.r_post("/res/SalesGroupPromotion/Update", { groupId: groupId, tag: tag, eid: eid, alias: alias }, function (data) {
if (data.result == "success") {
$("#tablist").tablegrid('Load');
$.messageBox5s('提示', "修改成功");
$("#action").val("");
$('#dlg4').dialog("close");
}
else {
$.messageBox5s('提示', "修改失败");
}
}, "json");
}
else {
$.r_post("/res/SalesGroupPromotion/Add", { groupId: groupId, tag: tag, eid: eid, alias: alias }, function (data) {
if (data.result == "success") {
$("#tablist").tablegrid('Load');
$.messageBox5s('提示', "添加成功");
}
else {
$.messageBox5s('提示', "添加失败");
}
}, "json");
}
}
function Bind_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/WeiXin/AfterSales/Bind?resId=" + row.res + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '绑定售后', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function BatchBind_Click() {
$("#modalwindow").html(GetIframeHtml("/WeiXin/AfterSales/BatchBind?Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '批量重新绑定售后', width: 900, height: 700, iconCls: 'icon-edit' }).window('open');
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
</script>