TG.WXCRM.V4/WEB/Views/WeiXin/WorkWeixin/Edit.cshtml

149 lines
4.5 KiB
Plaintext

@model WX.CRM.Model.Entity.WX_WORKWEIXIN
@using WX.CRM.WebHelper;
@{
ViewBag.Title = "企业微信号录入";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<script type="text/javascript">
/* $(function () {
$("#btnSave").click(function () {
if ($("#CreateForm").valid()) {
$.r_ajax({
url: "/WeiXin/WorkAccountInit/Edit",
type: "Post",
data: $("#CreateForm").serialize(),
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
window.parent.frameReturnByMes(data.message);
window.parent.frameReturnByReload(true);
window.parent.frameReturnByClose()
}
else {
$.messager.alert("警告", data.message, "error");
}
}
});
}
return false;
});
});*/
</script>
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
</div>
<!--遮罩层-->
<style type="text/css">
#bg {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.7;
opacity: .70;
filter: alpha(opacity=70);
}
#show {
display: none;
position: absolute;
top: 45%;
left: 40%;
width: 20%;
height: 10%;
padding: 8px;
border: 8px solid #E8E9F7;
background-color: white;
z-index: 1002;
overflow: auto;
}
</style>
<div id="bg"></div>
<div id="show"><br />&nbsp;&nbsp;提示:数据正在处理中……</div>
<form id="frmUpload" method="post" action="Edit" enctype="multipart/form-data">
@Html.ValidationSummary(true)
<table class="fromEditTable ">
<tbody>
<tr>
<td style="width:100px;">
微信号
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.ALIAS)
@Html.HiddenFor(m => m.PKID)
</td>
<td width="120px">
<span style="color:red">区分大小写,严格按照微信号大小写录入,否则将无法接收资源</span>
@Html.ValidationMessageFor(m => m.ALIAS)
</td>
</tr>
<tr>
<td style="width:100px;">
手机号
</td>
<td style="width:310px">
@Html.TextBoxFor(m => m.MOBILE)
</td>
<td width="120px">
@Html.ValidationMessageFor(m => m.MOBILE)
</td>
</tr>
</tbody>
</table>
<table>
<tr>
<td>微信二维码:</td>
<td>
<input id="FileQRCodeUrl" name="FileQRCodeUrl" type="file" />
<br />
<br />
样图:<br /><img src="~/Content/Images/qrcode.jpg" alt="" /><br />
</td>
</tr>
</table>
</form>
<script type="text/javascript">
$(document).ready(function () {
$('#frmUpload').ajaxForm({
dataType: 'json',
beforeSend: ForEverajaxLoading,
complete: ForEverajaxLoadEnd,
success: function (data) {
if (data.type == 1) {
parent.loadtablegrid();
$.messageBox5s('提示', "添加成功");
$("#frmUpload").resetForm();
} else {
$.messageBox5s('提示', data.message);
}
}
});
$("#btnSave").click(function () {
if ($('#ALIAS').val().trim() == '') {
alert('请输入微信号');
return false;
}
var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(18[0-9]{1}|(17[0-9]{1}))|(19[0-9]{1}))+\d{8})$/;
if (!myreg.test($("#MOBILE").val())) {
alert('请输入有效的手机号码!');
return false;
}
$('#frmUpload').submit();
})
});
</script>