235 lines
9.8 KiB
Plaintext
235 lines
9.8 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<div class="mvctool">
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
||
@Html.ToolButton("btnAdd", "icon-add", "申请", true)
|
||
</div>
|
||
<div class="bas_datagrid">
|
||
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
||
<ul class="toolBar_ul">
|
||
<li>日期:@Html.WdatePickerText("txt_ctime", DateTime.Now.ToString("yyyy-MM-dd"))~@Html.WdatePickerText("txt_etime", DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"))</li>
|
||
<li>用户名:@Html.TextBox("txt_userName")</li>
|
||
<li>订单Id:@Html.TextBox("txt_orderId")</li>
|
||
<li>客户ID:@Html.TextBox("txt_resid", "", new { style = "width:150px;" })</li>
|
||
<li>
|
||
状态: @Html.DropDownList("slt_status", new List<SelectListItem>() {
|
||
new SelectListItem(){ Text="未开通",Value="0"},
|
||
new SelectListItem(){ Text="所有",Value="-1"},
|
||
new SelectListItem(){ Text="已开通",Value="1"},
|
||
new SelectListItem(){ Text="已撤销",Value="2"}
|
||
}, new { style = "width:100px;" })
|
||
</li>
|
||
<li>
|
||
活动类型: @Html.DropDownList("slt_product", ViewBag.SoftProductList as IEnumerable<SelectListItem>, new { style = "width:150px;" })
|
||
</li>
|
||
<!--<li>@Html.Action("UserComBoxByRole", "Control", new { DeptCode = ViewBag.deptCode, onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid })</li>-->
|
||
<li>
|
||
@*@Html.ToolButtonPlain("btnQuery" , "icon-search", "查询", false, "")*@
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.ActiveList)
|
||
</div>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
|
||
$('#Orderlist').tablegrid({
|
||
url: '/Level2/Leve2Order/GetLevel2OrderHtmlList',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
isCheckMore: true,
|
||
data: GetControlValue
|
||
});
|
||
|
||
//('#Orderlist').tablegrid("Load");
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#Orderlist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
$("#btnQuery").click(function () {
|
||
$('#Orderlist').tablegrid("Search");
|
||
});
|
||
function GetControlValue() {
|
||
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val() };
|
||
}
|
||
$("#btnAdd").click(function () {
|
||
$("#modalwindow").html(GetIframeHtml("/Level2/Level2Order/CreateOrderApply?CustomerId="));
|
||
$("#modalwindow").window({ title: '申请', width: 550, height: 300, iconCls: 'icon-export' }).window('open');
|
||
});
|
||
});
|
||
|
||
//ifram 返回
|
||
function frameReturnByClose() {
|
||
$("#modalwindow").window('close');
|
||
}
|
||
function frameReturnByReload(flag) {
|
||
$("#Orderlist").tablegrid("Load");
|
||
}
|
||
function frameReturnByMes(mes) {
|
||
$.messageBox5s('提示', mes);
|
||
}
|
||
</script>
|
||
<script type="text/javascript">
|
||
function onLoadSucced() {
|
||
$('#Orderlist').tablegrid("Search");
|
||
}
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
//获取datagrid头部及字段
|
||
function getDataGridHeader() {
|
||
var columns = $('#Orderlist').tablegrid("getHead");
|
||
return columns;
|
||
}
|
||
|
||
|
||
function Export_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Level2/Leve2Order/Level2ListExport?" + GetQueryStr() + "&groupId=" + $("#nb1_uc_org_groups").val() + "&userId=" + $("#nb1_uc_org_ids").val())));
|
||
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
|
||
|
||
$("#CheckALL").click(function () {
|
||
var flag = $(this).attr("checked");
|
||
$("input[name='orderCheck']:checkbox").each(function () {
|
||
if (flag) {
|
||
$(this).attr("checked", true);
|
||
|
||
$(this).parent().parent().not(":has(input:disabled)").addClass("tr_onclick")
|
||
}
|
||
else {
|
||
$(this).removeAttr("checked");
|
||
$("#Orderlist tr:gt(0)").not(":has(input:disabled)").removeClass("tr_onclick")
|
||
}
|
||
});
|
||
})
|
||
function Check_Click() {
|
||
var orderids = [];
|
||
$("input[name='orderCheck']:checked").each(function () {
|
||
orderids.push(this.value);
|
||
});
|
||
//console.log(orderids);
|
||
if (orderids.length == 1) {
|
||
var src = "/Level2/Leve2Order/ApplyDetails?id=" + orderids[0];
|
||
|
||
$("#modalwindow").html(GetIframeHtml(src));
|
||
$("#modalwindow").window({ title: '编辑', width: 600, height: 450, iconCls: 'icon-edit' }).window('open');
|
||
|
||
|
||
} else if (orderids.length > 1) {
|
||
$.messager.confirm('提示', '您确定要批量开通所勾选的订单?', function (r) {
|
||
if (r) {
|
||
var errorMsg = "", each_count = 0, orderids_length = orderids.length;
|
||
$.each(orderids, function (i, n) {
|
||
$.r_post("/Level2/Leve2Order/OpenOrder?id=" + n + "&reson=多选一次审核", function (data) {
|
||
if (data.type == 0) {
|
||
errorMsg += "订单号:" + n + "," + data.message + "</br>";
|
||
}
|
||
if (++each_count == orderids_length) {
|
||
if (errorMsg) {
|
||
$.messageBox5s('提示', errorMsg);
|
||
}
|
||
else {
|
||
$.messageBox5s('提示', "开通成功");
|
||
$("#Orderlist").tablegrid('Search');
|
||
}
|
||
}
|
||
|
||
}, "json");
|
||
|
||
});
|
||
}
|
||
})
|
||
}
|
||
else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
|
||
|
||
function Delete_Click() {
|
||
var orderids = [];
|
||
$("input[name='orderCheck']:checked").each(function () {
|
||
orderids.push(this.value);
|
||
});
|
||
if (orderids.length < 1) {
|
||
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
||
}
|
||
else {
|
||
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
|
||
if (r) {
|
||
var errorMsg = "", each_count = 0, orderids_length = orderids.length;
|
||
$.each(orderids, function (i, n) {
|
||
$.r_post("/Level2/Leve2Order/DeleteOrder?id=" + n, function (data) {
|
||
if (data.type == 1) {
|
||
if (data.type != 1) {
|
||
errorMsg += "订单号:" + n + "," + data.message + "</br>";
|
||
}
|
||
}
|
||
if (++each_count == orderids_length) {
|
||
if (errorMsg) {
|
||
$.messageBox5s('提示', errorMsg);
|
||
}
|
||
else {
|
||
$.messageBox5s('提示', "删除成功");
|
||
$("#Orderlist").tablegrid('Search');
|
||
}
|
||
}
|
||
}, "json");
|
||
|
||
});
|
||
}
|
||
});
|
||
}
|
||
|
||
}
|
||
function Close_Click() {
|
||
var orderids = $('#Orderlist').tablegrid("getSelections");
|
||
var vail = true;
|
||
|
||
$.each(orderids, function (i, n) {
|
||
if (n.ORDERSTATUSNAME == "未开通") {
|
||
$.messageBox5s('提示', '未开通的订单不能关闭!');
|
||
vail = false;
|
||
return false;
|
||
}
|
||
});
|
||
if (vail == false) {
|
||
return;
|
||
}
|
||
|
||
if (orderids.length < 1) {
|
||
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
||
}
|
||
else {
|
||
$.messager.confirm('提示', '您确定要关闭所选择的所有订单吗?', function (r) {
|
||
if (r) {
|
||
var errorMsg = "", each_count = 0, orderids_length = orderids.length;
|
||
$.each(orderids, function (i, n) {
|
||
$.r_post("/Level2/Leve2Order/CloseFreeOrder?id=" + n.orderid, function (data) {
|
||
if (data.type == 1) {
|
||
if (data.type != 1) {
|
||
errorMsg += "订单号:" + n + "," + data.message + "</br>";
|
||
}
|
||
}
|
||
if (++each_count == orderids_length) {
|
||
if (errorMsg) {
|
||
$.messageBox5s('提示', errorMsg);
|
||
}
|
||
else {
|
||
$.messageBox5s('提示', "删除成功");
|
||
$("#Orderlist").tablegrid('Search');
|
||
}
|
||
}
|
||
}, "json");
|
||
|
||
});
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
</script> |