TG.WXCRM.V4/WEB/Views/Weapp/WeappGroup/Index.cshtml

136 lines
4.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using WX.CRM.WebHelper
@{
ViewBag.Title = "";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<style type="text/css">
.table1 td { height: 30px; }
</style>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnAdd", "icon-add", "添加", true)
@Html.ToolButton("btnEdit", "icon-edit", "修改", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="bas_datagrid">
@Html.Raw(ViewBag.RptList)
</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><input id="groupName" name="groupName" type="text" /></td>
</tr>
<tr>
<td align="right">公众号ID</td>
<td><input id="accountNum" name="accountNum" type="text" /></td>
</tr>
<tr>
<td align="right">组类型:</td>
<td><span id="groupType"></span></td>
</tr>
<tr>
<td align="right">客服:</td>
<td><span id="saleUserId"></span></td>
</tr>
<tr>
<td></td>
<td>
<input type="hidden" id="operate" />
<input type="hidden" id="pkid"/>
<input id="BtnSave" type="button" value="确认" onclick="BtnSave()"/>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(function () {
$(window).resize(function () {
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
LoadData();
$("#btnQuery").click(function () {
LoadData();
});
$("#btnAdd").click(function () {
AuditSingle("add", null, null, null, null, null);
});
$("#btnEdit").click(function () {
var row = $("#tablist").tablegrid("getSelected");
if (row != null) {
AuditSingle("edit", row.PKID, row.GROUPNAME, row.ACCOUNTNUM, row.GROUPTYPE, row.SALEUSERID);
} else { $.messageBox5s('提示', "选中要确认的数据!"); }
});
});
function LoadData() {
$("#tablist").tablegrid({
url: '/weixin/WeappGroup/index',
height: $(window).height() - 110,
loadNow: true,
isPage: true,
data: GetControlValue()
});
}
function GetControlValue() {
return
{
//year: $("#year").val(), month: $("#month").val(), eid: $("#txt_eid").val()
};
}
function AuditSingle(type, pkid, groupName, accountNum, groupType, saleUserId) {
if (type === "edit") {
$("#operate").val("update");
$("#pkid").val(pkid);
$("#groupName").val(groupName);
$("#accountNum").val(accountNum);
$("#groupType").html(groupType);
$("#saleUserId").html(saleUserId);
} else {
$("#operate").val("add");
$("#pkid").val("");
$("#groupName").val("");
$("#accountNum").val("");
$("#groupType").html("");
$("#saleUserId").html("");
}
$('#dlg4').dialog({
title: "组别",
width: 550,
height: 250,
closed: false,
cache: false,
modal: true
});
}
function BtnSave() {
var pkid = $("#pkid").val();
var groupName = $("#groupName").val();
var accountNum = $("#accountNum").val();
var operate = $("#operate").val();
$.r_ajax({
url: "/weixin/WeappGroup/" + operate,
type: "Post",
data: { pkid: pkid, groupName: groupName, accountNum: accountNum},
dataType: "json",
loading: true,
success: function (data) {
if (data.result === "ok") {
$('#dlg4').dialog('close');
LoadData();
$.messageBox5s('提示', data.message);
}
else {
$.messageBox5s('提示', data.message);
}
}
});
}
</script>