form.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
  2. <div class="layui-card-body padding-left-40">
  3. <div class="layui-form-item">
  4. <label class="relative block">
  5. <span class="color-green font-w7">登录用户账号</span>
  6. <span class="color-desc margin-left-5">Username</span>
  7. {if isset($vo) and isset($vo.username)}
  8. <input disabled value='{$vo.username|default=""}' class="layui-input layui-bg-gray">
  9. {else}
  10. <input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入4位及以上字符登录用户账号" class="layui-input">
  11. {/if}
  12. </label>
  13. <p class="help-block">登录用户账号创建后,不允许再次修改。</p>
  14. </div>
  15. <div class="layui-form-item">
  16. <label class="relative block">
  17. <span class="color-green font-w7">用户联系手机</span>
  18. <span class="color-desc margin-left-5">Phone</span>
  19. <input type="tel" maxlength="11" autocomplete="off" autofocus name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入用户联系手机" class="layui-input">
  20. </label>
  21. <p class="color-desc">可选,用户联系手机号码,需要填写正确的格式</p>
  22. </div>
  23. <div class="layui-form-item">
  24. <label class="relative block">
  25. <span class="color-green font-w7">联系电子邮箱</span>
  26. <span class="color-desc margin-left-5">Email</span>
  27. <input name="mail" autocomplete="off" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.mail|default=""}' placeholder="请输入联系电子邮箱" class="layui-input">
  28. </label>
  29. <p class="color-desc">可选,用户联系电子邮箱,需要填写正确的格式</p>
  30. </div>
  31. {if !isset($vo.id) || (isset($vo.id) && $vo.id != 10000)}
  32. <div class="layui-form-item">
  33. <label class="relative block">
  34. <span class="color-green font-w7">绑定员工</span>
  35. <span class="color-desc margin-left-5">engineer_id</span>
  36. <select class="layui-select relative block" style="width: 100%" name="engineer_id">
  37. {foreach $user_id_arr as $k=>$v}
  38. <!--{if isset($vo.engineer_id) && $vo.engineer_id==$k}-->
  39. <option selected value="{$k}">{$v}</option>
  40. <!--{else}-->
  41. <option value="{$k}">{$v}</option>
  42. <!--{/if}-->
  43. {/foreach}
  44. </select>
  45. </label>
  46. <p class="color-desc">可选,关联的员工,只能看到自己分配的订单</p>
  47. </div>
  48. {/if}
  49. {notempty name='authorizes'}
  50. <div class="layui-form-item relative">
  51. <span class="color-green font-w7">角色访问授权</span>
  52. <span class="color-desc margin-left-5">Authorization</span>
  53. <div class="layui-textarea">
  54. {if isset($vo.username) and $vo.username eq 'admin'}
  55. <span class="color-desc">超级用户不需要配置权限</span>
  56. {elseif empty($authorizes)}
  57. <span class="color-desc">未配置权限</span>
  58. {else}
  59. {foreach $authorizes as $authorize}
  60. <label class="think-checkbox layui-unselect">
  61. {if in_array($authorize.id, $vo.authorize)}
  62. <input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
  63. {else}
  64. <input type="checkbox" name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
  65. {/if}
  66. </label>
  67. {/foreach}
  68. {/if}
  69. </div>
  70. </div>
  71. {/notempty}
  72. <div class="layui-form-item">
  73. <label class="relative block">
  74. <span class="color-green font-w7">用户身份描述</span>
  75. <span class="color-desc margin-left-5">Description</span>
  76. <textarea placeholder="请输入用户身份描述" class="layui-textarea" name="desc">{$vo.desc|default=""}</textarea>
  77. </label>
  78. </div>
  79. </div>
  80. <div class="hr-line-dashed"></div>
  81. {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
  82. <div class="layui-form-item text-center">
  83. <button class="layui-btn" type='submit'>保存数据</button>
  84. <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
  85. </div>
  86. </form>