ZZDianXin_UI - 郑州电信 演示

XgRight.html 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 href="../css/Table/table1.css" rel="stylesheet" />
  8. <link href="../css/init.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="../css/Quality/bootstrap-editable.css" />
  10. <script src="../js/Questions/bootstrap-editable.js"></script>
  11. <title></title>
  12. <style>
  13. table tr {
  14. margin-bottom: 20px;
  15. }
  16. table tr td {
  17. text-align: left;
  18. padding: 5px;
  19. }
  20. .Content {
  21. padding: 10px;
  22. }
  23. .btn {
  24. background: #1ab394;
  25. }
  26. .Btn_box {
  27. margin-top: 20px;
  28. color: #fff;
  29. }
  30. .inpBox select {
  31. width: 150px;
  32. padding: 3px 6px;
  33. }
  34. .F_Remark {
  35. width: 100%;
  36. resize: none;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div>
  42. <div class="Content">
  43. <div class="tab">
  44. <table id="sqzx" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
  45. <tr>
  46. <th class="text-danger">试题分类:</th>
  47. <td>
  48. <div class="inpBox">
  49. <select name="" id="Select">
  50. <option value="">请选择试题分类</option>
  51. </select>
  52. </div>
  53. </td>
  54. <th>试题题型:</th>
  55. <td>
  56. <div class="inpBox">
  57. <select name="" id="CheckQuestion">
  58. <option value="1">问答题</option>
  59. <option value="2">单选题</option>
  60. <option value="3">多选题</option>
  61. </select>
  62. </div>
  63. </td>
  64. </tr>
  65. <tr>
  66. <th class="text-danger">试题标题:</th>
  67. <td colspan="5">
  68. <textarea name="" rows="1" cols="20" id="qTitle" class="F_Remark"></textarea>
  69. </td>
  70. </tr>
  71. <tr>
  72. <th>试题说明:</th>
  73. <td colspan="5">
  74. <textarea name="" rows="3" cols="20" id="remarks" class="F_Remark"></textarea>
  75. </td>
  76. </tr>
  77. </table>
  78. </div>
  79. <div style="text-align: center; margin-top: 50px;">
  80. <button class="btns add size-14">保存</button>
  81. </div>
  82. </div>
  83. </div>
  84. <script>
  85. var Cids = helper.request.queryString("Cids");
  86. var QuestionId;
  87. $(document).ready(function() {
  88. Select();
  89. });
  90. //修改
  91. $(".add").click(function() {
  92. var CategoryId = $("#Select").val(); //试题分类
  93. var Title = $("#qTitle").val(); //试题标题
  94. if(!$.trim(CategoryId)) {
  95. layer.confirm('试题分类不能为空!', {
  96. icon: 2,
  97. btn: ['确定']
  98. });
  99. return;
  100. }
  101. if(!$.trim(Title)) {
  102. layer.confirm('试题标题不能为空!', {
  103. icon: 2,
  104. btn: ['确定']
  105. });
  106. return;
  107. }
  108. $.ajax({
  109. type: "post",
  110. url: huayi.config.callcenter_url + "Questionnaire/CreateOrUpdateQuestion",
  111. async: true,
  112. dataType: "json",
  113. data: {
  114. F_QuestionId: QuestionId, //试题ID
  115. F_CategoryId: CategoryId, //分类ID
  116. F_Title: Title, //试题标题
  117. // F_Content://试题内容
  118. F_Type: $("#CheckQuestion").val(), //题型(1.问答题;2.单选题;3.多选题)
  119. F_Remark: $("#remarks").val(), //试题说明
  120. token: $.cookie("token"),
  121. },
  122. success: function(data) {
  123. if(data.state.toLowerCase() == 'success') {
  124. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  125. parent.layer.close(index); //再执行关闭
  126. parent.Finish();
  127. // parent.location.reload();
  128. parent.layer.msg("修改成功");
  129. }
  130. }
  131. });
  132. })
  133. //下拉
  134. function Select() {
  135. $.ajax({
  136. type: "get",
  137. url: huayi.config.callcenter_url + "Questionnaire/GetQCategoryAlllist",
  138. dataType: 'json',
  139. async: true,
  140. data: {
  141. token: $.cookie("token")
  142. },
  143. success: function(data) {
  144. /*验证请求*/
  145. if(data.state == "success") {
  146. var html = ''
  147. for(var i = 0; i < data.data.length; i++) {
  148. html += '<option value="' + data.data[i].F_CategoryId + '">' + data.data[i].F_CategoryName + '</option>'
  149. }
  150. $(html).appendTo("#Select");
  151. }
  152. }
  153. })
  154. .then(function() {
  155. //获取详情
  156. $.ajax({
  157. type: "get",
  158. url: huayi.config.callcenter_url + "Questionnaire/GetQuestionModel",
  159. dataType: 'json',
  160. async: true,
  161. data: {
  162. id: Cids,
  163. token: $.cookie("token")
  164. },
  165. success: function(data) {
  166. /*验证请求*/
  167. if(data.state == "success") {
  168. $("#Select").val(data.data.F_CategoryId); //试题分类
  169. console.log(data.data.F_CategoryId);
  170. QuestionId = data.data.F_QuestionId;
  171. $("#CheckQuestion").val(data.data.F_Type); //问题类型F_Title
  172. $('#qTitle').val(data.data.F_Title) //标题
  173. $('#remarks').val(data.data.F_Remark) //说明
  174. }
  175. }
  176. });
  177. });
  178. }
  179. </script>
  180. </body>
  181. </html>