edit.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="{$detail.title}"
  20. autocomplete="off" placeholder="请输入名称" class="layui-input"></td>
  21. <td class="layui-td-gray-2">公司类型<font>*</font></td>
  22. <td><input type="text" name="company_type" lay-reqText="请完善公司类型" value="{$detail.company_type}"
  23. autocomplete="off" placeholder="请输入公司类型" class="layui-input"></td>
  24. <td class="layui-td-gray-2">公司地址<font>*</font></td>
  25. <td><input type="text" name="address" lay-reqText="请完善公司地址" value="{$detail.address}"
  26. autocomplete="off" placeholder="请输入公司地址" class="layui-input"></td>
  27. </tr>
  28. <tr>
  29. <td class="layui-td-gray-2">部门联系电话</td>
  30. <td>
  31. <input type="text" name="landline" value="{$detail.phone}" placeholder="请输入部门联系电话,可空" autocomplete="off" class="layui-input">
  32. </td>
  33. <td class="layui-td-gray-2">有效期<font>*</font></td>
  34. <td id="date" style="display:flex;align-items: center;">
  35. <div class="layui-input-inline">
  36. <input type="text" id="start_time" name="start_time" readonly lay-reqText="请选择开始时间" placeholder="请选择" class="layui-input" value="{$detail.start_time|date='Y-m-d'}">
  37. </div>
  38. <span>-</span>
  39. <div class="layui-input-inline">
  40. <input type="text" id="end_time" name="end_time" readonly lay-reqText="请选择结束时间" placeholder="请选择" class="layui-input" value="{$detail.end_time|date='Y-m-d'}">
  41. </div>
  42. </td>
  43. <td class="layui-td-gray">状态</td>
  44. <td>
  45. <input type="radio" name="status" value="1" title="正常" {eq name="$detail.status" value="1"} checked{/eq}>
  46. <input type="radio" name="status" value="0" title="禁用" {eq name="$detail.status" value="0"} checked{/eq}>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="layui-td-gray">付费状态</td>
  51. <td colspan="3" style="display:flex;align-items: center;flex-wrap: wrap;justify-content: center;">
  52. <input type="radio" name="is_pay" value="0" title="未付费" {eq name="$detail.is_pay" value="0"} checked{/eq}>
  53. <input type="radio" name="is_pay" value="1" title="已付费" {eq name="$detail.is_pay" value="1"} checked{/eq}>
  54. <span>(未付费时,限制已归档的项目不能查看)</span>
  55. </td>
  56. </tr>
  57. </table>
  58. <div class="py-3">
  59. <input type="hidden" name="id" value="{$detail.id}"/>
  60. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  61. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  62. </div>
  63. </form>
  64. {/block}
  65. <!-- /主体 -->
  66. <!-- 脚本 -->
  67. {block name="script"}
  68. <script>
  69. var moduleInit = ['tool'];
  70. function gouguInit() {
  71. var form = layui.form, tool = layui.tool;
  72. //日期选择
  73. layui.laydate.render({
  74. elem: '#date',
  75. range: ['#start_time', '#end_time'],
  76. rangeLinked: true
  77. });
  78. let a = 1;
  79. //监听提交
  80. form.on('submit(webform)', function (data) {
  81. if(a){
  82. let callback = function (e) {
  83. layer.msg(e.msg);
  84. if (e.code == 0) {
  85. tool.sideClose(1000);
  86. a = 1
  87. }
  88. }
  89. console.log(data.field);
  90. tool.post("/admin/cpuser.company/edit", data.field, callback);
  91. }
  92. a = 0
  93. return false;
  94. });
  95. }
  96. </script>
  97. {/block}
  98. <!-- /脚本 -->