326 lines
14 KiB
Plaintext
326 lines
14 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "SearchCustomer";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
string roles = ViewBag.roleCodes;
|
||
}
|
||
<script type="text/javascript">
|
||
function btnQuery_Click(type) {
|
||
switch (type) {
|
||
case "username": str = "/Csvr/CustomerInfo/GetResData?type=username"; break;
|
||
case "userno": str = "/Csvr/CustomerInfo/GetResData?type=userno"; break;
|
||
case "mobile": str = "/Csvr/CustomerInfo/GetResData?type=mobile"; break;
|
||
case "tradeCode": str = "/Csvr/CustomerInfo/GetResData?type=tradeCode"; break;
|
||
case "resid": str = "/Csvr/CustomerInfo/GetResData?type=resid"; break;
|
||
case "OldId": str = "/Csvr/CustomerInfo/GetResData?type=OldId"; break;
|
||
case "OlduserName": str = "/Csvr/CustomerInfo/GetResData?type=OlduserName"; break;
|
||
case "customerName": str = "/Csvr/CustomerInfo/GetResData?type=customerName"; break;
|
||
case "getuser": str = "/Csvr/CustomerUC/GetOtherUser"; break;
|
||
case "getuserbysoftname": str = "/Csvr/CustomerUC/GetOtherUserBySoftName"; break;
|
||
case "unionid": str = "/Csvr/CustomerInfo/GetResData?type=unionid"; break;
|
||
case "nickname": str = "/Csvr/CustomerInfo/GetResData?type=nickname"; break;
|
||
case "mome": str = "/Csvr/CustomerInfo/GetResData?type=mome"; break;
|
||
};
|
||
if (type == "getuser") {
|
||
var resid = $("#txt_ResId").val();
|
||
$.r_ajax({
|
||
url: str,
|
||
type: "POST",
|
||
data: { resid: resid },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (data) {
|
||
if (data.reslust == true) {
|
||
$.messager.alert("成功", data.message, "info");
|
||
} else {
|
||
$.messager.alert("警告", data.message, "error");
|
||
}
|
||
}
|
||
});
|
||
return;
|
||
}
|
||
if (type == "getuserbysoftname") {
|
||
var softname = $("#txt_Oldusername").val();
|
||
$.r_ajax({
|
||
url: str,
|
||
type: "POST",
|
||
data: { softname: softname },
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (data) {
|
||
if (data.reslust == true) {
|
||
$.messager.alert("成功", data.message, "info");
|
||
} else {
|
||
$.messager.alert("警告", data.message, "error");
|
||
}
|
||
}
|
||
});
|
||
return;
|
||
}
|
||
if (type == "customerName") {
|
||
var customerName = $("#txt_customerName").val();
|
||
if (customerName == "") {
|
||
$.messager.alert("警告", "客户姓名不能为空!", "error");
|
||
return;
|
||
}
|
||
if (customerName.length < 2) {
|
||
$.messager.alert("警告", "客户姓名不能少于两个字!", "error");
|
||
return;
|
||
}
|
||
}
|
||
if (type == "unionid") {
|
||
var unionid = $("#txt_UnionId").val();
|
||
if (unionid == "") {
|
||
$.messager.alert("警告", "unionid不能为空!", "error");
|
||
return;
|
||
}
|
||
}
|
||
if (type == "nickname") {
|
||
var unionid = $("#txt_nickname").val();
|
||
if (unionid == "") {
|
||
$.messager.alert("警告", "客户昵称不能为空!", "error");
|
||
return;
|
||
}
|
||
}
|
||
if (type == "mome") {
|
||
var unionid = $("#txt_mome").val();
|
||
if (unionid == "") {
|
||
$.messager.alert("警告", "客户备注不能为空!", "error");
|
||
return;
|
||
}
|
||
}
|
||
|
||
$.r_ajax({
|
||
url: str,
|
||
type: "POST",
|
||
data: $("#CreateForm").serialize(),
|
||
dataType: "json",
|
||
loading: true,
|
||
success: function (data) {
|
||
if (data.reslust == 1) {
|
||
if (data.message == "存在多个客户ID") {
|
||
$("#listResId").find("tr").remove();
|
||
var str = data.ResId.substring(0, data.ResId.length);
|
||
var list = str.split(";");
|
||
|
||
for (var i = 0; i < list.length; i++) {
|
||
var splitList = list[i].split("-");
|
||
var resid = splitList[0];
|
||
if (resid.indexOf("c_") == 0) {//需要注册
|
||
$("#listResId").append("<tr><td><a href='javascript:void(0)' nc='1'>" + resid.replace("c_", "") + "</a></td><td>" + splitList[1] + "</td></tr>");
|
||
} else {
|
||
$("#listResId").append("<tr><td><a href='javascript:void(0)'>" + resid + "</a></td><td>" + splitList[1] + "</td></tr>");
|
||
}
|
||
}
|
||
$("#dlgResIds").dialog({ title: '客户ID显示选择', closed: false, cache: false, modal: true, width: '400', height: '300' });
|
||
} else {
|
||
var resid = data.ResId;
|
||
var windowUrl = "/Csvr/CustomerInfo/CustomerDetail?resid=" ;
|
||
if (resid.indexOf("c_") == 0) {//需要注册
|
||
windowUrl += resid.replace("c_", "") +"&isFromComplaint=1";
|
||
} else {
|
||
windowUrl += resid;
|
||
}
|
||
window.parent.ChildAddTab("客户详细", windowUrl, "icon-memeber");
|
||
}
|
||
} else {
|
||
window.frameReturnByMes(data.message);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
$(function () {
|
||
$("#listResId tr").live("click", function () {
|
||
var windowUrl = "/Csvr/CustomerInfo/CustomerDetail?resid=";
|
||
var a = $(this).find("td:eq(0)").find("a");
|
||
if (a.attr("nc") == "1") {//需要注册
|
||
windowUrl += a.html() + "&isFromComplaint=1";
|
||
} else {
|
||
windowUrl += a.html();
|
||
}
|
||
window.parent.ChildAddTab("客户详细", windowUrl, "icon-memeber");
|
||
});
|
||
})
|
||
</script>
|
||
<style>
|
||
.FindUser {
|
||
display: inline-block;
|
||
position: relative;
|
||
width: 25px;
|
||
height: 25px;
|
||
background: url(/Content/Images/icon/finduser.png) no-repeat center;
|
||
vertical-align: middle;
|
||
/*cursor: pointer;*/
|
||
padding-left: 20px;
|
||
}
|
||
.CusIdIcon {
|
||
display: inline-block;
|
||
position: relative;
|
||
width: 22px;
|
||
height: 22px;
|
||
background: url(/Content/Images/icon/id.png) no-repeat center;
|
||
vertical-align: middle;
|
||
/*cursor: pointer;*/
|
||
}
|
||
.PhoneIcon {
|
||
display: inline-block;
|
||
position: relative;
|
||
width: 18px;
|
||
height: 18px;
|
||
background: url(/Content/Images/icon/phone.png) no-repeat center;
|
||
vertical-align: middle;
|
||
/*cursor: pointer;*/
|
||
}
|
||
.UserIcon {
|
||
display: inline-block;
|
||
position: relative;
|
||
width: 18px;
|
||
height: 18px;
|
||
background: url(/Content/Images/icon/username.png) no-repeat center;
|
||
vertical-align: middle;
|
||
/*cursor: pointer;*/
|
||
}
|
||
.NameIcon {
|
||
display: inline-block;
|
||
position: relative;
|
||
width: 18px;
|
||
height: 18px;
|
||
background: url(/Content/Images/icon/name.png) no-repeat center;
|
||
vertical-align: middle;
|
||
/*cursor: pointer;*/
|
||
}
|
||
.mainTable {
|
||
margin: 30px 0 50px 5px;
|
||
}
|
||
|
||
.mainTable td {
|
||
height: 40px;
|
||
}
|
||
|
||
.mainTable input[type='button'] {
|
||
width: 50px;
|
||
}
|
||
</style>
|
||
<div class="mvctool">
|
||
<div class="mvctool_mytitle">
|
||
<span class="FindUser"></span>
|
||
查找客户
|
||
</div>
|
||
</div>
|
||
<div id="dlgResIds" class="easyui-dialog" closed="true" style="padding: 0px">
|
||
<table width="100%" class="layui-table" id="listResId"></table>
|
||
</div>
|
||
<div class="formContent">
|
||
@using (Html.BeginForm("SearchCustomer", "CustomerInfo", null, FormMethod.Post, new { Id = "CreateForm" }))
|
||
{
|
||
@Html.ValidationSummary(true)
|
||
<table class=" mainTable" style="padding:40px;">
|
||
<tbody>
|
||
<tr>
|
||
<td style="width:100px;">客 户 ID:</td>
|
||
<td>@Html.TextBox("txt_ResId", null, new { placeholder = "请输入客户ID" })</td>
|
||
<td>
|
||
@*<input id="btnQueryResid" class="layui-btn layui-btn-sm layui-btn-ok" type="button" value="查询" onclick="btnQuery_Click('resid')" />*@
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" id="btnQueryResid" onclick="btnQuery_Click('resid')">
|
||
<i class="layui-icon layui-icon-search"></i>查询
|
||
</button>
|
||
</td>
|
||
<td>
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" id="btnQueryResid" onclick="btnQuery_Click('getuser')" style="margin-left:10px">
|
||
<i class="layui-icon layui-icon-search"></i>获取用户
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="width:100px;">电话号码:</td>
|
||
<td>@Html.TextBox("txt_mobile", null, new { placeholder = "请输入电话号码" })</td>
|
||
<td>
|
||
@*<input class="layui-btn layui-btn-sm layui-btn-normal" id="btnQueryCustomerId" type="button" value="查询" onclick="btnQuery_Click('mobile')" />*@
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="btnQueryCustomerId" onclick="btnQuery_Click('mobile')">
|
||
<i class="layui-icon layui-icon-cellphone"></i>查询
|
||
</button>
|
||
</td>
|
||
|
||
</tr>
|
||
@if (!(ViewBag.roleCodes as string).Contains("[TNBHG]"))
|
||
{
|
||
if (ViewBag.ProjectType == "2" || ViewBag.ProjectType == "3")
|
||
{
|
||
<tr>
|
||
<td style="width:100px;">用 户 名:</td>
|
||
<td>@Html.TextBox("txt_Oldusername")</td>
|
||
<td>
|
||
@*<input class="layui-btn layui-btn-sm layui-btn-primary" id="btnQueryCustomerId" type="button" value="查询" onclick="btnQuery_Click('OlduserName')" />*@
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" id="btnQueryCustomerId" onclick="btnQuery_Click('OlduserName')">
|
||
<i class="layui-icon layui-icon-friends"></i>查询
|
||
</button>
|
||
</td>
|
||
<td>
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" onclick="btnQuery_Click('getuserbysoftname')" style="margin-left:10px">
|
||
<i class="layui-icon layui-icon-search"></i>获取用户
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
}
|
||
|
||
<tr>
|
||
<td style="width:100px;">客户姓名:</td>
|
||
<td style="width:190px;">@Html.TextBox("txt_customerName")</td>
|
||
<td>
|
||
@*<input class="layui-btn layui-btn-sm layui-btn-primary" id="btnQueryCustomerId" type="button" value="查询" onclick="btnQuery_Click('customerName')" />*@
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" id="btnQueryCustomerId" onclick="btnQuery_Click('customerName')">
|
||
<i class="layui-icon layui-icon-survey"></i>查询
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
}
|
||
</tbody>
|
||
</table>
|
||
<hr/>
|
||
<table class=" mainTable" style="padding:40px;">
|
||
<tbody>
|
||
<tr>
|
||
<td style="width:100px;">UNION/外部联系人 ID:</td>
|
||
<td></td>
|
||
<td>@Html.TextBox("txt_UnionId", null, new { placeholder = "请输入客户UNION ID" })</td>
|
||
<td>
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" id="btnQueryUnionId" onclick="btnQuery_Click('unionid')">
|
||
<i class="layui-icon layui-icon-search"></i>查询
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr style="display:none;">
|
||
<td style="width:100px;">外部联系人 ID:</td>
|
||
<td>@Html.TextBox("txt_eeid", (decimal)ViewBag.eid, new { placeholder = "工号" ,style="width:60px"})</td>
|
||
<td>@Html.TextBox("txt_extuserid", null, new { placeholder = "请输入客户外部联系人 ID" })</td>
|
||
<td>
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" id="btnQueryextuser" onclick="btnQuery_Click('extuserid')">
|
||
<i class="layui-icon layui-icon-search"></i>查询
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="width:100px;">昵称:</td>
|
||
<td>@Html.TextBox("txt_neid", (decimal)ViewBag.eid, new { placeholder = "工号", style = "width:60px" })</td>
|
||
<td>@Html.TextBox("txt_nickname", null, new { placeholder = "请输入客户昵称" })</td>
|
||
<td>
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" id="btnQuerynickname" onclick="btnQuery_Click('nickname')">
|
||
<i class="layui-icon layui-icon-search"></i>查询
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="width:100px;">客户备注:</td>
|
||
<td>@Html.TextBox("txt_meid", (decimal)ViewBag.eid, new { placeholder = "工号", style = "width:60px" })</td>
|
||
<td>@Html.TextBox("txt_mome", null, new { placeholder = "请输入客户客户备注" })</td>
|
||
<td>
|
||
<button type="button" class="layui-btn layui-btn-sm layui-btn-ok" id="btnQuerymome" onclick="btnQuery_Click('mome')">
|
||
<i class="layui-icon layui-icon-search"></i>查询
|
||
</button>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
}
|
||
</div>
|