213 lines
9.3 KiB
Plaintext
213 lines
9.3 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;
|
||
};
|
||
if (type == "customerName") {
|
||
var customerName = $("#txt_customerName").val();
|
||
if (customerName == "") {
|
||
$.messager.alert("警告", "客户姓名不能为空!", "error");
|
||
return;
|
||
}
|
||
if (customerName.length < 2) {
|
||
$.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("-");
|
||
$("#listResId").append("<tr><td><a href='javascript:void(0)'>" + splitList[0] + "</a></td><td>" + splitList[1] + "</td></tr>");
|
||
}
|
||
$("#dlgResIds").dialog({ title: '客户ID显示选择', closed: false, cache: false, modal: true, width: '400', height: '300' });
|
||
} else {
|
||
var windowUrl = "/Csvr/CustomerInfo/CustomerDetail?hgCustomer=@Html.Raw(Request.QueryString["hgCustomer"])&resid=" + data.ResId;
|
||
//window.location.replace(windowUrl);
|
||
try {
|
||
window.parent.ChildAddTab("客户详细", windowUrl, "icon-memeber");
|
||
} catch (e) {
|
||
|
||
}
|
||
try {
|
||
if (window["context"] == undefined) {
|
||
if (!window.location.origin) {
|
||
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
|
||
}
|
||
window["context"] = location.origin + "/V6.0";
|
||
}
|
||
window.top.postMessage({ name: '客户详细' ,url: location.origin + windowUrl, icon: "icon-detail" }, "*");
|
||
} catch (e) {
|
||
|
||
}
|
||
}
|
||
} else {
|
||
window.frameReturnByMes(data.message);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
$(function () {
|
||
$("#listResId tr").live("click", function () {
|
||
var mytoken = "@Html.Raw(Request.QueryString["mytoken"])" ;
|
||
var windowUrl = "/Csvr/CustomerInfo/CustomerDetail?mytoken=" + mytoken + "&hgCustomer=@Html.Raw(Request.QueryString["hgCustomer"])&resid=" + $(this).find("td:eq(0)").find("a").html();
|
||
//window.parent.ChildAddTab("客户详细", windowUrl, "icon-memeber");
|
||
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 200px 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>
|
||
</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>
|
||
</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>
|
||
}
|
||
</div>
|