create.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <link href="{__ADMIN_PATH}plug/ueditor/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
  4. <link href="{__ADMIN_PATH}module/wechat/news/css/style.css" type="text/css" rel="stylesheet">
  5. <link href="{__FRAME_PATH}css/plugins/chosen/chosen.css" rel="stylesheet">
  6. <script type="text/javascript" src="{__ADMIN_PATH}plug/ueditor/third-party/jquery-1.10.2.min.js"></script>
  7. <script type="text/javascript" src="{__ADMIN_PATH}plug/ueditor/third-party/xss.min.js"></script>
  8. <script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/ueditor/ueditor.config.js"></script>
  9. <script type="text/javascript" charset="utf-8" src="{__ADMIN_PATH}plug/ueditor/ueditor.all.js"></script>
  10. <script src="{__ADMIN_PATH}frame/js/ajaxfileupload.js"></script>
  11. <script src="{__ADMIN_PATH}plug/validate/jquery.validate.js"></script>
  12. <script src="{__FRAME_PATH}js/plugins/chosen/chosen.jquery.js"></script>
  13. <style>
  14. .wrapper-content {
  15. padding: 0 !important;
  16. }
  17. </style>
  18. {/block}
  19. {block name="content"}
  20. <div class="row">
  21. <div class="col-sm-12 panel panel-default">
  22. <div class="panel-body" style="padding: 30px">
  23. <form class="form-horizontal" id="signupForm">
  24. <div class="form-group">
  25. <div class="col-md-12">
  26. <div class="input-group">
  27. <span class="input-group-addon">职务名称:</span>
  28. <input maxlength="20" placeholder="请输入职务名称" name="job_name" class="layui-input" id="job_name"
  29. value="">
  30. </div>
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <div class="col-md-12">
  35. <div class="input-group">
  36. <span class="input-group-addon">排序:</span>
  37. <input maxlength="3" placeholder="请输入排序" name="rank" class="layui-input" id="rank"
  38. value="" type="number">
  39. </div>
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <div class="col-md-12">
  44. <div class="input-group">
  45. <span class="input-group-addon">是否启用:</span>
  46. <select name="is_show" id="is_show" aria-controls="editable" class="form-control input-sm">
  47. <option value="1">启用</option>
  48. <option value="0">禁用</option>
  49. </select>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="form-actions">
  54. <div class="row">
  55. <div class="col-md-9">
  56. <button type="button" style="margin-left: 44%" class="btn btn-w-m btn-info add_mer">提交
  57. </button>
  58. </div>
  59. </div>
  60. </div>
  61. </form>
  62. </div>
  63. </div>
  64. </div>
  65. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  66. {/block}
  67. {block name="script"}
  68. <script>
  69. $('.add_mer').on('click', function () {
  70. var list = {};
  71. list.job_name = $('#job_name').val();/* 企业名 */
  72. list.is_show = $('#is_show').val();
  73. list.rank = $('#rank').val();
  74. if (list.job_name == '') {
  75. $eb.message('error', '请输入企业名');
  76. return false;
  77. }
  78. var data = {};
  79. var index = layList.layer.load(1, {
  80. shade: [0.5, '#fff'] //0.1透明度的白色背景
  81. });
  82. ;
  83. $.ajax({
  84. url: "{:Url('add_job')}",
  85. data: list,
  86. type: 'post',
  87. dataType: 'json',
  88. success: function (re) {
  89. layer.close(index);
  90. if (re.code == 200) {
  91. data[re.data] = list;
  92. $('.type-all>.active>.new-id').val(re.data);
  93. $eb.message('success', re.msg);
  94. location.reload();
  95. setTimeout(function (e) {
  96. parent.$(".J_iframe:visible")[0].contentWindow.location.reload();
  97. layer.close(index);
  98. layList.reload();
  99. }, 600)
  100. } else {
  101. $eb.message('error', re.msg);
  102. }
  103. },
  104. error: function () {
  105. layer.close(index);
  106. }
  107. })
  108. });
  109. $(document).ready(function () {
  110. var config = {
  111. ".chosen-select": {},
  112. ".chosen-select-deselect": {allow_single_deselect: true},
  113. ".chosen-select-no-single": {disable_search_threshold: 10},
  114. ".chosen-select-no-results": {no_results_text: "沒有找到你要搜索的分类"},
  115. ".chosen-select-width": {width: "95%"}
  116. };
  117. for (var selector in config) {
  118. $(selector).chosen(config[selector])
  119. }
  120. })
  121. </script>
  122. {/block}