Нет описания

Back.html 18KB

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