Brak opisu

Details.html 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  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">
  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="btns" 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. var html = '';
  239. var detail = data.data.detail;
  240. for (var i = 0; i < detail.length; i++) {
  241. if (detail[i].field == "F_Phone") {
  242. html = '<li>' +
  243. '<label for="">' + detail[i].text + ':</label>' +
  244. '<span class="CusTelphone">' + detail[i].value + '</span><img id="Call" style="vertical-align: text-bottom;margin-left: 5px;"src="../img/Phones.png" />' +
  245. '</li>'
  246. } else {
  247. html = '<li>' +
  248. '<label for="">' + detail[i].text + ':</label>' +
  249. '<span class="' + detail[i].field + '">' + detail[i].value + '</span>' +
  250. '</li>'
  251. }
  252. $(html).appendTo(".UL");
  253. }
  254. if (data.data.pagerid > 0) {
  255. $('.content_3').show();
  256. $(".tbody").empty();
  257. $.ajax({
  258. type: "get",
  259. url: huayi.config.callcenter_url + "/Questionnaire/GetPagerInfoQ",
  260. async: true,
  261. dataType: "json",
  262. data: {
  263. pid: data.data.pagerid,
  264. token: $.cookie("token"),
  265. },
  266. success: function (data) {
  267. if (data.state.toLowerCase() == 'success') {
  268. $('.Title').text(data.data.F_Title);
  269. $(".F_Remark").text(data.data.F_Remark);
  270. var Questions = data.data.F_Questions;
  271. var html = '';
  272. for (var i = 0; i < Questions.length; i++) {
  273. var questype = Questions[i].questype;
  274. var Quesid = Questions[i].quesid;
  275. html += '<li class="" name="ltype' + Quesid + '" >';
  276. html += '<div class="Back">';
  277. html += '<h3 class="size-14 QuesTitle" indexs="' + Questions[i].quesid + '">' + Questions[i].questitle + ' </h3>';
  278. html += '</div>';
  279. //判断类型
  280. if (questype == 2) {
  281. //选项
  282. if (Questions[i].quesitems.length > 0) { //单选
  283. html += '<div class="radio" name="ltype' + Quesid + '" indexs="' + Questions[i].quesid + '">';
  284. var quesitems = Questions[i].quesitems;
  285. for (var j = 0; j < quesitems.length; j++) {
  286. html += '<label style="font-weight: normal;">'
  287. html += '' + (j + 1) + '.';
  288. 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>'
  289. }
  290. html += '</div>'
  291. html += '</li>'
  292. }
  293. } else if (questype == 1) {
  294. //问答题
  295. html += '<div class="Wd" indexs="' + Questions[i].quesid + '">';
  296. html += '<textarea class="Wds" index="' + Questions[i].quesid + '"name="" rows="" cols="" style="width: 100%;"></textarea>'
  297. html += '</div>'
  298. } else {
  299. if (Questions[i].quesitems.length > 0) { //多选
  300. html += '<div class="checkbox" name="ltype' + Quesid + '" indexs="' + Questions[i].quesid + '">';
  301. var quesitems = Questions[i].quesitems;
  302. for (var j = 0; j < quesitems.length; j++) {
  303. html += '<label style="font-weight: normal;">'
  304. html += '' + (j + 1) + '.';
  305. html += '<input type="checkbox" index_="' + quesitems[j].itemid + '" value="' + quesitems[j].itemid + '" name="ltype' + Quesid + '" ><span> ' + quesitems[j].itemname + '</span></label>'
  306. //html += '<input type="checkbox" index_="' + quesitems[j].itemid + '" value="' + quesitems[j].itemid + '" name="ltype' + Quesid + '" > ' + quesitems[j].itemname + '</label>'
  307. }
  308. html += '</div>'
  309. html += '</li >';
  310. }
  311. }
  312. }
  313. $(html).appendTo(".tbody");
  314. }
  315. }
  316. });
  317. }
  318. $('#taskid').val(data.data.taskid);
  319. $('#id').val(data.data.id);
  320. }
  321. $("#Call").click(function () {
  322. $.ajax({
  323. type: "get",
  324. url: huayi.config.callcenter_url + "CallOutOpt/GetCallOutprefix",
  325. async: true,
  326. dataType: 'json',
  327. data: {
  328. token: $.cookie("token"),
  329. phone: $(".CusTelphone").text()
  330. },
  331. success: function (result) {
  332. // result = $.parseJSON(result);
  333. if (result.state.toLowerCase() == "success") {
  334. var guid = uuid();
  335. top.obj.Type = "MakeCall";
  336. top.obj.DestinationNumber = result.data.phone;
  337. top.obj.Header = result.data.fix;
  338. top.obj.TaskType = "9"; //0:点击外呼;
  339. top.obj.TaskPhoneID = $('#id').val(); //点击外呼号码ID
  340. top.obj.TaskID = $('#taskid').val(); //点击外呼任务Id
  341. top.Send();
  342. $(".WH").addClass("hidens");
  343. }
  344. //更新外呼号码状态
  345. $.ajax({
  346. type: "post", url: huayi.config.callcenter_url + "CallPlan/UpdateCallState",
  347. dataType: "json", data: { id: id },
  348. success: function (res) { }
  349. })
  350. }
  351. });
  352. })
  353. }
  354. });
  355. GetHJJG();
  356. GetYHFK();
  357. }
  358. })
  359. //获取呼叫结果
  360. function GetHJJG() {
  361. $.ajax({
  362. type: "get",
  363. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  364. dataType: 'json',
  365. data: {
  366. flag: 'HJJG',
  367. token: token
  368. },
  369. async: true,
  370. success: function (data) {
  371. var Count = data.data;
  372. //$("<option value=''>--全部--</option>").appendTo($("#selhjjg"));
  373. for (var i = 0; i < Count.length; i++) {
  374. console.log(Count[i].F_UserName);
  375. //$("<option value='" + Count[i].F_DictionaryValueId + "'>" + Count[i].F_Name + "</option>").appendTo($("#selhjjg"));
  376. $("<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>").
  377. appendTo($("#ulhjjg"));
  378. }
  379. }
  380. });
  381. }
  382. function GetYHFK() {
  383. $.ajax({
  384. type: "get",
  385. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListByFlag",
  386. dataType: 'json',
  387. data: {
  388. flag: 'YHFK',
  389. token: token
  390. },
  391. async: true,
  392. success: function (data) {
  393. var Count = data.data;
  394. //$("<option value=''>--全部--</option>").appendTo($("#selhjjg"));
  395. for (var i = 0; i < Count.length; i++) {
  396. console.log(Count[i].F_UserName);
  397. //$("<option value='" + Count[i].F_DictionaryValueId + "'>" + Count[i].F_Name + "</option>").appendTo($("#selhjjg"));
  398. $("<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>").
  399. appendTo($("#ulyhfk"));
  400. }
  401. }
  402. });
  403. }
  404. //提交
  405. var ans = [];
  406. var type;
  407. var star_number = [];
  408. var content;
  409. var str;
  410. var strs;
  411. $("#Submit").click(function () {
  412. $("#Submit").attr("disabled", "disabled");
  413. $(".radio").each(function (j, k) {
  414. str = '';
  415. var name = $(k).attr("name");
  416. var index = $(k).attr("indexs");
  417. var val = $('input[name="' + name + '"]:checked').val();
  418. var valText = $('input[name="' + name + '"]:checked').next().text();
  419. if (val != null) {
  420. str = index + '_' + val + '_' + valText;
  421. ans.push(str);
  422. }
  423. })
  424. $(".checkbox").each(function (j, k) {
  425. strs = '';
  426. var name = $(k).attr("name");
  427. var index = $(k).attr("indexs");
  428. var check = ""; var text = "";
  429. //var val=$('input[name="'+ name+'"]:checked').val();
  430. var VAl = $('input[name="' + name + '"]:checked');
  431. $(VAl).each(function (i, n) {
  432. text += $(this).next().text() + "|";
  433. check += $(this).val() + "|";
  434. })
  435. if (check != "") {
  436. str = index + '_' + check + '_' + text;
  437. ans.push(str);
  438. }
  439. })
  440. $(".Wd").each(function (j, k) {
  441. strs = '';
  442. var name = $(k).attr("name");
  443. var index = $(k).attr("indexs");
  444. var val = $(k).find(".Wds").val();
  445. if (val) {
  446. str = index + '_0_' + val;
  447. ans.push(str);
  448. }
  449. })
  450. console.log(ans);
  451. //请求
  452. $.ajax({
  453. type: "POST",
  454. url: huayi.config.callcenter_url + "CallPlan/Answers",
  455. dataType: 'json',
  456. data: {
  457. taskid: $("#taskid").val(),//任务ID
  458. id: $('#id').val(),//客户电话ID
  459. //cusid: $("#F_CusID").val(),//客户档案ID
  460. ans: ans,//答案,数组形式["15_20_单选选项内容","17_25|36|58_复选选项内容1|选项内容2|选项内容3","30_0_问答题"]
  461. hjjg: $('#ulhjjg input[name="hjjg"]:checked ').val(),//呼叫结果
  462. yhfk: $('#ulyhfk input[name="yhfk"]:checked ').val(), //用户反馈
  463. remark: $(".remark").val(),
  464. token: $.cookie("token")
  465. },
  466. async: true,
  467. success: function (data) {
  468. if (data.state == 'success') {
  469. var Count = data.data;
  470. var index = parent.layer.getFrameIndex(window.name);
  471. parent.layer.close(index);
  472. parent.initTable();
  473. console.log(Count)
  474. } else {
  475. $("#Submit").removeAttr("disabled");
  476. }
  477. }
  478. });
  479. })
  480. </script>
  481. </body>
  482. </html>