完成通话记录功能、通时统计功能移植

dev
曾超新 5 years ago
parent 92f9340b2b
commit 22c26ef453
  1. 4
      frontend/controllers/CommonController.php
  2. 201
      frontend/controllers/PhoneCenterController.php
  3. 335
      frontend/views/common/call-phone.php
  4. 1
      frontend/views/common/update-pwd.php
  5. 168
      frontend/views/phone-center/assign-phone.php
  6. 336
      frontend/views/phone-center/call-records.php
  7. 128
      frontend/views/phone-center/edit.php
  8. 95
      frontend/views/phone-center/sub-edit.php
  9. 190
      frontend/views/phone-center/sub-index.php
  10. 434
      frontend/views/phone-center/usercall-index.php

@ -381,4 +381,8 @@ class CommonController extends \yii\web\Controller
} }
return $data; return $data;
} }
public function actionCallPhone() {
return $this->render('call-phone');
}
} }

@ -45,8 +45,13 @@ use common\models\CompanyT;
class PhoneCenterController extends BaseController class PhoneCenterController extends BaseController
{ {
public $enableCsrfValidation = false; public $enableCsrfValidation = false;
public $layout = 'blue-main';
public function actionCallRecords(){ public function actionCallRecords() {
return $this->render('call-records');
}
public function actionCallRecordsJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$begin_time = $request->get('begin_time',date('Y-m-d')); $begin_time = $request->get('begin_time',date('Y-m-d'));
$end_time = $request->get('end_time',date('Y-m-d')); $end_time = $request->get('end_time',date('Y-m-d'));
@ -57,7 +62,8 @@ class PhoneCenterController extends BaseController
$duration_end = $request->get('duration_end',''); $duration_end = $request->get('duration_end','');
$call_result = $request->get('call_result',''); $call_result = $request->get('call_result','');
$is_called = $request->get('is_called',''); $is_called = $request->get('is_called','');
$page = $request->get('page',0); $offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$company_type = $request->get('company_type',0);//0显示全部,1只显示江西,2只显示湖北 $company_type = $request->get('company_type',0);//0显示全部,1只显示江西,2只显示湖北
@ -71,79 +77,62 @@ class PhoneCenterController extends BaseController
->leftJoin('user_t','user_t.id=network_phone_t.user_id') ->leftJoin('user_t','user_t.id=network_phone_t.user_id')
->where('user_t.is_delete=0 and user_t.is_leave=0'); ->where('user_t.is_delete=0 and user_t.is_leave=0');
if($company_type == 3){ if($company_type == 3){
$query = $query->andWhere('user_t.id="'.$this->my->id.'"'); $query->andWhere('user_t.id="'.$this->my->id.'"');
} }
if($begin_time != ''){ if($begin_time != ''){
$query = $query->andWhere('network_phone_t.begin_date>="'.$begin_time.'"'); $query->andWhere('network_phone_t.begin_date>="'.$begin_time.'"');
} }
if($end_time != ''){ if($end_time != ''){
$query = $query->andWhere('network_phone_t.begin_date<="'.$end_time.'"'); $query->andWhere('network_phone_t.begin_date<="'.$end_time.'"');
} }
if($caller != ''){ if($caller != ''){
$query = $query->andWhere('network_phone_t.caller='.$caller); $query->andWhere('network_phone_t.caller='.$caller);
} }
if($called != ''){ if($called != ''){
$query = $query->andWhere('network_phone_t.called='.$called); $query->andWhere('network_phone_t.called='.$called);
} }
if($duration_begin != ''){ if($duration_begin != ''){
$query = $query->andWhere('network_phone_t.call_duration>='.$duration_begin); $query->andWhere('network_phone_t.call_duration>='.$duration_begin);
} }
if($duration_end != ''){ if($duration_end != ''){
$query = $query->andWhere('network_phone_t.call_duration<='.$duration_end); $query->andWhere('network_phone_t.call_duration<='.$duration_end);
} }
if($call_result != ''){ if($call_result != ''){
$query = $query->andWhere('network_phone_t.call_result="'.$call_result.'"'); $query->andWhere('network_phone_t.call_result="'.$call_result.'"');
} }
if($is_called == 1){ if($is_called == 1){
$query = $query->andWhere('network_phone_t.is_called=1'); $query->andWhere('network_phone_t.is_called=1');
}elseif ($is_called ==2){ }elseif ($is_called ==2){
$query = $query->andWhere('network_phone_t.is_called=0 or network_phone_t.is_called is null'); $query->andWhere('network_phone_t.is_called=0 or network_phone_t.is_called is null');
} }
if($username != ''){ if($username != ''){
$query = $query->andWhere('user_t.username="'.$username.'"'); $query->andWhere('user_t.username="'.$username.'"');
} }
if($company_id > 0) { if($company_id > 0) {
$query = $query->andWhere('user_t.company_id='.$company_id); $query->andWhere('user_t.company_id='.$company_id);
} }
$company_items = CompanyT::find()->all();
$total = $query->count(); $total = $query->count();
$pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]); $query->offset($offset)->limit($limit);
$pagination->setPage($page-1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$page_info = MyLib::getPageInfo($pagination);
$record_items = $query->orderBy('network_phone_t.id desc') $record_items = $query->orderBy('network_phone_t.id desc')
->all(); ->all();
return $this->render('call-records',[ $data = [];
'record_items' => $record_items, $data['total'] = $total;
'begin_time' => $begin_time, $data['rows'] = [];
'end_time' => $end_time, foreach($record_items as $item) {
'is_called' => $is_called, $row = $item->toArray();
$row['username'] = $item->user ? $item->user->getShowName():'';
'username' => $username, $row['call_duration'] = MyLib::HMSByTime($item->call_duration);
'caller' => $caller, $row['call_result'] = MyLib::phoneCenterStatus($item->call_result);
'called' => $called, $data['rows'][] = $row;
'duration_begin' => $duration_begin, }
'duration_end' => $duration_end,
'call_result' => $call_result, return $data;
'page_info' => $page_info,
'company_items'=>$company_items,
'company_type'=>$company_type
]);
} }
public function actionDownloadFile(){ public function actionDownloadFile(){
@ -237,33 +226,66 @@ public function actionDownload(){
} }
public function actionAssignPhone(){ public function actionAssignPhone(){
$user_items = UserT::find()->orderBy('username')->all(); return $this->render('assign-phone');
}
public function actionAssignPhoneJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$offset = $request->get('offset',0);
$limit = $request->get('limit', 10);
$phone_items = NetworkPhoneAssignT::find() $user_items = UserT::find()->orderBy('username')->all();
->leftJoin('user_t','user_t.id=network_phone_assign_t.user_id')
->orderBy('user_t.username')
->all();
return $this->render('assign-phone',[ $phone_items = NetworkPhoneAssignT::find()
'user_items' => $user_items, ->leftJoin('user_t','user_t.id=network_phone_assign_t.user_id')
'phone_items' => $phone_items ->orderBy('user_t.username')
]); ->all();
}
$data = [];
$data['total'] = count($phone_items);
$data['rows'] = [];
foreach($phone_items as $item) {
$row = $item->toArray();
$row['username'] = $item->user->getShowName();
$data['rows'][] = $row;
}
return $data;
}
public function actionSubIndex(){ public function actionSubIndex(){
$request = Yii::$app->request; $request = Yii::$app->request;
$id = $request->get('id',0); $id = $request->get('phone_id',0);
$assign_info = NetworkPhoneAssignT::findOne($id); $assign_info = NetworkPhoneAssignT::findOne($id);
$sub_items = NetworkPhoneSubT::find()->where('assign_id='.$assign_info->id)->all();
return $this->render('sub-index',[ return $this->render('sub-index',[
'assign_info' => $assign_info, 'assign_info' => $assign_info
'sub_items' => $sub_items
]); ]);
} }
public function actionSubIndexJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$id = $request->get('phone_id',0);
$offset = $request->get('offset', 0);
$limit = $request->get('limit', 10);
$assign_info = NetworkPhoneAssignT::findOne($id);
$sub_items = NetworkPhoneSubT::find()->where('assign_id='.$assign_info->id)->all();
$data = [];
$data['total'] = count($sub_items);
$data['rows'] = [];
foreach($sub_items as $item) {
$row = $item->toArray();
$data['rows'][] = $row;
}
return $data;
}
public function actionEdit() public function actionEdit()
{ {
@ -328,16 +350,18 @@ public function actionAssignPhone(){
} }
$row->user_id = $user_id; $row->user_id = $user_id;
$row->phone = $phone; $row->phone = $phone;
$row->save(); if(!$row->save()) {
throw new \Exception(print_r($row->getErrors(), true));
}
$tran->commit(); $tran->commit();
$result['success'] = true;
$result['msg'] = '保存成功';
} catch(\Exception $e) { } catch(\Exception $e) {
$tran->rollBack(); $tran->rollBack();
throw $e; $result['msg'] = $e->getMessage();
} }
$result['success'] = true;
$result['msg'] = '保存成功';
} }
return $result; return $result;
} }
@ -485,9 +509,11 @@ public function actionAssignPhone(){
return $result; return $result;
} }
public function actionUsercallIndex() {
public function actionUsercallIndex(){ return $this->render('usercall-index');
}
public function actionUsercallIndexJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
set_time_limit(0); set_time_limit(0);
ini_set('memory_limit', '3072M'); ini_set('memory_limit', '3072M');
@ -497,8 +523,8 @@ public function actionAssignPhone(){
$caller = $request->get('caller',''); $caller = $request->get('caller','');
$company_id = $request->get('company_id',0); $company_id = $request->get('company_id',0);
$company_type = $request->get('company_type',0);//0显示全部,1只显示江西,2只显示湖北,3只显示个人 $company_type = $request->get('company_type',0);//0显示全部,1只显示江西,2只显示湖北,3只显示个人
$offset = $request->get('offset', 0);
$page = $request->get('page', 1); $limit = $request->get('limit', 10);
$user_id = 0; $user_id = 0;
@ -513,17 +539,17 @@ public function actionAssignPhone(){
if($company_type == 3){ if($company_type == 3){
$query = $query->andWhere('user_t.id="'.$this->my->id.'"'); $query->andWhere('user_t.id="'.$this->my->id.'"');
} }
if($caller != ''){ if($caller != ''){
$query = $query->andWhere('user_t.username="'.$caller.'"'); $query->andWhere('user_t.username="'.$caller.'"');
} }
if($company_id > 0) { if($company_id > 0) {
$query = $query->andWhere('user_t.company_id='.$company_id); $query->andWhere('user_t.company_id='.$company_id);
} }
$query = $query->andWhere('user_t.is_delete=0 and user_t.is_leave=0')->orderBy('user_t.username'); $query->andWhere('user_t.is_delete=0 and user_t.is_leave=0')->orderBy('user_t.username');
if($caller != ''){ if($caller != ''){
$query1 = clone $query; $query1 = clone $query;
@ -545,28 +571,19 @@ public function actionAssignPhone(){
// dd($items); // dd($items);
// die; // die;
$pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]); $query = $query->offset($offset)->limit($limit);
$pagination->setPage($page - 1);
$query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all(); $items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
$company_items = CompanyT::find()->all(); $data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$data['rows'][] = $row;
}
return $this->render('usercall-index',[ return $data;
'items' => $items,
'begin_date' => $begin_date,
'end_date' => $end_date,
'caller' => $caller,
'company_items'=>$company_items,
'company_id'=>$company_id,
'company_type'=>$company_type,
'page_info'=>$page_info,
'page'=>$page,
'user_id'=>$user_id
]);
} }
public function actionUsercallIndexbak(){ public function actionUsercallIndexbak(){

@ -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'); ?>

@ -2,7 +2,6 @@
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<?php $this->beginBlock('header_css'); ?> <?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight"> <div class="wrapper wrapper-content animated fadeInRight">

@ -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>&nbsp;</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=" 提交 "/>
&nbsp;&nbsp;
<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=" 提交 "/>
&nbsp;&nbsp;
<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">&nbsp;</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?>&nbsp;&nbsp;[<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(); ?>

@ -1,340 +1,112 @@
<html> <?php
<meta charset="UTF-8"/> use \common\libs\MyLib;
<head> ?>
<title>卡尔话机WebSocket测试页</title> <?php $this->beginBlock('header_css'); ?>
</head> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<body onLoad="wsInit()"> <?php $this->endBlock(); ?>
<h1>卡尔话机WebSocket测试页</h1><h2>请使用支持webSocket的浏览器</h2>
输入server的ip和port,例如:ws://127.0.0.1:8800/<br/> <div class="wrapper wrapper-content animated fadeInRight">
<input id="serverInfo" type="text" value="ws://127.0.0.1:8800/" size="40"/>&nbsp;&nbsp; <div class="ibox float-e-margins">
<input type="button" id="btn" value="重新连接" onClick="wsInit('reConn')" /> <div class="ibox-title">
<br> <h5>通话记录</h5>
<div id="txt-e" style=" color: red; font-size: 18px; display: none;"></div> <div class="ibox-tools">
<div id="txt-ok" style=" color: green; font-size: 18px; display: none;"></div> <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<p> <i class="fa fa-refresh"></i> 刷新
发送报文:<input id="sendMsg" type="text" value='{"cmd":"LINK"}' style="width: 500px;"> </a>
<br><br> </div>
接收报文: </div>
<div class="ibox-content">
<textarea style="width:500px;"id="recMsg" name="" cols="" rows="10"></textarea></p> <form role="form" class="form-inline" onsubmit="return search();">
<p><input type="button" onClick="sendMsg('link')" value="发起link连接"></p> <div class="form-group" style="margin-bottom: 8px;">
<p><input type="button" onClick="sendMsg('ATD')" value="拨号"> <label for="username">坐席人员</label>
<span style="border:2px solid #6C3;font-size:12px; color:#1a1a1a; margin-left:10px;padding:5px"> <input type="text" id="caller" name="caller" class="form-control">
<label><input type="radio" name="sendhaoma" value="1" checked="true">隐藏号码</label> </div>
<label><input type="radio" name="sendhaoma" value="0" >显示号码</label> <div class="form-group" style="margin-bottom: 8px;">
</span> <label for="datepicker">通话时间</label>
<input type="tel" id="tel" value="10010" style="margin-left:10px;"/> <div class="input-group" id="datepicker">
</p> <input type="text" class="form-control" id="begin_date" name="begin_date" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<p><input type="button" onClick="sendMsg('ATH')" value="挂断"></p> <input type="text" class="form-control" id="end_date" name="end_date" value="" autocomplete="off" />
<p><input type="button" onClick="sendMsg('ATA')" value="接听"></p> </div>
<p><input type="button" onClick="sendMsg('READIMEI')" value="读取话机imei"></p> </div>
<p><input type="button" onClick="sendMsg('READVER')" value="读取话机版本号"></p> <button type="submit" class="btn btn-primary">搜索</button>
<p><input type="button" onClick="sendMsg('startrecord')" value="开启录音"></p> </form>
<p><input type="button" onClick="sendMsg('stoprecord')" value="停止录音"></p> <div class="row">
<p><input type="button" onClick="sendMsg('READSTATUS')" value="查询话机状态"><span style="font-size:12px; color:#333; margin-left:10px">备注:status:0挂机,1来电,2呼叫,3接通 <div class="col-md-12">
挂机状态时,number号码为空。</span></p> <table id="listTable">
<p><input type="button" onClick="sendMsg('HIDENUMBER')" value="隐藏或显示号码"> <thead>
<span style="border:2px solid #6C6;font-size:12px; color:#1a1a1a; margin-left:10px; padding:5px"> <tr>
<label><input type="radio" name="laidian" value="0" >来电</label> <label><input type="radio" name="laidian" value="1" >去电</label> <th data-field="id">ID</th>
</span> <th data-field="username">工号</th>
<span style="border:2px solid #6C3;font-size:12px; color:#1a1a1a; margin-left:10px;padding:5px"> <th data-field="name">姓名</th>
<label><input type="radio" name="haoma" value="1" >隐藏号码</label> <th data-field="total_call_num">通话数量</th>
<label><input type="radio" name="haoma" value="0" >显示号码</label> <th data-field="total_call_time_out">呼出时长</th>
</span> <th data-field="total_call_time">通话时长</th>
</p> <th data-field="call_in_total_num">呼入次数</th>
<p><input type="button" onClick="sendMsg('GETNUMBERHIDEN')" value="读取话机号码隐藏状态"> <th data-field="call_in_suc_num">成功呼入</th>
<span style="border:2px solid #6C6;font-size:12px; color:#1a1a1a; margin-left:10px; padding:5px"> <th data-field="call_in_suc_num_rate">呼入接通率</th>
<label><input name="duqvhj" type="radio" value="0" checked >来电</label> <th data-field="call_out_total_num">呼出次数</th>
<label><input type="radio" name="duqvhj" value="1">去电</label> <th data-field="call_out_suc_num">成功呼出</th>
</span> <th data-field="call_out_suc_num_rate">呼出接通率</th>
</p> <th data-field="phone_status">通话状态</th>
<p><input type="button" onClick="sendMsg('SETRECORDVOICE')" value="设置录音音量"> </tr>
<input type="voice" id="voice" value=""/><span style="font-size:12px; color:#333; margin-left:10px">备注:声音范围 1~100。</span> </thead>
</p> </table>
<p><input type="button" onClick="sendMsg('SETMODE')" value="设置话机通话模式"> </div>
<span style="border:2px solid #6C6;font-size:12px; color:#1a1a1a; margin-left:10px; padding:5px"> </div>
<label><input name="headsetProfile" type="radio" value="0" checked >关闭耳机模式</label> </div>
<label><input name="headsetProfile" type="radio" value="1">开耳机模式</label> </div>
</span> </div>
</p> <?php $this->beginBlock('footer_js'); ?>
<p><input type="button" onClick="sendMsg('GETMODE')" value="获取话机通话模式"> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<span style="font-size:12px; color:#333; margin-left:10px">备注:0 关闭耳机模式,1 开耳机模式。</span> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
</p> <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>
<p><input type="button" onClick="sendMsg('SETUOC')" value="设置远端播放">
<span style="border:2px solid #6C6;font-size:12px; color:#1a1a1a; margin-left:10px; padding:5px">
<label><input name="headsetProfileRadio" type="radio" value="0" checked >关闭远端播放</label>
<label><input name="headsetProfileRadio" type="radio" value="1">开启远端播放</label>
</span>
</p>
<p><input type="button" onClick="sendMsg('GETUOC')" value="获取远端播放">
<span style="font-size:12px; color:#333; margin-left:10px">备注:0 关闭远端播放,1 开启远端播放。</span>
</p>
<p>
<input type="button" onClick="sendMsg('UPPARAM')" value="设置通话记录传平台的参数">
<span style="font-size:12px; color:#1a1a1a; margin-left:10px; padding:5px">
url:<input type="upparamurl" id="upparamurl" value="http://apis.7moor.com/sim/cdr_ytx/insertCdr/" style="margin-left:10px;"/>
坐席工号:<input type="agent" id="agent" value="100001" style="margin-left:10px;"/>
计费账号:<input type="company" id="company" value="psytest" style="margin-left:10px;"/>
本机号码:<input type="thismobile" id="thismobile" value="13212345678" style="margin-left:10px;"/>
</span>
</p>
</body>
<script> <script>
var ws; function opFormatter(value, row, index) {
function wsInit(val){ var opStr = [];
//重连先关闭 opStr.push('<a href="javascript:void(0);" onclick="play(' + row.record_file_url + ')">');
if(val=='reConn'){ opStr.push('<i class="fa fa-play" title="播放"></i>');
ws.close(); opStr.push('</a>');
}
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;
} return opStr.join(' ');
};
//出现错误
ws.onerror = function(evt){
//console.log(evt);
}
//连接断开
ws.onclose = function(evt){
//console.log(evt)
showResult('error');
}
} else {
// 浏览器不支持 WebSocket
alert("您的浏览器不支持 WebSocket!");
}
} }
function refreshList() {
function showResult(val){ $('#listTable').bootstrapTable('refresh');
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="block";
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="block";
}
}
function reConn(){
ws = new WebSocket(serverInfo);
} }
function sendMsg(val){
// Web Socket 已连接上,使用 send() 方法发送数据
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"){ function search() {
val = '{"cmd":"LINK"}'; $('#listTable').bootstrapTable('destroy');
} $('#listTable').bootstrapTable({
/*if(val=="USB"){ url: "/phone-center/usercall-index-json",
val = '{"cmd":"USB","connected":"true","success":"true","message":"成功"}'; pagination: true,
}*/ sidePagination: 'server',
if(val=="ATD"){ queryParams: function(params) {
function getRadioLValue(haoma){ params.username = $('#username').val();
var obj = document.getElementsByName(haoma); params.begin_time = $('#begin_time').val();
for(i = 0;i<obj.length;i++){ params.end_time = $('#end_time').val();
if(obj[i].checked){ params.caller = $('#caller').val();
return obj[i].value; params.called = $('#called').val();
} params.call_result = $('#call_result').val();
} params.duration_begin = $('#duration_begin').val();
return "undefined"; params.duration_end = $('#duration_end').val();
params.is_called = $('#is_called').val();
return params;
} }
});
return false;
var sendhaoma = getRadioLValue("sendhaoma");
var number = document.getElementById("tel").value;
val = '{"cmd":"ATD","number":"'+number+'","hidden":"'+sendhaoma+'"}';
}
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("数据已发送");
} }
$(function() {
search();
laydate({
elem:'#begin_date',
format: 'YYYY-MM-DD'
});
laydate({
elem:'#end_date',
format: 'YYYY-MM-DD'
});
});
</script> </script>
</html> <?php $this->endBlock(); ?>

Loading…
Cancel
Save