parent
92f9340b2b
commit
22c26ef453
@ -0,0 +1,335 @@ |
|||||||
|
<?php |
||||||
|
use \common\libs\MyLib; |
||||||
|
?> |
||||||
|
<?php $this->beginBlock('header_css'); ?> |
||||||
|
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet"> |
||||||
|
<?php $this->endBlock(); ?> |
||||||
|
<input id="serverInfo" type="hidden" value="ws://127.0.0.1:8800/" size="40"/> |
||||||
|
<div id="txt-e" style=" color: red; font-size: 18px; display: none;"></div> |
||||||
|
<div id="txt-ok" style=" color: green; font-size: 18px; display: none;"></div> |
||||||
|
<input id="sendMsg" type="hidden" value='{"cmd":"LINK"}' style="width: 500px;" > |
||||||
|
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
|
<div class="ibox float-e-margins"> |
||||||
|
<div class="ibox-title"> |
||||||
|
<h5>呼叫电话</h5> |
||||||
|
</div> |
||||||
|
<div class="ibox-content"> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-12"> |
||||||
|
<form role="form" class="form-horizontal data-from" id="theFrm"> |
||||||
|
<input type="hidden" name="id" value="<?=$user_info->id?>">
|
||||||
|
<div class="form-group"> |
||||||
|
<label class="col-md-2 control-label">呼叫电话</label> |
||||||
|
<div class="col-md-5"> |
||||||
|
<input type="text" name="phone" id="phone" value="" class="form-control" autocomplete="off"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-5 col-md-offset-3"> |
||||||
|
<button class="btn btn-primary btn-call" type="button"> |
||||||
|
<strong>呼叫</strong> |
||||||
|
</button> |
||||||
|
<button class="btn btn-primary btn-stop" type="button"> |
||||||
|
<strong>挂断</strong> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<?php $this->beginBlock('footer_js'); ?> |
||||||
|
<script type="text/javascript" language="javascript"> |
||||||
|
$(function () { |
||||||
|
//提交按钮 |
||||||
|
$(".btn-call").click(function(){ |
||||||
|
var phone = $('#phone').val(); |
||||||
|
sendMsg('ATD',phone); |
||||||
|
}); |
||||||
|
$(".btn-stop").click(function(){ |
||||||
|
sendMsg('ATH'); |
||||||
|
}); |
||||||
|
}) |
||||||
|
</script> |
||||||
|
<script> |
||||||
|
var ws; |
||||||
|
function wsInit(val){ |
||||||
|
//重连先关闭 |
||||||
|
if(val=='reConn'){ |
||||||
|
ws.close(); |
||||||
|
} |
||||||
|
document.getElementById("txt-ok").innerText=""; |
||||||
|
document.getElementById("txt-e").innerText=""; |
||||||
|
if("WebSocket" in window) { |
||||||
|
var serverInfo = document.getElementById("serverInfo").value; |
||||||
|
// 打开一个 web socket,全局共用一个 |
||||||
|
ws = new WebSocket(serverInfo); |
||||||
|
|
||||||
|
console.log("已连接"+serverInfo); |
||||||
|
ws.onopen = function() { |
||||||
|
setTimeout(function(){ |
||||||
|
sendMsg('link') |
||||||
|
},100); |
||||||
|
showResult('ok'); |
||||||
|
}; |
||||||
|
ws.onmessage = function(evt) { |
||||||
|
document.getElementById("recMsg").value=evt.data; |
||||||
|
var data = JSON.parse(evt.data); |
||||||
|
//console.log(data); |
||||||
|
switch(data['cmd']) { |
||||||
|
// 服务端ping客户端 |
||||||
|
case 'USB': |
||||||
|
ws.send('{"cmd":"USB","connected":"true","success":"true","message":"成功"}'); |
||||||
|
break; |
||||||
|
case 'CORG': |
||||||
|
ws.send('{"cmd":"CORG","number":"10010","success":"true","message":"成功"}'); |
||||||
|
break; |
||||||
|
case 'CALLING': |
||||||
|
ws.send('{"cmd":"CALLING","number":"10010","success":"true","message":"成功"}'); |
||||||
|
break; |
||||||
|
case 'CBEGIN': |
||||||
|
ws.send('{"cmd":"CBEGIN","success":"true","message":"成功"}'); |
||||||
|
break; |
||||||
|
case 'ALERT': |
||||||
|
ws.send('{"cmd":"ALERT","success":"true","message":"成功"}'); |
||||||
|
break; |
||||||
|
case 'CEND': |
||||||
|
ws.send('{"cmd":"CEND","success":"true","message":"成功"}'); |
||||||
|
break; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
}; |
||||||
|
//出现错误 |
||||||
|
ws.onerror = function(evt){ |
||||||
|
//console.log(evt); |
||||||
|
} |
||||||
|
//连接断开 |
||||||
|
ws.onclose = function(evt){ |
||||||
|
//console.log(evt) |
||||||
|
showResult('error'); |
||||||
|
} |
||||||
|
} else { |
||||||
|
// 浏览器不支持 WebSocket |
||||||
|
alert("您的浏览器不支持 WebSocket!"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function showResult(val){ |
||||||
|
var serverInfo = document.getElementById("serverInfo").value; |
||||||
|
var okText = serverInfo + "连接成功"; |
||||||
|
var errText = serverInfo + "连接失败,请检查window服务、IP和端口安装并配置正确"; |
||||||
|
if(val=='ok'){ |
||||||
|
document.getElementById("txt-ok").innerText = okText; |
||||||
|
document.getElementById("txt-ok").style.display="none"; |
||||||
|
document.getElementById("txt-e").style.display="none"; |
||||||
|
}else{ |
||||||
|
//console.log(errText) |
||||||
|
document.getElementById("txt-e").innerText = errText; |
||||||
|
document.getElementById("txt-ok").style.display="none"; |
||||||
|
document.getElementById("txt-e").style.display="none"; |
||||||
|
} |
||||||
|
} |
||||||
|
function reConn(){ |
||||||
|
ws = new WebSocket(serverInfo); |
||||||
|
} |
||||||
|
function sendMsg(val,phone){ |
||||||
|
|
||||||
|
// Web Socket 已连接上,使用 send() 方法发送数据 |
||||||
|
if(ws === undefined) { |
||||||
|
parent.layer.msg('控件无效,请重新安装'); |
||||||
|
return; |
||||||
|
} |
||||||
|
var state=ws.readyState; |
||||||
|
|
||||||
|
console.log("readyState:"+state); |
||||||
|
if(state!=1){ |
||||||
|
document.getElementById("txt-e").style.display="block"; |
||||||
|
//location.reload(); |
||||||
|
return; |
||||||
|
}else{ |
||||||
|
document.getElementById("txt-e").style.display="none"; |
||||||
|
} |
||||||
|
|
||||||
|
if(val=="link"){ |
||||||
|
val = '{"cmd":"LINK"}'; |
||||||
|
} |
||||||
|
/*if(val=="USB"){ |
||||||
|
val = '{"cmd":"USB","connected":"true","success":"true","message":"成功"}'; |
||||||
|
}*/ |
||||||
|
if(val=="ATD"){ |
||||||
|
function getRadioLValue(haoma){ |
||||||
|
var obj = document.getElementsByName(haoma); |
||||||
|
for(i = 0;i<obj.length;i++){ |
||||||
|
if(obj[i].checked){ |
||||||
|
return obj[i].value; |
||||||
|
} |
||||||
|
} |
||||||
|
return "undefined"; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// var sendhaoma = getRadioLValue("sendhaoma"); |
||||||
|
var sendhaoma = 0; |
||||||
|
var number_one = phone; |
||||||
|
|
||||||
|
|
||||||
|
$.get('/phone/ax-out',{'phone':number_one,'user_id':'1'},function(obj){ |
||||||
|
|
||||||
|
if(obj.success) { |
||||||
|
|
||||||
|
var number = obj.msg; |
||||||
|
|
||||||
|
val = '{"cmd":"ATD","number":"'+number+'","hidden":"'+sendhaoma+'"}'; |
||||||
|
document.getElementById("sendMsg").value=val; |
||||||
|
ws.send(val); |
||||||
|
console.log("数据已发送"); |
||||||
|
} else { |
||||||
|
alert(obj.msg); |
||||||
|
} |
||||||
|
},'json'); |
||||||
|
|
||||||
|
} |
||||||
|
if(val=="ATH"){ |
||||||
|
val = '{"cmd":"ATH"}'; |
||||||
|
} |
||||||
|
if(val=="ATA"){ |
||||||
|
val = '{"cmd":"ATA"}'; |
||||||
|
} |
||||||
|
if(val=="READIMEI"){ |
||||||
|
val = '{"cmd":"READIMEI"}'; |
||||||
|
} |
||||||
|
if(val=="READVER"){ |
||||||
|
val = '{"cmd":"READVER"}'; |
||||||
|
} |
||||||
|
if(val=="READSTATUS"){ |
||||||
|
val = '{"cmd":"READSTATUS"}'; |
||||||
|
} |
||||||
|
if(val=="startrecord"){ |
||||||
|
function getLocalTime(nS) { |
||||||
|
return new Date(parseInt(nS) * 1000).Format("yyyyMMddhhmmss"); |
||||||
|
} |
||||||
|
Date.prototype.Format = function(fmt) {//author: meizz |
||||||
|
var o = { |
||||||
|
"M+" : this.getMonth() + 1, //月份 |
||||||
|
"d+" : this.getDate(), //日 |
||||||
|
"h+" : this.getHours(), //小时 |
||||||
|
"m+" : this.getMinutes(), //分 |
||||||
|
"s+" : this.getSeconds(), //秒 |
||||||
|
"q+" : Math.floor((this.getMonth() + 3) / 3), //季度 |
||||||
|
"S" : this.getMilliseconds() //毫秒 |
||||||
|
}; |
||||||
|
if (/(y+)/.test(fmt)) |
||||||
|
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); |
||||||
|
for (var k in o) |
||||||
|
if (new RegExp("(" + k + ")").test(fmt)) |
||||||
|
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); |
||||||
|
return fmt; |
||||||
|
} |
||||||
|
//E:\\qtproject\\PhoneService\\kaerHjSDK\\recordfile\\20180514.mp3 |
||||||
|
var time= Math.round(new Date() / 1000) ; |
||||||
|
var times =(getLocalTime(time)); |
||||||
|
console.log(time); |
||||||
|
var filename= "E:/qtproject/PhoneService/kaerHjSDK/recordfile/"+times+".mp3"; |
||||||
|
val = '{"cmd":"startrecord","filename":"'+filename+'"}'; |
||||||
|
//alert(filename); |
||||||
|
} |
||||||
|
if(val=="stoprecord"){ |
||||||
|
val = '{"cmd":"stoprecord"}'; |
||||||
|
} |
||||||
|
if(val=="HIDENUMBER"){ |
||||||
|
function getRadioValue(laidian){ |
||||||
|
var obj = document.getElementsByName(laidian); |
||||||
|
for(i = 0;i<obj.length;i++){ |
||||||
|
if(obj[i].checked){ |
||||||
|
return obj[i].value; |
||||||
|
} |
||||||
|
} |
||||||
|
return "undefined"; |
||||||
|
} |
||||||
|
function getRadioLValue(haoma){ |
||||||
|
var obj = document.getElementsByName(haoma); |
||||||
|
for(i = 0;i<obj.length;i++){ |
||||||
|
if(obj[i].checked){ |
||||||
|
return obj[i].value; |
||||||
|
} |
||||||
|
} |
||||||
|
return "undefined"; |
||||||
|
} |
||||||
|
var type=getRadioValue('laidian'); |
||||||
|
var hidden=getRadioLValue('haoma'); |
||||||
|
//console.log(type); |
||||||
|
//console.log('号码'+hidden); |
||||||
|
val = '{"cmd":"HIDENUMBER","type":"'+type+'","hidden":"'+hidden+'"}'; |
||||||
|
} |
||||||
|
if(val=="GETNUMBERHIDEN"){ |
||||||
|
function getRadioDqValue(duqvhj){ |
||||||
|
var obj = document.getElementsByName(duqvhj); |
||||||
|
for(i = 0;i<obj.length;i++){ |
||||||
|
if(obj[i].checked){ |
||||||
|
return obj[i].value; |
||||||
|
} |
||||||
|
} |
||||||
|
return "undefined"; |
||||||
|
} |
||||||
|
var type=getRadioDqValue('duqvhj'); |
||||||
|
val = '{"cmd":"GETNUMBERHIDEN","type":"'+type+'"}'; |
||||||
|
} |
||||||
|
if(val=="SETRECORDVOICE"){ |
||||||
|
var voice= document.getElementById("voice").value; |
||||||
|
val = '{"cmd":"SETRECORDVOICE","voice":"'+voice+'"}'; |
||||||
|
} |
||||||
|
if(val=="SETMODE"){ |
||||||
|
function getRadioHpValue(headsetProfile){ |
||||||
|
var obj = document.getElementsByName(headsetProfile); |
||||||
|
for(i = 0;i<obj.length;i++){ |
||||||
|
if(obj[i].checked){ |
||||||
|
return obj[i].value; |
||||||
|
} |
||||||
|
} |
||||||
|
return "undefined"; |
||||||
|
} |
||||||
|
var mode=getRadioHpValue('headsetProfile'); |
||||||
|
val = '{"cmd":"SETMODE","mode":"'+mode+'"}'; |
||||||
|
} |
||||||
|
if(val=="GETMODE"){ |
||||||
|
val = '{"cmd":"GETMODE"}'; |
||||||
|
} |
||||||
|
if(val=="SETUOC"){ |
||||||
|
function getRadioHpValue(headsetProfileRadio){ |
||||||
|
var obj = document.getElementsByName(headsetProfileRadio); |
||||||
|
for(i = 0;i<obj.length;i++){ |
||||||
|
if(obj[i].checked){ |
||||||
|
return obj[i].value; |
||||||
|
} |
||||||
|
} |
||||||
|
return "undefined"; |
||||||
|
} |
||||||
|
var mode=getRadioHpValue('headsetProfileRadio'); |
||||||
|
val = '{"cmd":"SETUOC","UOC":"'+mode+'"}'; |
||||||
|
} |
||||||
|
|
||||||
|
if(val=="GETUOC"){ |
||||||
|
val = '{"cmd":"GETUOC"}'; |
||||||
|
} |
||||||
|
if(val=="UPPARAM"){//设置通话记录传平台的参数 |
||||||
|
var upparamurl = document.getElementById("upparamurl").value;//坐席工号 |
||||||
|
var agent = document.getElementById("agent").value;//坐席工号 |
||||||
|
var company =document.getElementById("company").value;//计费账号 |
||||||
|
var thismobile =document.getElementById("thismobile").value;//本机号码 |
||||||
|
val = '{"cmd":"UPPARAM","url":"'+upparamurl+'","agent":"'+agent+'","company":"'+company+'","thismobile":"'+thismobile+'"}'; |
||||||
|
} |
||||||
|
document.getElementById("sendMsg").value=val; |
||||||
|
ws.send(val); |
||||||
|
console.log("数据已发送"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
</script> |
||||||
|
<?php $this->endBlock('footer_js'); ?> |
@ -1,89 +1,107 @@ |
|||||||
<?php |
<?php |
||||||
use \common\libs\MyLib; |
use \common\libs\MyLib; |
||||||
?> |
?> |
||||||
|
<?php $this->beginBlock('header_css'); ?> |
||||||
|
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||||
|
<?php $this->endBlock(); ?> |
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
<div class="ibox float-e-margins"> |
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
<div class="ibox-title"> |
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
<h5>号码分配</h5> |
||||||
if(s.type == "POST") { |
<div class="ibox-tools"> |
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
<i class="fa fa-plus"></i> 添加 |
||||||
} |
</a> |
||||||
}); |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||||
</script> |
<i class="fa fa-refresh"></i> 刷新 |
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="ibox-content"> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-12"> |
||||||
|
<table id="listTable"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th data-field="id">ID</th> |
||||||
|
<th data-field="username">人员名称</th> |
||||||
|
<th data-field="phone">电话号码</th> |
||||||
|
<th data-formatter="opFormatter">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
|
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
<?php $this->beginBlock('footer_js'); ?> |
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||||
if(s.type == "POST") { |
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
<script> |
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
function opFormatter(value, row, index) { |
||||||
} |
var opStr = []; |
||||||
}); |
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||||
</script> |
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||||
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611"> |
opStr.push('</a>'); |
||||||
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605"> |
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||||
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605"> |
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
opStr.push('</a>'); |
||||||
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script> |
opStr.push('<a href="javascript:void(0);" onclick="sub(' + row.id + ')">'); |
||||||
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script><script type="text/javascript" language="javascript" src="/js/func.js"></script> |
opStr.push('<i class="fa fa-phone" title="小号"></i>'); |
||||||
<script type="text/javascript" language="javascript"> |
opStr.push('</a>'); |
||||||
//修改 |
|
||||||
|
return opStr.join(' '); |
||||||
|
} |
||||||
|
function create() { |
||||||
|
title = '新增号码'; |
||||||
|
layer_show(title, '/phone-center/edit?id=0'); |
||||||
|
} |
||||||
function edit(id) { |
function edit(id) { |
||||||
window.location.href = '/phone-center/edit?id=' + id; |
var title = '编辑号码'; |
||||||
|
layer_show(title, '/phone-center/edit?id=' + id); |
||||||
|
} |
||||||
|
function sub(id) { |
||||||
|
window.location.href = '/phone-center/sub-index?phone_id=' + id; |
||||||
} |
} |
||||||
function del(id) { |
function del(id) { |
||||||
if(confirm('是否确认删除?')) { |
parent.layer.confirm('是否确认删除?', { |
||||||
$.post('/phone-center/delete',{id:id},function(obj){ |
btn: ['删除','取消'], //按钮 |
||||||
if(obj.success) { |
shade: false //不显示遮罩 |
||||||
window.location.reload(); |
}, function(){ |
||||||
} else { |
$.post('/phone-center/delete',{id:id},function(data) { |
||||||
alert(obj.msg); |
parent.layer.msg(data.msg); |
||||||
} |
refreshList(); |
||||||
},'json'); |
}, 'json'); |
||||||
} |
}, function(){ |
||||||
|
// |
||||||
|
}); |
||||||
} |
} |
||||||
function sub(id) { |
function refreshList() { |
||||||
window.location.href = '/phone-center/sub-index?id=' + id; |
$('#listTable').bootstrapTable('refresh'); |
||||||
} |
} |
||||||
|
|
||||||
$(function(){ |
function search() { |
||||||
$('#add-btn').click(function(){ |
$('#listTable').bootstrapTable('destroy'); |
||||||
edit(0); |
$('#listTable').bootstrapTable({ |
||||||
|
url: "/phone-center/assign-phone-json", |
||||||
|
pagination: true, |
||||||
|
sidePagination: 'server', |
||||||
|
queryParams: function(params) { |
||||||
|
params.type_id = $('#type_id').val(); |
||||||
|
params.name = $('#name').val(); |
||||||
|
return params; |
||||||
|
} |
||||||
}); |
}); |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
$(function() { |
||||||
|
search(); |
||||||
}); |
}); |
||||||
</script> |
</script> |
||||||
<table style="width:98%;" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
<?php $this->endBlock(); ?> |
||||||
<form id="searchForm"> |
|
||||||
<tr> |
|
||||||
<td class="td_bg"> |
|
||||||
<input type="button" class="act_btn" id="add-btn" name="search-btn" value="添加"> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
</form> |
|
||||||
</table> |
|
||||||
<table width="98%" align="center" cellpadding="3" cellspacing="1" class="table"> |
|
||||||
<tr> |
|
||||||
<td width="" align="center" class="bg_tr">人员名称</td> |
|
||||||
<td width="" align="center" class="bg_tr">电话号码</td> |
|
||||||
<td width="" align="center" class="bg_tr">操作</td> |
|
||||||
</tr> |
|
||||||
<form id="theFrm"> |
|
||||||
<?php |
|
||||||
foreach($phone_items as $item) { |
|
||||||
?> |
|
||||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->user->showName ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->phone?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap> |
|
||||||
[<a href="javascript:void(0);" onclick="edit(<?= $item['id'] ?>)">修改</a>]
|
|
||||||
[<a href="javascript:void(0);" onclick="del(<?= $item['id'] ?>)">删除</a>]
|
|
||||||
[<a href="javascript:void(0);" onclick="sub(<?= $item['id'] ?>)">小号</a>]
|
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<?php } ?> |
|
||||||
</form> |
|
||||||
</table> |
|
||||||
|
@ -1,180 +1,180 @@ |
|||||||
<?php |
<?php |
||||||
use \common\libs\MyLib; |
use \common\libs\MyLib; |
||||||
?> |
?> |
||||||
|
<?php $this->beginBlock('header_css'); ?> |
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
<?php $this->endBlock(); ?> |
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
|
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
if(s.type == "POST") { |
<div class="ibox float-e-margins"> |
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
<div class="ibox-title"> |
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
<h5>通话记录</h5> |
||||||
} |
<div class="ibox-tools"> |
||||||
}); |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||||
</script> |
<i class="fa fa-refresh"></i> 刷新 |
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
</a> |
||||||
|
</div> |
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
</div> |
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
<div class="ibox-content"> |
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
<form role="form" class="form-inline" onsubmit="return search();"> |
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
if(s.type == "POST") { |
<label for="username">工号</label> |
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
<input type="text" id="username" name="username" class="form-control"> |
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
</div> |
||||||
} |
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
}); |
<label for="datepicker">通话时间</label> |
||||||
</script> |
<div class="input-group" id="datepicker"> |
||||||
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611"> |
<input type="text" class="form-control" id="begin_time" name="begin_time" value="" autocomplete="off" /> |
||||||
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605"> |
<span class="input-group-addon">到</span> |
||||||
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605"> |
<input type="text" class="form-control" id="end_time" name="end_time" value="" autocomplete="off" /> |
||||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
</div> |
||||||
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script> |
</div> |
||||||
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script><script type="text/javascript" language="javascript" src="/js/func.js"></script> |
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> |
<label for="caller">主叫电话</label> |
||||||
|
<input type="text" id="caller" name="caller" class="form-control"> |
||||||
|
</div> |
||||||
<link rel="stylesheet" type="text/css" href="/copy/css/jquery.dialog.css" /> |
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
<script type="text/javascript" src="/copy/js/core.js"></script> |
<label for="called">被叫电话</label> |
||||||
<script type="text/javascript" src="/copy/js/jquery.dialog.js"></script> |
<input type="text" id="called" name="called" class="form-control"> |
||||||
|
</div> |
||||||
<script type="text/javascript" language="javascript"> |
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
//修改 |
<label for="call_result">通话状态</label> |
||||||
function edit(id) { |
<select name="call_result" id="call_result" class="form-control"> |
||||||
window.location.href = '/fix-project/edit?id=' + id; |
<option value="">请选择</option> |
||||||
} |
<option value="ANSWERED">通话成功</option> |
||||||
function del(id) { |
<option value="BUSY">被叫忙</option> |
||||||
if(confirm('是否确认删除?')) { |
<option value="NO_ANSWER">被叫无应答</option> |
||||||
$.post('/fix-project/delete',{id:id},function(obj){ |
<option value="REJECT">被叫拒接</option> |
||||||
if(obj.success) { |
<option value="HANGUP">主叫提前挂机</option> |
||||||
window.location.reload(); |
<option value="INVALID_NUMBER">空号</option> |
||||||
} else { |
<option value="POWER_OFF">关机</option> |
||||||
alert(obj.msg); |
<option value="UNAVAILABLE">暂时无法接听</option> |
||||||
} |
<option value="SUSPEND">停机</option> |
||||||
},'json'); |
<option value="TP_NO_BINDING">无绑定关系</option> |
||||||
} |
<option value="TP_TIMEOUT">号码查询接口超时</option> |
||||||
|
<option value="BLACK">黑名单号码</option> |
||||||
|
<option value="TP_ERROR">号码查询接口解析错误</option> |
||||||
|
<option value="CALLED_BLACK">被叫不支持</option> |
||||||
|
<option value="CALL_FORWARD">呼叫转移</option> |
||||||
|
<option value="OTHER">其他失败情形</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
|
<label for="duration">通话时长</label> |
||||||
|
<div class="input-group" id="duration"> |
||||||
|
<input type="text" id="duration_begin" name="duration_begin" class="form-control" size="3"> |
||||||
|
<span class="input-group-addon">到</span> |
||||||
|
<input type="text" id="duration_end" name="duration_end" class="form-control" size="3"> |
||||||
|
<span class="input-group-addon">截止(秒为单位)</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="form-group" style="margin-bottom: 8px;"> |
||||||
|
<label class="control-label">客户来电</label> |
||||||
|
<select name="is_called" name="is_called" class="form-control"> |
||||||
|
<option value="0">全部</option> |
||||||
|
<option value="1" >是</option> |
||||||
|
<option value="2" >否</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
<button type="submit" class="btn btn-primary">搜索</button> |
||||||
|
</form> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-12"> |
||||||
|
<table id="listTable"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th data-field="id">ID</th> |
||||||
|
<th data-field="username">坐席人员</th> |
||||||
|
<th data-field="begin_time">通话时间</th> |
||||||
|
<th data-field="caller">主叫真实号码</th> |
||||||
|
<th data-field="called">被叫真实号码</th> |
||||||
|
<th data-field="caller_show">主叫分配号码</th> |
||||||
|
<th data-field="called_show">被叫分配号码</th> |
||||||
|
<th data-field="call_duration">通话时长</th> |
||||||
|
<th data-field="call_result">通话状态</th> |
||||||
|
<th data-formatter="opFormatter">语音</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div id="player" class="hidden"> |
||||||
|
<audio controls> |
||||||
|
<!-- Audio files --> |
||||||
|
<source src="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3" type="audio/mp3"> |
||||||
|
|
||||||
|
<!-- Fallback for browsers that don't support the <audio> element --> |
||||||
|
您的浏览器不支持在线播放,请<a href="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3">下载</a> |
||||||
|
</audio> |
||||||
|
</div> |
||||||
|
<?php $this->beginBlock('footer_js'); ?> |
||||||
|
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||||
|
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||||
|
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||||
|
<script src="/assets/js/plugins/layer/laydate/laydate.js"></script> |
||||||
|
<script> |
||||||
|
function opFormatter(value, row, index) { |
||||||
|
var opStr = []; |
||||||
|
opStr.push('<a href="javascript:void(0);" onclick="play(' + row.record_file_url + ')">'); |
||||||
|
opStr.push('<i class="fa fa-play" title="播放"></i>'); |
||||||
|
opStr.push('</a>'); |
||||||
|
|
||||||
|
return opStr.join(' '); |
||||||
} |
} |
||||||
$(function(){ |
function play(url) { |
||||||
$('#add-btn').click(function(){ |
var body = '<audio controls>'; |
||||||
edit(0); |
body += '<source src="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3" type="audio/mp3">'; |
||||||
}); |
body += '您的浏览器不支持在线播放,请<a href="http://music.baidu.com/cms/app/muplayer/test_mp3/1.mp3">下载</a>'; |
||||||
|
body += '</audio>'; |
||||||
$("#search-btn").click(function(){ |
parent.layer.open({ |
||||||
var params = $('#searchForm').serialize(); |
type: 1, |
||||||
window.location.href = "/phone-center/call-records?" + params; |
skin: 'layui-layer-rim', //加上边框 |
||||||
|
area: ['320px', '130px'], //宽高 |
||||||
|
title: '播放语音', |
||||||
|
content: body |
||||||
}); |
}); |
||||||
|
} |
||||||
|
function refreshList() { |
||||||
|
$('#listTable').bootstrapTable('refresh'); |
||||||
|
} |
||||||
|
|
||||||
|
function search() { |
||||||
|
$('#listTable').bootstrapTable('destroy'); |
||||||
$('.exitDialog').Dialog({ |
$('#listTable').bootstrapTable({ |
||||||
title:'预约', |
url: "/phone-center/call-records-json", |
||||||
autoOpen: false, |
pagination: true, |
||||||
width:400, |
sidePagination: 'server', |
||||||
height:250 |
queryParams: function(params) { |
||||||
|
params.username = $('#username').val(); |
||||||
|
params.begin_time = $('#begin_time').val(); |
||||||
|
params.end_time = $('#end_time').val(); |
||||||
|
params.caller = $('#caller').val(); |
||||||
|
params.called = $('#called').val(); |
||||||
|
params.call_result = $('#call_result').val(); |
||||||
|
params.duration_begin = $('#duration_begin').val(); |
||||||
|
params.duration_end = $('#duration_end').val(); |
||||||
|
params.is_called = $('#is_called').val(); |
||||||
|
return params; |
||||||
|
} |
||||||
}); |
}); |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
$('.exit').click(function(){ |
$(function() { |
||||||
$('.exitDialog').Dialog('open'); |
search(); |
||||||
var url = $(this).attr('record_url'); |
laydate({ |
||||||
$("#play_url").attr('src',url); |
elem:'#begin_time', |
||||||
|
format: 'YYYY-MM-DD hh:mm:ss', |
||||||
|
istime: true |
||||||
}); |
}); |
||||||
|
laydate({ |
||||||
$('.exitDialog input[type=button]').click(function(e) { |
elem:'#end_time', |
||||||
if($(this).hasClass('normal')){ |
format: 'YYYY-MM-DD hh:mm:ss', |
||||||
} |
istime: true |
||||||
}); |
}); |
||||||
|
|
||||||
|
|
||||||
}); |
}); |
||||||
</script> |
</script> |
||||||
<table style="width:98%;" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
<?php $this->endBlock(); ?> |
||||||
<form id="searchForm"> |
|
||||||
<tr> |
|
||||||
<td class="td_bg"> |
|
||||||
通话时间:从<input name="begin_time" type="text" value="<?=$begin_time?>" style="width:150px;" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})">到<input name="end_time" type="text" value="<?=$end_time?>" style="width:150px;" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})">截止
|
|
||||||
主叫电话:<input name="caller" type="text" value="<?=$caller?>" style="width: 100px;">
|
|
||||||
被叫电话:<input name="called" type="text" value="<?=$called?>" style="width: 100px;">
|
|
||||||
|
|
||||||
通话状态: |
|
||||||
<select name="call_result"> |
|
||||||
<option value="">请选择</option> |
|
||||||
<option value="ANSWERED" <?= $call_result == 'ANSWERED'? 'selected':''?> >通话成功</option>
|
|
||||||
<option value="BUSY">被叫忙</option> |
|
||||||
<option value="NO_ANSWER">被叫无应答</option> |
|
||||||
<option value="REJECT">被叫拒接</option> |
|
||||||
<option value="HANGUP">主叫提前挂机</option> |
|
||||||
<option value="INVALID_NUMBER">空号</option> |
|
||||||
<option value="POWER_OFF">关机</option> |
|
||||||
<option value="UNAVAILABLE">暂时无法接听</option> |
|
||||||
<option value="SUSPEND">停机</option> |
|
||||||
<option value="TP_NO_BINDING">无绑定关系</option> |
|
||||||
<option value="TP_TIMEOUT">号码查询接口超时</option> |
|
||||||
<option value="BLACK">黑名单号码</option> |
|
||||||
<option value="TP_ERROR">号码查询接口解析错误</option> |
|
||||||
<option value="CALLED_BLACK">被叫不支持</option> |
|
||||||
<option value="CALL_FORWARD">呼叫转移</option> |
|
||||||
<option value="OTHER">其他失败情形</option> |
|
||||||
</select> |
|
||||||
通话时长:从<input name="duration_begin" type="text" value="<?=$duration_begin?>" style="width:100px;" >到<input name="duration_end" type="text" value="<?=$duration_end?>" style="width:100px;" >截止
|
|
||||||
(秒为单位) |
|
||||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
</form> |
|
||||||
</table> |
|
||||||
<table width="98%" align="center" cellpadding="3" cellspacing="1" class="table"> |
|
||||||
<tr> |
|
||||||
<td width="" align="center" class="bg_tr">序号</td> |
|
||||||
<td width="" align="center" class="bg_tr">坐席人员</td> |
|
||||||
<td width="" align="center" class="bg_tr">通话时间</td> |
|
||||||
<td width="" align="center" class="bg_tr">主叫真实号码</td> |
|
||||||
<td width="" align="center" class="bg_tr">被叫真实号码</td> |
|
||||||
<td width="" align="center" class="bg_tr">主叫分配号码</td> |
|
||||||
<td width="" align="center" class="bg_tr">被叫分配号码</td> |
|
||||||
<td width="" align="center" class="bg_tr">通话时长</td> |
|
||||||
<td width="" align="center" class="bg_tr">通话状态</td> |
|
||||||
<td width="" align="center" class="bg_tr">语音</td> |
|
||||||
</tr> |
|
||||||
<form id="theFrm"> |
|
||||||
<?php |
|
||||||
foreach($record_items as $item) { |
|
||||||
?> |
|
||||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->id ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->user?$item->user->showName:'' ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->begin_time ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->caller ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->called ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->caller_show ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= $item->called_show ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= MyLib::HMSByTime($item->call_duration)?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap><?= MyLib::phoneCenterStatus($item->call_result) ?></td>
|
|
||||||
<td align="center" class="td_bg" nowrap> |
|
||||||
<?php if($item->record_file_url):?> |
|
||||||
<a class="exit" record_url="<?=$item->record_file_url?>" href="javascript:void()">播放</a>
|
|
||||||
|
|
||||||
<?php endif;?> |
|
||||||
</td> |
|
||||||
|
|
||||||
</tr> |
|
||||||
|
|
||||||
|
|
||||||
<?php } ?> |
|
||||||
</form> |
|
||||||
</table> |
|
||||||
|
|
||||||
<div class="exitDialog"> |
|
||||||
<table style="width:98%; margin-top: 10px; "> |
|
||||||
<tr> |
|
||||||
<td> </td> |
|
||||||
</tr> |
|
||||||
<tr> |
|
||||||
<td> |
|
||||||
<audio id="play_url" src="" controls="controls"></audio> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
|
|
||||||
|
|
||||||
</table> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
@ -1,77 +1,79 @@ |
|||||||
<?php |
<?php |
||||||
use \common\libs\MyLib; |
use \common\libs\MyLib; |
||||||
?> |
?> |
||||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
<?php $this->beginBlock('header_css'); ?> |
||||||
<form id="theFrm"> |
<?php $this->endBlock(); ?> |
||||||
<input type="hidden" name="id" value="<?=$info->id?>">
|
|
||||||
<tr> |
|
||||||
<td width="20%" height="25" class="td_bg">人员名称</td> |
|
||||||
<td width="80%" height="25" class="td_bg"> |
|
||||||
<select name="user_id"> |
|
||||||
<?php |
|
||||||
|
|
||||||
echo '<option value="0">请选择</option>'; |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
foreach($user_items as $item) { |
<div class="ibox float-e-margins"> |
||||||
echo '<option value="'.$item->id.'"'; |
<div class="ibox-title"> |
||||||
if($info->user_id == $item->id) |
<h5>修改密码</h5> |
||||||
echo ' selected '; |
</div> |
||||||
echo '>'.$item->getShowName().'</option>'; |
<div class="ibox-content"> |
||||||
} |
<div class="row"> |
||||||
?> |
<div class="col-md-12"> |
||||||
</select> |
<form role="form" class="form-horizontal data-from" id="theFrm"> |
||||||
</td> |
<input type="hidden" name="id" value="<?=$info->id?>">
|
||||||
</tr> |
<div class="form-group"> |
||||||
<tr> |
<label class="col-md-1 control-label">人员名称</label> |
||||||
<td width="20%" height="25" class="td_bg">电话号码</td> |
<div class="col-md-6"> |
||||||
<td width="80%" height="25" class="td_bg"><input name="phone" type="text" id="phone" value="<?=$info->phone?>" size="40" /></td>
|
<select name="user_id" id="user_id" class="form-control"> |
||||||
</tr> |
<?php |
||||||
</form> |
|
||||||
<tr> |
|
||||||
<td height="22" colspan="2" align="center" class="td_bg"> |
|
||||||
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> |
|
||||||
|
|
||||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
</table> |
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
echo '<option value="0">请选择</option>'; |
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
foreach($user_items as $item) { |
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
echo '<option value="'.$item->id.'"'; |
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
if($info->user_id == $item->id) |
||||||
if(s.type == "POST") { |
echo ' selected '; |
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
echo '>'.$item->getShowName().'</option>'; |
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
} |
||||||
} |
?> |
||||||
}); |
</select> |
||||||
</script> |
</div> |
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<label class="col-md-1 control-label">电话号码</label> |
||||||
|
<div class="col-md-6"> |
||||||
|
<input type="text" class="form-control" name="phone" id="phone" value="<?=$info->phone?>">
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-5 col-md-offset-5"> |
||||||
|
<button class="btn btn-primary btn-save" type="button"> |
||||||
|
<strong>提 交</strong> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
<?php $this->beginBlock('footer_js'); ?> |
||||||
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611"> |
<script type="text/javascript" language="javascript"> |
||||||
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605"> |
|
||||||
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605"> |
|
||||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
|
||||||
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script> |
|
||||||
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script><script type="text/javascript" language="javascript"> |
|
||||||
$(function () { |
$(function () { |
||||||
//提交按钮 |
//提交按钮 |
||||||
$("#submit-btn").click(function(){ |
$(".btn-save").click(function(){ |
||||||
if(confirm('是否确认提交?')) { |
parent.layer.confirm('是否确认提交?', { |
||||||
|
btn: ['确认','取消'], //按钮 |
||||||
|
shade: false //不显示遮罩 |
||||||
|
}, function(){ |
||||||
var params = $("#theFrm").serialize(); |
var params = $("#theFrm").serialize(); |
||||||
$.post('/phone-center/save',params,function(obj){ |
$.post('/phone-center/save',params,function(data){ |
||||||
if(obj.success) { |
parent.layer.msg(data.msg); |
||||||
$('#back-btn').click(); |
if(data.success) { |
||||||
} else { |
parent.refreshList(); |
||||||
alert(obj.msg); |
layer_close(); |
||||||
} |
} |
||||||
},'json'); |
},'json'); |
||||||
} |
}, function(){ |
||||||
}); |
// |
||||||
|
}); |
||||||
//返回按钮 |
|
||||||
$('#back-btn').click(function(){ |
|
||||||
window.location.href='/phone-center/assign-phone'; |
|
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
|
<?php $this->endBlock('footer_js'); ?> |
||||||
|
@ -1,59 +1,62 @@ |
|||||||
<?php |
<?php |
||||||
use \common\libs\MyLib; |
use \common\libs\MyLib; |
||||||
?> |
?> |
||||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
<?php $this->beginBlock('header_css'); ?> |
||||||
<form id="theFrm"> |
<?php $this->endBlock(); ?> |
||||||
<input type="hidden" name="id" value="<?=$info->id?>">
|
|
||||||
<input type="hidden" name="assign_id" value="<?=$assign_id?>">
|
|
||||||
|
|
||||||
<tr> |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
<td width="20%" height="25" class="td_bg">电话号码</td> |
<div class="ibox float-e-margins"> |
||||||
<td width="40%" height="25" class="td_bg"><input name="phone" type="text" id="phone" value="<?=$info->phone?>" size="40" /></td>
|
<div class="ibox-title"> |
||||||
<td width="20%" height="25" class="td_bg">作为被叫号</td> |
<h5>修改密码</h5> |
||||||
<td width="40" height="25" class="td_bg"> |
</div> |
||||||
<input name="is_called" type="radio" id="is_called" value="0" size="40" <?=$info->is_called == 0?'checked':'' ?> />否
|
<div class="ibox-content"> |
||||||
<input name="is_called" type="radio" id="is_called" value="1" size="40" <?=$info->is_called == 1?'checked':''?> />是
|
<div class="row"> |
||||||
</td> |
<div class="col-md-12"> |
||||||
|
<form role="form" class="form-horizontal data-from" id="theFrm"> |
||||||
|
<input type="hidden" name="assign_id" value="<?=$assign_id?>">
|
||||||
|
<div class="form-group"> |
||||||
|
<label class="col-md-1 control-label">电话号码</label> |
||||||
|
<div class="col-md-6"> |
||||||
|
<input type="text" name="phone" value="" class="form-control"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-5 col-md-offset-5"> |
||||||
|
<button class="btn btn-primary btn-save" type="button"> |
||||||
|
<strong>保存</strong> |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
</tr> |
<?php $this->beginBlock('footer_js'); ?> |
||||||
</form> |
<script type="text/javascript" language="javascript"> |
||||||
<tr> |
|
||||||
<td height="22" colspan="4" align="center" class="td_bg"> |
|
||||||
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> |
|
||||||
|
|
||||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
</table> |
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
|
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611"> |
|
||||||
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605"> |
|
||||||
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605"> |
|
||||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
|
||||||
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script> |
|
||||||
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script><script type="text/javascript" language="javascript"> |
|
||||||
$(function () { |
$(function () { |
||||||
//提交按钮 |
//提交按钮 |
||||||
$("#submit-btn").click(function(){ |
$(".btn-save").click(function(){ |
||||||
if(confirm('是否确认提交?')) { |
parent.layer.confirm('是否确认提交?', { |
||||||
|
btn: ['确认','取消'], //按钮 |
||||||
|
shade: false //不显示遮罩 |
||||||
|
}, function(){ |
||||||
var params = $("#theFrm").serialize(); |
var params = $("#theFrm").serialize(); |
||||||
$.post('/phone-center/sub-save',params,function(obj){ |
$.post('/phone-center/sub-save',params,function(data){ |
||||||
alert(obj.msg); |
parent.layer.msg(data.msg); |
||||||
if(obj.success) { |
if(data.success) { |
||||||
$('#back-btn').click(); |
parent.refreshList(); |
||||||
|
layer_close(); |
||||||
} |
} |
||||||
},'json'); |
},'json'); |
||||||
} |
}, function(){ |
||||||
}); |
// |
||||||
|
}); |
||||||
//返回按钮 |
|
||||||
$('#back-btn').click(function(){ |
|
||||||
var params = $("#theFrm").serialize(); |
|
||||||
window.location.href='/phone-center/sub-index?id=<?=$assign_id?>';
|
|
||||||
}); |
}); |
||||||
}) |
}) |
||||||
</script> |
</script> |
||||||
|
<?php $this->endBlock('footer_js'); ?> |
||||||
|
@ -1,114 +1,106 @@ |
|||||||
<?php |
<?php |
||||||
use \common\libs\MyLib; |
use \common\libs\MyLib; |
||||||
?> |
?> |
||||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
<?php $this->beginBlock('header_css'); ?> |
||||||
<form id="theFrm"> |
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||||
<input type="hidden" name="assign_id" value="<?=$assign_info->id?>">
|
<?php $this->endBlock(); ?> |
||||||
<tr> |
|
||||||
<td width="20%" height="25" class="td_bg">人员名称</td> |
|
||||||
<td width="80%" height="25" class="td_bg" colspan="2"> |
|
||||||
<?=$assign_info->user->getShowName()?> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<tr> |
|
||||||
<td width="20%" height="25" class="td_bg">电话</td> |
|
||||||
<td width="80%" height="25" class="td_bg" colspan="2"> |
|
||||||
<?=$assign_info->phone?> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<tr> |
|
||||||
<td width="20%" height="25" class="td_bg" colspan="3"> </td> |
|
||||||
</tr> |
|
||||||
<tr> |
|
||||||
<td width="20%" height="25" class="td_bg">小号</td> |
|
||||||
<td width="80%" height="25" class="td_bg" colspan="2"> |
|
||||||
[<a href="javascript:void(0);" onclick="add(<?= $assign_info->id ?>)">添加</a>]
|
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
<?php foreach ($sub_items as $k=>$item):?> |
|
||||||
<tr> |
|
||||||
<td width="20%" height="25" class="td_bg"><?=$k+1?></td>
|
|
||||||
<td width="40%" height="25" class="td_bg"> |
|
||||||
<?=$item->phone?> [<a href="javascript:void(0);" onclick="link(<?= $item['id'] ?>,<?=$assign_info->id?>)">绑定</a>]
|
|
||||||
|
|
||||||
</td> |
<div class="wrapper wrapper-content animated fadeInRight"> |
||||||
<td height="25" class="td_bg"> |
<div class="ibox float-e-margins"> |
||||||
[<a href="javascript:void(0);" onclick="edit(<?= $item['id'] ?>,<?= $assign_info->id ?>)">修改</a>]
|
<div class="ibox-title"> |
||||||
[<a href="javascript:void(0);" onclick="del(<?= $item['id'] ?>)">删除</a>]
|
<h5>号码分配 -- <?=$assign_info->user->getShowName()?> -- <?=$assign_info->phone?></h5>
|
||||||
</td> |
<div class="ibox-tools"> |
||||||
</tr> |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||||
<?php endforeach;?> |
<i class="fa fa-plus"></i> 添加 |
||||||
</form> |
</a> |
||||||
<tr> |
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||||
<td height="22" colspan="3" align="center" class="td_bg" > |
<i class="fa fa-refresh"></i> 刷新 |
||||||
|
</a> |
||||||
|
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="history.back();"> |
||||||
|
<i class="fa fa-backward"></i> 返回 |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="ibox-content"> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-md-12"> |
||||||
|
<table id="listTable"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th data-field="id">ID</th> |
||||||
|
<th data-field="phone">电话号码</th> |
||||||
|
<th data-formatter="opFormatter">操作</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
</table> |
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
<?php $this->beginBlock('footer_js'); ?> |
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||||
if(s.type == "POST") { |
<script> |
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
function opFormatter(value, row, index) { |
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
var opStr = []; |
||||||
} |
opStr.push('<a href="javascript:void(0);" onclick="link(' + row.id + ')">'); |
||||||
}); |
opStr.push('<i class="fa fa-edit" title="绑定"></i>'); |
||||||
</script> |
opStr.push('</a>'); |
||||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||||
|
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||||
|
opStr.push('</a>'); |
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
return opStr.join(' '); |
||||||
$(document).bind("ajaxSend",function(elm,xhr,s) { |
|
||||||
var csrf_param = $('meta[name=csrf-param]').prop('content'); |
|
||||||
var csrf_token = $('meta[name=csrf-token]').prop('content'); |
|
||||||
if(s.type == "POST") { |
|
||||||
xhr.setRequestHeader('X-CSRF-Param',csrf_param); |
|
||||||
xhr.setRequestHeader('X-CSRF-Token',csrf_token); |
|
||||||
} |
|
||||||
}); |
|
||||||
</script> |
|
||||||
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611"> |
|
||||||
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605"> |
|
||||||
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605"> |
|
||||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> |
|
||||||
<script src="../Myfile/lib/layui/layui.js?v=20190611" charset="utf-8"></script> |
|
||||||
<script type="text/javascript" src="../Myfile/js/xadmin.js?v=20190612"></script><script type="text/javascript" language="javascript"> |
|
||||||
$(function () { |
|
||||||
//返回按钮 |
|
||||||
$('#back-btn').click(function(){ |
|
||||||
window.location.href='/phone-center/assign-phone'; |
|
||||||
}); |
|
||||||
}) |
|
||||||
|
|
||||||
function edit(id,assign_id) { |
|
||||||
window.location.href = '/phone-center/sub-edit?id=' + id + '&assign_id=' + assign_id; |
|
||||||
} |
|
||||||
function del(id,assign_id) { |
|
||||||
if(confirm('是否确认删除?')) { |
|
||||||
$.post('/phone-center/sub-delete',{id:id},function(obj){ |
|
||||||
if(obj.success) { |
|
||||||
window.location.reload(); |
|
||||||
} else { |
|
||||||
alert(obj.msg); |
|
||||||
} |
|
||||||
},'json'); |
|
||||||
} |
|
||||||
} |
} |
||||||
function add(id) { |
function create() { |
||||||
window.location.href = '/phone-center/sub-edit?assign_id=' + id; |
title = '新增小号'; |
||||||
|
layer_show(title, '/phone-center/sub-edit?assign_id=<?=$assign_info-id?>');
|
||||||
} |
} |
||||||
|
function link(id) { |
||||||
function link(id,assign_id) { |
$.get('/phone/ax-init',{id:id,assign_id:<?=$assign_info-id?>},function(obj){
|
||||||
$.get('/phone/ax-init',{id:id,assign_id:assign_id},function(obj){ |
parent.layer.msg(obj.msg); |
||||||
alert(obj.msg); |
|
||||||
|
|
||||||
},'json'); |
},'json'); |
||||||
|
|
||||||
} |
} |
||||||
|
function del(id) { |
||||||
|
parent.layer.confirm('是否确认删除?', { |
||||||
|
btn: ['删除','取消'], //按钮 |
||||||
|
shade: false //不显示遮罩 |
||||||
|
}, function(){ |
||||||
|
$.post('/phone-center/sub-delete',{id:id},function(data) { |
||||||
|
parent.layer.msg(data.msg); |
||||||
|
refreshList(); |
||||||
|
}, 'json'); |
||||||
|
}, function(){ |
||||||
|
// |
||||||
|
}); |
||||||
|
} |
||||||
|
function refreshList() { |
||||||
|
$('#listTable').bootstrapTable('refresh'); |
||||||
|
} |
||||||
|
|
||||||
|
function search() { |
||||||
|
$('#listTable').bootstrapTable('destroy'); |
||||||
|
$('#listTable').bootstrapTable({ |
||||||
|
url: "/phone-center/sub-index-json", |
||||||
|
pagination: true, |
||||||
|
sidePagination: 'server', |
||||||
|
queryParams: function(params) { |
||||||
|
params.phone_id = <?=$assign_info->id?>;
|
||||||
|
params.type_id = $('#type_id').val(); |
||||||
|
params.name = $('#name').val(); |
||||||
|
return params; |
||||||
|
} |
||||||
|
}); |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
$(function() { |
||||||
|
search(); |
||||||
|
}); |
||||||
</script> |
</script> |
||||||
|
<?php $this->endBlock(); ?> |
||||||
|
Loading…
Reference in new issue