TG.WXCRM.V4/WEB/Views/Res/VIPCustomer/Add.cshtml

178 lines
7.3 KiB
Plaintext
Raw 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.

@using WX.CRM.WebHelper;
@model WX.CRM.Model.Entity.RES_CALLOUTCUSTOMER
@{
ViewBag.Title = "Add";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<link href="~/Content/main.css" rel="stylesheet" />
<script type="text/javascript">
$(function () {
$('#frmUpload').ajaxForm({
dataType: 'json',
beforeSend: ForEverajaxLoading,
complete: ForEverajaxLoadEnd,
success: function (data) {
console.log(data)
if (data.type == "true") {
$.messageBox5s('提示', "号码提交成功!");
loadtablegrid();
} else {
$.messageBox5s('提示', data.message);
}
}
});
$("#btnSearch").click(function () {
if ($("#txt_resid").val() == "") {
$.messager.alert("提示", "请你输入客户ID", "error");
return false;
}
$.r_ajax({
url: "/Csvr/BlackNumber/GetAllResId",
type: "Post",
data: { resId: $("#txt_resid").val() },
dataType: "json",
loading: true,
success: function (data) {
if (data.result == "1") {
var residHtml = "";
$(data.ResIds).each(function (i, n) {
residHtml += "<input id=\"CBLNumber_" + i + "\" type=\"checkbox\" value=\"" + n.RESID + "\" name=\"CBLNumber_" + i + "\">";
residHtml += "<label for=\"CBLNumber_" + i + "\">" + (n.ISPRIMARYNUM == "1" ? "主号码" : "非主号") + " : " + n.RESID + "&nbsp;" + n.LASTNUM3 + "</label><br/>";
});
$("#divresids").html(residHtml);
} else {
$.messager.alert("提示", data.errorMessag, "error");
}
}
});
});
$("#btnSave").click(function () {
var title = $(".tabs-selected").find(".tabs-title").html();
var jsonData;
if (title == "资源") {
if ($("#CreateForm").valid()) {
jsonData = $("#CreateForm").serialize();
} else {
return false;
}
} else if (title == "文件上传导入") {
$('#frmUpload').submit();
return false
} else {
var BLACKNUMBER_resids = "";
$("#divresids input:checked").each(function () {
BLACKNUMBER_resids += $(this).val() + ",";
});
if (BLACKNUMBER_resids.length > 0)
BLACKNUMBER_resids = BLACKNUMBER_resids.substr(0, BLACKNUMBER_resids.length - 1);
jsonData = { Reson: $("#Reson1").val(), resids: BLACKNUMBER_resids };
}
$.r_ajax({
url: "/RES/VIPCustomer/Add",
type: "Post",
data: jsonData,
dataType: "json",
loading: true,
success: function (data) {
if (data.type === 10) {
if (title == "资源")
$("#showMsg").hide().text();
else
$("#showMsg1").hide().text();
CRM_Comon({}).showErrors(data.errors);
}
else {
if (title == "资源")
$("#showMsg").show().text(data.value);
else
$("#showMsg1").show().text(data.value);
window.parent.frameReturnByMes(data.message);
}
}
});
});
});
</script>
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
</div>
<div class="formContent">
<div class="easyui-tabs" id="ntt">
<div title="资源" style="padding:10px">
@using (Html.BeginForm("Add", "BlackNumber", null, FormMethod.Post, new { Id = "CreateForm" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable setTextWidth300">
<tbody>
<tr>
<td width="60px" style="width:100px;">客户ID:<p style="color:red;font-size:11px;">注:多个资源以逗号隔开</p></td>
<td style="width:310px">
<textarea id="resids" name="resids" rows="6"></textarea>
</td>
<td width="120px"></td>
</tr>
<tr>
<td width="60px" style="width:100px;">备注</td>
<td style="width:310px"><textarea name="Reson"></textarea></td>
<td width="120px"></td>
</tr>
<tr><td colspan="3"><span id="showMsg" class="warning" style="display:none;"></span></td></tr>
</tbody>
</table>
}
</div>
<div title="客户ID" style="padding:10px">
<form id="form2" name="form2">
<table class="fromEditTable setTextWidth300">
<tbody>
<tr>
<td width="60px">
客户ID
</td>
<td style="width:310px">
<input id="txt_resid" name="txt_resid" style="width:200px;" />
<input id="btnSearch" type="button" class="btn btn-primary" value="查找" />
</td>
<td width="120px"></td>
</tr>
<tr>
<td>结果:</td>
<td id="divresids" style="line-height:25px;">请在上面输入ID然后点击查找.......</td>
<td></td>
</tr>
<tr>
<td width="60px" style="width:100px;">备注:</td>
<td style="width:310px"><textarea name="Reson1" id="Reson1"></textarea></td>
<td width="120px"></td>
</tr>
<tr><td colspan="3"><span id="showMsg1" class="warning" style="display:none;"></span></td></tr>
</tbody>
</table>
</form>
</div>
<div title="文件上传导入" style="padding: 5px;">
<form id="frmUpload" method="post" action="/RES/VIPCustomer/UploadFile" enctype="multipart/form-data">
<table>
<tr>
<td>文件:</td>
<td>
<br />
文本文件格式如下:<br />
<img src="~/Content/Images/number_res.png" alt="" /><br />
<input id="FileMobile" name="FileMobile" type="file" />
<br />
</td>
</tr>
</table>
</form>
</div>
</div>
</div>