ComplianceServer/oldcode/WEB/Views/WeiXin/JZOrder/SupplementOrder.cshtml

272 lines
9.9 KiB
Plaintext

@model WX.CRM.Model.MAP.WX_SZZYORDER_Extend
@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("SupplementOrder", "JZOrder", null, FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable ">
<tr>
<td style="width:120px;">
客户手机号
</td>
<td style="width:310px">
<input type="text" name="mobile" id="mobile" />
</td>
<td width="120px"></td>
</tr>
<tr>
<td style="width:120px;">
客服工号
</td>
<td style="width:310px">
<input type="text" name="eid" id="eid" />
</td>
<td width="120px"></td>
</tr>
<tr>
<td style="width:120px;">
用户名
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.SoftUserName)
</td>
<td width="120px">@Html.ValidationMessageFor(m => m.SoftUserName)</td>
</tr>
<tr>
<td style="width:120px;">
姓名
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.Name)
</td>
<td width="120px">@Html.ValidationMessageFor(m => m.Name)</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">
@Html.TextBoxFor(m => m.PayNo)
</td>
<td width="120px">@Html.ValidationMessageFor(m => m.PayNo)</td>
</tr>
<tr>
<td style="width:120px;">
支付金额
</td>
<td style="width:310px">
<input type="text" name="needPay" id="NEEdPAY" />
</td>
<td width="120px"></td>
</tr>
<tr>
<td style="width:120px;">
支付类型
</td>
<td style="width:310px">
@Html.DropDownList("PAYTYPE", new List<SelectListItem>() {
new SelectListItem(){Text="银行转账",Value="3",Selected=true},
new SelectListItem(){Text="支付宝",Value="1",Selected=false},
new SelectListItem(){Text="微信支付",Value="5",Selected=false},
new SelectListItem(){Text="网银支付",Value="4",Selected=false},
new SelectListItem(){Text="银联",Value="7",Selected=false},
new SelectListItem(){Text="网银支付",Value="4",Selected=false}})
</td>
<td width="120px"></td>
</tr>
<tr>
<td style="width:120px;">
开通天数
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.OpenDays)
</td>
<td width="120px">@Html.ValidationMessageFor(m => m.OpenDays)</td>
</tr>
<tr>
<td style="width:120px;">
备注
</td>
<td style="width:310px">
@Html.TextAreaFor(m => m.wx_SzzyOrder.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>
</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.wx_SzzyOrder.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/JZOrder/SupplementOrder",
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;
});
});
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 {
$('#wx_SzzyOrder_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);
$('#wx_SzzyOrder_CUSTOMERUSERNAME').val(userName);
}
function ChooseCustomerWx() {
$("#modalwindow").html(GetIframeHtml("/WeiXin/SzzyOrder/RContactIndex?eid="+$('#eid').val().trim()));
$("#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>