Нет описания

Back.html 17KB

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