266 lines
9.0 KiB
Plaintext
266 lines
9.0 KiB
Plaintext
@model WX.CRM.Model.Entity.WX_SZZYORDER
|
|
@using WX.CRM.WebHelper;
|
|
|
|
@{
|
|
ViewBag.Title = "订单录入";
|
|
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
|
|
|
|
}
|
|
|
|
|
|
<div class="mvctool bgb">
|
|
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
|
|
</div>
|
|
|
|
@using (Html.BeginForm("AddByRes", "CommonOrder", null, FormMethod.Post, new { Id = "CreateForm" }))
|
|
{
|
|
@Html.ValidationSummary(true)
|
|
<table class="fromEditTable ">
|
|
|
|
<tr>
|
|
<td style="width:120px;">
|
|
客户ID
|
|
</td>
|
|
<td style="width:310px">
|
|
<input type="text" name="resid" id="resid" value="@ViewBag.CustomerId" />
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td style="width:120px;">
|
|
姓名
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.TextBoxFor(m => m.CNAME)
|
|
</td>
|
|
<td width="120px">@Html.ValidationMessageFor(m => m.CNAME)</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:120px;">
|
|
产品大类:
|
|
</td>
|
|
<td style="width:310px">
|
|
<select id="productId" name="productId" style="width:150px;height:22px" onChange="changeselect(this.value)">
|
|
<option value="0">--请选中产品大类--</option>
|
|
@foreach (var item in ViewBag.productList as List<SelectListItem>)
|
|
{
|
|
<option value="@item.Value">@item.Text</option>
|
|
}
|
|
</select>
|
|
|
|
</td>
|
|
<td width="120px">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:120px;">
|
|
产品小类:
|
|
</td>
|
|
<td style="width:310px">
|
|
<select id="subProductId" name="subProductId" style="width:220px;height:22px" onChange="changeSubProduct(this.value)">
|
|
<option value="0">--请选中产品小类--</option>
|
|
</select>
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="width:120px;">
|
|
支付金额
|
|
</td>
|
|
<td style="width:310px">
|
|
<input type="text" name="needPay" id="NEEdPAY" value="1" />
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:120px;">
|
|
订单类型
|
|
</td>
|
|
<td style="width:310px">
|
|
<select id="ORDERTYPE" name="ORDERTYPE" style="height:22px;">
|
|
<option value="1">普通订单</option>
|
|
<option value="2">续费订单</option>
|
|
<option value="3">升级订单</option>
|
|
</select>
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
@*<tr>
|
|
<td width="60px" style="width:100px;">
|
|
到账时间
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.WdatePickerText("arrivaltime", "")
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>*@
|
|
<tr>
|
|
<td width="60px" style="width:100px;">
|
|
订单开通时间
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.WdatePickerText("otime", "")
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="60px" style="width:100px;">
|
|
订单结束时间
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.WdatePickerText("endtime", "")
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td style="width:120px;">
|
|
备注
|
|
</td>
|
|
<td style="width:310px">
|
|
@Html.TextAreaFor(m => m.REMARK, new { style = "width:300px;height:50px" })
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:120px;">
|
|
客户来源
|
|
</td>
|
|
<td style="width:310px">
|
|
<select id="SOURCE" name="source" style="height:22px;" onChange="sourceselect(this.value)">
|
|
<option value="">请选择</option>
|
|
<option value="1">推广资源</option>
|
|
<option value="2">线下资源</option>
|
|
<option value="3">自找资源</option>
|
|
<option value="4">营销QQ</option>
|
|
<option value="5">公众号</option>
|
|
</select>
|
|
</td>
|
|
<td width="120px"></td>
|
|
</tr>
|
|
</table>
|
|
<table id="customerSource" style="display:none" class="fromEditTable ">
|
|
<tr>
|
|
|
|
<td style="width:152px;">
|
|
客户微信用户名
|
|
</td>
|
|
<td style="width:383px">
|
|
<input disabled value="" id="wxUserName" />
|
|
@Html.HiddenFor(m => m.CUSTOMERUSERNAME, new { style = "width:200px;" }) <input type="button" onclick="ChooseCustomerWx()" value="选择微信用户" />
|
|
</td>
|
|
<td width="120px"></td>
|
|
|
|
</tr>
|
|
</table>
|
|
<div id="modalwindow" class="easyui-window" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
|
|
|
|
}
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
$("#btnSave").click(function () {
|
|
if ($("#CreateForm").valid()) {
|
|
$.r_ajax({
|
|
url: "/WeiXin/CommonOrder/AddByRes",
|
|
type: "Post",
|
|
data: $("#CreateForm").serialize(),
|
|
dataType: "json",
|
|
loading: true,
|
|
success: function (data) {
|
|
if (data.type == 1) {
|
|
//window.parent.frameReturnByMes(data.message);
|
|
window.parent.frameReturnByMes('订单创建成功');
|
|
window.parent.frameReturnByReload(true);
|
|
//window.parent.frameReturnByClose();
|
|
window.location="/WeiXin/CommissionRule/Edit?orderid="+data.value;
|
|
}
|
|
else {
|
|
$.messager.alert("警告", data.message, "error");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return false;
|
|
});
|
|
|
|
$("#btnQuery").click(function () {
|
|
$('#tablist').tablegrid("Search");
|
|
});
|
|
});
|
|
|
|
|
|
function changeselect(productId) {
|
|
var nb1defaultIndex = 0;
|
|
if (productId == 0) {
|
|
$("#subProductId").unbind();
|
|
$("#subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
return;
|
|
}
|
|
$.r_post("/SzzyOrder/GetSubProductList?productId=" + productId, function (data) {
|
|
$("#subProductId").unbind();
|
|
|
|
$("#subProductId").html("<option value='0'>--请选中产品小类--</option>");
|
|
|
|
$(data).each(function (n, m) {
|
|
/*if (nb1defaultIndex == 0) {
|
|
$("#slt_subProductId").append("<option value='" + m.Value + "' selected='selected'>" + m.Text + "</option>");
|
|
}
|
|
else {*/
|
|
$("#subProductId").append("<option value='" + m.Value + "'>" + m.Text + "</option>");
|
|
|
|
//}
|
|
});
|
|
nb1defaultIndex++;
|
|
}, "json");
|
|
}
|
|
|
|
function ordertypeselect(type) {
|
|
if (type == 3) {
|
|
$('#upgradeOrderShow').css('display', 'block');
|
|
} else {
|
|
$('#upgradeOrderShow').css('display', 'none');
|
|
}
|
|
}
|
|
|
|
function sourceselect(val) {
|
|
// if (val == 1) {
|
|
$('#customerSource').css('display', 'block');
|
|
// } else {
|
|
$('#CUSTOMERUSERNAME').val('');
|
|
$('#wxUserName').val('');
|
|
// $('#customerSource').css('display', 'none');
|
|
// }
|
|
}
|
|
|
|
function changeSubProduct(subProductId) {
|
|
$.r_post("/SzzyOrder/GetSubProductPriceById?subProductId=" + subProductId, function (data) {
|
|
if (data.result) {
|
|
$("#NEEdPAY").val(data.price);
|
|
}
|
|
}, "json");
|
|
}
|
|
|
|
function selectCustomerWx(userName) {
|
|
$('#wxUserName').val(userName);
|
|
$('#CUSTOMERUSERNAME').val(userName);
|
|
}
|
|
|
|
function ChooseCustomerWx() {
|
|
$("#modalwindow").html(GetIframeHtml("/WeiXin/SzzyOrder/RContactIndex"));
|
|
$("#modalwindow").window({ title: '选择客户微信', width: 650, height: 500, iconCls: 'icon-add' }).window('open');
|
|
|
|
}
|
|
|
|
function GetIframeHtml(src) {
|
|
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
|
}
|
|
|
|
function frameReturnByClose() {
|
|
$("#modalwindow").window('close');
|
|
}
|
|
</script> |