Bez popisu

WorkOrderList.js 14KB

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