Sin descripción

Details.html 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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>
  10. .shark_content {
  11. overflow-y: auto;
  12. position: relative;
  13. padding-bottom: 50px;
  14. padding: 10px;
  15. margin-bottom: 30px;
  16. }
  17. .shark_content_title {
  18. font-size: 14px;
  19. height: 30px;
  20. line-height: 20px;
  21. border-bottom: 1px solid #CCCCCC;
  22. margin-bottom: 5px;
  23. margin-top: 5px;
  24. }
  25. .clearfix:after {
  26. content: "";
  27. display: block;
  28. clear: both;
  29. }
  30. ul {
  31. padding-left: 0;
  32. overflow: hidden;
  33. }
  34. ul li {
  35. list-style: none;
  36. float: left;
  37. width: 33%;
  38. padding: 6px 0 5px 10px;
  39. line-height: 30px;
  40. border: 0.1px dotted #cccccc;
  41. }
  42. label {
  43. text-align: center;
  44. width: 30%;
  45. }
  46. .layui-layer-shade {
  47. background-color: red !important;
  48. }
  49. .wh_btn {
  50. width: 80%;
  51. text-align: center;
  52. padding-top: 20px;
  53. margin: 0 auto;
  54. margin-bottom: 20px;
  55. }
  56. .content_3 {
  57. display: none;
  58. }
  59. #tbr {
  60. border: 1px solid #ccc;
  61. border-bottom: none;
  62. }
  63. #tbr td {
  64. padding: 10px;
  65. padding: 6px 0 5px 10px;
  66. color: #717171;
  67. line-height: 200%;
  68. border-top: 1px dotted #cccccc;
  69. }
  70. #tbr th {
  71. border-right: 1px dotted #cccccc;
  72. border-top: 1px dotted #cccccc;
  73. background: #f9f9f9;
  74. text-align: right;
  75. }
  76. .Back {
  77. padding: 5px;
  78. border-bottom: 1px solid #ccc;
  79. }
  80. label {
  81. margin-right: 10px;
  82. }
  83. .Phone_Text ul {
  84. padding-left: 0;
  85. }
  86. .Phone_Text li {
  87. width: 50%;
  88. }
  89. .Phone_Text label {
  90. width: 60px;
  91. }
  92. .Qus_box li {
  93. list-style: none;
  94. border: 1px solid #ccc;
  95. border-bottom: none;
  96. float: none;
  97. }
  98. .Qus_box {
  99. padding-left: 0 !important;
  100. }
  101. .Qus_box div {
  102. padding: 10px;
  103. border-bottom: 1px solid #ccc;
  104. }
  105. .title_ul {
  106. padding-left: 0;
  107. margin-bottom: 0;
  108. }
  109. .title_ul li {
  110. border: 1px solid #ccc;
  111. float: none;
  112. }
  113. .title_ul li label {
  114. border-right: 1px solid #ccc;
  115. line-height: 30px;
  116. margin: 0;
  117. padding: 10px;
  118. }
  119. .checkbox input[type=checkbox] {
  120. margin-top: 0;
  121. margin-left: 0;
  122. position: relative;
  123. }
  124. .radio input[type=radio] {
  125. margin-top: 0;
  126. margin-left: 0;
  127. position: relative;
  128. }
  129. .tbody li {
  130. width: 100%;
  131. padding: 5px;
  132. }
  133. .tbody label {
  134. text-align: left;
  135. background-color: #fff;
  136. }
  137. </style>
  138. </head>
  139. <body>
  140. <div class="shark_content ">
  141. <div class="content_1">
  142. <div class="shark_content_title">
  143. <span>电话信息:</span>
  144. </div>
  145. <ul class="UL"></ul>
  146. </div>
  147. <div class="content_2 clearfix">
  148. <div class="shark_content_title">
  149. <span>呼叫结果</span>
  150. </div>
  151. <div class="clearfix">
  152. <ul class="clearfix " id="ulhjjg"></ul>
  153. </div>
  154. </div>
  155. <div class="content_2 clearfix">
  156. <div class="shark_content_title">
  157. <span>用户反馈</span>
  158. </div>
  159. <div class="clearfix">
  160. <ul class="clearfix " id="ulyhfk"></ul>
  161. </div>
  162. </div>
  163. <div class="content_3 clearfix" style="display: none;">
  164. <div class="shark_content_title">
  165. <span>问卷调查</span>
  166. </div>
  167. <div class="clearfix">
  168. <div class="tbright">
  169. <table id="tbr" style="width: 100%;">
  170. <thead>
  171. <tr>
  172. <th style='width: 150px;'>问卷名称:</th>
  173. <td colspan="7"><span class="Title"></span></td>
  174. </tr>
  175. <tr>
  176. <th style='width: 150px;'>问卷说明:</th>
  177. <td colspan="7"><span class="F_Remark"></span></td>
  178. </tr>
  179. </thead>
  180. <!--<tbody class="tbody">
  181. <tr class="Back">
  182. <td colspan="2">
  183. <h3 class="size-14">1、对我们的产品是否满意? </h3>
  184. </td>
  185. </tr>
  186. <tr class="">
  187. <td colspan="2">
  188. <div class="Message_box">
  189. <label style="font-weight: normal;">1.<input type="checkbox" value="一般" name="ltype"> 一般</label>
  190. <label style="font-weight: normal;"><input type="checkbox" value="538" name="ltype"> 满意</label>
  191. <label style="font-weight: normal;"><input type="checkbox" value="539" name="ltype">不满意</label>
  192. </div>
  193. </td>
  194. </tr>
  195. <tr class="Back">
  196. <td colspan="2">
  197. <h3 class="size-14">2、您好,你是? </h3>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td colspan="2">
  202. <div class="Message_box">
  203. <textarea name="" rows="" cols="" style="width: 100%;"></textarea>
  204. </div>
  205. </td>
  206. </tr>
  207. </tbody>-->
  208. </table>
  209. <ul class="tbody"></ul>
  210. </div>
  211. </div>
  212. </div>
  213. </div>
  214. <div class="wh_btn">
  215. <input type="hidden" name="taskid" id="taskid" value="" />
  216. <input type="hidden" name="id" id="id" value="" />
  217. <input type="button" value="提交" class="btn btn-primary" id="Submit" />
  218. </div>
  219. <script src="../js/guid.js"></script>
  220. <script>
  221. var id = helper.request.queryString("wid");
  222. var taskId;
  223. var token = $.cookie("token");
  224. console.log(id);
  225. $(document).ready(function() {
  226. if(id) {
  227. $.ajax({
  228. type: "get",
  229. url: huayi.config.callcenter_url + "CallPlan/GetCallNumDetail",
  230. async: true,
  231. dataType: 'json',
  232. data: {
  233. token: token,
  234. id: id
  235. },
  236. success: function(data) {
  237. if(data.state == 'success') {
  238. debugger;
  239. var html = '';
  240. var detail = data.data.detail;
  241. for(var i = 0; i < detail.length; i++) {
  242. if(detail[i].field == "F_Phone") {
  243. html = '<li>' +
  244. '<label for="">' + detail[i].text + ':</label>' +
  245. '<span class="CusTelphone">' + detail[i].value + '</span><img id="Call" style="vertical-align: text-bottom;margin-left: 5px;"src="../img/Phones.png" />' +
  246. '</li>'
  247. } else {
  248. html = '<li>' +
  249. '<label for="">' + detail[i].text + ':</label>' +
  250. '<span class="' + detail[i].field + '">' + detail[i].value + '</span>' +
  251. '</li>'
  252. }
  253. $(html).appendTo(".UL");
  254. }
  255. if(data.data.pagerid > 0) {
  256. $('.content_3').show();
  257. $(".tbody").empty();
  258. $.ajax({
  259. type: "get",
  260. url: huayi.config.callcenter_url + "/Questionnaire/GetPagerInfoQ",
  261. async: true,
  262. dataType: "json",
  263. data: {
  264. pid: data.data.pagerid,
  265. token: $.cookie("token"),
  266. },
  267. success: function(data) {
  268. if(data.state.toLowerCase() == 'success') {
  269. $('.Title').text(data.data.F_Title);
  270. $(".F_Remark").text(data.data.F_Remark);
  271. var Questions = data.data.F_Questions;
  272. var html = '';
  273. for(var i = 0; i < Questions.length; i++) {
  274. var questype = Questions[i].questype;
  275. var Quesid = Questions[i].quesid;
  276. html += '<li class="" name="ltype' + Quesid + '" >';
  277. html += '<div class="Back">';
  278. html += '<h3 class="size-14 QuesTitle" indexs="' + Questions[i].quesid + '">' + Questions[i].questitle + ' </h3>';
  279. html += '</div>';
  280. //判断类型
  281. if(questype == 2) {
  282. //选项
  283. if(Questions[i].quesitems.length > 0) { //单选
  284. html += '<div class="radio" name="ltype' + Quesid + '" indexs="' + Questions[i].quesid + '">';
  285. var quesitems = Questions[i].quesitems;
  286. for(var j = 0; j < quesitems.length; j++) {
  287. html += '<label style="font-weight: normal;">'
  288. html += '' + (j + 1) + '.';
  289. html += '<input type="radio" index_="' + quesitems[j].itemid + '" value="' + quesitems[j].itemid + '" name="ltype' + Quesid + '" style="margin-left:5px;"> <span>' + quesitems[j].itemname + '</span></label>'
  290. }
  291. html += '</div>'
  292. html += '</li>'
  293. }
  294. } else if(questype == 1) {
  295. //问答题
  296. html += '<div class="Wd" indexs="' + Questions[i].quesid + '">';
  297. html += '<textarea class="Wds" index="' + Questions[i].quesid + '"name="" rows="" cols="" style="width: 100%;"></textarea>'
  298. html += '</div>'
  299. } else {
  300. if(Questions[i].quesitems.length > 0) { //多选
  301. html += '<div class="checkbox" name="ltype' + Quesid + '" indexs="' + Questions[i].quesid + '">';
  302. var quesitems = Questions[i].quesitems;
  303. for(var j = 0; j < quesitems.length; j++) {
  304. html += '<label style="font-weight: normal;">'
  305. html += '' + (j + 1) + '.';
  306. html += '<input type="checkbox" index_="' + quesitems[j].itemid + '" value="' + quesitems[j].itemid + '" name="ltype' + Quesid + '" ><span> ' + quesitems[j].itemname + '</span></label>'
  307. //html += '<input type="checkbox" index_="' + quesitems[j].itemid + '" value="' + quesitems[j].itemid + '" name="ltype' + Quesid + '" > ' + quesitems[j].itemname + '</label>'
  308. }
  309. html += '</div>'
  310. html += '</li >';
  311. }
  312. }
  313. }
  314. $(html).appendTo(".tbody");
  315. }
  316. }
  317. });
  318. }
  319. $('#taskid').val(data.data.taskid);
  320. $('#id').val(data.data.id);
  321. }
  322. $("#Call").click(function() {
  323. $.ajax({
  324. type: "get",
  325. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  326. async: true,
  327. dataType: 'json',
  328. data: {
  329. token: $.cookie("token"),
  330. phone: $(".CusTelphone").text()
  331. },
  332. success: function(result) {
  333. // result = $.parseJSON(result);
  334. if(result.state.toLowerCase() == "success") {
  335. var guid = uuid();
  336. top.obj.Type = "MakeCall";
  337. top.obj.DestinationNumber = result.data.phone;
  338. top.obj.Header = result.data.fix;
  339. top.obj.TaskType = "9"; //0:点击外呼;
  340. top.obj.TaskPhoneID = $('#id').val(); //点击外呼号码ID
  341. top.obj.TaskID = $('#taskid').val(); //点击外呼任务Id
  342. top.Send();
  343. $(".WH").addClass("hidens");
  344. //更新外呼号码状态
  345. $.ajax({
  346. type: "post",
  347. url: huayi.config.callcenter_url + "CallPlan/UpdateCallState",
  348. dataType: "json",
  349. data: {
  350. id: id
  351. },
  352. success: function(res) {}
  353. })
  354. }
  355. }
  356. });
  357. })
  358. }
  359. });
  360. GetHJJG();
  361. GetYHFK();
  362. }
  363. })
  364. //获取呼叫结果
  365. function GetHJJG() {
  366. $.ajax({
  367. type: "get",
  368. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  369. dataType: 'json',
  370. data: {
  371. flag: 'HJJG',
  372. token: token
  373. },
  374. async: true,
  375. success: function(data) {
  376. debugger;
  377. var Count = data.data;
  378. //$("<option value=''>--全部--</option>").appendTo($("#selhjjg"));
  379. for(var i = 0; i < Count.length; i++) {
  380. console.log(Count[i].F_UserName);
  381. //$("<option value='" + Count[i].F_DictionaryValueId + "'>" + Count[i].F_Name + "</option>").appendTo($("#selhjjg"));
  382. $("<li><input type='radio' name='hjjg' value='" + Count[i].F_DictionaryValueId + "' id='hjjg" + Count[i].F_DictionaryValueId + "' /><label for='hjjg" + Count[i].F_DictionaryValueId + "'>" + Count[i].F_Name + "</label></li>").
  383. appendTo($("#ulhjjg"));
  384. }
  385. }
  386. });
  387. }
  388. function GetYHFK() {
  389. $.ajax({
  390. type: "get",
  391. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  392. dataType: 'json',
  393. data: {
  394. flag: 'YHFK',
  395. token: token
  396. },
  397. async: true,
  398. success: function(data) {
  399. debugger;
  400. var Count = data.data;
  401. //$("<option value=''>--全部--</option>").appendTo($("#selhjjg"));
  402. for(var i = 0; i < Count.length; i++) {
  403. console.log(Count[i].F_UserName);
  404. //$("<option value='" + Count[i].F_DictionaryValueId + "'>" + Count[i].F_Name + "</option>").appendTo($("#selhjjg"));
  405. $("<li><input type='radio' name='yhfk' value='" + Count[i].F_DictionaryValueId + "' id='yhfk" + Count[i].F_DictionaryValueId + "' /><label for='yhfk" + Count[i].F_DictionaryValueId + "'>" + Count[i].F_Name + "</label></li>").
  406. appendTo($("#ulyhfk"));
  407. }
  408. }
  409. });
  410. }
  411. //提交
  412. var ans = [];
  413. var type;
  414. var star_number = [];
  415. var content;
  416. var str;
  417. var strs;
  418. $("#Submit").click(function() {
  419. $("#Submit").attr("disabled", "disabled");
  420. $(".radio").each(function(j, k) {
  421. str = '';
  422. var name = $(k).attr("name");
  423. var index = $(k).attr("indexs");
  424. var val = $('input[name="' + name + '"]:checked').val();
  425. var valText = $('input[name="' + name + '"]:checked').next().text();
  426. if(val != null) {
  427. str = index + '_' + val + '_' + valText;
  428. ans.push(str);
  429. }
  430. })
  431. $(".checkbox").each(function(j, k) {
  432. strs = '';
  433. var name = $(k).attr("name");
  434. var index = $(k).attr("indexs");
  435. var check = "";
  436. var text = "";
  437. //var val=$('input[name="'+ name+'"]:checked').val();
  438. var VAl = $('input[name="' + name + '"]:checked');
  439. $(VAl).each(function(i, n) {
  440. text += $(this).next().text() + "|";
  441. check += $(this).val() + "|";
  442. })
  443. if(check != "") {
  444. str = index + '_' + check + '_' + text;
  445. ans.push(str);
  446. }
  447. })
  448. $(".Wd").each(function(j, k) {
  449. strs = '';
  450. var name = $(k).attr("name");
  451. var index = $(k).attr("indexs");
  452. var val = $(k).find(".Wds").val();
  453. if(val) {
  454. str = index + '_0_' + val;
  455. ans.push(str);
  456. }
  457. })
  458. console.log(ans);
  459. //请求
  460. $.ajax({
  461. type: "POST",
  462. url: huayi.config.callcenter_url + "CallPlan/Answers",
  463. dataType: 'json',
  464. data: {
  465. taskid: $("#taskid").val(), //任务ID
  466. id: $('#id').val(), //客户电话ID
  467. //cusid: $("#F_CusID").val(),//客户档案ID
  468. ans: ans, //答案,数组形式["15_20_单选选项内容","17_25|36|58_复选选项内容1|选项内容2|选项内容3","30_0_问答题"]
  469. hjjg: $('#ulhjjg input[name="hjjg"]:checked ').val(), //呼叫结果
  470. yhfk: $('#ulyhfk input[name="yhfk"]:checked ').val(), //用户反馈
  471. remark: $(".remark").val(),
  472. token: $.cookie("token")
  473. },
  474. async: true,
  475. success: function(data) {
  476. if(data.state == 'success') {
  477. var Count = data.data;
  478. var index = parent.layer.getFrameIndex(window.name);
  479. parent.layer.close(index);
  480. parent.initTable();
  481. console.log(Count)
  482. } else {
  483. $("#Submit").removeAttr("disabled");
  484. }
  485. }
  486. });
  487. })
  488. </script>
  489. </body>
  490. </html>