//代办搜索 $(".db").click(function() { initTable() }) //导出 $('.export').click(function() { var params = dataParam() params.isdc = 1; exportFileFun(apiUrl, params) }) $("#workorderlist").on("click-row.bs.table", function(e, row, ele) { $('.success').removeClass('success'); //去除之前选中的行的,选中样式 $(ele).addClass('success'); //添加当前选中的 success样式用于区别 }); function initTable() { $.ajax({ url: huayi.config.callcenter_url + apiUrl, type: 'get', data: dataParam(), dataType: "json", async: true, success: function(data) { if(data.data && data.data.length > 0) { columnsArray = [] var result = data.data[0] var key = Object.keys(result) for(var i = 0; i < key.length; i++) { var title = key[i]; var obj = { title: title, align: 'center', field: title //这里循环时field是bean的属性,动态数据加载,这里是个坑 我的bean是两层嵌套的,得按列数来查里面一层的beanList的第几个。这里这样写达不到效果,是个大坑 } if(columnsWidth) { obj.width = columnsWidth } columnsArray.push(obj); } } else { columnsArray = [] data.data = [] } $('#workorderlist').bootstrapTable('destroy'); $('#workorderlist').bootstrapTable({ columns: columnsArray, data: data.data }); } }); } // 导出列表 function exportFileFun(api, params) { var url = huayi.config.callcenter_url + api; if(typeof(params) !== "object") { return } // 分页为空 Object.keys(params).forEach(function(key, index) { if(index === 0) { url += `?${key}=${params[key]}` } else { url += `&${key}=${params[key]}` } }) window.location.href = url; } function selectMultiple(obj) { var maindeptId = ""; var maindeptId_ = obj.val(); //坐席 if(maindeptId_ != null) { $(maindeptId_).each(function(i, n) { var obj2 = ''; obj2 = n + ","; maindeptId += obj2; }) maindeptId = maindeptId.substring(0, maindeptId.length - 1) } else { maindeptId = "" } return maindeptId } //来源 function LY(obj) { obj.empty(); obj.append( '' ); $.getJSON( huayi.config.callcenter_url + "Dictionary/GetDicValueListById", { token: $.cookie("token"), id: 1, }, function(data) { if(data.state.toLowerCase() == "success") { var content = data.data; $(content).each(function(i, n) { $( "" ).appendTo(obj); }); } } ); } ///坐席 function ZX(obj) { obj.empty(); $.getJSON( huayi.config.callcenter_url + "UserAccount/GetSeatList", { token: $.cookie("token"), }, function(data) { if(data.state.toLowerCase() == "success") { var content = data.data; $( "" ).appendTo(obj); $(content).each(function(i, n) { $( "" ).appendTo(obj); }); obj.selectpicker({ noneSelectedText: "请选择", //默认显示内容 }); obj.selectpicker("refresh"); } } ); } //下拉框开始 $(".Closed").click(function() { $(".ckxq").addClass("Hidens"); }); /*tree下拉框效果*/ $(".inpBox .tree").click(function() { if($(this).parent().find(".addTree").is(":hidden")) { $(this).parent().find(".addTree").show(); } else { $(this).parent().find(".addTree").hide(); } }); /*普通下拉框效果*/ $(".inpBox .select").click(function() { if($(this).parent().find(".xl_common").is(":hidden")) { $(this).parent().find(".xl_common").show(); } else { $(this).parent().find(".xl_common").hide(); } }); $(".xl").click(function() { if($(this).parent().find(".addTree").is(":hidden")) { $(this).parent().find(".addTree").show(); } else { $(this).parent().find(".addTree").hide(); } if($(this).parent().find(".xl_common").is(":hidden")) { $(this).parent().find(".xl_common").show(); } else { $(this).parent().find(".xl_common").hide(); } }); $(".inpBox").mouseleave(function() { $(this).children(".addTree").hide(); $(this).children(".xl_common").hide(); }) $(".xl_box").on("click", "li", function() { var obj = $(this).parent().parent().parent(); obj.find("input").eq(0).val($(this).text()); obj.find("input").eq(1).val($(this).attr("itemid")); obj.find(".xl_common").hide(); }) // 承办单位搜索 $(".inps").bind("input propertychange", function() { $(".xlAdd").css("display", "none"); $(".selDpart1").css("display", "block"); if($(".inps").val() == "") { $(".selDpart1").css("display", "none"); return; } var debounceDepart = debounce(depart, 500); debounceDepart($(".inps").val()); }); $("#reflectCategoryList").on("click", "li", function() { $(".reflectCategoryList-wrapper").hide(); $("#reflectCategory").val($(this).attr("indexName")); $("#keyid").val($(this).attr("index")); }); $("#sponsor").on("click", "li", function() { $(".selDpart1").css("display", "none"); $(".inps").val($(this).html()); $("#PID").val($(this).attr("index")); $("#Dpment").val($(this).attr("index")); $(".Cleans").show(); console.log($("#PID").val()) }); ///部门 function depart(dept) { $("#sponsor").empty(); $.getJSON( huayi.config.callcenter_url + "Department/GetDeptList", { token: $.cookie("token"), iscbdw:iscbdw, deptname: dept, }, function(data) { if(data.state.toLowerCase() == "success") { var content = data.data; console.log(content) $(content).each(function(i, n) { $( "