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

239 lines
11 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.

@model WX.CRM.WEB.ViewModel.Level2.BatchOrder
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Index</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jQuery.validator.noinput.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.easyui.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/op/ProductSelect.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/json2.js")" type="text/javascript"></script>
<style type="text/css">
p {
font-size: 11px;
}
.tbHeigh {
height: 45px;
}
.bottomlink td {
border-bottom: dashed 1px #097eb2;
}
.table {
width: 80%;
table-layout: fixed;
empty-cells: show;
border-collapse: collapse;
margin: 0 auto;
}
.table td {
height: 20px;
border: 1px solid #cad9ea;
padding: 0 1em 0;
}
.table thead td {
font-weight: bold;
height: 30px;
background-color: #f5fafe;
}
</style>
</head>
<body>
<div style="height:100%;width:800px;margin: 0 auto; overflow-x:hidden; overflow-y: auto;">
@using (Html.BeginForm("Index", "BatchOrder", FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<fieldset style="width:760px;">
<legend>批量注册</legend>
<div style="width:760px;border-bottom:double 4px #097eb2; padding-bottom:10px;">
<div style="width:600px;margin: 0 auto; ">
<table>
<tbody>
<tr>
<td colspan="5" valign="top" style="font-size:11px; height:24px; color:#676666">用户名格式JMD11,JMD12前缀+尾号</td>
</tr>
<tr class="bottomlink">
<td width="60px" valign="top" style="padding-top:4px; ">
用户名:
</td>
<td class="tbHeigh" style="width:130px;" valign="top">
@Html.TextBoxFor(m => m.FirstName, new { placeholder = "前缀", style = "width:90px" })
<p>@Html.ValidationMessageFor(m => m.FirstName)</p>
</td>
<td class="tbHeigh" style="width:130px;" valign="top">
@Html.TextBoxFor(m => m.LastStartName, new { placeholder = "尾号起始", style = "width:90px" })&nbsp;&nbsp;&nbsp;~
<p>@Html.ValidationMessageFor(m => m.LastStartName)</p>
</td>
<td class="tbHeigh" style="width:130px;" valign="top">
@Html.TextBoxFor(m => m.LastEndName, new { placeholder = "尾号结束", style = "width:90px" })
<p>@Html.ValidationMessageFor(m => m.LastEndName)</p>
</td>
</tr>
</tbody>
</table>
<br />
<table>
<tbody>
<tr class="bottomlink">
<td width="60px" valign="top" style="padding-top:4px;height:26px;">
@Html.LabelFor(m => m.ProductCode):
</td>
<td id="product" class="tbHeigh" style="width:520px;height:26px;" valign="top">
<select id="BigPuc" style="width:230px;"></select>
<select id="ProductCode" name="ProductCode" style="width:230px;"></select>
</td>
</tr>
<tr class="bottomlink">
<td width="60px" valign="top" style="padding-top:14px;">
@Html.LabelFor(m => m.campaignId):
</td>
<td class="tbHeigh" style="width:520px;padding-top:10px;" valign="top">
@Html.TextBoxFor(m => m.campaignId)
<p>@Html.ValidationMessageFor(m => m.campaignId)</p>
</td>
</tr>
<tr>
<td width="60px" valign="top" style="padding-top:14px;">
@Html.LabelFor(m => m.IP):
</td>
<td class="tbHeigh" style="width:520px;padding-top:10px;" valign="top">
@Html.TextBoxFor(m => m.IP)
<p>@Html.ValidationMessageFor(m => m.IP)</p>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input id="ViewList" type="button" value="预览" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="width:760px; padding-top:10px;">
<div id="View" style="display:none;">
<table class="table">
<thead>
<tr>
<td>用户名</td>
<td>产品</td>
<td>渠道号</td>
<td>限定IP</td>
</tr>
</thead>
<tbody id="tbList">
@*@foreach (var m in ViewBag.ListOrder as List<AY.UserCenter.Web.Areas.Order.Models.BatchOrder>)
{
<tr>
<td>@m.FullName</td>
<td>@m.ProductCode</td>
<td>@m.IP</td>
</tr>
}*@
</tbody>
<tfoot>
<tr>
<td colspan="3" id="pager"></td>
</tr>
</tfoot>
</table>
<input type="hidden" id="hidQuery" value="" />
</div>
</div>
<div id="Commmit_div" style="width:760px; padding-top:10px;display:none">
<div style="width:100px; margin:0 auto;">
<input id="Commmit" type="button" value="注册并开通" />
</div>
</div>
</fieldset>
}
</div>
</body>
</html>
<script type="text/javascript">
$(function () {
$("#product").ProductSelect({
url: "/Level2/L2Product/GetZXL2Product",
Product_obj: "#ProductCode"
});
});
$("#ViewList").click(function () {
if ($("#CreateForm").valid()) {
$("#View").show();
$("#Commmit_div").show();
var para = "FirstName=" + $("#FirstName").val() + "&campaignId=" + $("#campaignId").val() +
"&LastStartName=" + $("#LastStartName").val() + "&LastEndName=" + $("#LastEndName").val()
+ "&ProductCode=" + $("#ProductCode").val() + "&IP=" + $("#IP").val() + "&ProductName=" + encodeURI(encodeURI($("#ProductCode").find("option:selected").text()));
GetList(1, para);
}
})
function GetList(index, query) {
$.ajax({
url: "/Level2/BatchOrder/getList?page=" + index + "&" + query,
type: "Post",
dataType: "json",
success: function (data) {
if (data.result) {
$("#tbList").empty();
$("#pager").empty();
$("#hidQuery").val();
var _text = "";
$.each(data.Data, function (i, n) {
_text += "<tr><td>" + n.FullName + "</td>" + "<td>" + n.ProductName + "</td>" + "<td>" + n.campaignId + "</td>" + "<td>" + n.IP + "</td></tr>"
});
$("#tbList").append(_text);
$("#pager").append(data.page);
$("#hidQuery").val(data.para)
}
}
});
}
function ShowPage(index) {
GetList(index, $("#hidQuery").val());
}
function toPage(nobj) {
GetList(nobj.value, $("#hidQuery").val());
}
$("#Commmit").click(function () {
var value = $("#hidQuery").val();
var $this = $(this);
$this.hide();
if (value) {
$.ajax({
url: "/Level2/BatchOrder/Open?" + value,
type: "Post",
dataType: "json",
success: function (data) {
$this.show();
if (data.result) {
alert("注册并开通成功");
$("#View").hide();
$("#Commmit_div").hide();
}
else {
alert("注册失败:" + data.message);
}
}
});
}
});
</script>