Keine Beschreibung

auditBack.html 22KB

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