group_assign.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. {extend name="public/layout"/} {block name="title"}添加{/block} {block name="body"}
  2. <style type="text/css">
  3. html,
  4. body {
  5. display: block;
  6. min-width: 100%;
  7. background-color: #fff;
  8. }
  9. .layui-fluid {
  10. display: block;
  11. border-radius: 5px;
  12. padding: 0;
  13. background-color: #ffffff;
  14. }
  15. .layui-tab {
  16. padding: 15px;
  17. height: 100%;
  18. }
  19. .layui-input-inline.input-longer-inline {
  20. width: 290px;
  21. }
  22. .layui-form-item .layui-input-inline {
  23. width: auto;
  24. }
  25. .layui-titlebox{
  26. position: relative;
  27. left: 0;
  28. height: 40px;
  29. white-space: nowrap;
  30. font-size: 0;
  31. border-bottom-width: 1px;
  32. border-bottom-style: solid;
  33. transition: all .2s;
  34. -webkit-transition: all .2s;
  35. border-color: #e6e6e6;
  36. color: #666;
  37. background-color: #f2f2f2;
  38. }
  39. .layui-titlebox li {
  40. display: inline-block;
  41. vertical-align: middle;
  42. font-size: 14px;
  43. transition: all .2s;
  44. -webkit-transition: all .2s;
  45. position: relative;
  46. line-height: 40px;
  47. width: 50%;
  48. text-align: center;
  49. cursor: pointer;
  50. box-sizing: border-box;
  51. }
  52. .layui-titlebox .layui-this {
  53. color: #000;
  54. border-bottom-color: transparent;
  55. background-color: #249EFB;
  56. color: #FFFFFF;
  57. }
  58. .layui-titlebox .layui-this:after {
  59. position: absolute;
  60. left: 0;
  61. top: 0;
  62. content: '';
  63. width: 100%;
  64. height: 41px;
  65. border-width: 1px;
  66. border-style: solid;
  67. border-color: #e6e6e6;
  68. border-bottom-color: #fff;
  69. border-radius: 2px 2px 0 0;
  70. box-sizing: border-box;
  71. pointer-events: none;
  72. }
  73. .saveBtn,.cancel,.cancel:hover,.saveBtn:hover {
  74. background-color: #fff;
  75. color: #249EFB;
  76. border: 1px solid #249EFB;
  77. }
  78. .layui-icon-add-circle::before {
  79. font-size: 30px;
  80. }
  81. .layui-border-btn,.layui-border-btn:hover {
  82. border: 1px solid #249EFB;
  83. background-color: #fff;
  84. color: #249EFB;
  85. }
  86. .layui-tab-content {
  87. padding: 0;
  88. }
  89. .plr20{
  90. padding: 0px 20px;
  91. }
  92. .layui-form-radio>i {
  93. font-size: 18px;
  94. }
  95. .layui-card-body{padding:15px;}
  96. .layui-table, .layui-table-view{margin:0;}
  97. .plr20{
  98. padding: 0px 20px;
  99. }
  100. .woverflow{overflow:hidden;}
  101. .layui-table-view .layui-table{width:100% !important;}
  102. </style>
  103. <div class="layui-fluid">
  104. <div class="layui-table">
  105. <form class="layui-form">
  106. <div class="layui-tab-content">
  107. <div class="layui-tab-item layui-show">
  108. <div class="layui-card-body">
  109. <table id="datalist" lay-filter="datalist"></table>
  110. </div>
  111. <div class="woverflow">
  112. <button type="button" class="layui-btn layui-btn-normal" id="next_step" style="width:165px;height:38px;float:right;margin-right: 15px;">确定指派</button>
  113. </div>
  114. </div>
  115. </div>
  116. </form>
  117. </div>
  118. </div>
  119. {/block} {block name="js"}
  120. <script>
  121. layui.config({
  122. base: '__LAYUI__/',
  123. urlbase: '/sys'
  124. }).extend({
  125. index: 'lib/index'
  126. }).use(['index', 'table', 'form'], function() {
  127. var $ = layui.$,
  128. table = layui.table,
  129. form = layui.form;
  130. var id = '{$id}';
  131. var from = '{$from}';
  132. if(from=='share'){
  133. $('#next_step').html('确定共享');
  134. }
  135. table.render({
  136. elem: '#datalist',
  137. url: "{:url('talkskill/groupAssign')}?from={:$from}&id={:$id}",
  138. page: true,
  139. // height: 'full-160',
  140. height: '460',
  141. cols: [
  142. [
  143. {
  144. type: 'checkbox',
  145. fixed: 'left',
  146. width: 80
  147. },
  148. {
  149. type: 'numbers',
  150. field: 'id',
  151. title: '序号',
  152. width: '8%',
  153. fixed: 'left'
  154. },
  155. {
  156. title: '店面名称',
  157. field: 'company_name',
  158. fixed: 'left'
  159. },
  160. ]
  161. ]
  162. });
  163. $('#next_step').click(function(){
  164. var index = parent.layer.getFrameIndex(window.name);
  165. var checkStatus = layui.table.checkStatus('datalist').data;
  166. console.log(checkStatus);
  167. var ids = [];
  168. for(var i=0;i<checkStatus.length;i++){
  169. ids.push(checkStatus[i].root_id)
  170. }
  171. if (ids.length==0) {
  172. return false;
  173. }
  174. ids = ids.join(',');//必须要写,不然后台获取不到数据
  175. var id = {$id};
  176. var from = "{$from}";
  177. $.ajax({
  178. url: '{:url("talkskill/groupAssignAdd")}',
  179. type: 'post',
  180. data: {'ids':ids,id:id,from:from},
  181. dataType: 'json',
  182. success: function(res) {
  183. if(res.code === 0) {
  184. layer.msg(res.msg, {
  185. anim: 0
  186. ,time: 800
  187. }, function() {
  188. parent.layui.table.reload('label-table'); //重载表格
  189. parent.layer.close(index); //再执行关闭
  190. });
  191. } else {
  192. layer.msg(res.msg, {
  193. anim: 6
  194. ,time: 800
  195. });
  196. }
  197. }
  198. });
  199. })
  200. });
  201. </script>
  202. {/block}