add.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <style>
  4. .layui-td-gray-2{
  5. text-align: center;
  6. }
  7. .footer{
  8. display: none;
  9. }
  10. </style>
  11. {/block}
  12. <!-- 主体 -->
  13. {block name="body"}
  14. <form class="layui-form p-4">
  15. <h3 class="pb-3">新建业主</h3>
  16. <table class="layui-table layui-table-form">
  17. <tr>
  18. <td class="layui-td-gray-2">业主名称<font>*</font></td>
  19. <td><input type="text" name="title" lay-verify="required" lay-reqText="请完善名称" value=""
  20. autocomplete="off" placeholder="请输入名称" class="layui-input"></td>
  21. <td class="layui-td-gray-2">电话<font>*</font></td>
  22. <td><input type="text" name="phone" lay-verify="required" lay-reqText="请完善电话" value=""
  23. autocomplete="off" placeholder="请输入电话" class="layui-input"></td>
  24. </tr>
  25. <tr>
  26. <td class="layui-td-gray-2">业主类型<font>*</font></td>
  27. <td><input type="text" name="company_type" lay-verify="required" lay-reqText="请完善送审单位类型" value=""
  28. autocomplete="off" placeholder="请输入送审单位类型" class="layui-input"></td>
  29. <td class="layui-td-gray-2">业主地址<font>*</font></td>
  30. <td><input type="text" name="address" lay-verify="required" lay-reqText="请完善送审单位地址" value=""
  31. autocomplete="off" placeholder="请输入送审单位类型" class="layui-input"></td>
  32. <td colspan='2'></td>
  33. </tr>
  34. </table>
  35. <div class="pt-3">
  36. <input type="hidden" name="" value="0"/>
  37. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  38. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  39. </div>
  40. </form>
  41. {/block}
  42. <!-- /主体 -->
  43. <!-- 脚本 -->
  44. {block name="script"}
  45. <script>
  46. var moduleInit = ['tool'];
  47. function gouguInit() {
  48. var form = layui.form, tool = layui.tool;
  49. let a = 1;
  50. //监听提交
  51. form.on('submit(webform)', function (data) {
  52. if(a){
  53. let callback = function (e) {
  54. layer.msg(e.msg);
  55. if (e.code == 0) {
  56. tool.sideClose(1000);
  57. a = 1
  58. }
  59. }
  60. tool.post("/admin/cpuser.institution/add", data.field, callback);
  61. }
  62. a = 0
  63. return false;
  64. });
  65. }
  66. </script>
  67. {/block}
  68. <!-- /脚本 -->