|
|
@@ -186,9 +186,10 @@
|
|
186
|
186
|
</div>
|
|
187
|
187
|
</div>-->
|
|
188
|
188
|
</div>
|
|
189
|
|
- <div class="anniu" style="margin: 20px 0;">
|
|
190
|
|
- <button class="btns search" type="button"><i class="fa fa-search"></i>查询</button>
|
|
191
|
|
- <a class="btns" id="addto"><i class="fa fa-plus"></i>添加</a>
|
|
|
189
|
+ <div class="anniu layui-btn-group demoTable" style="margin: 20px 0;">
|
|
|
190
|
+ <button class="btns search layui-btn" type="button"><i class="fa fa-search"></i>查询</button>
|
|
|
191
|
+ <a class="btns layui-btn" id="addto"><i class="fa fa-plus"></i>添加</a>
|
|
|
192
|
+ <a class="btns layui-btn" id="remove" data-type="getCheckData"><i class="fa fa-remove"></i>批量删除</a>
|
|
192
|
193
|
</div>
|
|
193
|
194
|
<table class="layui-hide" id="table1" lay-filter="demo"></table>
|
|
194
|
195
|
</div>
|
|
|
@@ -202,6 +203,32 @@
|
|
202
|
203
|
<script src="../js/layui/layui.js"></script>
|
|
203
|
204
|
<script src="../js/jquery.form.min.js"></script>
|
|
204
|
205
|
<script>
|
|
|
206
|
+ $.ajax({
|
|
|
207
|
+ type:"get",
|
|
|
208
|
+ url:huayi.config.callcenter_url + 'Customer/GetList',
|
|
|
209
|
+ async:true,
|
|
|
210
|
+ dataType:'json',
|
|
|
211
|
+ data:{
|
|
|
212
|
+ token: token,
|
|
|
213
|
+ },
|
|
|
214
|
+ success:function(res){
|
|
|
215
|
+ searchBar=res.data.search;
|
|
|
216
|
+ //搜索条件
|
|
|
217
|
+ $('.tool').html('');
|
|
|
218
|
+ $(searchBar).each(function(k,q){
|
|
|
219
|
+ if(q.F_Search>0){
|
|
|
220
|
+ $('<div class="searchbox col-sm-2">'+
|
|
|
221
|
+ '<div class="secon">'+
|
|
|
222
|
+ '<b>'+q.F_Name +':</b>'+
|
|
|
223
|
+ '<p class="secl"><input type="text" class="phone" name="'+q.F_DBFieldName+'"/></p>'+
|
|
|
224
|
+ '</div>'+
|
|
|
225
|
+ '</div>').appendTo('.tool')
|
|
|
226
|
+ }
|
|
|
227
|
+ })
|
|
|
228
|
+ }
|
|
|
229
|
+ });
|
|
|
230
|
+
|
|
|
231
|
+
|
|
205
|
232
|
var sear;
|
|
206
|
233
|
var token = $.cookie("token");
|
|
207
|
234
|
|
|
|
@@ -224,33 +251,21 @@
|
|
224
|
251
|
function initTable() {
|
|
225
|
252
|
var colsData = [];
|
|
226
|
253
|
var arrData = [];
|
|
227
|
|
- $.ajax({
|
|
228
|
|
- url: huayi.config.callcenter_url + 'Customer/GetList',
|
|
229
|
|
- type: 'get',
|
|
230
|
|
- data: {
|
|
231
|
|
- token: token,
|
|
232
|
|
- },
|
|
233
|
|
- dataType: "json",
|
|
234
|
|
- async: true,
|
|
235
|
|
- success: function (returnValue) {
|
|
236
|
|
- //异步获取数据
|
|
237
|
|
- if (returnValue.data) {
|
|
|
254
|
+ $(".container-fluid")
|
|
|
255
|
+ .attr("method", "get")
|
|
|
256
|
+ .attr("action", huayi.config.callcenter_url + "Customer/GetSearch")
|
|
|
257
|
+ .attr("enctype", "multipart/form-data");
|
|
|
258
|
+ $(".container-fluid").ajaxSubmit({
|
|
|
259
|
+ dataType: "json",
|
|
|
260
|
+ data: {
|
|
|
261
|
+ token: token
|
|
|
262
|
+ },
|
|
|
263
|
+ success: function(returnValue) {
|
|
|
264
|
+ //debugger;
|
|
|
265
|
+ if(returnValue.state.toLowerCase() == "success") {
|
|
|
266
|
+ //异步获取数据
|
|
238
|
267
|
var theadData = returnValue.data.headlist,
|
|
239
|
|
- resultData1 = returnValue.data.datalist,
|
|
240
|
|
- searchBar=returnValue.data.search;
|
|
241
|
|
- //搜索条件
|
|
242
|
|
- $('.tool').html('');
|
|
243
|
|
- $(searchBar).each(function(k,q){
|
|
244
|
|
- console.log(q.F_Search);
|
|
245
|
|
- if(q.F_Search>0){
|
|
246
|
|
- $('<div class="searchbox col-sm-2">'+
|
|
247
|
|
- '<div class="secon">'+
|
|
248
|
|
- '<b>'+q.F_Name +':</b>'+
|
|
249
|
|
- '<p class="secl"><input type="text" class="phone" name="'+q.F_DBFieldName+'"/></p>'+
|
|
250
|
|
- '</div>'+
|
|
251
|
|
- '</div>').appendTo('.tool')
|
|
252
|
|
- }
|
|
253
|
|
- })
|
|
|
268
|
+ resultData1 = returnValue.data.datalist;
|
|
254
|
269
|
//加载头部
|
|
255
|
270
|
$(theadData).each(function(i,n){
|
|
256
|
271
|
var obj1 = {};
|
|
|
@@ -284,11 +299,11 @@
|
|
284
|
299
|
//,limit: 5 //每页默认显示的数量
|
|
285
|
300
|
});
|
|
286
|
301
|
});
|
|
287
|
|
- } else {
|
|
288
|
|
- //console.log(returnValue.message);
|
|
289
|
|
- }
|
|
290
|
|
- },
|
|
291
|
|
- });
|
|
|
302
|
+
|
|
|
303
|
+ }
|
|
|
304
|
+
|
|
|
305
|
+ }
|
|
|
306
|
+ });
|
|
292
|
307
|
}
|
|
293
|
308
|
layui.use('table', function () {
|
|
294
|
309
|
var table = layui.table;
|
|
|
@@ -332,7 +347,56 @@
|
|
332
|
347
|
// layer.alert('编辑行:<br>'+ JSON.stringify(data))
|
|
333
|
348
|
}
|
|
334
|
349
|
});
|
|
335
|
|
- });
|
|
|
350
|
+
|
|
|
351
|
+
|
|
|
352
|
+
|
|
|
353
|
+
|
|
|
354
|
+ //批量删除
|
|
|
355
|
+ var $ = layui.$, active = {
|
|
|
356
|
+ getCheckData: function(){ //获取选中数据
|
|
|
357
|
+ var checkStatus = table.checkStatus('table1').data;
|
|
|
358
|
+ var arr=[];
|
|
|
359
|
+ $(checkStatus).each(function(k,y){
|
|
|
360
|
+ arr.push(y.id)
|
|
|
361
|
+ })
|
|
|
362
|
+ if(arr.length <=0){
|
|
|
363
|
+ layer.msg('请选择要删除的行!');
|
|
|
364
|
+ }else{
|
|
|
365
|
+ layer.confirm('确定删除吗?', function(index){
|
|
|
366
|
+ $.ajax({
|
|
|
367
|
+ type:"post",
|
|
|
368
|
+ url: huayi.config.callcenter_url + 'Customer/DelCustomer',
|
|
|
369
|
+ async:true,
|
|
|
370
|
+ dataType:'json',
|
|
|
371
|
+ data:{
|
|
|
372
|
+ token: token,
|
|
|
373
|
+ ids:arr
|
|
|
374
|
+ },
|
|
|
375
|
+ success:function(res){
|
|
|
376
|
+ if(res.state.toLowerCase()=='success'){
|
|
|
377
|
+ layer.close(index);
|
|
|
378
|
+ layer.msg('删除成功!');
|
|
|
379
|
+ initTable();
|
|
|
380
|
+ }
|
|
|
381
|
+
|
|
|
382
|
+ }
|
|
|
383
|
+ });
|
|
|
384
|
+ });
|
|
|
385
|
+ }
|
|
|
386
|
+ }
|
|
|
387
|
+
|
|
|
388
|
+ };
|
|
|
389
|
+ $('.demoTable #remove').on('click', function(){
|
|
|
390
|
+ var type = $(this).data('type');
|
|
|
391
|
+ active[type] ? active[type].call(this) : '';
|
|
|
392
|
+ });
|
|
|
393
|
+
|
|
|
394
|
+ });
|
|
|
395
|
+
|
|
|
396
|
+
|
|
|
397
|
+
|
|
|
398
|
+
|
|
|
399
|
+
|
|
336
|
400
|
</script>
|
|
337
|
401
|
</body>
|
|
338
|
402
|
|