No Description

WorkOrderList.js 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. // 查看详情
  64. function ckxq(str) {
  65. layer.open({
  66. type: 2,
  67. content: "../CommonHtml/WorkDatil.html?wid=" + str, //iframe的url,no代表不显示滚动条
  68. title: "工单详情",
  69. area: ["100%", "100%"], //宽高
  70. maxmin: true,
  71. shade: 0,
  72. });
  73. }
  74. // 省平台签收
  75. function provincialPlatformSignup(str) {
  76. layer.confirm(
  77. "确定签收吗?",
  78. {
  79. btn: ["是", "否"], //按钮
  80. },
  81. function () {
  82. $.post(
  83. huayi.config.callcenter_url + "Affairs/SubmitWorkOrder",
  84. {
  85. ids: str,
  86. token: $.cookie("token"),
  87. },
  88. function (result) {
  89. result = JSON.parse(result);
  90. if (result.state.toLowerCase() == "success") {
  91. layer.msg("操作成功");
  92. load();
  93. }
  94. }
  95. );
  96. }
  97. );
  98. }
  99. // 省平台退回
  100. function provincialPlatformReturn(str) {
  101. layer.open({
  102. type: 2,
  103. content: "../CommonHtml/provincialPlatformReturn.html?wid=" + str, //iframe的url,no代表不显示滚动条
  104. title: "省平台退回",
  105. area: ["70%", "70%"], //宽高
  106. shade: 0,
  107. });
  108. }
  109. // 省平台申请延时
  110. function provincialPlatformApplicationDelay(str) {
  111. layer.open({
  112. type: 2,
  113. content:
  114. "../CommonHtml/provincialPlatformApplicationDelay.html?wid=" + str, //iframe的url,no代表不显示滚动条
  115. title: "省平台申请延时",
  116. area: ["70%", "70%"], //宽高
  117. shade: 0,
  118. });
  119. }
  120. // 省平台反馈
  121. function provincialPlatformFeedback(str) {
  122. layer.open({
  123. type: 2,
  124. content: "../CommonHtml/provincialPlatformFeedback.html?wid=" + str, //iframe的url,no代表不显示滚动条
  125. title: "省平台反馈",
  126. area: ["70%", "70%"], //宽高
  127. shade: 0,
  128. });
  129. }
  130. // 服务工单上报
  131. function reportServiceWorkOrder(str) {
  132. layer.open({
  133. type: 2,
  134. content: "../CommonHtml/provincialPlatformReport.html?wid=" + str, //iframe的url,no代表不显示滚动条
  135. title: "省平台上报",
  136. area: ["70%", "70%"], //宽高
  137. shade: 0,
  138. });
  139. }
  140. function getReactionCategory(pid = 38) {
  141. $.get(
  142. huayi.config.callcenter_url + "Dictionary/GetZTreeNew",
  143. {
  144. token: $.cookie("token"),
  145. pid: pid,
  146. },
  147. function (result) {
  148. result = $.parseJSON(result);
  149. var content = JSON.parse(result.data);
  150. layui.use("dropdown", function () {
  151. var dropdown = layui.dropdown;
  152. dropdown.render({
  153. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  154. data: content,
  155. id: "reflectCategory",
  156. isclickparent: true,
  157. //菜单被点击的事件
  158. click: function (obj) {
  159. $("#reflectCategory").val(obj.title);
  160. $("#keyid").val(obj.id);
  161. $(".CleansReactionCategory").show();
  162. },
  163. });
  164. });
  165. }
  166. );
  167. }
  168. function getSearchReactionCategory(key) {
  169. $("#reflectCategoryList").empty();
  170. $.get(
  171. huayi.config.callcenter_url + "Dictionary/GetKeyListNew",
  172. {
  173. token: $.cookie("token"),
  174. key: key,
  175. },
  176. function (result) {
  177. result = $.parseJSON(result);
  178. if (result.state.toLowerCase() === "success") {
  179. var content = result.data;
  180. if (content.length > 0) {
  181. content.forEach(function (e, i) {
  182. $(
  183. "<li index='" +
  184. e.id +
  185. "' indexName='" +
  186. e.name +
  187. "'>" +
  188. e.names +
  189. "</li>"
  190. ).appendTo("#reflectCategoryList");
  191. });
  192. } else {
  193. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  194. "#reflectCategoryList"
  195. );
  196. }
  197. }
  198. }
  199. );
  200. }
  201. function debounce(fun, delay) {
  202. return function (args) {
  203. var that = this;
  204. var _args = args;
  205. clearTimeout(fun.id);
  206. fun.id = setTimeout(function () {
  207. fun.call(that, _args);
  208. }, delay);
  209. };
  210. }
  211. $(".CleansReactionCategory").click(function () {
  212. $("#reflectCategory").val("");
  213. $("#keyid").val("");
  214. $(".CleansReactionCategory").hide();
  215. });
  216. $("#sponsor").on("click", "li", function () {
  217. $(".selDpart1").css("display", "none");
  218. $(".inps").val($(this).html());
  219. $("#PID").val($(this).attr("index"));
  220. $("#Dpment").val($(this).attr("index"));
  221. $(".Cleans").show();
  222. });
  223. ///部门
  224. function depart(dept) {
  225. $("#sponsor").empty();
  226. $.getJSON(
  227. huayi.config.callcenter_url + "Department/GetDeptListByDept",
  228. {
  229. token: $.cookie("token"),
  230. dept: dept,
  231. },
  232. function (data) {
  233. if (data.state.toLowerCase() == "success") {
  234. var content = data.data;
  235. $(content).each(function (i, n) {
  236. $(
  237. "<li index='" +
  238. n.F_DeptId +
  239. "'>" +
  240. n.F_DeptName +
  241. "</li>"
  242. ).appendTo("#sponsor");
  243. });
  244. }
  245. }
  246. );
  247. }
  248. // 获取角色
  249. function getCharacter(obj) {
  250. obj.empty();
  251. obj.append("<option value=''>请选择</option>");
  252. $.ajax({
  253. type: "get",
  254. async: false,
  255. url: huayi.config.callcenter_url + "RoleInfo/GetRoleList",
  256. data: {
  257. pageindex: 1,
  258. pagesize: 100,
  259. token: $.cookie("token"),
  260. name: "", //角色名称
  261. },
  262. dataType: "json",
  263. success: function (data) {
  264. var data = data.rows;
  265. $.each(data, function (index, value) {
  266. obj.append(
  267. "<option value='" +
  268. value.F_RoleCode +
  269. "'>" +
  270. value.F_RoleName +
  271. "</option>"
  272. );
  273. });
  274. },
  275. });
  276. }
  277. // 多媒体角色
  278. function getMultimediaPersonnel(obj) {
  279. obj.empty();
  280. obj.append("<option value=''>请选择</option>");
  281. $.getJSON(
  282. huayi.config.callcenter_url + "UserAccount/GetList",
  283. {
  284. token: $.cookie("token"),
  285. rolecode: "23", // 23多媒体
  286. page: 1,
  287. pagesize: 10000,
  288. },
  289. function (data) {
  290. var content = data.rows;
  291. $(content).each(function (i, n) {
  292. $(
  293. "<option value='" +
  294. n.F_UserCode +
  295. "'>" +
  296. n.F_UserName +
  297. "</option>"
  298. ).appendTo(obj);
  299. });
  300. obj.selectpicker({
  301. noneSelectedText: "请选择", //默认显示内容
  302. });
  303. obj.selectpicker("refresh");
  304. }
  305. );
  306. }