notice_list.blade.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <div class="row">
  2. <div class="col-xs-12">
  3. <div class="box">
  4. <div class="box-header">
  5. <div class="box-body table-responsive no-padding" style="font-size: 15px;">
  6. <div class="row" style="margin-bottom: 20px;">
  7. <div class="col-xs-12">
  8. <form class="form-inline">
  9. <input type="text" value="{{$req['user']??''}}" name="user" placeholder="搜索用户昵称" class="form-control">
  10. <input type="text" value="{{$req['name']??''}}" name="name" placeholder="搜索患者姓名" class="form-control">
  11. <input type="text" value="{{$req['phone']??''}}" name="phone" placeholder="搜索手机号" class="form-control">
  12. <input type="text" value="{{$req['guardian_name']??''}}" name="guardian_name" placeholder="搜索监护人姓名" class="form-control">
  13. <select name="product_type" class="form-control">
  14. <option value="0">请选择用户类型</option>
  15. <option <?php if (!empty($req['product_type']) && $req['product_type'] == 4) { echo 'selected'; } ?> value="4">计免</option>
  16. <option <?php if (!empty($req['product_type']) && $req['product_type'] == 5) { echo 'selected'; } ?> value="5">儿保</option>
  17. </select>
  18. <input class="btn btn-flat btn-primary m_10" type="submit" value="搜索">
  19. <button onclick="showSendNotice()" class="btn btn-info" type="button" style="float: right">群发通知</button>
  20. </form>
  21. </div>
  22. </div>
  23. <table class="table table-bordered table-hover table-striped">
  24. <tbody>
  25. <tr>
  26. <th>{{--<input id="batch_selected" type="checkbox" onclick="batch_selected()">--}}</th>
  27. <th>用户</th>
  28. <th>监护人</th>
  29. <th>患者</th>
  30. <th>关系</th>
  31. <th>手机号</th>
  32. <th>出生日期</th>
  33. <th>操作</th>
  34. </tr>
  35. <?php foreach ($list as $k => $v){ ?>
  36. <tr>
  37. <td><input class="box_ids" type="checkbox" value="{{$v['id']}}" name="ids" onclick="selected(this)" <?php if (in_array($v['id'], $ids)) { echo 'checked'; } ?>></td>
  38. <td>{{$v['users']['nickname']}}</td>
  39. <td>{{$v['guardian_name']}}</td>
  40. <td>{{$v['name']}}</td>
  41. <td>{{$v['relationship_type_text']}}</td>
  42. <td>{{$v['phone']}}</td>
  43. <td>{{$v['birthday']}}</td>
  44. <td></td>
  45. </tr>
  46. <?php }?>
  47. </tbody>
  48. </table>
  49. </div>
  50. <div style="text-align:center;font-size: 14px;">{{ $list->links() }}</div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div id="show_send_notice" style="display: none">
  56. <div class="modal-content">
  57. <form id="commentForm">
  58. <div class="modal-body">
  59. <div class="form-group">
  60. <label>发送用户</label>
  61. <div id="name_text"></div>
  62. </div>
  63. <div class="form-group">
  64. <label>内容</label>
  65. <textarea name="content" class="form-control content action" rows="4" placeholder="输入内容"></textarea>
  66. </div>
  67. <div class="form-group">
  68. <label>服务类型</label>
  69. <select class="form-control" name="type">
  70. <option value="">请选择</option>
  71. <option value="4">计免</option>
  72. <option value="5">儿保</option>
  73. </select>
  74. </div>
  75. <div class="form-group">
  76. <label>服务时间</label>
  77. <input type="text" id="service_time" name="stime" value="" class="form-control">
  78. </div>
  79. <div class="form-group">
  80. <label>备注</label>
  81. <textarea name="remark" class="form-control" rows="3" placeholder="输入备注"></textarea>
  82. </div>
  83. </div>
  84. <div class="modal-footer">
  85. <button type="button" class="btn btn-default" onclick="closeShow()">关闭</button>
  86. <button type="button" class="btn btn-primary" onclick="sendNotice()">提交</button>
  87. </div>
  88. </form>
  89. </div>
  90. </div>
  91. <script src="/layui/layer/layer.js"></script>
  92. <script src="/laydate/laydate.js?v=2.2.1"></script>
  93. <script>
  94. $(function () {
  95. laydate.render({
  96. elem: '#service_time',
  97. format: 'yyyy-MM-dd',
  98. });
  99. })
  100. function showSendNotice()
  101. {
  102. $.post("{{ url('/cdms/community/noticeManage/getCacheUsers') }}", {type: "notice"}, function (res) {
  103. if (res.status == 0) {
  104. $('#name_text').text(res.data);
  105. layer.open({
  106. type: 1,
  107. title: '群发通知',
  108. area: ['50%', '95%'], //宽高
  109. content: $('#show_send_notice')
  110. });
  111. }
  112. else {
  113. alert(res.message);
  114. }
  115. })
  116. }
  117. function batch_selected()
  118. {
  119. if ($('#batch_selected').is(':checked')) {
  120. $("input[name='ids']").attr("checked","true");
  121. }
  122. else {
  123. $("input[name='ids']").removeAttr("checked");
  124. }
  125. selected();
  126. }
  127. function selected(obj)
  128. {
  129. var checkID = [$(obj).val()];
  130. $.post("{{ url('/cdms/community/noticeManage/saveIds') }}", {ids: checkID, type: "notice"}, function (res) {
  131. if (res.status != 0) {
  132. alert(res.message);
  133. }
  134. })
  135. }
  136. function closeShow()
  137. {
  138. layer.closeAll();
  139. }
  140. function sendNotice()
  141. {
  142. $.post('{{url("/cdms/Community/NoticeManage/sendNotice")}}', $('#commentForm').serialize(), function (res) {
  143. if (res.status == 0){
  144. location.reload(true);
  145. }
  146. else {
  147. layer.msg(res.message, {icon: 5, time: 3000});
  148. }
  149. });
  150. }
  151. </script>