edit.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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="请完善财政局"
  20. value="{$detail.title}" autocomplete="off" placeholder="请输入财政局" class="layui-input">
  21. </td>
  22. </tr>
  23. <tr>
  24. <td class="layui-td-gray-2">座机<font>*</font></td>
  25. <td><input type="text" name="landline" lay-reqText="请完善座机"
  26. value="{$detail.landline}" autocomplete="off" placeholder="请输入座机" class="layui-input"></td>
  27. <td class="layui-td-gray-2">地址<font>*</font></td>
  28. <td><input type="text" name="address" lay-reqText="请完善地址"
  29. value="{$detail.address}" autocomplete="off" placeholder="请输入地址" class="layui-input"></td>
  30. </tr>
  31. </table>
  32. <div class="py-3">
  33. <input type="hidden" name="id" value="{$detail.id}"/>
  34. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  35. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  36. </div>
  37. </form>
  38. {/block}
  39. <!-- /主体 -->
  40. <!-- 脚本 -->
  41. {block name="script"}
  42. <script>
  43. var moduleInit = ['tool'];
  44. function gouguInit() {
  45. var form = layui.form, tool = layui.tool;
  46. let a = 1
  47. //监听提交
  48. form.on('submit(webform)', function (data) {
  49. if(a){
  50. let callback = function (e) {
  51. layer.msg(e.msg);
  52. if (e.code == 0) {
  53. tool.sideClose(1000);
  54. a = 1
  55. }
  56. }
  57. tool.post("/admin/cpuser.financial/edit", data.field, callback);
  58. }
  59. a = 0
  60. return false;
  61. });
  62. }
  63. </script>
  64. {/block}
  65. <!-- /脚本 -->