Sin descripción

auditBack.html 18KB

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