Няма описание

auditBack.html 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link rel="stylesheet" href="../css/init.css" />
  8. <title>工单审核</title>
  9. <style type="text/css">
  10. #msg1,
  11. #msg2,
  12. #msg3,
  13. #phone {
  14. border: none;
  15. border-bottom: 1px solid #ccc;
  16. margin-bottom: 20px;
  17. background-color: #FFFFFF;
  18. color: #00a1cb;
  19. }
  20. #msg4 {
  21. width: 250px;
  22. height: 50px;
  23. border: none;
  24. border-bottom: 1px solid #ccc;
  25. margin-bottom: 20px;
  26. vertical-align: top;
  27. }
  28. #msg2 {
  29. vertical-align: top;
  30. height: 25px;
  31. }
  32. #msg1:focus,
  33. #msg2:focus,
  34. #msg3:focus,
  35. #msg4:focus,
  36. #phone:focus {
  37. outline: none;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <div class="Common">
  43. <table>
  44. <tr>
  45. <th>
  46. 来电号码:
  47. </th>
  48. <td>
  49. <a class="CallOut" id="CallOut">
  50. <span class="F_CusPhone"></span>
  51. <img class="cupImg" style="vertical-align: text-bottom;margin-left: 5px;" src="../img/Phones.png" />
  52. </a>
  53. </td>
  54. <th>回访方式:</th>
  55. <td><span class="visittype"></span></td>
  56. <!-- <th>
  57. 联系号码:
  58. </th>
  59. <td><a class="CallOut1" id="CallOut1"><span class="F_ConPhone"></span><img class="copImg"
  60. style="vertical-align: text-bottom;margin-left: 5px;" src="../img/Phones.png" /></a></td> -->
  61. </tr>
  62. <tr>
  63. <th class="Importent">
  64. 审核人:
  65. </th>
  66. <td><input type="text" id="visituser" /></td>
  67. <th>
  68. 审核方式:
  69. </th>
  70. <td>
  71. <select class="select_" id="type">
  72. <option value="0">电话</option>
  73. <option value="1">微信</option>
  74. <option value="2">APP</option>
  75. <option value="3">网站</option>
  76. <option value="4">微博</option>
  77. <option value="5">信箱</option>
  78. </select>
  79. </td>
  80. </tr>
  81. <tr>
  82. <th class="Importent">审核结果:</th>
  83. <td>
  84. <input checked="true" type="radio" value="1" name="huifang" />满意
  85. <input type="radio" value="0" name="huifang" />不满意
  86. </td>
  87. </tr>
  88. <tr>
  89. <th class="Importent">审核内容:</th>
  90. <td colspan="7"><textarea data-adaptheight id="result" name="" rows="" cols=""></textarea></td>
  91. </tr>
  92. <tr>
  93. <th class="Importent">重办原因:</th>
  94. <td colspan="7"><textarea data-adaptheight id="replace" name="" rows="" cols=""></textarea></td>
  95. </tr>
  96. </table>
  97. <!-- <div class="" style="margin: 20px 0 0 0;">
  98. 尊敬的市民,您于<input id="msg1" type="text" disabled />反映的<textarea id="msg2" type="text"></textarea>问题,工单号:<input
  99. id="msg3" type="text" disabled />,<br />
  100. 处理结果如下:<textarea id="msg4" type="text"></textarea>如有异议,请您再次致电12345,感谢您的支持。<br />
  101. 通知号码:<input id="phone" type="text" />
  102. <button class="btns sendMsg">发送短信</button>
  103. </div> -->
  104. <div class="btn_box">
  105. <input type="hidden" id="F_guid" value="" />
  106. <!-- <button class="btns BC">保存</button>
  107. <button class="btns Submit">保存并提交</button> -->
  108. <button class="btns returnRedo">退回重办</button>
  109. <button class="btns CB">提交重办</button>
  110. <button class="btns Transfer">已办未果</button>
  111. <button class="btns auditBtn" style="display: none;">审核</button>
  112. <button class="btns Closure">结案</button>
  113. <button class="btns sendMessage">发送短信</button>
  114. <button class="btns" onclick="intelligentOutboundCall()">智能外呼</button>
  115. </div>
  116. </div>
  117. <!--<script src="../js/main.js?v=1.5"></script>-->
  118. <script src="../js/adjustHeight.js"></script>
  119. <script src="../js/guid.js"></script>
  120. <script src="../js/sm2/sm2.js"></script>
  121. <script src="../js/sm2/decrypt.js"></script>
  122. <script>
  123. var wid = helper.request.queryString("wid");
  124. var IsExamine = helper.request.queryString("IsExamine"); // 0待回访未审核、1待待回访已审核
  125. var State;
  126. var nexttype;
  127. var a = $("#ID").val()
  128. loadTEL();
  129. Detail();
  130. $(document).ready(function () {
  131. if (String(IsExamine) === "0") {
  132. $(".auditBtn").show();
  133. $(".Closure").hide();
  134. } else if (String(IsExamine) === "1") {
  135. $(".auditBtn").hide();
  136. $(".Closure").show();
  137. }
  138. $('.BC').click(function () {
  139. State = 0;
  140. JA();
  141. });
  142. $('.Closure').click(function () {
  143. State = 1;
  144. Closure();
  145. });
  146. $('.returnRedo').click(function () {
  147. nexttype = 2;
  148. CB();
  149. });
  150. $('.CB').click(function () {
  151. State = 1;
  152. nexttype = 1;
  153. CB();
  154. })
  155. $('.Transfer').click(function () {
  156. Transfer();
  157. })
  158. $('.Submit').click(function () {
  159. State = 1;
  160. JA();
  161. })
  162. $('.sendMessage').click(function () {
  163. sendMessage()
  164. })
  165. $(".CallOut").click(function (event) {
  166. if ($(".F_CusPhone").text()) {
  167. calloutopt($(".F_CusPhone").text());
  168. }
  169. });
  170. $(".CallOut1").click(function (event) {
  171. if ($(".F_ConPhone").text()) {
  172. calloutopt($(".F_ConPhone").text());
  173. }
  174. });
  175. if($.cookie("makeCallId")){
  176. top.$.cookie("makeCallId", "");
  177. }
  178. // 营商审核
  179. $(".auditBtn").click(function () {
  180. $.ajax({
  181. type: "post",
  182. url: huayi.config.callcenter_url +
  183. "WorkOrder/BusinessApproved",
  184. dataType: "json",
  185. async: false,
  186. data: {
  187. token: $.cookie("token"),
  188. workorderid: wid,
  189. },
  190. success: function (data) {
  191. if (data.state.toLowerCase() == "success") {
  192. var index = parent.layer.getFrameIndex(window
  193. .name); //先得到当前iframe层的索引
  194. parent.layer.close(index); //再执行关闭
  195. parent.$("#orderlist").bootstrapTable("refresh");
  196. parent.layer.msg("操作成功");
  197. }
  198. },
  199. });
  200. })
  201. });
  202. function intelligentOutboundCall(){
  203. layer.open({
  204. type: 2,
  205. content: "./auditBack/intelligentOutboundCallList.html?telephone="+$(".F_CusPhone").text()+"&wid="+wid, //
  206. title: "智能外呼列表",
  207. area: ["100%", "100%"], //宽高
  208. });
  209. }
  210. //重办
  211. function CB() {
  212. if ($('#replace').val() == '') {
  213. layer.msg("请输入重办原因");
  214. return;
  215. }
  216. $.post(huayi.config.callcenter_url + 'WorkOrder/VisitWorkOrder', {
  217. workorderid: wid,
  218. visituser: $("#visituser").val(), //审核人
  219. result: $("#result").val(), //审核内容
  220. type: $("#type").val(),
  221. cbreason: $('#replace').val(), //重办原因
  222. issatisfie: $(' input[name="huifang"]:checked ').val(),
  223. state: State,
  224. nexttype: nexttype,
  225. visitid: a,
  226. token: $.cookie("token")
  227. }, function (result) {
  228. result = JSON.parse(result);
  229. if (result.state.toLowerCase() == "success") {
  230. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  231. parent.layer.close(index); //再执行关闭
  232. parent.$('#orderlist').bootstrapTable('refresh');
  233. parent.layer.msg("操作成功");
  234. }
  235. })
  236. }
  237. function Transfer() {
  238. $.post(huayi.config.callcenter_url + 'WorkOrder/Transfer', {
  239. workorderid: wid,
  240. token: $.cookie("token")
  241. }, function (result) {
  242. result = JSON.parse(result);
  243. if (result.state.toLowerCase() == "success") {
  244. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  245. parent.layer.close(index); //再执行关闭
  246. parent.$('#orderlist').bootstrapTable('refresh');
  247. parent.layer.msg("操作成功");
  248. }
  249. })
  250. }
  251. //审核
  252. function JA() {
  253. $.post(huayi.config.callcenter_url + 'WorkOrder/VisitWorkOrder', {
  254. workorderid: wid,
  255. visituser: $("#visituser").val(), //审核人
  256. result: $("#result").val(), //审核内容
  257. type: $("#type").val(),
  258. issatisfie: $(' input[name="huifang"]:checked ').val(),
  259. state: State,
  260. visitid: a,
  261. token: $.cookie("token")
  262. }, function (result) {
  263. result = JSON.parse(result);
  264. if (result.state.toLowerCase() == "success") {
  265. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  266. parent.layer.close(index); //再执行关闭
  267. parent.$('#orderlist').bootstrapTable('refresh');
  268. parent.layer.msg("操作成功");
  269. }
  270. })
  271. }
  272. //发送短信
  273. $('.sendMsg').click(function () {
  274. if (!$('#msg4').val()) {
  275. layer.msg('请填写结果')
  276. return
  277. }
  278. if (!$('#phone').val()) {
  279. layer.msg('请填写通知号码')
  280. return
  281. }
  282. $.ajax({
  283. type: "post",
  284. url: huayi.config.callcenter_url + 'WorkOrder/SmsHand',
  285. async: true,
  286. data: {
  287. msg1: $('#msg1').val(),
  288. msg2: $('#msg2').val(),
  289. msg3: $('#msg3').val(),
  290. msg4: $('#msg4').val(),
  291. mobile: $('#phone').val(),
  292. token: $.cookie("token")
  293. },
  294. success: function (res) {
  295. res = JSON.parse(res)
  296. if (res.state.toLowerCase() == 'success') {
  297. layer.msg('短信发送成功')
  298. } else {
  299. layer.msg('短信发送失败')
  300. }
  301. }
  302. });
  303. })
  304. //结案
  305. function Closure() {
  306. $.post(huayi.config.callcenter_url + 'WorkOrder/VisitWorkOrder', {
  307. workorderid: wid,
  308. visituser: $("#visituser").val(), //审核人
  309. result: $("#result").val(), //审核内容
  310. type: $("#type").val(),
  311. issatisfie: $(' input[name="huifang"]:checked ').val(),
  312. state: State,
  313. visitid: a,
  314. callid: $.cookie("makeCallId"),
  315. token: $.cookie("token")
  316. }, function (result) {
  317. result = JSON.parse(result);
  318. if (result.state.toLowerCase() == "success") {
  319. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  320. parent.layer.close(index); //再执行关闭
  321. if(!$.cookie("makeCallId")){
  322. parent.layer.msg("操作成功,非站内拨打");
  323. }else{
  324. parent.layer.msg("操作成功");
  325. }
  326. parent.$('#orderlist').bootstrapTable('refresh');
  327. top.$.cookie("makeCallId", "");
  328. }
  329. })
  330. }
  331. // 发送短信
  332. function sendMessage() {
  333. $.ajax({
  334. type: "post",
  335. url: huayi.config.callcenter_url + 'WorkOrder/SendVisit',
  336. async: true,
  337. data: {
  338. workorderid: wid,
  339. phone: $(".F_CusPhone").text(),
  340. token: $.cookie("token")
  341. },
  342. success: function (res) {
  343. res = JSON.parse(res)
  344. if (res.state.toLowerCase() == 'success') {
  345. layer.msg('短信发送成功')
  346. } else {
  347. layer.msg('短信发送失败')
  348. }
  349. }
  350. });
  351. }
  352. //草稿详情
  353. function Detail() {
  354. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  355. workorderid: wid,
  356. type: 3,
  357. token: $.cookie("token")
  358. }, function (result) {
  359. if (result.state.toLowerCase() == "success") {
  360. if (result.data.length > 0) {
  361. $("#visituser").val(result.data[0].F_VisitUser);
  362. $("#issatisfie").val(result.data[0].F_IsSatisfie);
  363. $("#type").val(result.data[0].F_Type);
  364. $("#result").val(result.data[0].F_Result);
  365. }
  366. }
  367. })
  368. }
  369. //加载用户电话
  370. function loadTEL() {
  371. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrderNew', {
  372. workorderid: wid,
  373. type: 0,
  374. "token": $.cookie("token")
  375. }, function (result) {
  376. if (result.state.toLowerCase() == "success") {
  377. var Data = result.data.data;
  378. $('#msg3').val(Data[0].F_WorkOrderId)
  379. $('#msg1').val(Data[0].F_CreateTime)
  380. $('#msg2').text(Data[0].F_ComTitle)
  381. $('#msg4').val(result.data.bldata && result.data.bldata[result.data.bldata.length - 1]
  382. .F_Situation)
  383. if (Data[0].F_CusPhone) {
  384. var cusPhone = decryptFn(Data[0].F_CusPhoneShow)
  385. $(".F_CusPhone").text(cusPhone);
  386. $('.cupImg').css('display', 'inline-block')
  387. } else {
  388. $(".F_CusPhone").css('display', 'none');
  389. $('.cupImg').css('display', 'none');
  390. }
  391. if (Data[0].F_ConPhone) {
  392. var conPhone = decryptFn(Data[0].F_CusPhoneShow)
  393. $(".F_ConPhone").text(conPhone);
  394. $('.copImg').css('display', 'inline-block')
  395. } else {
  396. $(".F_ConPhone").css('display', 'none');
  397. $('.copImg').css('display', 'none');
  398. }
  399. if (String(Data[0].F_VisitType) === "1") {
  400. $(".visittype").text("无需回访")
  401. } else {
  402. $(".visittype").text("正常回访")
  403. }
  404. }
  405. })
  406. }
  407. function calloutopt(telphone) {
  408. $.getJSON(huayi.config.callcenter_url + 'UserAccount/GetNowUser', {
  409. "token": $.cookie("token")
  410. }, function (result) {
  411. if (result.state.toLowerCase() == "success") {
  412. if (result.data.user.F_SeatFlag) { //判断是否话务人员
  413. if ($.cookie("extno")) { //判断是否登录分机号
  414. event.stopPropagation();
  415. if (telphone) {
  416. $.ajax({
  417. type: "get",
  418. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  419. async: true,
  420. dataType: 'json',
  421. data: {
  422. token: $.cookie("token"),
  423. phone: telphone
  424. },
  425. success: function (result) {
  426. if (result.state.toLowerCase() == "success") {
  427. var guid = uuid();
  428. $("#F_guid").val(guid);
  429. top.obj.Type = "MakeCall";
  430. top.obj.DestinationNumber = result.data.phone;
  431. top.obj.Header = result.data.fix;
  432. top.obj.TaskType = "2"; //0:拨号外呼;1:未接来电外呼;2:审核外呼
  433. top.obj.TaskPhoneID = wid; //审核的工单ID
  434. top.obj.TaskID = guid; //审核记录编号
  435. top.Send();
  436. }
  437. }
  438. });
  439. }
  440. } else
  441. layer.msg("未绑定分机号,不能操作回拨");
  442. } else
  443. layer.msg("非话务人员登录,不能操作回拨");
  444. }
  445. });
  446. }
  447. </script>
  448. </body>
  449. </html>