Нет описания

WorkOrderList.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  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. //转110
  75. function transferOneHun(str){
  76. layer.confirm(
  77. "确定要转110吗?",
  78. {
  79. btn: ["是", "否"], //按钮
  80. },
  81. function () {
  82. $.post(
  83. huayi.config.callcenter_url + "APPS/PushWorkOrder",
  84. {
  85. workorderid: 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 provincialPlatformSignup(str) {
  101. layer.confirm(
  102. "确定签收吗?",
  103. {
  104. btn: ["是", "否"], //按钮
  105. },
  106. function () {
  107. $.post(
  108. huayi.config.callcenter_url + "Affairs/SubmitWorkOrder",
  109. {
  110. ids: str,
  111. token: $.cookie("token"),
  112. },
  113. function (result) {
  114. result = JSON.parse(result);
  115. if (result.state.toLowerCase() == "success") {
  116. layer.msg("操作成功");
  117. load();
  118. }
  119. }
  120. );
  121. }
  122. );
  123. }
  124. // 省平台退回
  125. function provincialPlatformReturn(str) {
  126. layer.open({
  127. type: 2,
  128. content: "../CommonHtml/provincialPlatformReturn.html?wid=" + str, //iframe的url,no代表不显示滚动条
  129. title: "省平台退回",
  130. area: ["70%", "70%"], //宽高
  131. shade: 0,
  132. });
  133. }
  134. // 省平台申请延时
  135. function provincialPlatformApplicationDelay(str,type) {
  136. layer.open({
  137. type: 2,
  138. content:
  139. "../CommonHtml/provincialPlatformApplicationDelay.html?wid=" + str+"&type="+type, //iframe的url,no代表不显示滚动条
  140. title: "省平台申请延时",
  141. area: ["70%", "70%"], //宽高
  142. shade: 0,
  143. });
  144. }
  145. // 省平台反馈
  146. function provincialPlatformFeedback(str) {
  147. layer.open({
  148. type: 2,
  149. content: "../CommonHtml/provincialPlatformFeedback.html?wid=" + str, //iframe的url,no代表不显示滚动条
  150. title: "省平台反馈",
  151. area: ["70%", "70%"], //宽高
  152. shade: 0,
  153. });
  154. }
  155. // 服务工单上报
  156. function reportServiceWorkOrder(str) {
  157. layer.open({
  158. type: 2,
  159. content: "../CommonHtml/provincialPlatformReport.html?wid=" + str, //iframe的url,no代表不显示滚动条
  160. title: "省平台上报",
  161. area: ["70%", "70%"], //宽高
  162. shade: 0,
  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. function getCharacter(obj) {
  278. obj.empty();
  279. obj.append("<option value=''>请选择</option>");
  280. $.ajax({
  281. type: "get",
  282. async: false,
  283. url: huayi.config.callcenter_url + "RoleInfo/GetRoleList",
  284. data: {
  285. pageindex: 1,
  286. pagesize: 100,
  287. token: $.cookie("token"),
  288. name: "", //角色名称
  289. },
  290. dataType: "json",
  291. success: function (data) {
  292. var data = data.rows;
  293. $.each(data, function (index, value) {
  294. obj.append(
  295. "<option value='" +
  296. value.F_RoleCode +
  297. "'>" +
  298. value.F_RoleName +
  299. "</option>"
  300. );
  301. });
  302. },
  303. });
  304. }
  305. // 多媒体角色人员
  306. function getMultimediaPersonnel(obj) {
  307. obj.empty();
  308. obj.append("<option value=''>请选择</option>");
  309. $.getJSON(
  310. huayi.config.callcenter_url + "UserAccount/GetList",
  311. {
  312. token: $.cookie("token"),
  313. rolecode: "23", // 23多媒体
  314. page: 1,
  315. pagesize: 10000,
  316. },
  317. function (data) {
  318. var content = data.rows;
  319. $(content).each(function (i, n) {
  320. $(
  321. "<option value='" +
  322. n.F_UserCode +
  323. "'>" +
  324. n.F_UserName +
  325. "</option>"
  326. ).appendTo(obj);
  327. });
  328. obj.selectpicker({
  329. noneSelectedText: "请选择", //默认显示内容
  330. });
  331. obj.selectpicker("refresh");
  332. }
  333. );
  334. }
  335. // 导出列表
  336. function exportFileFun(api, params) {
  337. var url = huayi.config.callcenter_url + api;
  338. if(typeof(params) !== "object") {
  339. return
  340. }
  341. // 分页为空
  342. params.page = "";
  343. params.pagesize = "";
  344. Object.keys(params).forEach(function(key, index) {
  345. if (index === 0) {
  346. url += `?${key}=${params[key]}`
  347. } else {
  348. url += `&${key}=${params[key]}`
  349. }
  350. })
  351. console.log((url))
  352. window.location.href = url;
  353. }
  354. //市平台申请延期
  355. function ysShi(str){
  356. layer.open({
  357. type: 2,
  358. content: "../CommonHtml/shiTimesq.html?wid=" + str, //iframe的url,no代表不显示滚动条
  359. title: "市平台申请延时",
  360. area: ["70%", "70%"], //宽高
  361. shade: 0,
  362. });
  363. }