activitiExample.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <div id="activitiExample" 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">
  16. <label class="layui-form-label">时间</label>
  17. <div class="layui-input-block">
  18. <input type="text" name="day" lay-verify="required" placeholder="请输入请假天数" autocomplete="off" class="layui-input">
  19. </div>
  20. </div>
  21. <div class="layui-form-item layui-form-text">
  22. <label class="layui-form-label">请假原因</label>
  23. <div class="layui-input-block">
  24. <textarea name="reason" lay-verify="required" placeholder="请输入请假原因" class="layui-textarea"></textarea>
  25. </div>
  26. </div>
  27. <div class="layui-form-item">
  28. <div class="layui-input-block">
  29. <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
  30. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  31. </div>
  32. </div>
  33. </form>
  34. </div>
  35. <script>
  36. $(function(){
  37. var form = layui.form,
  38. layer = layui.layer;
  39. //监听提交
  40. form.on('submit(demo1)', function(data){
  41. // layer.alert(JSON.stringify(data.field), {
  42. // title: '最终的提交信息'
  43. // })
  44. //请求后台
  45. Prolog.ajax({
  46. url: "/api/askforleave-service/askforleave/employ",
  47. type: "POST",
  48. data: {
  49. "employName":data.field.username,
  50. "holidaytime":data.field.day,
  51. "reason":data.field.reason
  52. },
  53. success:function(da){
  54. alert(da.data);
  55. }
  56. });
  57. return false;
  58. });
  59. });
  60. </script>