Açıklama Yok

WorkOrderList.js 14KB

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