| xqd
@@ -18,8 +18,6 @@
|
|
|
<div class="col-sm-8 pull-right">
|
|
|
<span id="addCallList" class="btn btn-primary pull-right fa fa-phone"
|
|
|
style="display: none">添加到电话列表</span>
|
|
|
- <span id="export_call" class="btn btn-success pull-right fa fa-table"
|
|
|
- style="display: none">导出到Excel</span>
|
|
|
</div>
|
|
|
@endif
|
|
|
{{--@if(role('Call/Records/create'))--}}
|
| xqd
@@ -82,38 +80,36 @@
|
|
|
@section('js')
|
|
|
<script type="text/javascript">
|
|
|
/*电话全选功能*/
|
|
|
- var items = $('.contacts');
|
|
|
|
|
|
- $('#checkAll').click(function () {
|
|
|
+ $('body').on('click', '#checkAll', function () {
|
|
|
+ items = $('.contacts');
|
|
|
|
|
|
isChecked = $(this).prop('checked')
|
|
|
items.prop('checked', isChecked)
|
|
|
if (isChecked == true) {
|
|
|
$('#addCallList').show()
|
|
|
- $('#export_call').show()
|
|
|
} else {
|
|
|
$('#addCallList').hide()
|
|
|
- $('#export_call').hide()
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- items.click(function () {
|
|
|
+ $('body').on('click','.contacts',function () {
|
|
|
+ items = $('.contacts');
|
|
|
+
|
|
|
checkedLength = $('.contacts:checked').length
|
|
|
if (checkedLength) {
|
|
|
$('#addCallList').show()
|
|
|
- $('#export_call').show()
|
|
|
} else {
|
|
|
$('#addCallList').hide()
|
|
|
- $('#export_call').hide()
|
|
|
}
|
|
|
if (items.length == checkedLength) {
|
|
|
$('#addCallList').show()
|
|
|
- $('#export_call').show()
|
|
|
} else {
|
|
|
$('#checkAll').prop('checked', false)
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+
|
|
|
/*添加选择的电话到拨打列表*/
|
|
|
$('#addCallList').click(function () {
|
|
|
contact_phones = [];
|
| xqd
@@ -142,31 +138,31 @@
|
|
|
});
|
|
|
|
|
|
/*导出通话纪录到excel*/
|
|
|
- $('#export_call').click(function () {
|
|
|
- call_ids = [];
|
|
|
- csrf_token = "{{ csrf_token() }}";
|
|
|
- $('.contacts:checked').each(function () {
|
|
|
- call_ids.push($(this).val())
|
|
|
- });
|
|
|
-
|
|
|
- $.ajax({
|
|
|
- type: 'post',
|
|
|
- url: '{{ U('Call/Records/export_call') }}',
|
|
|
- data: {call_ids: call_ids, _token: csrf_token},
|
|
|
- success: function (data) {
|
|
|
- if (data == 200) {
|
|
|
- layer.msg('导入成功', {
|
|
|
- icon: 1,
|
|
|
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
|
|
- }, function () {
|
|
|
- window.location.href = window.location.href
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- });
|
|
|
+ {{--$('#export_call').click(function () {--}}
|
|
|
+ {{--call_ids = [];--}}
|
|
|
+ {{--csrf_token = "{{ csrf_token() }}";--}}
|
|
|
+ {{--$('.contacts:checked').each(function () {--}}
|
|
|
+ {{--call_ids.push($(this).val())--}}
|
|
|
+ {{--});--}}
|
|
|
+
|
|
|
+ {{--$.ajax({--}}
|
|
|
+ {{--type: 'post',--}}
|
|
|
+ {{--url: '{{ U('Call/Records/export_call') }}',--}}
|
|
|
+ {{--data: {call_ids: call_ids, _token: csrf_token},--}}
|
|
|
+ {{--success: function (data) {--}}
|
|
|
+ {{--if (data == 200) {--}}
|
|
|
+ {{--layer.msg('导入成功', {--}}
|
|
|
+ {{--icon: 1,--}}
|
|
|
+ {{--time: 2000 //2秒关闭(如果不配置,默认是3秒)--}}
|
|
|
+ {{--}, function () {--}}
|
|
|
+ {{--window.location.href = window.location.href--}}
|
|
|
+ {{--});--}}
|
|
|
+
|
|
|
+ {{--}--}}
|
|
|
+ {{--}--}}
|
|
|
+
|
|
|
+ {{--})--}}
|
|
|
+ {{--});--}}
|
|
|
|
|
|
/*通话纪录筛选*/
|
|
|
function filter_records() {
|