add.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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">通知情况<font>*</font></td>
  9. <td>
  10. <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入通知情况" lay-reqText="请输入通知情况" class="layui-input">
  11. </td>
  12. <td class="layui-td-gray">上级通知情况<font>*</font></td>
  13. <td>
  14. <select name="pid" lay-verify="required" lay-reqText="请选择上级部门">
  15. <option value="0">作为顶级通知设置</option>
  16. {volist name="push_message" id="v"}
  17. <option value="{$v.id}" {eq name="$pid" value="$v.id"} selected{/eq}>{$v.title}</option>
  18. {/volist}
  19. </select>
  20. </td>
  21. <td class="layui-td-gray">可设置方<font>*</font></td>
  22. <td>
  23. <input type="checkbox" name="is_who" value="0" title="财政局" lay-skin="primary" checked>
  24. <input type="checkbox" name="is_who" value="1" title="业主" lay-skin="primary">
  25. <input type="checkbox" name="is_who" value="2" title="公司" lay-skin="primary">
  26. </td>
  27. </tr>
  28. <tr>
  29. <td class="layui-td-gray-2">财政局-通知内容</td>
  30. <td colspan="3">
  31. <input type="text" name="content" placeholder="请输入通知内容,可空" autocomplete="off" class="layui-input">
  32. </td>
  33. <td class="layui-td-gray">是否带<font>项目名称</font></td>
  34. <td>
  35. <input type="radio" name="is_project_name" value="1" title="是" checked>
  36. <input type="radio" name="is_project_name" value="0" title="否">
  37. </td>
  38. <td class="layui-td-gray">人员</td>
  39. <td>
  40. <select name="is_people" lay-verify="" lay-reqText="请选择人员">
  41. <option value="">无</option>
  42. <option value="申请人">申请人</option>
  43. <option value="审批人">审批人</option>
  44. <option value="接收人">接收人</option>
  45. </select>
  46. </td>
  47. <td class="layui-td-gray">是否微信推送</td>
  48. <td>
  49. <input type="radio" name="is_wechat" value="1" title="是" checked>
  50. <input type="radio" name="is_wechat" value="0" title="否">
  51. </td>
  52. </tr>
  53. <tr>
  54. <td class="layui-td-gray-2">公司-通知内容</td>
  55. <td colspan="3">
  56. <input type="text" name="content_company" placeholder="请输入通知内容,可空" autocomplete="off" class="layui-input">
  57. </td>
  58. <td class="layui-td-gray">是否带<font>项目名称</font></td>
  59. <td>
  60. <input type="radio" name="is_project_name_company" value="1" title="是" checked>
  61. <input type="radio" name="is_project_name_company" value="0" title="否">
  62. </td>
  63. <td class="layui-td-gray">人员</td>
  64. <td>
  65. <select name="is_people_company" lay-verify="" lay-reqText="请选择人员">
  66. <option value="">无</option>
  67. <option value="申请人">申请人</option>
  68. <option value="审批人">审批人</option>
  69. <option value="接收人">接收人</option>
  70. </select>
  71. </td>
  72. <td class="layui-td-gray">是否微信推送</td>
  73. <td>
  74. <input type="radio" name="is_wechat_company" value="1" title="是" checked>
  75. <input type="radio" name="is_wechat_company" value="0" title="否">
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class="layui-td-gray-2">业主-通知内容</td>
  80. <td colspan="3">
  81. <input type="text" name="content_proprietor" placeholder="请输入通知内容,可空" autocomplete="off" class="layui-input">
  82. </td>
  83. <td class="layui-td-gray">是否带<font>项目名称</font></td>
  84. <td>
  85. <input type="radio" name="is_project_name_proprietor" value="1" title="是" checked>
  86. <input type="radio" name="is_project_name_proprietor" value="0" title="否">
  87. </td>
  88. <td class="layui-td-gray">人员</td>
  89. <td>
  90. <select name="is_people_proprietor" lay-verify="" lay-reqText="请选择人员">
  91. <option value="">无</option>
  92. <option value="申请人">申请人</option>
  93. <option value="审批人">审批人</option>
  94. <option value="接收人">接收人</option>
  95. </select>
  96. </td>
  97. <td class="layui-td-gray">是否微信推送</td>
  98. <td>
  99. <input type="radio" name="is_wechat_proprietor" value="1" title="是" checked>
  100. <input type="radio" name="is_wechat_proprietor" value="0" title="否">
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class="layui-td-gray">通知阶段</td>
  105. <!-- <td>
  106. <select name="rule_id" lay-verify="" lay-reqText="">
  107. <option value="0">未选择,可为空</option>
  108. {volist name="rule" id="v"}
  109. <option value="{$v.id}" >{$v.title}</option>
  110. {/volist}
  111. </select>
  112. </td> -->
  113. <td colspan="3">
  114. <input type="text" name="rule_url" placeholder="请输入通知阶段url,可空" autocomplete="off" class="layui-input">
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="layui-td-gray-2">说明<font>*</font></td>
  119. <td colspan="3"><strong class="red">注意:通知阶段选择后,通知内容若为空,则不会通知。</strong></td>
  120. </tr>
  121. </table>
  122. <div class="py-3">
  123. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  124. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  125. </div>
  126. </form>
  127. {/block}
  128. <!-- /主体 -->
  129. <!-- 脚本 -->
  130. {block name="script"}
  131. <script>
  132. const moduleInit = ['tool'];
  133. function gouguInit() {
  134. var form = layui.form,tool=layui.tool;
  135. //监听提交
  136. form.on('submit(webform)', function(data){
  137. let callback = function (e) {
  138. layer.msg(e.msg);
  139. if (e.code == 0) {
  140. setTimeout(function () {
  141. parent.location.reload();
  142. }, 1000);
  143. }
  144. }
  145. var is_who = [];
  146. $('input:checkbox[name="is_who"]:checked').each(function(){
  147. is_who.push($(this).val());
  148. });
  149. // alert(is_who);
  150. // console.log(is_who);
  151. data.field.is_who = is_who;
  152. tool.post("/admin/pushmessage/add", data.field,callback);
  153. return false;
  154. });
  155. }
  156. </script>
  157. {/block}
  158. <!-- /脚本 -->