TG.WXCRM.V4/WEB/Views/Level2/Leve2Order/Index.cshtml

216 lines
9.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 System.Collections;
@using System.Web.UI.WebControls;
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<script type="text/javascript">
function onLoadSucced() {
$('#tablist').tablegrid("Search");
}
$(function () {
var search = -1;
getDate();
//加载list
$('#tablist').tablegrid({
url: '/Level2/Leve2Order/GetHtmlList',
height: $(window).height() - 110,
loadNow: true,
onLoadSuccess: function (data) {
//成功
$("[field='productcode']").remove();
$("[field='CHANNEL']").remove();
},
onLoadError: function () {
//失败
$.messager.alert("警告", "信息加载失败!", "error");
}
});
function getDate() {
var _date, $stime, $etime;
_date = CRM_Comon().GetDate();
$stime = $("#txt_ctime");
$etime = $("#txt_etime");
if ($stime.val() == "") {
$stime.val(_date.AddDays(-7, { MinDate: true }));
} if ($etime.val() == "") {
$etime.val(_date.getLocalDate({ MaxDate: true }));
}
}
//$('#tablist').tablegrid("Load");
$(window).resize(function () {//自动适应大小
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
//查询订单
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
});
$("#btnQuery_his").click(function () {
search = 1;
$('#tablist').tablegrid("Search");
});
//订单详情
$("#btnDetail").click(function () {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/Level2/Leve2Order/Details?id=" + row.orderid));
$("#modalwindow").window({ title: '订单详情', width: 600, height: 500, iconCls: 'icon-details' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
});
//大类改变
$("#slt_productbigtype").change(function () {
var selec = $("#slt_productbigtype").val();
$("#slt_productsmalltype").get(0).options.length = 0;
$.getJSON("/Level2/Leve2Order/JsonProType?code=" + selec, { 'slt_productbigtype': selec }, function (data) {
for (var i = 0; i < data.length; i++) {
$("#slt_productsmalltype").append("<option value='" + data[i].Value + "'>" + data[i].Text + "</option>");
}
});
});
});
//取消订单
function btncancel_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
if (confirm("确认取消订单?")) {
if (row.isopen == '已开通') {
if (row.ispayed == '未支付') {
$.messager.confirm('提示', '@Suggestion.CancelOrder', function (r) {
if (r) {
$.r_post("/Level2/Leve2Order/CancelOrde?id=" + row.orderid, function (data) {
if (data.type) {
$("#tablist").tablegrid('Load');
}
$.messageBox5s('提示', data.message);
}, "json");
}
});
} else {
$.messageBox5s('提示', '该订单已支付,不能取消订单!');
}
}
else {
$.messageBox5s('提示', '该订单未开通,不能取消订单!');
}
}
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
};
//开通订单
function btnopen_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
if (row.isopen == '未开通') {
$("#modalwindow").html(GetIframeHtml("/Level2/Leve2Order/OpenOrderDetails?id=" + row.orderid));
$("#modalwindow").window({ title: '开通订单', width: 500, height: 400, iconCls: 'icon-details' }).window('open');
} else {
$.messageBox5s('提示', '该订单已开通!');
}
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
};
//创建订单
function btnAdd_Click() {
$("#modalwindow").html(GetIframeHtml("/Level2/Leve2Order/L2CreateActiveOrder"));
$("#modalwindow").window({ title: '新增', width: 700, height: 400, iconCls: 'icon-add' }).window('open');
};
//查看用户名
function btnSUsername_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/Level2/Leve2Order/UserNameDetails?id=" + row.orderid));
$("#modalwindow").window({ title: '用户名', width: 400, height: 300, iconCls: 'icon-details' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
};
//导出订单列表
function btnexport_Click() {
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Level2/Leve2Order/ListExport?" + GetQueryStr() + "&" + getPageOptions("tablist"))));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
};
//网银支付下单并开通
function btnPayCreate_Click() {
$("#modalwindow").html(GetIframeHtml("/Level2/Leve2Order/L2CreatePayOrder?protype=" + $("#hidprotype").val()));
$("#modalwindow").window({ title: '银行转账下单并开通', width: 700, height: 400, iconCls: 'icon-add' }).window('open');
};
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='auto' frameborder='0'' src='" + src + "'></iframe>";
}
//ifram 返回
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
function getPageOptions(gridID) {
var option = $("#tablist").tablepage('getPagination');
var str = "rows=" + option.rows + "&page=" + option.page + "&order=" + option.order + "&sort=" + option.sort;
return str;
}
//获取datagrid头部及字段
function getDataGridHeader() {
var columns = $('#tablist').tablegrid("getHead");
return columns;
}
</script>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnDetail", "icon-details", "订单详情", 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>产品大类:@Html.DropDownList("slt_productbigtype", ViewBag.bplist as IEnumerable<SelectListItem>, new { style = "width:150px" })&nbsp;</li>
<li>产品小类:@Html.DropDownList("slt_productsmalltype", ViewBag.splist as IEnumerable<SelectListItem>, new { style = "width:165px" })&nbsp;</li>
<li>
开通状态: @Html.DropDownList("slt_openStatu", new List<SelectListItem>() {
new SelectListItem(){ Text="所有",Value=""},
new SelectListItem(){ Text="已开通",Value="1"},
new SelectListItem(){ Text="未开通",Value="0"}
}, new { style = "width:60px" })
</li>
<li>用户名:<input type="text" name="txt_userName" />&nbsp;</li>
<li>订单号:<input type="text" name="txt_OrderId" />&nbsp;</li>
<li>客户ID<input type="text" name="txt_ResId" style="width:135px;" />&nbsp;</li>
<li>
下单时间:
<input type="text" id="txt_ctime" name="txt_ctime" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" style="width:140px;" />
~<input type="text" id="txt_etime" name="txt_etime" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" style="width:140px;" />
</li>
<li>
开通时间:
<input type="text" id="txt_ctime" name="txt_openctime" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" style="width:140px;" />
~<input type="text" id="txt_etime" name="txt_openetime" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss' })" style="width:140px;" />
</li>
<li >
<input type="text" name="txt_protype" id="hidprotype" hidden="hidden" value=@ViewBag.protype />&nbsp;
</li>
</ul>
</div>
@Html.Raw(ViewBag.gridTable)
</div>