No Description

auditBack.html 16KB

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