No Description

addorEdit.html 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <script src="../../Script/Common/huayi.load.js"></script>
  7. <script src="../../Script/Common/huayi.config.js"></script>
  8. <link href="../../css/init.css" rel="stylesheet" />
  9. <link rel="stylesheet" type="text/css" href="../../css/Table/table1.css" />
  10. <link rel="stylesheet" href="../../css/webuploader.css" />
  11. <title>新增公告</title>
  12. <style>
  13. #noticCont{
  14. height: 380px;
  15. }
  16. </style>
  17. </head>
  18. <body class="gray-bg">
  19. <div class="container wrapper-content animated fadeInRight">
  20. <div class="form-horizontal">
  21. <div class="form-group code">
  22. <label for="code" class="col-sm-3 control-label text-right">排序号</label>
  23. <div class="col-sm-9">
  24. <input id="code" class="form-control" type="text" autocomplete="off" placeholder="请输入排序号" />
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label for="borrowpeoplec" class="col-sm-3 control-label text-right">公告内容</label>
  29. <div class="col-sm-9">
  30. <textarea id="noticCont" rows="3" cols="20" class="form-control" placeholder="请输入公告内容"></textarea>
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <div class="col-sm-12" style="text-align: center;">
  35. <input type="button" id="HY_save" class="btn_gray btn" value="保存" />
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <script type="text/javascript">
  41. var id = helper.request.queryString("id");
  42. if(id!=''){
  43. $('.code').css('display','none')
  44. getDetial(id)
  45. $('#HY_save').click(function(){
  46. $.ajax({
  47. type: "get",
  48. url: huayi.config.callcenter_url + 'testusertypeapi/api/TestUserType/upimportmassage',
  49. async: true,
  50. dataType: 'json',
  51. data: {
  52. id:id,
  53. ifshowfirst: $('#code').val(),
  54. conterinfo:$('#noticCont').val()
  55. },
  56. success: function(data) {
  57. if (data.state.toLowerCase() == 'success') {
  58. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  59. parent.layer.close(index); //再执行关闭
  60. layer.msg(data.message);
  61. parent.initTable();
  62. }
  63. }
  64. });
  65. })
  66. }else{
  67. $('.code').css('display','block')
  68. $('#HY_save').click(function(){
  69. $.ajax({
  70. type: "get",
  71. url: huayi.config.callcenter_url + 'testusertypeapi/api/TestUserType/addimportmassage',
  72. async: true,
  73. dataType: 'json',
  74. data: {
  75. ifshowfirst: $('#code').val(),
  76. conterinfo:$('#noticCont').val()
  77. },
  78. success: function(data) {
  79. if (data.state.toLowerCase() == 'success') {
  80. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  81. parent.layer.close(index); //再执行关闭
  82. layer.msg(data.message);
  83. parent.initTable();
  84. }
  85. }
  86. });
  87. })
  88. }
  89. function getDetial(id){
  90. $.ajax({
  91. type: "get",
  92. url: huayi.config.callcenter_url + 'testusertypeapi/api/TestUserType/getimportmassagebyid',
  93. async: true,
  94. dataType: 'json',
  95. data: {
  96. id:id
  97. },
  98. success: function(data) {
  99. if (data.state.toLowerCase() == 'success') {
  100. $('#code').val(data.data[0].ifshowfirst)
  101. $('#noticCont').val(data.data[0].conterinfo)
  102. }
  103. }
  104. });
  105. }
  106. </script>
  107. </body>
  108. </html>