Nessuna descrizione

WorkOrderList.js 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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. cacheManager.fetchData('GetDicZTreeNew',"Dictionary/GetDicZTreeNew",{pid}).then(result => {
  234. // $.fn.zTree.init($("#addTreeDemoReactionCategory"),settingReactionCategory, result.data); //实例化树形图
  235. var content = JSON.parse(result.data);
  236. layui.use("dropdown", function () {
  237. var dropdown = layui.dropdown;
  238. dropdown.render({
  239. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  240. data: content,
  241. id: "reflectCategory",
  242. isclickparent: true,
  243. //菜单被点击的事件
  244. click: function (obj) {
  245. $("#reflectCategory").val(obj.title);
  246. $("#keyid").val(obj.id);
  247. $(".CleansReactionCategory").show();
  248. },
  249. });
  250. });
  251. }).catch(error => {
  252. console.log('GetZTreeListNew加载失败' + error.message, 'GetDicZTreeNew');
  253. });
  254. }
  255. // 搜索获取反映类别数据
  256. function getSearchReactionCategory(key) {
  257. $("#reflectCategoryList").empty();
  258. $.get(
  259. huayi.config.callcenter_url + "Dictionary/GetKeyListNew",
  260. {
  261. token: $.cookie("token"),
  262. key: key,
  263. },
  264. function (result) {
  265. result = $.parseJSON(result);
  266. if (result.state.toLowerCase() === "success") {
  267. var content = result.data;
  268. if (content.length > 0) {
  269. content.forEach(function (e, i) {
  270. $(
  271. "<li index='" +
  272. e.id +
  273. "' indexName='" +
  274. e.name +
  275. "'>" +
  276. e.names +
  277. "</li>"
  278. ).appendTo("#reflectCategoryList");
  279. });
  280. } else {
  281. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  282. "#reflectCategoryList"
  283. );
  284. }
  285. }
  286. }
  287. );
  288. }
  289. // 防抖函数
  290. function debounce(fun, delay) {
  291. return function (args) {
  292. var that = this;
  293. var _args = args;
  294. clearTimeout(fun.id);
  295. fun.id = setTimeout(function () {
  296. fun.call(that, _args);
  297. }, delay);
  298. };
  299. }
  300. $(".CleansReactionCategory").click(function () {
  301. $("#reflectCategory").val("");
  302. $("#keyid").val("");
  303. $(".CleansReactionCategory").hide();
  304. });
  305. $("#sponsor").on("click", "li", function () {
  306. $(".selDpart1").css("display", "none");
  307. $(".inps").val($(this).html());
  308. $("#PID").val($(this).attr("index"));
  309. $("#Dpment").val($(this).attr("index"));
  310. $(".Cleans").show();
  311. });
  312. ///部门
  313. function depart(dept) {
  314. $("#sponsor").empty();
  315. $.getJSON(
  316. huayi.config.callcenter_url + "Department/GetDeptListByDept",
  317. {
  318. token: $.cookie("token"),
  319. dept: dept,
  320. },
  321. function (data) {
  322. if (data.state.toLowerCase() == "success") {
  323. var content = data.data;
  324. $(content).each(function (i, n) {
  325. $(
  326. "<li index='" +
  327. n.F_DeptId +
  328. "'>" +
  329. n.F_DeptName +
  330. "</li>"
  331. ).appendTo("#sponsor");
  332. });
  333. }
  334. }
  335. );
  336. }
  337. // 获取角色
  338. function getCharacter(obj) {
  339. obj.empty();
  340. obj.append("<option value=''>请选择</option>");
  341. cacheManager.fetchData('RoleInfo/GetRoleList',"RoleInfo/GetRoleList",{pageindex: 1,pagesize: 100,name: ""}).then(data => {
  342. var data = data.rows;
  343. $.each(data, function (index, value) {
  344. obj.append("<option value='" +value.F_RoleCode + "'>" +value.F_RoleName +"</option>"
  345. );
  346. });
  347. }).catch(error => {
  348. console.log('加载失败' + error.message, 'RoleInfo/GetRoleList');
  349. });
  350. }
  351. // 多媒体角色人员
  352. function getMultimediaPersonnel(obj) {
  353. obj.empty();
  354. obj.append("<option value=''>请选择</option>");
  355. cacheManager.fetchData('UserAccount/GetList',"UserAccount/GetList",{rolecode: "23", page: 1, pagesize: 10000 }).then(data => {
  356. var content = data.rows;
  357. $(content).each(function (i, n) {
  358. $("<option value='" +n.F_UserCode +"'>" +n.F_UserName +"</option>").appendTo(obj);
  359. });
  360. obj.selectpicker({
  361. noneSelectedText: "请选择", //默认显示内容
  362. });
  363. obj.selectpicker("refresh");
  364. }).catch(error => {
  365. console.log('加载失败' + error.message, 'UserAccount/GetList');
  366. });
  367. }
  368. // 导出列表 导出后弹框提示,做个下载中心,在里面进行下载 2025-0704
  369. function exportFileFunNew(api, params) {
  370. // 分页为空
  371. params.page = "";
  372. params.pagesize = "";
  373. $.ajax({
  374. type: "get",
  375. url: huayi.config.callcenter_url + api,
  376. dataType: 'json',
  377. data:params ,
  378. success: function (data) {
  379. if (data.state && data.state.toLowerCase() == "success") {
  380. layer.confirm('导出成功,请稍等一会儿,点击右上角下载中心进行下载!', {
  381. btn: ['确定']
  382. });
  383. }
  384. }
  385. });
  386. }
  387. // 导出列表
  388. function exportFileFun(api, params) {
  389. var url = huayi.config.callcenter_url + api;
  390. if(typeof(params) !== "object") {
  391. return
  392. }
  393. // 分页为空
  394. params.page = "";
  395. params.pagesize = "";
  396. Object.keys(params).forEach(function(key, index) {
  397. if (index === 0) {
  398. url += `?${key}=${params[key]}`
  399. } else {
  400. url += `&${key}=${params[key]}`
  401. }
  402. })
  403. console.log((url))
  404. window.location.href = url;
  405. }
  406. //市平台申请延期
  407. function ysShi(str){
  408. layer.open({
  409. type: 2,
  410. content: "../CommonHtml/shiTimesq.html?wid=" + str, //iframe的url,no代表不显示滚动条
  411. title: "市平台申请延时",
  412. area: ["70%", "70%"], //宽高
  413. shade: 0,
  414. });
  415. }
  416. //审核通过
  417. function approved(str) {
  418. layer.confirm('确认审核通过吗?', {
  419. btn: ['是', '否'] // 按钮
  420. }, function() {
  421. layer.confirm('是否发送短信?', {
  422. btn: ['是', '否'] // 按钮
  423. }, function() {
  424. toExamineWorkOrder(str, 1)
  425. }, function() {
  426. toExamineWorkOrder(str, 0)
  427. });
  428. });
  429. }
  430. //审核不通过
  431. function auditFailed(str) {
  432. layer.open({
  433. type: 2,
  434. content: "../CommonHtml/haveDoneToAuditOperation.html?wid=" + str + "&nexttype=1", //iframe的url,no代表不显示滚动条
  435. title: "审核不通过",
  436. area: ["50%", "50%"], //宽高
  437. });
  438. }
  439. function toExamineWorkOrder(str, issmsAudit) {
  440. $.post(huayi.config.callcenter_url + 'WorkOrder/ToExamineWorkOrder', {
  441. workorderid: str,
  442. nexttype: 0, // 0审核通过 1审核不通过 2审核通过转办
  443. issms: issmsAudit,
  444. "token": $.cookie("token")
  445. }, function(result) {
  446. result = JSON.parse(result);
  447. if(result.state.toLowerCase() == "success") {
  448. layer.msg("操作成功");
  449. $("#orderlist").bootstrapTable('refresh');
  450. }
  451. })
  452. }
  453. //审核通过转办
  454. function approvedComplaint(str) {
  455. layer.open({
  456. type: 2,
  457. content: "../CommonHtml/haveDoneToAuditOperation.html?wid=" + str + "&nexttype=2", //iframe的url,no代表不显示滚动条
  458. title: "审核通过转办",
  459. area: ["50%", "50%"], //宽高
  460. });
  461. }
  462. //派单
  463. function pd(str) {
  464. layer.open({
  465. type: 2,
  466. content: "../CommonHtml/handle.html?wid=" + str, //iframe的url,no代表不显示滚动条
  467. title: "办理工单",
  468. area: ["87%", "80%"], //宽高
  469. });
  470. }