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

dev
曾超新 5 years ago
parent 92f9340b2b
commit 22c26ef453
  1. 4
      frontend/controllers/CommonController.php
  2. 191
      frontend/controllers/PhoneCenterController.php
  3. 335
      frontend/views/common/call-phone.php
  4. 1
      frontend/views/common/update-pwd.php
  5. 164
      frontend/views/phone-center/assign-phone.php
  6. 308
      frontend/views/phone-center/call-records.php
  7. 104
      frontend/views/phone-center/edit.php
  8. 91
      frontend/views/phone-center/sub-edit.php
  9. 182
      frontend/views/phone-center/sub-index.php
  10. 448
      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,7 +226,16 @@ public function actionDownload(){
} }
public function actionAssignPhone(){ public function actionAssignPhone(){
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);
$user_items = UserT::find()->orderBy('username')->all(); $user_items = UserT::find()->orderBy('username')->all();
$phone_items = NetworkPhoneAssignT::find() $phone_items = NetworkPhoneAssignT::find()
@ -245,25 +243,49 @@ public function actionAssignPhone(){
->orderBy('user_t.username') ->orderBy('user_t.username')
->all(); ->all();
return $this->render('assign-phone',[ $data = [];
'user_items' => $user_items, $data['total'] = count($phone_items);
'phone_items' => $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();
} catch(\Exception $e) {
$tran->rollBack();
throw $e;
} }
$tran->commit();
$result['success'] = true; $result['success'] = true;
$result['msg'] = '保存成功'; $result['msg'] = '保存成功';
} catch(\Exception $e) {
$tran->rollBack();
$result['msg'] = $e->getMessage();
}
} }
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 + ')">');
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) { 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');
}, 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(){ $(function() {
$('#add-btn').click(function(){ search();
edit(0);
});
}); });
</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,104 +1,47 @@
<?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;
}
function del(id) {
if(confirm('是否确认删除?')) {
$.post('/fix-project/delete',{id:id},function(obj){
if(obj.success) {
window.location.reload();
} else {
alert(obj.msg);
}
},'json');
}
}
$(function(){
$('#add-btn').click(function(){
edit(0);
});
$("#search-btn").click(function(){
var params = $('#searchForm').serialize();
window.location.href = "/phone-center/call-records?" + params;
});
$('.exitDialog').Dialog({
title:'预约',
autoOpen: false,
width:400,
height:250
});
$('.exit').click(function(){
$('.exitDialog').Dialog('open');
var url = $(this).attr('record_url');
$("#play_url").attr('src',url);
});
$('.exitDialog input[type=button]').click(function(e) {
if($(this).hasClass('normal')){
}
});
});
</script>
<table style="width:98%;" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<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="">请选择</option>
<option value="ANSWERED" <?= $call_result == 'ANSWERED'? 'selected':''?> >通话成功</option> <option value="ANSWERED">通话成功</option>
<option value="BUSY">被叫忙</option> <option value="BUSY">被叫忙</option>
<option value="NO_ANSWER">被叫无应答</option> <option value="NO_ANSWER">被叫无应答</option>
<option value="REJECT">被叫拒接</option> <option value="REJECT">被叫拒接</option>
@ -115,66 +58,123 @@ use \common\libs\MyLib;
<option value="CALL_FORWARD">呼叫转移</option> <option value="CALL_FORWARD">呼叫转移</option>
<option value="OTHER">其他失败情形</option> <option value="OTHER">其他失败情形</option>
</select> </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;" >截止 </div>
(秒为单位) <div class="form-group" style="margin-bottom: 8px;">
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> <label for="duration">通话时长</label>
</td> <div class="input-group" id="duration">
</tr> <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> </form>
</table> <div class="row">
<table width="98%" align="center" cellpadding="3" cellspacing="1" class="table"> <div class="col-md-12">
<table id="listTable">
<thead>
<tr> <tr>
<td width="" align="center" class="bg_tr">序号</td> <th data-field="id">ID</th>
<td width="" align="center" class="bg_tr">坐席人员</td> <th data-field="username">坐席人员</th>
<td width="" align="center" class="bg_tr">通话时间</td> <th data-field="begin_time">通话时间</th>
<td width="" align="center" class="bg_tr">主叫真实号码</td> <th data-field="caller">主叫真实号码</th>
<td width="" align="center" class="bg_tr">被叫真实号码</td> <th data-field="called">被叫真实号码</th>
<td width="" align="center" class="bg_tr">主叫分配号码</td> <th data-field="caller_show">主叫分配号码</th>
<td width="" align="center" class="bg_tr">被叫分配号码</td> <th data-field="called_show">被叫分配号码</th>
<td width="" align="center" class="bg_tr">通话时长</td> <th data-field="call_duration">通话时长</th>
<td width="" align="center" class="bg_tr">通话状态</td> <th data-field="call_result">通话状态</th>
<td width="" align="center" class="bg_tr">语音</td> <th data-formatter="opFormatter">语音</th>
</tr> </tr>
<form id="theFrm"> </thead>
<?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> </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 play(url) {
var body = '<audio controls>';
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>';
parent.layer.open({
type: 1,
skin: 'layui-layer-rim', //加上边框
area: ['320px', '130px'], //宽高
title: '播放语音',
content: body
});
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
<div class="exitDialog"> function search() {
<table style="width:98%; margin-top: 10px; "> $('#listTable').bootstrapTable('destroy');
<tr> $('#listTable').bootstrapTable({
<td>&nbsp;</td> url: "/phone-center/call-records-json",
</tr> pagination: true,
<tr> sidePagination: 'server',
<td> queryParams: function(params) {
<audio id="play_url" src="" controls="controls"></audio> params.username = $('#username').val();
</td> params.begin_time = $('#begin_time').val();
</tr> params.end_time = $('#end_time').val();
params.caller = $('#caller').val();
params.called = $('#called').val();
</table> 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;
}
</div> $(function() {
search();
laydate({
elem:'#begin_time',
format: 'YYYY-MM-DD hh:mm:ss',
istime: true
});
laydate({
elem:'#end_time',
format: 'YYYY-MM-DD hh:mm:ss',
istime: true
});
});
</script>
<?php $this->endBlock(); ?>

@ -1,13 +1,23 @@
<?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(); ?>
<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="<?=$info->id?>"> <input type="hidden" name="id" value="<?=$info->id?>">
<tr> <div class="form-group">
<td width="20%" height="25" class="td_bg">人员名称</td> <label class="col-md-1 control-label">人员名称</label>
<td width="80%" height="25" class="td_bg"> <div class="col-md-6">
<select name="user_id"> <select name="user_id" id="user_id" class="form-control">
<?php <?php
echo '<option value="0">请选择</option>'; echo '<option value="0">请选择</option>';
@ -19,59 +29,51 @@ use \common\libs\MyLib;
} }
?> ?>
</select> </select>
</td> </div>
</tr> </div>
<tr> <div class="form-group">
<td width="20%" height="25" class="td_bg">电话号码</td> <label class="col-md-1 control-label">电话号码</label>
<td width="80%" height="25" class="td_bg"><input name="phone" type="text" id="phone" value="<?=$info->phone?>" size="40" /></td> <div class="col-md-6">
</tr> <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> </form>
<tr> </div>
<td height="22" colspan="2" align="center" class="td_bg"> </div>
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> </div>
&nbsp;&nbsp; </div>
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> </div>
</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 type="text/javascript" language="javascript">
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>
<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/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>
<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>
</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> </form>
<tr> </div>
<td height="22" colspan="4" align="center" class="td_bg"> </div>
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> </div>
&nbsp;&nbsp; </div>
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> </div>
</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>
<?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/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>
<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> <tr>
<td height="22" colspan="3" align="center" class="td_bg" > <th data-field="id">ID</th>
<th data-field="phone">电话号码</th>
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> <th data-formatter="opFormatter">操作</th>
</td>
</tr> </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 > <?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>');
<link rel="stylesheet" href="../Myfile/css/font.css?v=20190611"> opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
<link rel="stylesheet" href="../Myfile/css/xadmin.css?v=20190605"> opStr.push('<i class="fa fa-trash" title="删除"></i>');
<link rel="stylesheet" href="../Myfile/css/theme274.min.css?v=20190605"> opStr.push('</a>');
<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) { return opStr.join(' ');
window.location.href = '/phone-center/sub-edit?id=' + id + '&assign_id=' + assign_id;
} }
function del(id,assign_id) { function create() {
if(confirm('是否确认删除?')) { title = '新增小号';
$.post('/phone-center/sub-delete',{id:id},function(obj){ layer_show(title, '/phone-center/sub-edit?assign_id=<?=$assign_info-id?>');
if(obj.success) {
window.location.reload();
} else {
alert(obj.msg);
} }
function link(id) {
$.get('/phone/ax-init',{id:id,assign_id:<?=$assign_info-id?>},function(obj){
parent.layer.msg(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 add(id) { function refreshList() {
window.location.href = '/phone-center/sub-edit?assign_id=' + id; $('#listTable').bootstrapTable('refresh');
} }
function link(id,assign_id) { function search() {
$.get('/phone/ax-init',{id:id,assign_id:assign_id},function(obj){ $('#listTable').bootstrapTable('destroy');
alert(obj.msg); $('#listTable').bootstrapTable({
url: "/phone-center/sub-index-json",
},'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=""; return opStr.join(' ');
document.getElementById("txt-e").innerText=""; }
if("WebSocket" in window) { function refreshList() {
var serverInfo = document.getElementById("serverInfo").value; $('#listTable').bootstrapTable('refresh');
// 打开一个 web socket,全局共用一个 }
ws = new WebSocket(serverInfo);
//console.log("已连接"+serverInfo); function search() {
ws.onopen = function() { $('#listTable').bootstrapTable('destroy');
setTimeout(function(){ $('#listTable').bootstrapTable({
sendMsg('link') url: "/phone-center/usercall-index-json",
},100); pagination: true,
showResult('ok'); sidePagination: 'server',
}; queryParams: function(params) {
ws.onmessage = function(evt) { params.username = $('#username').val();
document.getElementById("recMsg").value=evt.data; params.begin_time = $('#begin_time').val();
var data = JSON.parse(evt.data); params.end_time = $('#end_time').val();
//console.log(data); params.caller = $('#caller').val();
switch(data['cmd']) { params.called = $('#called').val();
// 服务端ping客户端 params.call_result = $('#call_result').val();
case 'USB': params.duration_begin = $('#duration_begin').val();
ws.send('{"cmd":"USB","connected":"true","success":"true","message":"成功"}'); params.duration_end = $('#duration_end').val();
break; params.is_called = $('#is_called').val();
case 'CORG': return params;
ws.send('{"cmd":"CORG","number":"10010","success":"true","message":"成功"}'); }
break; });
case 'CALLING': return false;
ws.send('{"cmd":"CALLING","number":"10010","success":"true","message":"成功"}'); }
break;
case 'CBEGIN': $(function() {
ws.send('{"cmd":"CBEGIN","success":"true","message":"成功"}'); search();
break; laydate({
case 'ALERT': elem:'#begin_date',
ws.send('{"cmd":"ALERT","success":"true","message":"成功"}'); format: 'YYYY-MM-DD'
break; });
case 'CEND': laydate({
ws.send('{"cmd":"CEND","success":"true","message":"成功"}'); elem:'#end_date',
break; format: 'YYYY-MM-DD'
});
} });
};
//出现错误
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="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"){
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 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("数据已发送");
}
</script> </script>
</html> <?php $this->endBlock(); ?>

Loading…
Cancel
Save