Нет описания

orderListHeader.js 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. $(".inps").val(treeNode.F_DeptName);
  159. $("#PID").val(treeNode.F_DeptId);
  160. $(".Cleans").show();
  161. }
  162. //树形下拉结束
  163. // 获取反映类别数据,多级下拉选项
  164. function getReactionCategory(pid = 38) {
  165. $.get(
  166. huayi.config.callcenter_url + "Dictionary/GetZTreeNew",
  167. {
  168. token: $.cookie("token"),
  169. pid: pid,
  170. },
  171. function (result) {
  172. result = $.parseJSON(result);
  173. var content = JSON.parse(result.data);
  174. layui.use("dropdown", function () {
  175. var dropdown = layui.dropdown;
  176. dropdown.render({
  177. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  178. data: content,
  179. id: "reflectCategory",
  180. isclickparent: true,
  181. //菜单被点击的事件
  182. click: function (obj) {
  183. $("#reflectCategory").val(obj.title);
  184. $("#keyid").val(obj.id);
  185. $(".CleansReactionCategory").show();
  186. },
  187. });
  188. });
  189. }
  190. );
  191. }
  192. // 搜索获取反映类别数据开始
  193. function getSearchReactionCategory(key) {
  194. $("#reflectCategoryList").empty();
  195. $.get(
  196. huayi.config.callcenter_url + "Dictionary/GetKeyListNew",
  197. {
  198. token: $.cookie("token"),
  199. key: key,
  200. },
  201. function (result) {
  202. result = $.parseJSON(result);
  203. if (result.state.toLowerCase() === "success") {
  204. var content = result.data;
  205. if (content.length > 0) {
  206. content.forEach(function (e, i) {
  207. $(
  208. "<li index='" +
  209. e.id +
  210. "' indexName='" +
  211. e.name +
  212. "'>" +
  213. e.names +
  214. "</li>"
  215. ).appendTo("#reflectCategoryList");
  216. });
  217. } else {
  218. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  219. "#reflectCategoryList"
  220. );
  221. }
  222. }
  223. }
  224. );
  225. }
  226. // 防抖函数
  227. function debounce(fun, delay) {
  228. return function (args) {
  229. var that = this;
  230. var _args = args;
  231. clearTimeout(fun.id);
  232. fun.id = setTimeout(function () {
  233. fun.call(that, _args);
  234. }, delay);
  235. };
  236. }
  237. $(".CleansReactionCategory").click(function () {
  238. $("#reflectCategory").val("");
  239. $("#keyid").val("");
  240. $(".CleansReactionCategory").hide();
  241. });
  242. $("#sponsor").on("click", "li", function () {
  243. $(".selDpart1").css("display", "none");
  244. $(".inps").val($(this).html());
  245. $("#PID").val($(this).attr("index"));
  246. $("#Dpment").val($(this).attr("index"));
  247. $(".Cleans").show();
  248. });
  249. ///部门
  250. function depart(dept) {
  251. $("#sponsor").empty();
  252. $.getJSON(
  253. huayi.config.callcenter_url + "Department/GetDeptListByDept",
  254. {
  255. token: $.cookie("token"),
  256. dept: dept,
  257. },
  258. function (data) {
  259. if (data.state.toLowerCase() == "success") {
  260. var content = data.data;
  261. $(content).each(function (i, n) {
  262. $(
  263. "<li index='" +
  264. n.F_DeptId +
  265. "'>" +
  266. n.F_DeptName +
  267. "</li>"
  268. ).appendTo("#sponsor");
  269. });
  270. }
  271. }
  272. );
  273. }
  274. // 搜索获取反映类别数据结束
  275. // 导出列表
  276. function exportFileFun(api, params) {
  277. var url = huayi.config.callcenter_url + api;
  278. if(typeof(params) !== "object") {
  279. return
  280. }
  281. delete params.page
  282. delete params.pagesize
  283. delete params.pageindex
  284. Object.keys(params).forEach(function(key, index) {
  285. if(!params[key]){
  286. if (params[key] != 0) {
  287. params[key] = ""
  288. }
  289. }
  290. if (index === 0) {
  291. url += `?${key}=${params[key]}`
  292. } else {
  293. url += `&${key}=${params[key]}`
  294. }
  295. })
  296. console.log(url)
  297. window.location.href = url;
  298. }