Нет описания

auditBack.html 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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>
  83. 办结状态:
  84. </th>
  85. <td>
  86. <select class="select_" id="completionStatus">
  87. <option value="0">正常</option>
  88. <option value="1">撤单</option>
  89. <option value="2">废单</option>
  90. </select>
  91. </td>
  92. </tr>
  93. <tr>
  94. <th>
  95. 事件解决结果:
  96. </th>
  97. <td>
  98. <select class="select_" id="isResolved">
  99. <option value="1">已解决</option>
  100. <option value="0">未解决</option>
  101. </select>
  102. </td>
  103. </tr>
  104. <tr>
  105. <th class="Importent">审核结果:</th>
  106. <td>
  107. <input checked="true" type="radio" value="1" name="huifang" />满意
  108. <input type="radio" value="0" name="huifang" />不满意
  109. </td>
  110. </tr>
  111. <tr>
  112. <th class="Importent">审核内容:</th>
  113. <td colspan="7"><textarea data-adaptheight id="result" name="" rows="" cols=""></textarea></td>
  114. </tr>
  115. <tr>
  116. <th class="Importent">重办原因:</th>
  117. <td colspan="7"><textarea data-adaptheight id="replace" name="" rows="" cols=""></textarea></td>
  118. </tr>
  119. </table>
  120. <!-- <div class="" style="margin: 20px 0 0 0;">
  121. 尊敬的市民,您于<input id="msg1" type="text" disabled />反映的<textarea id="msg2" type="text"></textarea>问题,工单号:<input
  122. id="msg3" type="text" disabled />,<br />
  123. 处理结果如下:<textarea id="msg4" type="text"></textarea>如有异议,请您再次致电12345,感谢您的支持。<br />
  124. 通知号码:<input id="phone" type="text" />
  125. <button class="btns sendMsg">发送短信</button>
  126. </div> -->
  127. <div class="btn_box">
  128. <input type="hidden" id="F_guid" value="" />
  129. <!-- <button class="btns BC">保存</button>
  130. <button class="btns Submit">保存并提交</button> -->
  131. <button class="btns returnRedo isShowbtn">退回重办</button>
  132. <button class="btns CB isShowbtn">提交重办</button>
  133. <button class="btns Transfer">已办未果</button>
  134. <button class="btns auditBtn isShowbtn" style="display: none;">审核</button>
  135. <button class="btns Closure">结案</button>
  136. <button class="btns sendMessage">发送短信</button>
  137. <button class="btns" onclick="intelligentOutboundCall()">智能外呼</button>
  138. </div>
  139. <span class="F_ConPhone" style="display: none;"></span>
  140. </div>
  141. <!--<script src="../js/main.js?v=1.5"></script>-->
  142. <script src="../js/adjustHeight.js"></script>
  143. <script src="../js/guid.js"></script>
  144. <script src="../js/sm2/sm2.js"></script>
  145. <script src="../js/sm2/decrypt.js"></script>
  146. <script>
  147. var wid = helper.request.queryString("wid");
  148. var IsExamine = helper.request.queryString("IsExamine"); // 0待回访未审核、1待待回访已审核
  149. var State;
  150. var nexttype;
  151. var ischange = 0;
  152. var isSpecialPhone = false;
  153. var a = $("#ID").val()
  154. loadTEL();
  155. loadHF();
  156. Detail();
  157. $(document).ready(function () {
  158. if (String(IsExamine) === "0") {
  159. $(".auditBtn").show();
  160. $(".Closure").hide();
  161. } else if (String(IsExamine) === "1") {
  162. $(".auditBtn").hide();
  163. $(".Closure").show();
  164. }
  165. $('.BC').click(function () {
  166. State = 0;
  167. JA();
  168. });
  169. $('.Closure').click(function () {
  170. if (isCloseLayer()) return;
  171. State = 1;
  172. Closure();
  173. });
  174. $('.returnRedo').click(function () {
  175. if (isCloseLayer()) return;
  176. nexttype = 2;
  177. CB();
  178. });
  179. $('.CB').click(function () {
  180. if (isCloseLayer()) return;
  181. State = 1;
  182. nexttype = 1;
  183. CB();
  184. })
  185. $('.Transfer').click(function () {
  186. if (isCloseLayer()) return;
  187. Transfer();
  188. })
  189. $('.Submit').click(function () {
  190. State = 1;
  191. JA();
  192. })
  193. $('.sendMessage').click(function () {
  194. if (isCloseLayer()) return;
  195. sendMessage()
  196. })
  197. $(".CallOut").click(function (event) {
  198. if ($(".F_CusPhone").text()) {
  199. calloutopt($(".F_CusPhone").text());
  200. }
  201. });
  202. $(".CallOut1").click(function (event) {
  203. if ($(".F_ConPhone").text()) {
  204. calloutopt($(".F_ConPhone").text());
  205. }
  206. });
  207. if($.cookie("makeCallId")){
  208. top.$.cookie("makeCallId", "");
  209. }
  210. // if($.cookie("code") == 'ZXHWY'){
  211. // $(".CB").hide()
  212. // }else{
  213. // $(".CB").show()
  214. // }
  215. // 营商审核
  216. $(".auditBtn").click(function () {
  217. if (isCloseLayer()) return;
  218. $.ajax({
  219. type: "post",
  220. url: huayi.config.callcenter_url +
  221. "WorkOrder/BusinessApproved",
  222. dataType: "json",
  223. async: false,
  224. data: {
  225. token: $.cookie("token"),
  226. workorderid: wid,
  227. },
  228. success: function (data) {
  229. if (data.state.toLowerCase() == "success") {
  230. var index = parent.layer.getFrameIndex(window
  231. .name); //先得到当前iframe层的索引
  232. parent.layer.close(index); //再执行关闭
  233. parent.$("#orderlist").bootstrapTable("refresh");
  234. parent.layer.msg("操作成功");
  235. }
  236. },
  237. });
  238. })
  239. });
  240. function intelligentOutboundCall(){
  241. if (isCloseLayer()) return;
  242. // layer.open({
  243. // type: 2,
  244. // content: "./auditBack/intelligentOutboundCallList.html?telephone="+$(".F_CusPhone").text()+"&wid="+wid, //
  245. // title: "智能外呼列表",
  246. // area: ["100%", "100%"], //宽高
  247. // });
  248. addCallPhone(wid,$(".F_CusPhone").text())
  249. }
  250. function addCallPhone(strWid,strPhone){
  251. console.log(getAddCallLoglist(strWid,strPhone))
  252. $.ajax({
  253. type:"post",
  254. url:huayi.config.callcenter_url + "Abutment/AddCallLog", //获取数据的Servlet地址,
  255. async:true,
  256. dataType:"json",
  257. data:{
  258. planId: 40,
  259. AddCallLoglist:getAddCallLoglist(strWid,strPhone),
  260. token:$.cookie("token")
  261. },
  262. success:function(res){
  263. if (res.state ==="success") {
  264. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  265. parent.layer.close(index); //再执行关闭
  266. parent.$('#orderlist').bootstrapTable('refresh');
  267. parent.layer.msg("操作成功");
  268. }
  269. }
  270. });
  271. }
  272. function getAddCallLoglist(wid,telephone){
  273. var AddCallLoglist = [{
  274. workorderid:wid,
  275. title:'安阳智能回访',
  276. telephone:telephone
  277. }]
  278. return AddCallLoglist
  279. }
  280. function isCloseLayer() {
  281. if (isSpecialPhone) {
  282. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  283. parent.layer.close(index); //再执行关闭
  284. return true;
  285. } else {
  286. return false;
  287. }
  288. }
  289. //重办
  290. function CB() {
  291. if ($('#replace').val() == '') {
  292. layer.msg("请输入重办原因");
  293. return;
  294. }
  295. $.post(huayi.config.callcenter_url + 'WorkOrder/VisitWorkOrder', {
  296. workorderid: wid,
  297. completionStatus: $("#completionStatus").val(),
  298. visituser: $("#visituser").val(), // 审核人
  299. result: $("#result").val(), // 审核内容
  300. type: $("#type").val(),
  301. cbreason: $('#replace').val(), // 重办原因
  302. issatisfie: $(' input[name="huifang"]:checked ').val(),
  303. state: State,
  304. nexttype: nexttype,
  305. visitid: a,
  306. token: $.cookie("token")
  307. }, function (result) {
  308. result = JSON.parse(result);
  309. if (result.state.toLowerCase() == "success") {
  310. var index = parent.layer.getFrameIndex(window.name); // 先得到当前iframe层的索引
  311. parent.layer.close(index); // 再执行关闭
  312. parent.$('#orderlist').bootstrapTable('refresh');
  313. parent.layer.msg("操作成功");
  314. }
  315. })
  316. }
  317. function Transfer() {
  318. $.post(huayi.config.callcenter_url + 'WorkOrder/Transfer', {
  319. workorderid: wid,
  320. token: $.cookie("token")
  321. }, function (result) {
  322. result = JSON.parse(result);
  323. if (result.state.toLowerCase() == "success") {
  324. var index = parent.layer.getFrameIndex(window.name); // 先得到当前iframe层的索引
  325. parent.layer.close(index); // 再执行关闭
  326. parent.$('#orderlist').bootstrapTable('refresh');
  327. parent.layer.msg("操作成功");
  328. }
  329. })
  330. }
  331. //审核
  332. function JA() {
  333. $.post(huayi.config.callcenter_url + 'WorkOrder/VisitWorkOrder', {
  334. workorderid: wid,
  335. completionStatus: $("#completionStatus").val(),
  336. visituser: $("#visituser").val(), // 审核人
  337. result: $("#result").val(), //审核内容
  338. type: $("#type").val(),
  339. issatisfie: $(' input[name="huifang"]:checked ').val(),
  340. state: State,
  341. visitid: a,
  342. token: $.cookie("token")
  343. }, function (result) {
  344. result = JSON.parse(result);
  345. if (result.state.toLowerCase() == "success") {
  346. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  347. parent.layer.close(index); //再执行关闭
  348. parent.$('#orderlist').bootstrapTable('refresh');
  349. parent.layer.msg("操作成功");
  350. }
  351. })
  352. }
  353. //发送短信
  354. $('.sendMsg').click(function () {
  355. if (!$('#msg4').val()) {
  356. layer.msg('请填写结果')
  357. return
  358. }
  359. if (!$('#phone').val()) {
  360. layer.msg('请填写通知号码')
  361. return
  362. }
  363. $.ajax({
  364. type: "post",
  365. url: huayi.config.callcenter_url + 'WorkOrder/SmsHand',
  366. async: true,
  367. data: {
  368. msg1: $('#msg1').val(),
  369. msg2: $('#msg2').val(),
  370. msg3: $('#msg3').val(),
  371. msg4: $('#msg4').val(),
  372. mobile: $('#phone').val(),
  373. token: $.cookie("token")
  374. },
  375. success: function (res) {
  376. res = JSON.parse(res)
  377. if (res.state.toLowerCase() == 'success') {
  378. layer.msg('短信发送成功')
  379. } else {
  380. layer.msg('短信发送失败')
  381. }
  382. }
  383. });
  384. })
  385. //结案
  386. function Closure() {
  387. $.post(huayi.config.callcenter_url + 'WorkOrder/VisitWorkOrder', {
  388. workorderid: wid,
  389. completionStatus: $("#completionStatus").val(),
  390. isResolved:$("#isResolved").val(),
  391. visituser: $("#visituser").val(), //审核人
  392. result: $("#result").val(), //审核内容
  393. type: $("#type").val(),
  394. issatisfie: $(' input[name="huifang"]:checked ').val(),
  395. state: State,
  396. visitid: a,
  397. callid: $.cookie("makeCallId"),
  398. token: $.cookie("token")
  399. }, function (result) {
  400. result = JSON.parse(result);
  401. if (result.state.toLowerCase() == "success") {
  402. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  403. parent.layer.close(index); //再执行关闭
  404. if(!$.cookie("makeCallId")){
  405. parent.layer.msg("操作成功,非站内拨打");
  406. }else{
  407. parent.layer.msg("操作成功");
  408. }
  409. parent.$('#orderlist').bootstrapTable('refresh');
  410. top.$.cookie("makeCallId", "");
  411. }
  412. })
  413. }
  414. // 发送短信
  415. function sendMessage() {
  416. $.ajax({
  417. type: "post",
  418. url: huayi.config.callcenter_url + 'WorkOrder/SendVisit',
  419. async: true,
  420. data: {
  421. workorderid: wid,
  422. phone: $(".F_ConPhone").text() || $(".F_CusPhone").text(),
  423. token: $.cookie("token")
  424. },
  425. success: function (res) {
  426. res = JSON.parse(res)
  427. if (res.state.toLowerCase() == 'success') {
  428. layer.msg('短信发送成功')
  429. } else {
  430. layer.msg('短信发送失败')
  431. }
  432. }
  433. });
  434. }
  435. //草稿详情
  436. function Detail() {
  437. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
  438. workorderid: wid,
  439. type: 3,
  440. token: $.cookie("token")
  441. }, function (result) {
  442. if (result.state.toLowerCase() == "success") {
  443. if (result.data.length > 0) {
  444. $("#visituser").val(result.data[0].F_VisitUser);
  445. $("#issatisfie").val(result.data[0].F_IsSatisfie);
  446. $("#type").val(result.data[0].F_Type);
  447. $("#result").val(result.data[0].F_Result);
  448. }
  449. }
  450. })
  451. }
  452. //加载用户电话
  453. function loadTEL() {
  454. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrderNew', {
  455. workorderid: wid,
  456. type: 0,
  457. "token": $.cookie("token")
  458. }, function (result) {
  459. if (result.state.toLowerCase() == "success") {
  460. var Data = result.data.data;
  461. $('#msg3').val(Data[0].F_WorkOrderId)
  462. $('#msg1').val(Data[0].F_CreateTime)
  463. $('#msg2').text(Data[0].F_ComTitle)
  464. $('#msg4').val(result.data.bldata && result.data.bldata[result.data.bldata.length - 1]
  465. .F_Situation)
  466. if (Data[0].F_CusPhone) {
  467. var cusPhone = decryptFn(Data[0].F_CusPhoneShow)
  468. $(".F_CusPhone").text(cusPhone);
  469. $('.cupImg').css('display', 'inline-block')
  470. } else {
  471. $(".F_CusPhone").css('display', 'none');
  472. $('.cupImg').css('display', 'none');
  473. }
  474. if (Data[0].F_ConPhone) {
  475. var conPhone = decryptFn(Data[0].F_CusPhoneShow)
  476. $(".F_ConPhone").text(conPhone);
  477. $('.copImg').css('display', 'inline-block')
  478. } else {
  479. $(".F_ConPhone").css('display', 'none');
  480. $('.copImg').css('display', 'none');
  481. }
  482. if (String(Data[0].F_VisitType) === "1") {
  483. $(".visittype").text("无需回访")
  484. } else {
  485. $(".visittype").text("正常回访")
  486. }
  487. }
  488. })
  489. }
  490. //回访
  491. function loadHF(){
  492. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrderNew', {
  493. workorderid: wid,
  494. type: 6,
  495. "token": $.cookie("token")
  496. }, function (result) {
  497. if (result.state.toLowerCase() == "success") {
  498. if(result.data.length>=1){
  499. ischange = 1
  500. if($(' input[name="huifang"]:checked ').val() == '1'){//满意
  501. $('.isShowbtn').hide()
  502. $('.sendMessage').show()
  503. }else{
  504. $('.isShowbtn').hide()
  505. $('.sendMessage').hide()
  506. }
  507. }
  508. }
  509. })
  510. }
  511. $('input:radio[name=huifang]').change(function() {
  512. if(ischange == 1 && this.value == '1'){
  513. $('.isShowbtn').hide()
  514. $('.sendMessage').show()
  515. }
  516. if(ischange == 1 && this.value == '0'){
  517. $('.isShowbtn').hide()
  518. $('.sendMessage').hide()
  519. }
  520. });
  521. function calloutopt(telphone) {
  522. $.getJSON(huayi.config.callcenter_url + 'UserAccount/GetNowUser', {
  523. "token": $.cookie("token")
  524. }, function (result) {
  525. if (result.state.toLowerCase() == "success") {
  526. if (result.data.user.F_SeatFlag) { //判断是否话务人员
  527. if ($.cookie("extno")) { //判断是否登录分机号
  528. event.stopPropagation();
  529. if (telphone) {
  530. $.ajax({
  531. type: "get",
  532. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  533. async: true,
  534. dataType: 'json',
  535. data: {
  536. token: $.cookie("token"),
  537. phone: telphone
  538. },
  539. success: function (result) {
  540. if (result.state.toLowerCase() == "success") {
  541. if (result.data.open.toString() == '1') {
  542. isSpecialPhone = true;
  543. } else {
  544. isSpecialPhone = false;
  545. }
  546. var guid = uuid();
  547. $("#F_guid").val(guid);
  548. top.obj.Type = "MakeCall";
  549. top.obj.DestinationNumber = result.data.phone;
  550. top.obj.Header = result.data.fix;
  551. top.obj.TaskType = "2"; //0:拨号外呼;1:未接来电外呼;2:审核外呼
  552. top.obj.TaskPhoneID = wid; //审核的工单ID
  553. top.obj.TaskID = guid; //审核记录编号
  554. top.Send();
  555. }
  556. }
  557. });
  558. }
  559. } else
  560. layer.msg("未绑定分机号,不能操作回拨");
  561. } else
  562. layer.msg("非话务人员登录,不能操作回拨");
  563. }
  564. });
  565. }
  566. </script>
  567. </body>
  568. </html>