| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- var sourceareaObj,exportParam,typeObj,infopropertyObj
- $(function() {
- laydate.skin('blue');
- laydate({
- elem: '#starttime',
- event: 'focus',
- istime: true,
- format: 'YYYY-MM-DD hh:mm:ss'
- });
- laydate({
- elem: '#endtime',
- event: 'focus',
- istime: true,
- format: 'YYYY-MM-DD hh:mm:ss'
- });
-
- laydate({
- elem: '#dealstarttime',
- event: 'focus',
- istime: true,
- format: 'YYYY-MM-DD hh:mm:ss'
- });
- laydate({
- elem: '#dealstrendtime',
- event: 'focus',
- istime: true,
- format: 'YYYY-MM-DD hh:mm:ss'
- });
- sourceareaObj = {
- ele:"#sourceAreas",
- apiUrl:"Area/GetAreaListById",
- data:{
- textKey:'F_AreaName',
- valueKey:'F_AreaId'
- }
- }
- sourceObj = {
- ele:"#source",
- id: 1
- }
- typeObj = {
- ele:"#type",
- id: 2
- }
- phoneTypeObj = {
- ele:"#phoneType",
- id: 2498
- }
- //工单来源
- selectCommonFn(getDicObjFn(sourceObj))
- //电话类别
- selectCommonFn(getDicObjFn(phoneTypeObj))
- //受话坐席
- personSelect($("#ZX"),"ZXLD,MTDD","UserAccount/GetSeatList");
- //审核员
- personSelect($("#yardman"),"ZXLD,MTDD","UserAccount/GetUsersList");
- //受话坐席
- personSelect($("#closeuser"),"ZXLD,MTDD","UserAccount/GetUsersList");
- //精准地域
- selectCommonFn(sourceareaObj)
-
- tree();
- //反应类别
- getReactionCategory();
- //类型
- selectCommonFn(getDicObjFn(typeObj))
- $(".Seach").click(function() {
- load(getParam);
- })
- // 导出文件
- $(".exportFile").click(function() {
-
- exportParam.isdc = 1;
- console.log(exportParam)
- exportFileFun(getLoadParams(urlState).apiUrl, exportParam)
- })
-
- })
- $('.ul_tab li').click(function () {
- $(this).addClass("active").siblings().removeClass("active");
- var index = $(this).index();
- if (getParam.tabSecondText ==='待审转办') {
- getParam.params.issh = index;
- }
- if (getParam.tabSecondText ==='已办待审核'||getParam.tabSecondText ==='已办待回访') {
- getParam.params.db = index;
- }
- load();
- })
- function Close() {
- $(".lyxz").removeClass("cx");
- if ($("audio").length > 0) {
- $("audio")[0].pause();
- }
- }
- // 反映类别搜索
- $("#reflectCategory").bind("input propertychange", function () {
- $(".layui-dropdown").hide();
- $(".CleansReactionCategory").show();
- if ($("#reflectCategory").val() == "") {
- $(".reflectCategoryList-wrapper").hide();
- return;
- }
- $(".reflectCategoryList-wrapper").show();
- var debounceGetSearchReactionCategory = debounce(
- getSearchReactionCategory,
- 500
- );
- debounceGetSearchReactionCategory($("#reflectCategory").val());
- });
- // 反映类别搜索结束
- //承办单位下拉事件开始
- $(".inps").focus(function() {
- $(".xlAdd").css("display", "block");
- });
- $(".xl").click(function() {
- if($(".xlAdd").css("display") == "block") {
- $(".xlAdd").css("display", "none");
- } else {
- $(".xlAdd").css("display", "block");
- }
- });
- $(".addTree").mouseleave(function() {
- $(this).css("display", "none");
- });
- //清除
- $(".Cleans ").click(function() {
- $(".inps").val("");
- $("#PID").val("");
- $("#Dpment").val("");
- });
- //承办单位下拉事件结束
- //树形下拉开始
- function tree() {
- $.get(
- huayi.config.callcenter_url + "Department/GetDeptList", {
- token: $.cookie("token"),
- },
- function(result) {
- result = $.parseJSON(result);
- $.fn.zTree.init( $("#addTreeDemo"),setting1, result.data); //实例化树形图
- }
- );
- }
- var setting1 = {
- data: {
- key: {
- name: "F_DeptName",
- },
- simpleData: {
- enable: true,
- idKey: "F_DeptId",
- pIdKey: "F_PartentId",
- rootPId: 0,
- },
- },
- callback: {
- onClick: zTreeOnClick,
- },
- };
- function zTreeOnClick(event, treeId, treeNode) {
- if(treeNode.level >= 1) {
- $(".inps").val(treeNode.F_DeptName);
- $("#PID").val(treeNode.F_DeptId);
- $(".Cleans").show();
- }
- }
- //树形下拉结束
- // 获取反映类别数据,多级下拉选项
- function getReactionCategory(pid = 38) {
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetZTreeNew",
- {
- token: $.cookie("token"),
- pid: pid,
- },
- function (result) {
- result = $.parseJSON(result);
- var content = JSON.parse(result.data);
- layui.use("dropdown", function () {
- var dropdown = layui.dropdown;
- dropdown.render({
- elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
- data: content,
- id: "reflectCategory",
- isclickparent: true,
- //菜单被点击的事件
- click: function (obj) {
- $("#reflectCategory").val(obj.title);
- $("#keyid").val(obj.id);
- $(".CleansReactionCategory").show();
- },
- });
- });
- }
- );
- }
- // 搜索获取反映类别数据开始
- function getSearchReactionCategory(key) {
- $("#reflectCategoryList").empty();
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetKeyListNew",
- {
- token: $.cookie("token"),
- key: key,
- },
- function (result) {
- result = $.parseJSON(result);
- if (result.state.toLowerCase() === "success") {
- var content = result.data;
- if (content.length > 0) {
- content.forEach(function (e, i) {
- $(
- "<li index='" +
- e.id +
- "' indexName='" +
- e.name +
- "'>" +
- e.names +
- "</li>"
- ).appendTo("#reflectCategoryList");
- });
- } else {
- $("<li index='' indexName=''>没有相关数据</li>").appendTo(
- "#reflectCategoryList"
- );
- }
- }
- }
- );
- }
- // 防抖函数
- function debounce(fun, delay) {
- return function (args) {
- var that = this;
- var _args = args;
- clearTimeout(fun.id);
- fun.id = setTimeout(function () {
- fun.call(that, _args);
- }, delay);
- };
- }
- $(".CleansReactionCategory").click(function () {
- $("#reflectCategory").val("");
- $("#keyid").val("");
- $(".CleansReactionCategory").hide();
- });
- $("#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();
- });
- ///部门
- function depart(dept) {
- $("#sponsor").empty();
- $.getJSON(
- huayi.config.callcenter_url + "Department/GetDeptListByDept",
- {
- token: $.cookie("token"),
- dept: dept,
- },
- function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $(
- "<li index='" +
- n.F_DeptId +
- "'>" +
- n.F_DeptName +
- "</li>"
- ).appendTo("#sponsor");
- });
- }
- }
- );
- }
- // 搜索获取反映类别数据结束
- // 导出列表
- function exportFileFun(api, params) {
- var url = huayi.config.callcenter_url + api;
- if(typeof(params) !== "object") {
- return
- }
- delete params.page
- delete params.pagesize
- delete params.pageindex
- Object.keys(params).forEach(function(key, index) {
-
- if(!params[key]){
- if (params[key] != 0) {
- params[key] = ""
- }
- }
- if (index === 0) {
- url += `?${key}=${params[key]}`
- } else {
- url += `&${key}=${params[key]}`
- }
- })
- console.log(url)
- window.location.href = url;
- }
|