manager.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <div id="manager" class="plg-tab-container">
  2. <blockquote class="layui-elem-quote layui-text plg-elem-quote" style="background:#fff;">
  3. 流程实例使用教程
  4. </blockquote>
  5. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  6. <legend>示列:总经理</legend>
  7. </fieldset>
  8. <form class="layui-form" action="">
  9. <div class="layui-form-item">
  10. <label class="layui-form-label">总经理</label>
  11. <div class="layui-input-block">
  12. <input type="text" name="username" autocomplete="off" lay-verify="required" placeholder="请输入名称" class="layui-input">
  13. </div>
  14. </div>
  15. <div class="layui-form-item layui-form-text">
  16. <label class="layui-form-label">批文</label>
  17. <div class="layui-input-block">
  18. <textarea name="reason" autocomplete="off" lay-verify="required" placeholder="请输入" class="layui-textarea"></textarea>
  19. </div>
  20. </div>
  21. <div class="layui-form-item">
  22. <div class="layui-input-block">
  23. <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
  24. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  25. </div>
  26. </div>
  27. </form>
  28. </div>
  29. <script>
  30. $(function(){
  31. var form = layui.form,
  32. layer = layui.layer;
  33. //监听提交
  34. form.on('submit(demo1)', function(data){
  35. // layer.alert(JSON.stringify(data.field), {
  36. // title: '最终的提交信息'
  37. // })
  38. //请求后台
  39. Prolog.ajax({
  40. url: "/api/askforleave-service/askforleave/leader",
  41. type: "POST",
  42. data: {
  43. "leaderName":data.field.username,
  44. "leaderreason":data.field.reason
  45. },
  46. success:function(da){
  47. alert(da.data);
  48. }
  49. });
  50. return false;
  51. });
  52. });
  53. </script>