Нет описания

orderListHeader.js 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. var sourceareaObj,exportParam,typeObj,infopropertyObj
  2. $(function() {
  3. laydate.skin('blue');
  4. laydate({
  5. elem: '#starttime',
  6. event: 'focus',
  7. istime: true,
  8. format: 'YYYY-MM-DD hh:mm:ss'
  9. });
  10. laydate({
  11. elem: '#endtime',
  12. event: 'focus',
  13. istime: true,
  14. format: 'YYYY-MM-DD hh:mm:ss'
  15. });
  16. laydate({
  17. elem: '#dealstarttime',
  18. event: 'focus',
  19. istime: true,
  20. format: 'YYYY-MM-DD hh:mm:ss'
  21. });
  22. laydate({
  23. elem: '#dealstrendtime',
  24. event: 'focus',
  25. istime: true,
  26. format: 'YYYY-MM-DD hh:mm:ss'
  27. });
  28. sourceareaObj = {
  29. ele:"#sourceAreas",
  30. apiUrl:"Area/GetAreaListById",
  31. data:{
  32. textKey:'F_AreaName',
  33. valueKey:'F_AreaId'
  34. }
  35. }
  36. sourceObj = {
  37. ele:"#source",
  38. id: 1
  39. }
  40. typeObj = {
  41. ele:"#type",
  42. id: 2
  43. }
  44. phoneTypeObj = {
  45. ele:"#phoneType",
  46. id: 2498
  47. }
  48. //工单来源
  49. selectCommonFn(getDicObjFn(sourceObj))
  50. //电话类别
  51. selectCommonFn(getDicObjFn(phoneTypeObj))
  52. //受话坐席
  53. personSelect($("#ZX"),"ZXLD,MTDD","UserAccount/GetSeatList");
  54. //审核员
  55. personSelect($("#yardman"),"ZXLD,MTDD","UserAccount/GetUsersList");
  56. //受话坐席
  57. personSelect($("#closeuser"),"ZXLD,MTDD","UserAccount/GetUsersList");
  58. //精准地域
  59. selectCommonFn(sourceareaObj)
  60. tree();
  61. //反应类别
  62. getReactionCategory();
  63. //类型
  64. selectCommonFn(getDicObjFn(typeObj))
  65. $(".Seach").click(function() {
  66. load(getParam);
  67. })
  68. // 导出文件
  69. $(".exportFile").click(function() {
  70. exportParam.isdc = 1;
  71. console.log(exportParam)
  72. exportFileFun(getLoadParams(urlState).apiUrl, exportParam)
  73. })
  74. })
  75. $('.ul_tab li').click(function () {
  76. $(this).addClass("active").siblings().removeClass("active");
  77. var index = $(this).index();
  78. if (getParam.tabSecondText ==='待审转办') {
  79. getParam.params.issh = index;
  80. }
  81. if (getParam.tabSecondText ==='已办待审核'||getParam.tabSecondText ==='已办待回访') {
  82. getParam.params.db = index;
  83. }
  84. load();
  85. })
  86. function Close() {
  87. $(".lyxz").removeClass("cx");
  88. if ($("audio").length > 0) {
  89. $("audio")[0].pause();
  90. }
  91. }
  92. // 反映类别搜索
  93. $("#reflectCategory").bind("input propertychange", function () {
  94. $(".layui-dropdown").hide();
  95. $(".CleansReactionCategory").show();
  96. if ($("#reflectCategory").val() == "") {
  97. $(".reflectCategoryList-wrapper").hide();
  98. return;
  99. }
  100. $(".reflectCategoryList-wrapper").show();
  101. var debounceGetSearchReactionCategory = debounce(
  102. getSearchReactionCategory,
  103. 500
  104. );
  105. debounceGetSearchReactionCategory($("#reflectCategory").val());
  106. });
  107. // 反映类别搜索结束
  108. //承办单位下拉事件开始
  109. $(".inps").focus(function() {
  110. $(".xlAdd").css("display", "block");
  111. });
  112. $(".xl").click(function() {
  113. if($(".xlAdd").css("display") == "block") {
  114. $(".xlAdd").css("display", "none");
  115. } else {
  116. $(".xlAdd").css("display", "block");
  117. }
  118. });
  119. $(".addTree").mouseleave(function() {
  120. $(this).css("display", "none");
  121. });
  122. //清除
  123. $(".Cleans ").click(function() {
  124. $(".inps").val("");
  125. $("#PID").val("");
  126. $("#Dpment").val("");
  127. });
  128. //承办单位下拉事件结束
  129. //树形下拉开始
  130. function tree() {
  131. $.get(
  132. huayi.config.callcenter_url + "Department/GetDeptList", {
  133. token: $.cookie("token"),
  134. },
  135. function(result) {
  136. result = $.parseJSON(result);
  137. $.fn.zTree.init( $("#addTreeDemo"),setting1, result.data); //实例化树形图
  138. }
  139. );
  140. }
  141. var setting1 = {
  142. data: {
  143. key: {
  144. name: "F_DeptName",
  145. },
  146. simpleData: {
  147. enable: true,
  148. idKey: "F_DeptId",
  149. pIdKey: "F_PartentId",
  150. rootPId: 0,
  151. },
  152. },
  153. callback: {
  154. onClick: zTreeOnClick,
  155. },
  156. };
  157. function zTreeOnClick(event, treeId, treeNode) {
  158. if(treeNode.level >= 1) {
  159. $(".inps").val(treeNode.F_DeptName);
  160. $("#PID").val(treeNode.F_DeptId);
  161. $(".Cleans").show();
  162. }
  163. }
  164. //树形下拉结束
  165. // 获取反映类别数据,多级下拉选项
  166. function getReactionCategory(pid = 38) {
  167. $.get(
  168. huayi.config.callcenter_url + "Dictionary/GetZTreeNew",
  169. {
  170. token: $.cookie("token"),
  171. pid: pid,
  172. },
  173. function (result) {
  174. result = $.parseJSON(result);
  175. var content = JSON.parse(result.data);
  176. layui.use("dropdown", function () {
  177. var dropdown = layui.dropdown;
  178. dropdown.render({
  179. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  180. data: content,
  181. id: "reflectCategory",
  182. isclickparent: true,
  183. //菜单被点击的事件
  184. click: function (obj) {
  185. $("#reflectCategory").val(obj.title);
  186. $("#keyid").val(obj.id);
  187. $(".CleansReactionCategory").show();
  188. },
  189. });
  190. });
  191. }
  192. );
  193. }
  194. // 搜索获取反映类别数据开始
  195. function getSearchReactionCategory(key) {
  196. $("#reflectCategoryList").empty();
  197. $.get(
  198. huayi.config.callcenter_url + "Dictionary/GetKeyListNew",
  199. {
  200. token: $.cookie("token"),
  201. key: key,
  202. },
  203. function (result) {
  204. result = $.parseJSON(result);
  205. if (result.state.toLowerCase() === "success") {
  206. var content = result.data;
  207. if (content.length > 0) {
  208. content.forEach(function (e, i) {
  209. $(
  210. "<li index='" +
  211. e.id +
  212. "' indexName='" +
  213. e.name +
  214. "'>" +
  215. e.names +
  216. "</li>"
  217. ).appendTo("#reflectCategoryList");
  218. });
  219. } else {
  220. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  221. "#reflectCategoryList"
  222. );
  223. }
  224. }
  225. }
  226. );
  227. }
  228. // 防抖函数
  229. function debounce(fun, delay) {
  230. return function (args) {
  231. var that = this;
  232. var _args = args;
  233. clearTimeout(fun.id);
  234. fun.id = setTimeout(function () {
  235. fun.call(that, _args);
  236. }, delay);
  237. };
  238. }
  239. $(".CleansReactionCategory").click(function () {
  240. $("#reflectCategory").val("");
  241. $("#keyid").val("");
  242. $(".CleansReactionCategory").hide();
  243. });
  244. $("#sponsor").on("click", "li", function () {
  245. $(".selDpart1").css("display", "none");
  246. $(".inps").val($(this).html());
  247. $("#PID").val($(this).attr("index"));
  248. $("#Dpment").val($(this).attr("index"));
  249. $(".Cleans").show();
  250. });
  251. ///部门
  252. function depart(dept) {
  253. $("#sponsor").empty();
  254. $.getJSON(
  255. huayi.config.callcenter_url + "Department/GetDeptListByDept",
  256. {
  257. token: $.cookie("token"),
  258. dept: dept,
  259. },
  260. function (data) {
  261. if (data.state.toLowerCase() == "success") {
  262. var content = data.data;
  263. $(content).each(function (i, n) {
  264. $(
  265. "<li index='" +
  266. n.F_DeptId +
  267. "'>" +
  268. n.F_DeptName +
  269. "</li>"
  270. ).appendTo("#sponsor");
  271. });
  272. }
  273. }
  274. );
  275. }
  276. // 搜索获取反映类别数据结束
  277. // 导出列表
  278. function exportFileFun(api, params) {
  279. var url = huayi.config.callcenter_url + api;
  280. if(typeof(params) !== "object") {
  281. return
  282. }
  283. delete params.page
  284. delete params.pagesize
  285. delete params.pageindex
  286. Object.keys(params).forEach(function(key, index) {
  287. if(!params[key]){
  288. if (params[key] != 0) {
  289. params[key] = ""
  290. }
  291. }
  292. if (index === 0) {
  293. url += `?${key}=${params[key]}`
  294. } else {
  295. url += `&${key}=${params[key]}`
  296. }
  297. })
  298. console.log(url)
  299. window.location.href = url;
  300. }