rushfee/resource/html/rush/message.html

186 lines
5.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<html login="false">
<head>
<title>短信发送</title>
</head>
<body >
<div widget="toolbar" >
<a widget="button" id= "message" iconCls="icon-mail" onclick="message">发送短信</a>
<a widget="button" iconCls="icon-exit" onclick="CloseWindow()" >退出</a>
</div>
<!-- <input widget="hidden" name="cutype" />-->
<!-- <input widget="hidden" name="injf" />-->
<!-- <input widget="hidden" name="ifmz" />-->
<input widget="edit" name="contact" label="短信接受人" readonly="true" style="margin-top:5px"/>
<input widget="edit" name="mobile" label="电话" readonly="true" />
<br/>
<input widget="textarea" name="msg" label="短信内容" width="505px" height="100px"/>
<br/>
<br/>
<span id="warning" style="margin-left:65px">提示:短信接收人为客户信息明细页面下方表格选择的联系人</span>
</body>
<script type="text/javascript">
var flag = 0;
var myDate = new Date();
function init(param){
var injf=param.injf;
var cutype=param.cutype;
var ifmz=param.ifmz;
var nowDate=myDate.toLocaleDateString();
var serviceDate=param.serviceDate;
aos.get("contact").setValue(param.contact);
aos.get("mobile").setValue(param.mobile);
var cust_name=param.cust_name;
/* var data = {};
data['customerid']=param.customer_id
aos.post({
url:"rush/message/serch",
data:data,
success:function(rtnData){
/!*aos.get("injf").setValue(rtnData.tgstatus);
aos.get("ifmz").setValue(rtnData.mzkh);
aos.get("cutype").setValue(rtnData.isservice);*!/
injf = rtnData['tgstatus'];
ifmz= rtnData['mzkh'];
cutype = rtnData['isservice'];
}})
*/
aos.post({
url:"rush/message/getContent",
success:function(rtnData){
if(rtnData!=null&&rtnData.length>0){
var msg_jjdq_fwf='';
var msg_yjdq_fwf='';
var msg_jjdq_tg='';
var msg_yjdq_tg='';
var msg_fmz='';
var msg_mz='';
for(var i=0;i<rtnData.length;i++){
if(rtnData[i]['text']=='jjdq'){
msg_jjdq_fwf=rtnData[i]['memo'];
}
if(rtnData[i]['text']=='yjdq'){
msg_yjdq_fwf=rtnData[i]['memo'];
}
if(rtnData[i]['text']=='tgjjdq'){
msg_jjdq_tg=rtnData[i]['memo'];
}
if(rtnData[i]['text']=='tgyjdq'){
msg_yjdq_tg=rtnData[i]['memo'];
}
if(rtnData[i]['text']=='tgfmz'){
msg_fmz=rtnData[i]['memo'];
}
if(rtnData[i]['text']=='tgmz'){
msg_mz=rtnData[i]['memo'];
}
}
if(cutype=='服务费'){
if((new Date(nowDate.replace(/-/g,"\/"))) > (new Date(serviceDate.replace(/-/g,"\/")))){
aos.get("msg").setValue(cust_name+""+msg_yjdq_fwf);
}else{
aos.get("msg").setValue(cust_name+""+msg_jjdq_fwf);
}
}
if(cutype=='托管'){
if(injf=='不在机柜'){
if(ifmz=='不是免征户'){
aos.get("msg").setValue(cust_name+""+msg_fmz);
}
else{
aos.get("msg").setValue(cust_name+""+msg_mz);
}
}
else{
if((new Date(nowDate.replace(/-/g,"\/"))) > (new Date(serviceDate.replace(/-/g,"\/")))){
aos.get("msg").setValue(cust_name+""+msg_yjdq_tg);
}else{
aos.get("msg").setValue(cust_name+""+msg_jjdq_tg);
}
}
}
}}
})
}
//发送短信功能成功后插入rush_log表。并返回插入数据的id。
function message(){
if(flag==0){
var msgparam = aos.getForm().getData();
msgparam['msg']=aos.get('msg').getValue();
msgparam['mobile']=aos.get('mobile').getValue();
aos.post({
url:"rush/call/testSendSMS",
data:msgparam,
success:function(rtnData){
aos.alert('发送成功');
var param = aos.getForm().getData();
param['info']="联系"+aos.get('contact').getValue()+"("+aos.get('mobile').getValue()+");"+"短信内容:"+aos.get('msg').getValue();
param['action']='message';
param['time']='0';
aos.post({
url:"rush/search/insertLog",
data:param,
success:function(rtnData){
CloseWindow(rtnData);
}
});
}
});
}
flag = flag + 1 ;
}
/* var timeoutflag = null;
$('#message').click(function() {
if(timeoutflag != null){
clearTimeout(timeoutflag);
timeoutflag = null;
}
else{
timeoutflag=setTimeout(function(){
// dosomething();//此处是一个会请求远程的ajax 异步操作;
var msgparam = aos.getForm().getData();
msgparam['msg']=aos.get('msg').getValue();
msgparam['mobile']=aos.get('mobile').getValue();
aos.post({
url:"rush/call/testSendSMS",
data:msgparam,
success:function(rtnData){
aos.alert('发送成功');
var param = aos.getForm().getData();
param['info']="联系"+aos.get('contact').getValue()+"("+aos.get('mobile').getValue()+");"+"短信内容:"+aos.get('msg').getValue();
param['action']='message';
param['time']='0';
aos.post({
url:"rush/search/insertLog",
data:param,
success:function(rtnData){
CloseWindow(rtnData);
}
});
}
});
},3000);
}
}); */
/* function CloseWindow(){
aos.get("injf").setValue();
aos.get("ifmz").setValue();
aos.get("cutype").setValue();
}*/
</script>
</html>