64 lines
2.7 KiB
Plaintext
64 lines
2.7 KiB
Plaintext
@using WX.CRM.Model.Entity
|
|
@{
|
|
ViewBag.Title = "客户归类";
|
|
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
|
|
var data = ViewBag.OrderCustomerClassify as List<decimal>;
|
|
}
|
|
<div class="mvctool bgb">
|
|
<a id="btnSave" style="float: left;" class="l-btn l-btn-plain"><span class="l-btn-left"><span class="l-btn-text icon-save" style="padding-left: 20px;">确定</span></span></a>
|
|
<span id="spMessage" style="top:5px; position:relative;left:30px;"></span>
|
|
</div>
|
|
<div class="checkList">
|
|
<ul id="checkboxList">
|
|
@foreach (var item in ViewBag.OrderCustomerType as List<WX_ORDERCUSTOMERTYPE>)
|
|
{
|
|
if (data.Contains(item.PKID))
|
|
{
|
|
<li class='checkLi'><input type='checkbox' id='ckb @item.PKID' title='@item.NAME' name='ckb @item.PKID' checked value='@item.PKID' /><label for='ckb @item.PKID'>@item.NAME</label></li>
|
|
}
|
|
else
|
|
{
|
|
<li class='checkLi'><input type='checkbox' id='ckb @item.PKID' title='@item.NAME' name='ckb @item.PKID' value='@item.PKID' /><label for='ckb @item.PKID'>@item.NAME</label></li>
|
|
}
|
|
|
|
}
|
|
</ul>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#checkboxList li").live("click", function () {
|
|
if ($(this).find("input").attr("checked") == null)
|
|
$(this).removeClass("checkLi").addClass("uncheckLi");
|
|
else
|
|
$(this).removeClass("uncheckLi").addClass("checkLi");
|
|
});
|
|
$("#btnSave").click(function () {
|
|
var resid ="@ViewBag.Resid";
|
|
var checkedFilds = "";//被选中的字段
|
|
$.each($("#checkboxList li input"), function (i, ex) {
|
|
if ($(ex).attr("checked") == "checked") {
|
|
checkedFilds += $(ex).val() + ",";
|
|
}
|
|
});
|
|
checkedFilds = checkedFilds.substr(0, checkedFilds.length - 1);
|
|
$("#btnSave").addClass("l-btn-disabled");
|
|
$("#spMessage").html("正在归类.......");
|
|
$.r_post("/AfterSales/SortSave?resid=" + resid+"&TypeId=" + checkedFilds, function (result)
|
|
{
|
|
var a = JSON.parse(result);
|
|
if (a.type == 1) {
|
|
parent.$.messageBox5s("提示", a.message);
|
|
parent.$("#tablist").tablegrid("Load");
|
|
parent.$("#modalwindow").window('close');
|
|
}
|
|
else
|
|
{
|
|
$.messager.alert("提示", a.message);
|
|
$("#btnSave").removeClass("l-btn-disabled");
|
|
$("#spMessage").html("");
|
|
}
|
|
})
|
|
});
|
|
});
|
|
</script>
|