183 lines
6.6 KiB
Plaintext
183 lines
6.6 KiB
Plaintext
@using WX.CRM.WebHelper;
|
|
@{
|
|
ViewBag.Title = "CreateProductOrder";
|
|
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
|
|
}
|
|
<script type="text/javascript">
|
|
//var isOEM_Active = false;
|
|
var deptCode = '@ViewBag.DeptCode';
|
|
var hasMianOrderId = true;
|
|
$(function () {
|
|
var $product = $("#ProductList");
|
|
var producntid = $product.val();
|
|
var producntname= $("#ProductList option:selected").text();
|
|
BindLevel2Module(producntid, producntname);
|
|
$product.bind("change", function () {
|
|
producntid = $(this).val();
|
|
producntname = $("#ProductList option:selected").text();
|
|
BindLevel2Module(producntid, producntname);
|
|
});
|
|
$("#btnSave").click(function () {
|
|
var username = $("#UserName").val();
|
|
var days = 0;
|
|
//var price = $("#Price").val();
|
|
//if (!isOEM_Active) {
|
|
// if (days == "") {
|
|
// $.messageBox5s('提示', "开通天数不能为空");
|
|
// return;
|
|
// }
|
|
// if (price == "") {
|
|
// $.messageBox5s('提示', "支付金额不能为空");
|
|
// return;
|
|
// }
|
|
//}
|
|
//else {
|
|
// days = "0";
|
|
// price = "0";
|
|
//}
|
|
if (deptCode == "SHZZ") {
|
|
days = $("#Days").val();
|
|
if (days == "") {
|
|
$.messager.alert("错误", "天数不能为空!", "error");
|
|
return;
|
|
}
|
|
if (isNaN(days)) {
|
|
$.messager.alert("错误", "天数只能是数字!", "error");
|
|
return;
|
|
}
|
|
var mainOrderId = $("#mainOrderId").val();
|
|
if (mainOrderId == "") {
|
|
$.messager.alert("错误", "订单号不能为空!", "error");
|
|
return;
|
|
}
|
|
if (!hasMianOrderId) {
|
|
$.messager.alert("错误", "订单号不存在!", "error");
|
|
return;
|
|
}
|
|
}
|
|
else {
|
|
days = null;
|
|
}
|
|
if (username) {
|
|
$.r_ajax({
|
|
url: "/Level2/Leve2Order/CreateOrder",
|
|
type: "Post",
|
|
data: { UserName: username, ProductList: $product.val(), ResId: '@ViewBag.CustomerId', Days: days, mainOrderId: mainOrderId },
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.type === 0) {
|
|
//$.messageBox5s('提示', data.message);
|
|
$.messager.alert("警告", data.message, "error");
|
|
}
|
|
else {
|
|
//window.parent.parent.currenttabclose();
|
|
window.parent.$("#modalwindow").window('close');
|
|
window.parent.refreshLevel2Order();
|
|
window.parent.$.messager.alert("警告", data.message, "info");
|
|
//layui.use('layer', function () {
|
|
// var layer = layui.layer;
|
|
// layer.msg('开通成功!');
|
|
//});
|
|
}
|
|
}
|
|
});
|
|
}
|
|
else {
|
|
$.messageBox5s('提示', "用户名不能为空!");
|
|
}
|
|
|
|
});
|
|
|
|
$("#mainOrderId").change(function () {
|
|
if (this.value != "") {
|
|
$.getJSON('/Level2/Leve2Order/MainOrderIsExists?mainOrderId=' + this.value, function (rsp) {
|
|
if (!rsp.ret) {
|
|
hasMianOrderId = false;
|
|
$.messager.alert("警告", "订单号不存在!", "error");
|
|
}
|
|
else {
|
|
hasMianOrderId = true;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
function BindLevel2Module(productId, producntName) {
|
|
//isOEM_Active = false;
|
|
if (deptCode == "SHZZ") {
|
|
$("#hidTr").show();
|
|
}
|
|
|
|
//if (producntName.indexOf("免费用户体验功能") > -1 || producntName.indexOf("付费用户特权功能") > -1 || producntName.indexOf("私人定制特权功能") > -1) {
|
|
//isOEM_Active = true;
|
|
//$("#tb tr td[name='setv']").each(function () {
|
|
// $(this).hide();
|
|
//});
|
|
//}
|
|
|
|
//$.r_ajax({
|
|
// url: "/Soft/Module/Level2Module",
|
|
// type: "Post",
|
|
// data: { productId: productId },
|
|
// dataType: "html",
|
|
// loading: true,
|
|
// success: function (data) {
|
|
// $("#module").html(data);
|
|
// }
|
|
//});
|
|
}
|
|
|
|
});
|
|
</script>
|
|
|
|
<div class="mvctool bgb">
|
|
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
|
|
</div>
|
|
<div style=" height:90%;width:100%; overflow-y:auto">
|
|
@Html.Action("CustomerInfo", "CustomerUC", new { CustomerId = ViewBag.CustomerId })
|
|
<br />
|
|
<table id="tb" style="border-collapse: separate;border-spacing: 10px;">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
用户名
|
|
</td>
|
|
<td>
|
|
@Html.DropDownList("UserName", ViewBag.UserNameItems as IEnumerable<SelectListItem>)
|
|
</td>
|
|
<td>
|
|
活动名称
|
|
</td>
|
|
<td>
|
|
@Html.DropDownList("ProductList", ViewBag.ProductList as IEnumerable<SelectListItem>)
|
|
</td>
|
|
|
|
@*<td name="setv">
|
|
支付金额
|
|
</td>
|
|
<td name="setv">
|
|
@Html.TextBox("Price")
|
|
</td>*@
|
|
</tr>
|
|
<tr id="hidTr" style="display:none;">
|
|
<td>
|
|
开通天数
|
|
</td>
|
|
<td>
|
|
@Html.TextBox("Days", string.Empty, new { style = "width:50px;" })
|
|
</td>
|
|
<td>
|
|
订单号
|
|
</td>
|
|
<td>
|
|
@Html.TextBox("mainOrderId")
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<br />
|
|
<div id="module"></div>
|
|
</div>
|