Нет описания

WorkOrderList.js 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. $(document).ready(function () {
  2. getReactionCategory();
  3. // 反映类别搜索
  4. $("#reflectCategory").bind("input propertychange", function () {
  5. $(".layui-dropdown").hide();
  6. $(".CleansReactionCategory").show();
  7. if ($("#reflectCategory").val() == "") {
  8. $(".reflectCategoryList-wrapper").hide();
  9. return;
  10. }
  11. $(".reflectCategoryList-wrapper").show();
  12. var debounceGetSearchReactionCategory = debounce(
  13. getSearchReactionCategory,
  14. 500
  15. );
  16. debounceGetSearchReactionCategory($("#reflectCategory").val());
  17. });
  18. // 承办单位搜索
  19. $(".inps").bind("input propertychange", function () {
  20. $(".xlAdd").css("display", "none");
  21. $(".selDpart1").css("display", "block");
  22. if ($(".inps").val() == "") {
  23. $(".selDpart1").css("display", "none");
  24. return;
  25. }
  26. var debounceDepart = debounce(depart, 500);
  27. debounceDepart($(".inps").val());
  28. });
  29. $("#reflectCategoryList").on("click", "li", function () {
  30. $(".reflectCategoryList-wrapper").hide();
  31. $("#reflectCategory").val($(this).attr("indexName"));
  32. $("#keyid").val($(this).attr("index"));
  33. });
  34. });
  35. // 查看工单详情
  36. function View(val, row) {
  37. var workId = val;
  38. var workIdCode = workId.slice(0, 4);
  39. var workIdAddress = workId.slice(4, 10);
  40. var workIdDate = workId.slice(10, 16);
  41. var workIdSerialNumber = workId.slice(16);
  42. return (
  43. '<div class="imgs" ><a class="" style="font-weight: 700;" index="' +
  44. row.CreateUser +
  45. '" onclick= ckxq("' +
  46. row.F_WorkOrderId +
  47. '") >' +
  48. '<span style="color: #000000">' +
  49. workIdCode +
  50. "</span>" +
  51. '<span style="color: #FF0000">' +
  52. workIdAddress +
  53. "</span>" +
  54. '<span style="color: #008000">' +
  55. workIdDate +
  56. "</span>" +
  57. '<span style="color: #800080">' +
  58. workIdSerialNumber +
  59. "</span>" +
  60. "</a></div>"
  61. );
  62. }
  63. function doNotBusiness(str){
  64. layer.confirm(
  65. "确定要转为非营商工单吗?",
  66. {
  67. btn: ["是", "否"], //按钮
  68. },
  69. function () {
  70. $.post(
  71. huayi.config.callcenter_url + "WorkOrder/Reseller",
  72. {
  73. workorderid: str,
  74. type: 0,
  75. token: $.cookie("token"),
  76. },
  77. function (result) {
  78. result = JSON.parse(result);
  79. if (result.state.toLowerCase() == "success") {
  80. layer.msg("操作成功");
  81. load();
  82. }
  83. }
  84. );
  85. }
  86. );
  87. }
  88. function doBusiness(str){
  89. layer.confirm(
  90. "确定要转为营商工单吗?",
  91. {
  92. btn: ["是", "否"], //按钮
  93. },
  94. function () {
  95. $.post(
  96. huayi.config.callcenter_url + "WorkOrder/Reseller",
  97. {
  98. workorderid: str,
  99. type: 1,
  100. token: $.cookie("token"),
  101. },
  102. function (result) {
  103. result = JSON.parse(result);
  104. if (result.state.toLowerCase() == "success") {
  105. layer.msg("操作成功");
  106. load();
  107. }
  108. }
  109. );
  110. }
  111. );
  112. }
  113. // 查看详情
  114. function ckxq(str) {
  115. layer.open({
  116. type: 2,
  117. content: "../CommonHtml/WorkDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
  118. title: "工单详情",
  119. area: ["100%", "100%"], //宽高
  120. maxmin: true,
  121. shade: 0,
  122. });
  123. }
  124. //转110
  125. function transferOneHun(str){
  126. layer.confirm(
  127. "确定要转110吗?",
  128. {
  129. btn: ["是", "否"], //按钮
  130. },
  131. function () {
  132. $.post(
  133. huayi.config.callcenter_url + "APPS/PushWorkOrder",
  134. {
  135. workorderid: str,
  136. token: $.cookie("token"),
  137. },
  138. function (result) {
  139. result = JSON.parse(result);
  140. if (result.state.toLowerCase() == "success") {
  141. layer.msg("操作成功");
  142. load();
  143. }
  144. }
  145. );
  146. }
  147. );
  148. }
  149. // 省平台签收
  150. function provincialPlatformSignup(str) {
  151. layer.confirm(
  152. "确定签收吗?",
  153. {
  154. btn: ["是", "否"], //按钮
  155. },
  156. function () {
  157. $.post(
  158. huayi.config.callcenter_url + "Affairs/SubmitWorkOrder",
  159. {
  160. ids: str,
  161. token: $.cookie("token"),
  162. },
  163. function (result) {
  164. result = JSON.parse(result);
  165. if (result.state.toLowerCase() == "success") {
  166. layer.msg("操作成功");
  167. load();
  168. }
  169. }
  170. );
  171. }
  172. );
  173. }
  174. // 省平台退回
  175. function provincialPlatformReturn(str) {
  176. layer.open({
  177. type: 2,
  178. content: "../CommonHtml/provincialPlatformReturn.html?wid=" + str, //iframe的url,no代表不显示滚动条
  179. title: "省平台退回",
  180. area: ["70%", "70%"], //宽高
  181. shade: 0,
  182. });
  183. }
  184. // 省平台申请延时
  185. function provincialPlatformApplicationDelay(str,type) {
  186. layer.open({
  187. type: 2,
  188. content:
  189. "../CommonHtml/provincialPlatformApplicationDelay.html?wid=" + str+"&type="+type, //iframe的url,no代表不显示滚动条
  190. title: "省平台申请延时",
  191. area: ["70%", "70%"], //宽高
  192. shade: 0,
  193. });
  194. }
  195. // 省平台反馈
  196. function provincialPlatformFeedback(str) {
  197. layer.open({
  198. type: 2,
  199. content: "../CommonHtml/provincialPlatformFeedback.html?wid=" + str, //iframe的url,no代表不显示滚动条
  200. title: "省平台反馈",
  201. area: ["70%", "70%"], //宽高
  202. shade: 0,
  203. });
  204. }
  205. // 服务工单上报
  206. function reportServiceWorkOrder(str) {
  207. layer.open({
  208. type: 2,
  209. content: "../CommonHtml/provincialPlatformReport.html?wid=" + str, //iframe的url,no代表不显示滚动条
  210. title: "省平台上报",
  211. area: ["70%", "70%"], //宽高
  212. shade: 0,
  213. });
  214. }
  215. // 获取反映类别数据,多级下拉选项
  216. function getReactionCategory(pid = 38) {
  217. $.get(
  218. huayi.config.callcenter_url + "Dictionary/GetZTreeNew",
  219. {
  220. token: $.cookie("token"),
  221. pid: pid,
  222. },
  223. function (result) {
  224. result = $.parseJSON(result);
  225. var content = JSON.parse(result.data);
  226. layui.use("dropdown", function () {
  227. var dropdown = layui.dropdown;
  228. dropdown.render({
  229. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  230. data: content,
  231. id: "reflectCategory",
  232. isclickparent: true,
  233. //菜单被点击的事件
  234. click: function (obj) {
  235. $("#reflectCategory").val(obj.title);
  236. $("#keyid").val(obj.id);
  237. $(".CleansReactionCategory").show();
  238. },
  239. });
  240. });
  241. }
  242. );
  243. }
  244. // 搜索获取反映类别数据
  245. function getSearchReactionCategory(key) {
  246. $("#reflectCategoryList").empty();
  247. $.get(
  248. huayi.config.callcenter_url + "Dictionary/GetKeyListNew",
  249. {
  250. token: $.cookie("token"),
  251. key: key,
  252. },
  253. function (result) {
  254. result = $.parseJSON(result);
  255. if (result.state.toLowerCase() === "success") {
  256. var content = result.data;
  257. if (content.length > 0) {
  258. content.forEach(function (e, i) {
  259. $(
  260. "<li index='" +
  261. e.id +
  262. "' indexName='" +
  263. e.name +
  264. "'>" +
  265. e.names +
  266. "</li>"
  267. ).appendTo("#reflectCategoryList");
  268. });
  269. } else {
  270. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  271. "#reflectCategoryList"
  272. );
  273. }
  274. }
  275. }
  276. );
  277. }
  278. // 防抖函数
  279. function debounce(fun, delay) {
  280. return function (args) {
  281. var that = this;
  282. var _args = args;
  283. clearTimeout(fun.id);
  284. fun.id = setTimeout(function () {
  285. fun.call(that, _args);
  286. }, delay);
  287. };
  288. }
  289. $(".CleansReactionCategory").click(function () {
  290. $("#reflectCategory").val("");
  291. $("#keyid").val("");
  292. $(".CleansReactionCategory").hide();
  293. });
  294. $("#sponsor").on("click", "li", function () {
  295. $(".selDpart1").css("display", "none");
  296. $(".inps").val($(this).html());
  297. $("#PID").val($(this).attr("index"));
  298. $("#Dpment").val($(this).attr("index"));
  299. $(".Cleans").show();
  300. });
  301. ///部门
  302. function depart(dept) {
  303. $("#sponsor").empty();
  304. $.getJSON(
  305. huayi.config.callcenter_url + "Department/GetDeptListByDept",
  306. {
  307. token: $.cookie("token"),
  308. dept: dept,
  309. },
  310. function (data) {
  311. if (data.state.toLowerCase() == "success") {
  312. var content = data.data;
  313. $(content).each(function (i, n) {
  314. $(
  315. "<li index='" +
  316. n.F_DeptId +
  317. "'>" +
  318. n.F_DeptName +
  319. "</li>"
  320. ).appendTo("#sponsor");
  321. });
  322. }
  323. }
  324. );
  325. }
  326. // 获取角色
  327. function getCharacter(obj) {
  328. obj.empty();
  329. obj.append("<option value=''>请选择</option>");
  330. $.ajax({
  331. type: "get",
  332. async: false,
  333. url: huayi.config.callcenter_url + "RoleInfo/GetRoleList",
  334. data: {
  335. pageindex: 1,
  336. pagesize: 100,
  337. token: $.cookie("token"),
  338. name: "", //角色名称
  339. },
  340. dataType: "json",
  341. success: function (data) {
  342. var data = data.rows;
  343. $.each(data, function (index, value) {
  344. obj.append(
  345. "<option value='" +
  346. value.F_RoleCode +
  347. "'>" +
  348. value.F_RoleName +
  349. "</option>"
  350. );
  351. });
  352. },
  353. });
  354. }
  355. // 多媒体角色人员
  356. function getMultimediaPersonnel(obj) {
  357. obj.empty();
  358. obj.append("<option value=''>请选择</option>");
  359. $.getJSON(
  360. huayi.config.callcenter_url + "UserAccount/GetList",
  361. {
  362. token: $.cookie("token"),
  363. rolecode: "23", // 23多媒体
  364. page: 1,
  365. pagesize: 10000,
  366. },
  367. function (data) {
  368. var content = data.rows;
  369. $(content).each(function (i, n) {
  370. $(
  371. "<option value='" +
  372. n.F_UserCode +
  373. "'>" +
  374. n.F_UserName +
  375. "</option>"
  376. ).appendTo(obj);
  377. });
  378. obj.selectpicker({
  379. noneSelectedText: "请选择", //默认显示内容
  380. });
  381. obj.selectpicker("refresh");
  382. }
  383. );
  384. }
  385. // 导出列表
  386. function exportFileFun(api, params) {
  387. var url = huayi.config.callcenter_url + api;
  388. if(typeof(params) !== "object") {
  389. return
  390. }
  391. // 分页为空
  392. params.page = "";
  393. params.pagesize = "";
  394. Object.keys(params).forEach(function(key, index) {
  395. if (index === 0) {
  396. url += `?${key}=${params[key]}`
  397. } else {
  398. url += `&${key}=${params[key]}`
  399. }
  400. })
  401. console.log((url))
  402. window.location.href = url;
  403. }
  404. //市平台申请延期
  405. function ysShi(str){
  406. layer.open({
  407. type: 2,
  408. content: "../CommonHtml/shiTimesq.html?wid=" + str, //iframe的url,no代表不显示滚动条
  409. title: "市平台申请延时",
  410. area: ["70%", "70%"], //宽高
  411. shade: 0,
  412. });
  413. }