新乡民调(来自息县民调) - 主标

modify.html 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. <title></title>
  10. <style>
  11. .Content {
  12. text-align: center;
  13. padding: 10px;
  14. }
  15. .btn {
  16. background: #1ab394;
  17. }
  18. .Btn_box {
  19. margin-top: 20px;
  20. color: #fff;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <div>
  26. <div class="Content">
  27. <span>名称:<input type="text" class="name" /></span>
  28. <div class="Btn_box">
  29. <button class="rightAll btn size-14">保存</button>
  30. </div>
  31. </div>
  32. </div>
  33. <script>
  34. var wid = helper.request.queryString("Str");
  35. console.log(wid);
  36. if(wid) {
  37. //增加分类
  38. $.ajax({
  39. type: "post",
  40. url: huayi.config.callcenter_url + "Questionnaire/GetQCategoryModel",
  41. dataType: 'json',
  42. data: {
  43. id: wid,
  44. token: $.cookie("token")
  45. },
  46. async: true,
  47. success: function(data) {
  48. if(data.state == "success") {
  49. $(".name").val(data.data.F_CategoryName);
  50. }
  51. }
  52. });
  53. $(".rightAll").click(function() {
  54. if(!$(".name").val()) {
  55. layer.msg("名称不能为空");
  56. }
  57. //修改分类
  58. $.ajax({
  59. type: "post",
  60. url: huayi.config.callcenter_url + "Questionnaire/CreateOrUpdateQCategory",
  61. dataType: 'json',
  62. data: {
  63. id: wid,
  64. name: $(".name").val(),
  65. token: $.cookie("token")
  66. },
  67. async: true,
  68. success: function(data) {
  69. if(data.state == "success") {
  70. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  71. parent.layer.close(index); //再执行关闭
  72. parent.IndexCategoryGe();
  73. parent.layer.msg("修改成功");
  74. }
  75. }
  76. });
  77. })
  78. }
  79. </script>
  80. </body>
  81. </html>