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 |
||||
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 > |
||||
$(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> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>号码分配</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||
<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');"> |
||||
<i class="fa fa-refresh"></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="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) { |
||||
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); |
||||
|
||||
<?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> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="sub(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-phone" title="小号"></i>'); |
||||
opStr.push('</a>'); |
||||
|
||||
return opStr.join(' '); |
||||
} |
||||
function create() { |
||||
title = '新增号码'; |
||||
layer_show(title, '/phone-center/edit?id=0'); |
||||
} |
||||
}); |
||||
</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" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
//修改 |
||||
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) { |
||||
if(confirm('是否确认删除?')) { |
||||
$.post('/phone-center/delete',{id:id},function(obj){ |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
} else { |
||||
alert(obj.msg); |
||||
parent.layer.confirm('是否确认删除?', { |
||||
btn: ['删除','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
$.post('/phone-center/delete',{id:id},function(data) { |
||||
parent.layer.msg(data.msg); |
||||
refreshList(); |
||||
}, 'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
} |
||||
},'json'); |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#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; |
||||
} |
||||
function sub(id) { |
||||
window.location.href = '/phone-center/sub-index?id=' + id; |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function(){ |
||||
$('#add-btn').click(function(){ |
||||
edit(0); |
||||
}); |
||||
$(function() { |
||||
search(); |
||||
}); |
||||
</script> |
||||
<table style="width:98%;" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<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> |
||||
<?php $this->endBlock(); ?> |
||||
|
@ -1,59 +1,62 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="theFrm"> |
||||
<input type="hidden" name="id" value="<?=$info->id?>">
|
||||
<input type="hidden" name="assign_id" value="<?=$assign_id?>">
|
||||
|
||||
<tr> |
||||
<td width="20%" height="25" class="td_bg">电话号码</td> |
||||
<td width="40%" height="25" class="td_bg"><input name="phone" type="text" id="phone" value="<?=$info->phone?>" size="40" /></td>
|
||||
<td width="20%" height="25" class="td_bg">作为被叫号</td> |
||||
<td width="40" height="25" class="td_bg"> |
||||
<input name="is_called" type="radio" id="is_called" value="0" size="40" <?=$info->is_called == 0?'checked':'' ?> />否
|
||||
<input name="is_called" type="radio" id="is_called" value="1" size="40" <?=$info->is_called == 1?'checked':''?> />是
|
||||
</td> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
</tr> |
||||
<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="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> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<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"> |
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script type="text/javascript" language="javascript"> |
||||
$(function () { |
||||
//提交按钮 |
||||
$("#submit-btn").click(function(){ |
||||
if(confirm('是否确认提交?')) { |
||||
$(".btn-save").click(function(){ |
||||
parent.layer.confirm('是否确认提交?', { |
||||
btn: ['确认','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
var params = $("#theFrm").serialize(); |
||||
$.post('/phone-center/sub-save',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
$('#back-btn').click(); |
||||
$.post('/phone-center/sub-save',params,function(data){ |
||||
parent.layer.msg(data.msg); |
||||
if(data.success) { |
||||
parent.refreshList(); |
||||
layer_close(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}, function(){ |
||||
// |
||||
}); |
||||
|
||||
//返回按钮 |
||||
$('#back-btn').click(function(){ |
||||
var params = $("#theFrm").serialize(); |
||||
window.location.href='/phone-center/sub-index?id=<?=$assign_id?>';
|
||||
}); |
||||
}) |
||||
</script> |
||||
<?php $this->endBlock('footer_js'); ?> |
||||
|
@ -1,114 +1,106 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="theFrm"> |
||||
<input type="hidden" name="assign_id" value="<?=$assign_info->id?>">
|
||||
<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>]
|
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
</td> |
||||
<td height="25" class="td_bg"> |
||||
[<a href="javascript:void(0);" onclick="edit(<?= $item['id'] ?>,<?= $assign_info->id ?>)">修改</a>]
|
||||
[<a href="javascript:void(0);" onclick="del(<?= $item['id'] ?>)">删除</a>]
|
||||
</td> |
||||
</tr> |
||||
<?php endforeach;?> |
||||
</form> |
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>号码分配 -- <?=$assign_info->user->getShowName()?> -- <?=$assign_info->phone?></h5>
|
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||
<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');"> |
||||
<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> |
||||
<td height="22" colspan="3" align="center" class="td_bg" > |
||||
|
||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
||||
</td> |
||||
<th data-field="id">ID</th> |
||||
<th data-field="phone">电话号码</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</table> |
||||
</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) { |
||||
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> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
|
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script><script > |
||||
$(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'; |
||||
}); |
||||
}) |
||||
<?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> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="link(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-edit" title="绑定"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||
opStr.push('</a>'); |
||||
|
||||
function edit(id,assign_id) { |
||||
window.location.href = '/phone-center/sub-edit?id=' + id + '&assign_id=' + assign_id; |
||||
return opStr.join(' '); |
||||
} |
||||
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); |
||||
function create() { |
||||
title = '新增小号'; |
||||
layer_show(title, '/phone-center/sub-edit?assign_id=<?=$assign_info-id?>');
|
||||
} |
||||
function link(id) { |
||||
$.get('/phone/ax-init',{id:id,assign_id:<?=$assign_info-id?>},function(obj){
|
||||
parent.layer.msg(obj.msg); |
||||
},'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 add(id) { |
||||
window.location.href = '/phone-center/sub-edit?assign_id=' + id; |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function link(id,assign_id) { |
||||
$.get('/phone/ax-init',{id:id,assign_id:assign_id},function(obj){ |
||||
alert(obj.msg); |
||||
|
||||
},'json'); |
||||
|
||||
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> |
||||
<?php $this->endBlock(); ?> |
||||
|
Loading…
Reference in new issue