/*发送短信*/

5 篇文章 0 订阅
/*发送邮件*/
$("#sendEmail").on("click",function(){
//console.log("send mail");
var customerArrEmail = "";
$("input[name='selectCustomer']").each(function(){
if( $(this).prop("checked")){
var customerEmail = $(this).parent().parent().find("td:eq(3)").find("input").val();
if(customerEmail != "")
customerArrEmail += customerEmail+";";
}
});
console.log(customerArrEmail);
$("#emailVal").val(customerArrEmail);
$("#phoneVal").val("");
$("#sendOption").submit();
});

/*发送短信*/
$("#sendPhone").on("click",function(){
var customerArrPhone = "";
$("input[name='selectCustomer']").each(function(){
if( $(this).prop("checked")){
var customerPhone = $(this).parent().parent().find("td:eq(2)").html();
if(customerPhone != "")
customerArrPhone += customerPhone+";";
}
});
console.log(customerArrPhone);
if(customerArrPhone == ""){
customerArrPhone = "phone";
}
$("#phoneVal").val(customerArrPhone);
$("#emailVal").val("");
$("#sendOption").submit();
});

/*创建线索*/
$("#btn_createsales").on("click",function(){
location.href = "${rc.contextPath}/saleclues/new";
});

/*得到checkbox中所选择的客户Id */
function getSelectedIds(){
var customerArr = [];
if($("#allCheck").prop("checked")){
$("input[name='hobby']").each(function(){
/* var customerId = $(this).val();
cu stomerArr += customerId+",";*/
customerArr.push($(this).val());
});
}else{
$("input[name='hobby']").each(function(){
if( $(this).prop("checked")){
/* var customerId = $(this).val();
cus tomerArr += customerId+",";*/
customerArr.push($(this).val());
}
});
}
return customerArr.join(",");
}


/*分配 */
var d;
$('#allotsaleclues').click(function(){
d = dialog(this);
d.open();
});
$("#confirmButton").click(function(){
var selectedIds = getSelectedIds();
if(selectedIds != ""){
$.ajax({
url:"<c:url value='/saleclues/allotsaleclues'/>",
type:"post",
dataType:"json",
data:{
selectedIds:selectedIds,
newOrgId:3
},
success:function(data){
if(data.type == "1"){
console.log('bb');
//alert(data.msg);
d.close();
}else
alert(data.msg);
}
})
}else
alert("请选择数据");
});
$("#cancelButton").click(function(){
d.close();
})
/*分配 */

/*回收*/
var d2;
$('#recyclesaleclues').click(function(){
d2 = dialog(this);
d2.open();
});
$("#confirmButton2").click(function(){
var selectedIds = getSelectedIds();
if(selectedIds != ""){
$.ajax({
url:"<c:url value='/saleclues/recyclesaleclues'/>",
type:"post",
dataType:"json",
data:{
selectedIds:selectedIds
},
success:function(data){
if(data.type == "1"){
console.log('bb');
//alert(data.msg);
d2.close();
}else
alert(data.msg);
}
})
}else
alert("请选择数据");
});
$("#cancelButton2").click(function(){
d2.close();
})
/*回收 */

/*关闭*/
var d3;
$('#closesaleclues').click(function(){
d3 = dialog(this);
d3.open();
});
$("#confirmButton3").click(function(){
var selectedIds = getSelectedIds();
if(selectedIds != ""){
$.ajax({
url:"<c:url value='/saleclues/closesaleclues'/>",
type:"post",
dataType:"json",
data:{
selectedIds:selectedIds,
reason:'客户反悔了'
},
success:function(data){
if(data.type == "1"){
console.log('bb');
//alert(data.msg);
d3.close();
}else
alert(data.msg);
}
})
}else
alert("请选择数据");
});
$("#cancelButton3").click(function(){
d3.close();
})
/*关闭*/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值