TG.WXCRM.V4/WEB/Views/Csvr/CustomerUC/ContactUC.cshtml

422 lines
18 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

@model WX.CRM.Model.Entity.RES_CUSTOMER
@using WX.CRM.WebHelper;
@using WX.CRM.Model
@using WX.CRM.Common;
@using System.Web.UI.WebControls;
@using WX.CRM.Model.Enum;
@{
Layout = null;
var callout = ViewBag.CallOutPhone as IEnumerable<ListItem>;
var calloutdefault = ViewBag.CallOutPhoneDefault as IEnumerable<String>;
}
<script src="~/Scripts/jquery.cookie.js"></script>
<script type="text/javascript">
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
function UcLink_Click(id) {
var resid = id;
var src = "/Res/Customer/Create?resid=" + resid;
$("#modalwindow").html(GetIframeHtml(src));
$("#modalwindow").window({ title: '编辑', width: 600, height: 450, iconCls: 'icon-edit' }).window('open');
}
</script>
<script type="text/javascript">
/*
* X秒内只允许点击一次拨号
*/
var CONSTWAIT = 5;
var wait = CONSTWAIT;
function time() {
call = document.getElementsByName("btnCall");
if (wait == 0) {
for (var i = 0; i < call.length; i += 2) {
call[i].removeAttribute("disabled");
call[i].value = "拨号";
$(call[i]).removeClass("layui-btn-disabled").find("[ntype='boname']").html("拨号");
call[i + 1].removeAttribute("disabled");
call[i + 1].value = "长途拨号";
$(call[i + 1]).removeClass("layui-btn-disabled").find("[ntype='boname']").html("长途拨号");
}
wait = CONSTWAIT;
} else {
for (var i = 0; i < call.length; i++) {
call[i].setAttribute("disabled", true);
call[i].value = wait + "秒后";
$(call[i]).addClass("layui-btn-disabled").find("[ntype='boname']").html(wait + "秒后");
}
wait--;
setTimeout(function () {
time()
}, 1000);
}
};
function CheckDailPhone(resid, objZero, isbc, callout, ctiver, LASTNUM3) {
var url = "/JZOrder/CheckDailPhone";
var param = { "resid": resid };
$.ajax({
type: 'post',
dataType: 'json',
url: url,
data: param,
success: function (msg) {
if (msg.reg != "") {
$.messager.confirm('提示', msg.reg, function (r) {
if (r) {
if (msg.type == "2") {
$.ajax({
type: 'post',
dataType: 'json',
url: "/JZOrder/UpdateAiStatus",
data: param,
success: function (data) {
if (data.reg) {
time();
DailPhone(resid, objZero, isbc, callout, ctiver, LASTNUM3);
}
}
});
} else {
time();
DailPhone(resid, objZero, isbc, callout, ctiver, LASTNUM3);
}
}
});
} else {
time();
DailPhone(resid, objZero, isbc, callout, ctiver, LASTNUM3);
}
}
});
}
</script>
<style>
.btn-primary {
width: 100px;
}
.arrowdown {
background: url(/Content/Images/toggle.gif) no-repeat 0 -10px;
cursor: pointer;
height: 10px;
width: 9px;
float: right;
margin-top: 5px;
}
.arrowup {
background: url(/Content/Images/toggle.gif) no-repeat;
height: 10px;
width: 9px;
float: right;
margin-top: 5px;
}
</style>
<div class="group content_title_width">
<span class="csicon PhoneIcon"></span>
<span>客户联系方式</span>
<span class="righttitle">
<a href="#" onclick="UcLink_Click('@ViewBag.resid')">添加手机</a>&nbsp;&nbsp;
@if (callout != null)
{
@Html.RadioButtonList("CallOutNum", callout, calloutdefault)
}
</span>
<span style="padding-left:30px;">
| <a href="javascript:Show_FavoriteAndMyResWindow('@ViewBag.resid');">客户归属</a>
</span>
</div>
<div class="content_div">
@{ bool IsShowWeiXinZhuShou = (bool)ViewBag.IsShowWeiXinZhuShou; }
<table class="layui-table content_width">
<tbody>
@{int n = 0; }
@foreach (var item in ViewBag.ResCustList as List<WX.CRM.Model.Entity.RES_CUSTOMER>)
{
n++;
<tr>
<td>
@item.UMID
</td>
@if (item.TYPE != 2 && item.TYPE != 3)
{
<td style="text-align:center">
手机号客户
</td>
<td style="text-align:center">
<font color="@(item.IsVip?"black":"red")" id="mobile@(n)">@item.LASTNUM3</font>
<div id="HideModeil" class="arrowdown" onclick="showMobile(@(n),'@item.RESID')"></div>
<div id="ShowMobile" class="arrowup" style="display:none;"></div>
@*} *@
</td>
<td style="text-align:center">@item.map_MobileArea</td>
<td class="noRecord" style="text-align:center">
@if (item.RES_CUSTOMERDETAIL.ISPRIMARYNUM == 1)
{
<a style="color:red">主号码</a>
}
else
{
<input id="updatePrimayNumber" class="layui-btn layui-btn-sm layui-btn-normal" style="width:80px;text-align:center" type="button" value="修改主号码" onclick="ModifyPrimaryNumber('@item.RESID')" />
}
</td>
<td id="hiddleTd" style="text-align:center">
<input type="button" class="layui-btn layui-btn-sm layui-btn-primary" style="width:80px;text-align:center" onclick="if(confirm('确认解除主号码?')) RemoveNumber('@item.RESID');" id="btnRemove" value="解除主号码">
</td>
<td style="text-align:center">
<input type="button" class="layui-btn layui-btn-sm layui-btn-primary" style=" text-align: center" onclick="ApplyVIPNumber('@item.RESID','@item.LASTNUM3')" value="申请VIP通道 " id="BtnApplyVIP">
</td>
if (ViewBag.IsFromHg == 1)
{
<td style="text-align:center">
<button name="btnCall" value="拨号" class="layui-btn layui-btn-sm layui-bg-red" style="width: 80px; text-align: center" onclick='CheckDailPhone("@item.RESID","",@ViewBag.IsBC,$("input[name=CallOutNum]:checked").val(),"@ViewBag.CTI_VER","@item.LASTNUM3");'>
<span class="csicon CallIcon"></span>
<span ntype="boname">拨号</span>
</button>
</td>
<td style="text-align:center">
<button name="btnCall" value="长途拨号" class="layui-btn layui-btn-sm layui-btn-normal" style="width: 80px; text-align: center" onclick='CheckDailPhone("@item.RESID", "0",@ViewBag.IsBC,$("input[name=CallOutNum]:checked").val(),"@ViewBag.CTI_VER","@item.LASTNUM3");'>
<span ntype="boname">长途拨号</span>
</button>
</td>
}
else
{
<td style="text-align:center">
<button name="btnCall" value="拨号" class="layui-btn layui-btn-sm layui-bg-red" style="width: 80px; text-align: center" onclick='time();DailPhone("@item.RESID","",@ViewBag.IsBC,$("input[name=CallOutNum]:checked").val(),"@ViewBag.CTI_VER","@item.LASTNUM3");'>
<span class="csicon CallIcon"></span>
<span ntype="boname">拨号</span>
</button>
@*<input type="button" name="btnCall" class="layui-btn layui-btn-sm layui-btn-ok" style="width: 80px; text-align: center" value="拨号" onclick='time();DailPhone("@item.RESID","",@ViewBag.IsBC,$("input[name=CallOutNum]:checked").val(),"@ViewBag.CTI_VER","@item.LASTNUM3");'>*@
</td>
<td style="text-align:center">
<button name="btnCall" value="长途拨号" class="layui-btn layui-btn-sm layui-btn-normal" style="width: 80px; text-align: center" onclick='time();DailPhone("@item.RESID", "0",@ViewBag.IsBC,$("input[name=CallOutNum]:checked").val(),"@ViewBag.CTI_VER","@item.LASTNUM3");'>
<span ntype="boname">长途拨号</span>
</button>
</td>
}
<td style="text-align:center">
<a href="javascript:SentMessage('@item.CUSTOMERID','@item.RESID')">发送短信</a><a href="javascript:MessageMore('@item.RESID')"><i class="layui-icon layui-icon-right" style="font-size:12px; margin-left:20px; cursor:pointer"></i></a>
</td>
}
else
{
<td style="text-align:center">
企微客户
</td>
<td class="noRecord" style="text-align:center">
@item.RESID
</td>
<td style="text-align:center">@item.map_MobileArea</td>
<td class="noRecord" style="text-align:center">
</td>
<td id="hiddleTd" style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
<td style="text-align:center">
</td>
}
</tr>
if (ViewBag.CanShowMoile == "1")
{
<script type="text/javascript">$(function () { showMobileByResIdAndUserId(@(n),'@item.RESID');});</script>
}
}
</tbody>
</table>
</div>
<div id="ApplyVIPBox" style="display: none;">
<textarea cols="37" rows="6" id="VIPMemoTxt"></textarea>
<div style="padding-left: 5px;">
是否广州本地号码:<input type="radio" name="IsLocal" value="1" />是
<input type="radio" name="IsLocal" value="0" checked="checked" />否
</div>
</div>
<script type="text/javascript" src="~/Scripts/LinkPhone.js?v=@(DateTime.Now.Ticks)"></script>
<script type="text/javascript">
function Show_FavoriteAndMyResWindow(mresid) {
var src = "/Csvr/FavoriteCustomer/FavoriteAndMyRes?resid=" + mresid;
$("#modalwindow").html(GetIframeHtml(src));
$("#modalwindow").window({ title: '查看收藏和归属', width: 600, height: 450, iconCls: 'icon-edit' }).window('open');
}
//添加到微信助手
function AddWebChatAssistant(resid) {
var eid = "@ViewBag.Eid";
var cookieName = "WebChatAssistant_" + eid;
var cookieValue = $.cookie(cookieName);
if (cookieValue == null || cookieValue == "null") {
cookieValue = resid;
$.cookie(cookieName, cookieValue, {
expires: 7,
path: '/',
}) 
}
else {
if (cookieValue.indexOf(resid) == -1) {//不要有重复的Resid
cookieValue += "," + resid;
$.cookie(cookieName, cookieValue, {
expires: 7,
path: '/',
}) 
}
}
$.messager.alert('提示', '已经成功的添加到微信助手里面!');
}
//发送短息
function SentMessage(customerId,resId)
{
var windowUrl="/Sms/MsgTemplate/SendTemplateMessage?customerId="+customerId+"&resId="+resId;
//if (top.location != location){
// window.parent.ChildAddTab("发短信", windowUrl, "");
//}else{
// window.open(windowUrl);
//}
$("#modalwindow").html(GetIframeHtml(windowUrl));
$("#modalwindow").window({ title: '编辑', width: $(window).width() * 0.8, height: $(window).height() * 0.8, iconCls: 'icon-edit' }).window('open');
}
function RemoveNumber(resid) {
$.r_ajax({
url: "/Res/Customer/RemovePrimaryNumber?resid=" + resid,
type: "Post",
data: "",
dataType: "json",
loading: true,
success: function (data) {
if (data.type == 1) {
window.frameReturnByMes(data.message);
}
else {
alert(data.message);
window.frameReturnByMes(data.message);
}
}
});
}
function ModifyPrimaryNumber(resid) {
var src = "/Csvr/ApplyPrimNum/Edit?resid=" + resid + "&type=0";
$("#modalwindow").html(GetIframeHtml(src));
$("#modalwindow").window({ title: '申请', width: 600, height: 450, iconCls: 'icon-edit' }).window('open');
}
function Reload_Click() {
frameReturnByReload(true);
}
function ApplyVIPNumber(resid,number)
{
$.r_ajax({
type: "POST",
url: "/Csvr/ApplyVip/JudgeVIPNumber",
data:{resId:resid},
loading: true,
success: function (msg) {
if (msg == "True") {
window.frameReturnByMes("此号码已经申请过");
}
else {
$("#ApplyVIPBox").show();
$("#ApplyVIPBox").dialog({
width: 300,
height:230,
modal: true,
title: "申请理由",
maximizable: false,
minimizable: false,
collapsible: false,
buttons: [{
text: '确认',
iconCls: 'icon-ok',
handler: function () {
var memo = $("#VIPMemoTxt").val();
if (memo.length < 1) {
window.frameReturnByMes("申请理由不能为空");
return;
}
var isLocal = $("input[name='IsLocal']:checked").val(); //获取是否本地号码的值
$.r_ajax({
type: "Post",
url: "/Csvr/ApplyVip/ApplyVIPNumber",
data: {resId:resid,memo:memo,isLocal:isLocal,mobile:number},
loading: true,
dataType: "json",
success: function (data) {
if (data.type == 1) {
window.frameReturnByMes("申请成功!");
$("#ApplyVIPBox").dialog("close");
} else {
window.frameReturnByMes("申请失败!");
}
}
});
}
}]
});
}
}
});
}
function showMobile(n, resid) {
$.r_ajax({
type: "Post",
url: "/Res/MobileQueryLog/GetMobileByResId",
data: { resId: resid},
loading: true,
dataType: "json",
success: function (data) {
if (data.type == 1) {
$('#mobile' + n).text(data.message);
//alert(data.message);
$('#HideModeil').css('display', 'none');
$('#ShowMobile').css('display', 'block');
} else {
$.messager.alert("警告", data.message, "error");
}
}
});
}
function showMobileByResIdAndUserId(n, resid) {
$.r_ajax({
type: "Post",
url: "/Res/MobileQueryLog/GetMobileByResIdAndUserId",
data: { resId: resid },
loading: true,
dataType: "json",
success: function (data) {
if (data.type == 1) {
$('#mobile' + n).text(data.message);
//alert(data.message);
//$('#HideModeil').css('display', 'none');
//$('#ShowMobile').css('display', 'block');
} else {
//$.messager.alert("警告", data.message, "error");
}
}
});
}
function MessageMore(resId) {
$("#modalwindow").html(GetIframeHtml("/Sms/SmsMessage/Index2?resid=" + resId));
$("#modalwindow").window({ title: '查看短信', width: $(window).width() * 0.9, height: 600, iconCls: 'icon-edit' }).window('open');
};
</script>