edit.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. <input type="hidden" name="id" id="id" value="{$model.id}">
  25. <div class="form-group">
  26. <div class="col-md-12">
  27. <div class="input-group">
  28. <span class="input-group-addon">职务名称:</span>
  29. <input maxlength="20" placeholder="请在职务名称" name="job_name" class="layui-input" id="job_name"
  30. value="{$model.job_name}">
  31. </div>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <div class="col-md-12">
  36. <div class="input-group">
  37. <span class="input-group-addon">排序:</span>
  38. <input maxlength="3" placeholder="请输入排序" name="rank" class="layui-input" id="rank"
  39. value="{$model.rank}" type="number">
  40. </div>
  41. </div>
  42. </div>
  43. <div class="form-group">
  44. <div class="col-md-12">
  45. <div class="input-group">
  46. <span class="input-group-addon">是否启用:</span>
  47. <select name="is_show" id="is_show" aria-controls="editable" class="form-control input-sm">
  48. <option value="1" {eq name="model.is_show" value="1"}selected="selected"{/eq}>启用</option>
  49. <option value="0" {eq name="model.is_show" value="0"}selected="selected"{/eq}>禁用</option>
  50. </select>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="form-actions">
  55. <div class="row">
  56. <div class="col-md-9">
  57. <button type="button" style="margin-left: 44%" class="btn btn-w-m btn-info add_mer">提交
  58. </button>
  59. </div>
  60. </div>
  61. </div>
  62. </form>
  63. </div>
  64. </div>
  65. </div>
  66. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  67. {/block}
  68. {block name="script"}
  69. <script>
  70. $('.add_mer').on('click', function () {
  71. var list = {};
  72. list.id = $('#id').val();/* 企业名 */
  73. list.job_name = $('#job_name').val();/* 企业名 */
  74. list.is_show = $('#is_show').val();
  75. list.rank = $('#rank').val();
  76. if (list.job_name == '') {
  77. $eb.message('error', '请输入企业名');
  78. return false;
  79. }
  80. var data = {};
  81. var index = layList.layer.load(1, {
  82. shade: [0.5, '#fff'] //0.1透明度的白色背景
  83. });
  84. ;
  85. $.ajax({
  86. url: "{:Url('edit_job')}",
  87. data: list,
  88. type: 'post',
  89. dataType: 'json',
  90. success: function (re) {
  91. layer.close(index);
  92. if (re.code == 200) {
  93. data[re.data] = list;
  94. $('.type-all>.active>.new-id').val(re.data);
  95. $eb.message('success', re.msg);
  96. location.reload();
  97. setTimeout(function (e) {
  98. parent.$(".J_iframe:visible")[0].contentWindow.location.reload();
  99. layer.close(index);
  100. layList.reload();
  101. }, 600)
  102. } else {
  103. $eb.message('error', re.msg);
  104. }
  105. },
  106. error: function () {
  107. layer.close(index);
  108. }
  109. })
  110. });
  111. $(document).ready(function () {
  112. var config = {
  113. ".chosen-select": {},
  114. ".chosen-select-deselect": {allow_single_deselect: true},
  115. ".chosen-select-no-single": {disable_search_threshold: 10},
  116. ".chosen-select-no-results": {no_results_text: "沒有找到你要搜索的分类"},
  117. ".chosen-select-width": {width: "95%"}
  118. };
  119. for (var selector in config) {
  120. $(selector).chosen(config[selector])
  121. }
  122. })
  123. </script>
  124. {/block}