edit.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <form class="layui-form p-4">
  5. <h3 class="pb-3">通知设置</h3>
  6. <table class="layui-table">
  7. <tr>
  8. <td class="layui-td-gray">通知阶段</td>
  9. <td>
  10. <input type="hidden" name="message_id" value="{$data.id}">
  11. <input type="text" name="" value="{$data.title}" lay-verify="" autocomplete="off" placeholder="请输入通知情况" lay-reqText="请输入通知情况" class="layui-input">
  12. </td>
  13. </tr>
  14. <tr>
  15. <td class="layui-td-gray">抄送人员</td>
  16. <td>
  17. <div id="memberSelect"></div>
  18. </td>
  19. </tr>
  20. <!-- <tr>
  21. <td class="layui-td-gray-2">说明<font>*</font></td>
  22. <td colspan="3"><strong class="red">注意:通知阶段选择后,通知内容若为空,则不会通知。</strong></td>
  23. </tr> -->
  24. </table>
  25. <div class="py-3">
  26. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  27. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  28. </div>
  29. </form>
  30. {/block}
  31. <!-- /主体 -->
  32. <!-- 脚本 -->
  33. {block name="script"}
  34. <script>
  35. const moduleInit = ['tool'];
  36. function gouguInit() {
  37. var form = layui.form,tool=layui.tool;
  38. //监听提交
  39. form.on('submit(webform)', function(data){
  40. // selectMember = memberSelect.getValue();
  41. let callback = function (e) {
  42. layer.msg(e.msg);
  43. if (e.code == 0) {
  44. setTimeout(function () {
  45. parent.location.reload();
  46. }, 1000);
  47. }
  48. }
  49. // data.field.member_id = selectMember;
  50. tool.post("/admin/pushmember/edit", data.field, callback);
  51. return false;
  52. });
  53. var person = {:json_encode($person)};
  54. var member = {:json_encode($member)};
  55. // console.log(person);
  56. // console.log(member);
  57. var memberSelect = xmSelect.render({
  58. el: '#memberSelect', // div的id值
  59. toolbar: { // 工具条【‘全选’,‘清空’】
  60. show: true, // 开启工具条
  61. showIcon: false, // 隐藏工具条的图标
  62. },
  63. filterable: true, // 开启搜索模式,默认按照name进行搜索
  64. paging: false, // 启用分页
  65. pageSize: 3, // 每页的数据个数
  66. data: person, // 默认是name(相当于我们常传的value值)和value(相当于我们常传的id)
  67. prop: {
  68. value: 'id',
  69. name: 'nickname',
  70. },
  71. });
  72. memberSelect.setValue(member);
  73. }
  74. </script>
  75. {/block}
  76. <!-- /脚本 -->