| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link href="../css/layer/need/layer.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <title></title>
- <style>
- .BiaoTi{
- width: 100%;
- text-align:center;
- border-color:#ccc ;
- border:1px solid #ccc;
- }
- textarea{
- border-color:#ccc ;
- border:1px solid #ccc;
- height: 100px;
- }
- .Common {
- width: 100%;
- background: #fff;
- text-align: center;
- padding: 10px 15px;
- height: auto;
- overflow-y: auto;
- }
- .Common table th {
- padding: 5px 8px 5px 0;
- text-align: right;
- width: 20%;
- }
- .Common table {
- width: 100%;
- }
- .Common table td textarea {
- width: 100%;
- vertical-align: middle;
- resize: none;
- outline: none;
- }
- .Common table td {
- padding: 6px 0 5px 10px;
- text-align: left;
- color: #717171;
- line-height: 200%;
- }
- .btn_box {
- margin-top: 30px;
- }
- </style>
- </head>
- <body>
- <div class="Common">
- <table >
- <tr>
- <th>标题:</th>
- <td>
- <input class="BiaoTi" id="title" type="text" style="" />
- </td>
-
- </tr>
- <tr>
- <th >内容:</th>
- <td colspan="2">
- <textarea data-adaptheight id="content" name="" rows="" cols=""></textarea>
- </td>
- </tr>
- </table>
- <div class="btn_box">
- <button class="btns">保存</button>
- </div>
- </div>
- <script >
-
- $(document).ready(function(){
- $(".btns").click(function(){
- if(!$("#title").val()){
- layer.msg("输入标题");
- }
- else if(!$("#content").val()){
- layer.msg("输入内容");
- }
- Add()
-
-
- })
-
-
- })
-
- function Add(){
- $.post(huayi.config.callcenter_url + "Notice/AddNotice", {
- title:$("#title").val(),
- content:$("#content").val(),
- token: $.cookie("token"),
- }, function(result) {
- result = JSON.parse(result);
- if(result.state.toLowerCase() == "success") {
-
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.initTable();
- parent.layer.msg("添加成功");
- }
- })
- }
-
- </script>
- </body>
- </html>
|