| xqd
@@ -19,7 +19,7 @@
|
|
|
@if(role('User/Threads/addCallList'))
|
|
|
<div class="col-sm-8 pull-right">
|
|
|
<span class="btn btn-primary pull-right fa fa-phone"
|
|
|
- data-toggle="modal"
|
|
|
+ data-toggle="modal"
|
|
|
data-target="#myModal2">添加到电话列表</span>
|
|
|
<span id="export_threads" class="btn btn-success pull-right fa fa-table"
|
|
|
style="display: none">导出到Excel</span>
|
| xqd
@@ -76,21 +76,22 @@
|
|
|
<div class="modal-body">
|
|
|
<div class="ibox float-e-margins">
|
|
|
<div class="ibox-content">
|
|
|
- <select name="ip" class="form-control" id="ip">
|
|
|
- <option value="172.31.20.133">172.31.20.133</option>
|
|
|
- <option value="172.31.20.134">172.31.20.134</option>
|
|
|
- <option value="172.31.20.135">172.31.20.135</option>
|
|
|
- <option value="172.31.20.136">172.31.20.136</option>
|
|
|
- <option value="172.31.20.137">172.31.20.137</option>
|
|
|
- </select>
|
|
|
-
|
|
|
- <div class="form-group">
|
|
|
- <label class="control-label col-sm-3"> </label>
|
|
|
- <div class="col-sm-9">
|
|
|
- <input type="submit" class="btn btn-success" style="margin-right:20px;" id="addCallList">
|
|
|
- <input type="reset" class="btn btn-default">
|
|
|
- </div>
|
|
|
+ <select name="ip" class="form-control" id="ip">
|
|
|
+ <option value="172.31.20.133">172.31.20.133</option>
|
|
|
+ <option value="172.31.20.134">172.31.20.134</option>
|
|
|
+ <option value="172.31.20.135">172.31.20.135</option>
|
|
|
+ <option value="172.31.20.136">172.31.20.136</option>
|
|
|
+ <option value="172.31.20.137">172.31.20.137</option>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="control-label col-sm-3"> </label>
|
|
|
+ <div class="col-sm-9">
|
|
|
+ <input type="submit" class="btn btn-success" style="margin-right:20px;"
|
|
|
+ id="addCallList">
|
|
|
+ <input type="reset" class="btn btn-default">
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
| xqd
@@ -122,19 +123,37 @@
|
|
|
items.each(function () {
|
|
|
saveChecked($(this))
|
|
|
});
|
|
|
- if (isChecked == true) {
|
|
|
+ if (checkedIds.length) {
|
|
|
$('#addCallList').show();
|
|
|
$('#export_threads').show()
|
|
|
} else {
|
|
|
$('#addCallList').hide();
|
|
|
$('#export_threads').hide()
|
|
|
}
|
|
|
- console.log(checkedIds)
|
|
|
});
|
|
|
|
|
|
+ $('body').on('click', '#checkTotal', function () {
|
|
|
+ items = $('.contacts');
|
|
|
+
|
|
|
+ isChecked = $(this).prop('checked')
|
|
|
+ items.prop('checked', isChecked)
|
|
|
+
|
|
|
+ if (isChecked == true) {
|
|
|
+ $('.fa-phone').show()
|
|
|
+ checkedIds = [{{ $allIds }}][0]
|
|
|
+ $('#export_threads').show()
|
|
|
+ $('#checkAll').prop('checked', true)
|
|
|
+ } else {
|
|
|
+ $('.fa-phone').hide()
|
|
|
+ $('#checkAll').prop('checked', false)
|
|
|
+ checkedIds = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
$('body').on('click', '.contacts', function () {
|
|
|
items = $('.contacts');
|
|
|
checkedLength = $('.contacts:checked').length
|
|
|
+
|
|
|
if (checkedLength) {
|
|
|
$('#addCallList').show()
|
|
|
$('#export_threads').show()
|
| xqd
@@ -142,7 +161,9 @@
|
|
|
$('#addCallList').hide()
|
|
|
$('#export_threads').hide()
|
|
|
}
|
|
|
+
|
|
|
if (items.length == checkedLength) {
|
|
|
+ $('#checkAll').prop('checked', true)
|
|
|
$('#addCallList').show()
|
|
|
$('#export_threads').show()
|
|
|
} else {
|
| xqd
@@ -155,7 +176,7 @@
|
|
|
|
|
|
/*保存选中的项*/
|
|
|
function saveChecked(e) {
|
|
|
- if (e.is(":checked")) {
|
|
|
+ if (e.is(":checked") && checkedIds.indexOf(e.data("id"), 0) == -1) {
|
|
|
checkedIds.push(e.data("id"));
|
|
|
} else {
|
|
|
for (var i = 0; i < checkedIds.length; i++) {
|
| xqd
@@ -179,6 +200,11 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ checkedLength = $('.contacts:checked').length
|
|
|
+ if(checkedLength == $boxes.length){
|
|
|
+ $('#checkAll').prop('checked', true)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/*添加选择的电话到拨打列表*/
|
| xqd
@@ -190,7 +216,7 @@
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: '{{ U('User/Threads/addCallList') }}',
|
|
|
- data: {contact_ids: contact_ids, _token: csrf_token,ip:ip},
|
|
|
+ data: {contact_ids: contact_ids, _token: csrf_token, ip: ip},
|
|
|
success: function (data) {
|
|
|
if (data == 200) {
|
|
|
layer.msg('导入成功', {
|