TG.WXCRM.V4/WEB/Views/Csvr/BlackNumber/Add.cshtml

172 lines
7.6 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;
@{
ViewBag.Title = "Add";
Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
}
<link href="~/Content/main.css" rel="stylesheet" />
<script type="text/javascript">
$(function () {
$("#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.message, "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 {
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 = { Blacktype: $("#Blacktype1").val(), Reson: $("#Reson1").val(), BLACKNUMBER_resids: BLACKNUMBER_resids };
}
$.r_ajax({
url: "/Csvr/BlackNumber/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="formContent">
<div class="easyui-tabs" id="#ntt">
<div title="资源" style="padding:10px">
@using (Html.BeginForm("Add", "BlackNumber", null, FormMethod.Post, new { Id = "CreateForm", noControl = "noControl" }))
{
@Html.ValidationSummary(true)
<table class="fromEditTable setTextWidth300">
<tbody>
<tr>
<td width="60px" style="width:100px;">
黑名单类型:
</td>
<td style="width:310px">
<select name="Blacktype" style="width:300px;">
<option value="C">呼出黑名单</option>
<option value="I">呼入黑名单</option>
<option value="S">短信黑名单</option>
<option value="T">客户拒接电话</option>
</select>
</td>
<td width="120px"></td>
</tr>
<tr>
<td width="60px" style="width:100px;">客户ID:<p style="color:red;font-size:11px;">注:多个资源以逗号隔开</p></td>
<td style="width:310px">
<textarea id="BLACKNUMBER_resids" name="BLACKNUMBER_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">
黑名单类型:
</td>
<td style="width:310px">
<select name="Blacktype1" id="Blacktype1" style="width:300px;">
<option value="C">呼出黑名单</option>
<option value="I">呼入黑名单</option>
<option value="S">短信黑名单</option>
<option value="T">客户拒接电话</option>
</select>
</td>
<td width="120px"></td>
</tr>
<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>
</div>
<div class="mvctool bgb">
@Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")
</div>