Keine Beschreibung

XgRighta.html 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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/boot/bootstrap-table.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. }
  37. th{
  38. text-align: center;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div>
  44. <div class="Content">
  45. <div class="tab">
  46. <table id="sqzx" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
  47. <tr>
  48. <th>题型:</th>
  49. <td>
  50. <div class="inpBox">
  51. <select name="" id="CheckQuestion">
  52. <option value="1">问答题</option>
  53. <option value="2">单选题</option>
  54. <option value="3">多选题</option>
  55. </select>
  56. </div>
  57. </td>
  58. </tr>
  59. <tr>
  60. <th>标题:</th>
  61. <td colspan="5">
  62. <textarea name="" rows="3" cols="20" class="F_Remark"></textarea>
  63. </td>
  64. </tr>
  65. </table>
  66. </div>
  67. <div style="text-align: center; margin-top: 50px;">
  68. <button class="btns add size-14">保存</button>
  69. </div>
  70. </div>
  71. </div>
  72. <script>
  73. var Cids = helper.request.queryString("Cids");
  74. var QuestionId;
  75. $(document).ready(function() {
  76. Select();
  77. //获取详情
  78. $.ajax({
  79. type: "get",
  80. url: huayi.config.callcenter_url + "QCSettings/GetItems",
  81. dataType: 'json',
  82. async: true,
  83. data: {
  84. id: Cids,
  85. token: $.cookie("token")
  86. },
  87. success: function(data) {
  88. /*验证请求*/
  89. if(data.state == "success") {
  90. console.log(data);
  91. $("#CheckQuestion").val(data.data.QCItem.F_ItemQType); //问题类型F_Title
  92. $('.F_Remark').val(data.data.QCItem.F_ItemName)//标题
  93. }
  94. }
  95. });
  96. //切换效果
  97. $("#CheckQuestion").change(function() {
  98. var ss = $(this).val();
  99. if(ss == "1") {
  100. $(".Check_box").hide();
  101. } else {
  102. $(".Check_box").show();
  103. }
  104. });
  105. //列表
  106. function Select() {
  107. $.ajax({
  108. type: "get",
  109. url: huayi.config.callcenter_url + "Questionnaire/GetQCategoryAlllist",
  110. dataType: 'json',
  111. async: true,
  112. data: {
  113. token: $.cookie("token")
  114. },
  115. success: function(data) {
  116. /*验证请求*/
  117. if(data.state == "success") {
  118. var html = ''
  119. for(var i = 0; i < data.data.length; i++) {
  120. html += '<option value="' + data.data[i].F_CategoryId + '">' + data.data[i].F_CategoryName + '</option>'
  121. }
  122. $(html).appendTo("#Select");
  123. }
  124. }
  125. });
  126. }
  127. });
  128. //序号
  129. function setCode(value, row, index) {
  130. return index + 1;
  131. }
  132. //修改
  133. function Check(value, row, index) {
  134. return '<a title="点击移入" class="username">' + value + '</a>'
  135. }
  136. //操作
  137. function Remove(value, row, index) {
  138. return '<div><a title="点击移入" ><i class="fa fa-remove size-14"></i></a></div>'
  139. }
  140. $("#Add").click(function() {
  141. var index = $tableLeft.bootstrapTable('getData').length;
  142. $tableLeft.bootstrapTable('insertRow', {
  143. index: index,
  144. row: {
  145. id: '测试',
  146. F_CategoryName: '测试测试'
  147. }
  148. });
  149. });
  150. ;
  151. //增加
  152. $(".add").click(function() {
  153. var Title = $(".F_Remark").val(); //试题题型
  154. if(!Title) {
  155. layer.msg("标题不能为空");
  156. }
  157. $.ajax({
  158. type: "post",
  159. url: huayi.config.callcenter_url + "QCSettings/EditItems",
  160. async: true,
  161. dataType: "json",
  162. data: {
  163. F_ItemsId:Cids,//试题ID
  164. F_ItemName: Title, //试题标题
  165. F_ItemType:0,
  166. F_ItemQType: $("#CheckQuestion").val(), //题型(1.问答题;2.单选题;3.多选题)
  167. token: $.cookie("token"),
  168. },
  169. success: function(data) {
  170. if(data.state.toLowerCase() == 'success') {
  171. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  172. parent.layer.close(index); //再执行关闭
  173. parent.Finish();
  174. parent.layer.msg("修改成功");
  175. }
  176. }
  177. });
  178. })
  179. //清除 CLEAN
  180. function Clean() {
  181. }
  182. </script>
  183. </body>
  184. </html>