edit.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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><td class="layui-td-gray-2">总公司<font>*</font></td>
  18. <td><input type="text" name="parent_company" lay-verify="required" lay-reqText="请完善总公司" value="{$detail.parent_company}" autocomplete="off" placeholder="请输入总公司" class="layui-input"></td><td class="layui-td-gray-2">名称<font>*</font></td>
  19. <td><input type="text" name="name" lay-verify="required" lay-reqText="请完善名称" value="{$detail.name}" autocomplete="off" placeholder="请输入名称" class="layui-input"></td><td class="layui-td-gray-2">负责人<font>*</font></td>
  20. <td><input type="text" name="principal" lay-verify="required" lay-reqText="请完善负责人" value="{$detail.principal}" autocomplete="off" placeholder="请输入负责人" class="layui-input"></td>
  21. </tr>
  22. <tr><td class="layui-td-gray-2">电话<font>*</font></td>
  23. <td><input type="text" name="phone" lay-verify="required" lay-reqText="请完善电话" value="{$detail.phone}" autocomplete="off" placeholder="请输入电话" class="layui-input"></td><td class="layui-td-gray-2">公司类型<font>*</font></td>
  24. <td><input type="text" name="type" lay-verify="required" lay-reqText="请完善公司类型" value="{$detail.type}" autocomplete="off" placeholder="请输入公司类型" class="layui-input"></td><td class="layui-td-gray-2">授权模块<font>*</font></td>
  25. <td>
  26. <select name="module" lay-verify="required" lay-reqText="请完善授权模块">
  27. <option value="">请选择</option>
  28. <option value="1" {eq name="$detail.module" value="1"} selected{/eq}>选项一</option>
  29. <option value="2" {eq name="$detail.module" value="2"} selected{/eq}>选项二</option>
  30. </select>
  31. </td>
  32. </tr>
  33. <tr><td class="layui-td-gray-2">到期时间</td>
  34. <td><input type="text" name="maturity_time" value="{$detail.maturity_time|time_format=###,'Y-m-d'}" readonly readonly id="laydate_maturity_time" autocomplete="off" placeholder="请选择" class="layui-input"></td><td class="layui-td-gray-2">创建时间</td>
  35. <td><input type="text" name="create_time" value="{$detail.create_time|time_format=###,'Y-m-d'}" readonly readonly id="laydate_create_time" autocomplete="off" placeholder="请选择" class="layui-input"></td><td class="layui-td-gray-2">更新时间</td>
  36. <td><input type="text" name="update_time" value="{$detail.update_time|time_format=###,'Y-m-d'}" readonly readonly id="laydate_update_time" autocomplete="off" placeholder="请选择" class="layui-input"></td>
  37. </tr>
  38. <tr><td class="layui-td-gray-2">删除时间</td>
  39. <td><input type="text" name="delete_time" value="{$detail.delete_time|time_format=###,'Y-m-d'}" readonly readonly id="laydate_delete_time" autocomplete="off" placeholder="请选择" class="layui-input"></td><td colspan='4'></td>
  40. </tr>
  41. </table>
  42. <div class="py-3">
  43. <input type="hidden" name="" value="{$detail.id}"/>
  44. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  45. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  46. </div>
  47. </form>
  48. {/block}
  49. <!-- /主体 -->
  50. <!-- 脚本 -->
  51. {block name="script"}
  52. <script>
  53. var moduleInit = ['tool'];
  54. function gouguInit() {
  55. var form = layui.form, tool = layui.tool;
  56. //日期选择
  57. layui.laydate.render({
  58. elem: '#laydate_maturity_time' //指定元素
  59. });//日期选择
  60. layui.laydate.render({
  61. elem: '#laydate_create_time' //指定元素
  62. });//日期选择
  63. layui.laydate.render({
  64. elem: '#laydate_update_time' //指定元素
  65. });//日期选择
  66. layui.laydate.render({
  67. elem: '#laydate_delete_time' //指定元素
  68. });
  69. let a = 1;
  70. //监听提交
  71. form.on('submit(webform)', function (data) {
  72. if(a){
  73. let callback = function (e) {
  74. layer.msg(e.msg);
  75. if (e.code == 0) {
  76. tool.sideClose(1000);
  77. a = 1
  78. }
  79. }
  80. tool.post("/admin/cpuser.institution/edit", data.field, callback);
  81. }
  82. a = 0
  83. return false;
  84. });
  85. }
  86. </script>
  87. {/block}
  88. <!-- /脚本 -->