Нет описания

auditBack.html 22KB

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