ComplianceServer/oldcode/Core.Web/Views/BlackNumber/Add.cshtml

246 lines
11 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/_Layout.cshtml";
}
<link href="~/Content/main.css" rel="stylesheet" />
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
<style>
.setTextWidth300 {
border-collapse: separate;
border-spacing: 15px;
}
</style>
<script type="text/javascript">
$(function () {
$("#btnSearch").click(function () {
if ($("#txt_resid").val() == "") {
$.messager.alert("提示", "请你输入客户ID", "error");
return false;
}
$.r_ajax({
url: "/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 = $(".layui-this").html();
var jsonData;
if (title == "资源") {
jsonData = $("#CreateForm").serialize();
} else {
debugger
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(), txt_channel: $("#channel").val(), Reson: $("#Reson1").val(), BLACKNUMBER_resids: BLACKNUMBER_resids };
}
$.r_ajax({
url: "/BlackNumber/Add",
type: "Post",
data: jsonData,
dataType: "json",
loading: true,
success: function (data) {
if (data.type == true) {
layer.alert("操作成功!", {
yes: function () {
layer.closeAll();
parent.layer.closeAll();
parent.TableReload();
}
})
} else {
var tip = data.message;
layer.alert(tip, {
yes: function () {
layer.closeAll()
}
})
}
}
});
});
var optionsChannel = {
el: '#selectChannel',
name: 'txt_channel',//表单的name属性
layVerify: '',
tips: '请选择事业部',
toolbar: {//工具条,全选,清空,反选,自定义
show: true,
list: [
'CLEAR'
]
},
data: []
};
var selectChannel = xmSelect.render(optionsChannel);
var allChannel = @Html.Raw(ViewBag.AllChannel);
selectChannel.update({ data: allChannel });
var optionsChannel1 = {
el: '#selectChannel1',
name: 'txt_channel1',//表单的name属性
layVerify: '',
tips: '请选择事业部',
toolbar: {//工具条,全选,清空,反选,自定义
show: true,
list: [
'CLEAR'
]
},
on: function (data) {
let mydeptid = "";
for (var i = 0; i < data.arr.length; i++) {
mydeptid += data.arr[i].value + ",";
}
mydeptid = mydeptid.substring(0, mydeptid.length - 1)
$("#channel").val(mydeptid);
},
data: []
};
var selectChannel1 = xmSelect.render(optionsChannel1);
selectChannel1.update({ data: allChannel });
});
</script>
<div class="x-body">
<div class="layui-form-item" id="extdiv">
<div class="layui-tab" lay-filter="tabchannel">
<ul class="layui-tab-title">
<li class="layui-this">资源</li>
<li>客户ID</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
@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="F" selected="selected">禁止下单</option>
</select>
</td>
</tr>
<tr>
<td width="60px" style="width:100px;">
事业部:
</td>
<td style="width:310px">
<div id="selectChannel" style="width: 300px;"></div>
<div id="channel" style="display:none"></div>
</td>
</tr>
<tr style="margin-top:10px;">
<td width="60px" style="width:120px;">
<select name="txt_inputType" id="txt_inputType" style="height:35px;">
<option value="1" selected>客户ID:</option>
<option value="2">手机号码:</option>
</select>
<p style="color:red;font-size:11px;">注:多个资源或手机号以逗号隔开</p>
</td>
<td style="width:310px">
<textarea id="BLACKNUMBER_resids" name="BLACKNUMBER_resids" rows="6" style="width:100%;"></textarea>
</td>
</tr>
<tr style="margin-top:10px;">
<td width="60px" style="width:100px;">备注</td>
<td style="width:310px"><textarea name="Reson" style="width:100%;" rows="3" ></textarea></td>
</tr>
<tr><td colspan="3"><span id="showMsg" class="warning" style="display:none;"></span></td></tr>
</tbody>
</table>
}
</div>
<div class="layui-tab-item">
<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="F" selected="selected">禁止下单</option>
</select>
</td>
<td width="120px"></td>
</tr>
<tr>
<td width="60px" style="width:100px;">
事业部:
</td>
<td style="width:310px">
<div id="selectChannel1" style="width: 300px;"></div>
</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" rows="3" style="width:100%"></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>
</div>
<div class="mvctool bgb">
@* @Html.ToolButtonPlain("btnSave", "icon-save", "保存", false, "")*@
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="save" id="btnSave">确定</button>
</div>
</div>
</div>