123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- {extend name="public/layout"/} {block name="title"}添加{/block} {block name="body"}
- <style type="text/css">
- html,
- body {
- display: block;
- min-width: 100%;
- background-color: #fff;
- }
-
- .layui-fluid {
- display: block;
- border-radius: 5px;
- padding: 0;
- background-color: #ffffff;
- }
-
- .layui-tab {
- padding: 15px;
- height: 100%;
- }
- .layui-input-inline.input-longer-inline {
- width: 290px;
- }
-
- .layui-form-item .layui-input-inline {
- width: auto;
- }
- .layui-titlebox{
- position: relative;
- left: 0;
- height: 40px;
- white-space: nowrap;
- font-size: 0;
- border-bottom-width: 1px;
- border-bottom-style: solid;
- transition: all .2s;
- -webkit-transition: all .2s;
- border-color: #e6e6e6;
- color: #666;
- background-color: #f2f2f2;
- }
- .layui-titlebox li {
- display: inline-block;
- vertical-align: middle;
- font-size: 14px;
- transition: all .2s;
- -webkit-transition: all .2s;
- position: relative;
- line-height: 40px;
- width: 50%;
- text-align: center;
- cursor: pointer;
- box-sizing: border-box;
- }
- .layui-titlebox .layui-this {
- color: #000;
- border-bottom-color: transparent;
- background-color: #249EFB;
- color: #FFFFFF;
- }
- .layui-titlebox .layui-this:after {
- position: absolute;
- left: 0;
- top: 0;
- content: '';
- width: 100%;
- height: 41px;
- border-width: 1px;
- border-style: solid;
- border-color: #e6e6e6;
- border-bottom-color: #fff;
- border-radius: 2px 2px 0 0;
- box-sizing: border-box;
- pointer-events: none;
- }
- .saveBtn,.cancel,.cancel:hover,.saveBtn:hover {
- background-color: #fff;
- color: #249EFB;
- border: 1px solid #249EFB;
- }
- .layui-icon-add-circle::before {
- font-size: 30px;
- }
- .layui-border-btn,.layui-border-btn:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- }
- .layui-tab-content {
- padding: 0;
- }
- .plr20{
- padding: 0px 20px;
- }
- .layui-form-radio>i {
- font-size: 18px;
- }
- .layui-card-body{padding:15px;}
- .layui-table, .layui-table-view{margin:0;}
- .plr20{
- padding: 0px 20px;
- }
- .woverflow{overflow:hidden;}
- .layui-table-view .layui-table{width:100% !important;}
- </style>
- <div class="layui-fluid">
- <div class="layui-table">
- <form class="layui-form">
- <div class="layui-tab-content">
- <div class="layui-tab-item layui-show">
- <div class="layui-card-body">
- <table id="datalist" lay-filter="datalist"></table>
- </div>
- <div class="woverflow">
- <button type="button" class="layui-btn layui-btn-normal" id="next_step" style="width:165px;height:38px;float:right;margin-right: 15px;">确定指派</button>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- {/block} {block name="js"}
- <script>
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index'
- }).use(['index', 'table', 'form'], function() {
- var $ = layui.$,
- table = layui.table,
- form = layui.form;
- var id = '{$id}';
- var from = '{$from}';
- if(from=='share'){
- $('#next_step').html('确定共享');
- }
- table.render({
- elem: '#datalist',
- url: "{:url('talkskill/groupAssign')}?from={:$from}&id={:$id}",
- page: true,
- // height: 'full-160',
- height: '460',
- cols: [
- [
- {
- type: 'checkbox',
- fixed: 'left',
- width: 80
- },
- {
- type: 'numbers',
- field: 'id',
- title: '序号',
- width: '8%',
- fixed: 'left'
- },
- {
- title: '店面名称',
- field: 'company_name',
- fixed: 'left'
- },
- ]
- ]
- });
- $('#next_step').click(function(){
- var index = parent.layer.getFrameIndex(window.name);
-
- var checkStatus = layui.table.checkStatus('datalist').data;
- console.log(checkStatus);
- var ids = [];
- for(var i=0;i<checkStatus.length;i++){
- ids.push(checkStatus[i].root_id)
- }
- if (ids.length==0) {
-
- return false;
- }
- ids = ids.join(',');//必须要写,不然后台获取不到数据
- var id = {$id};
- var from = "{$from}";
- $.ajax({
- url: '{:url("talkskill/groupAssignAdd")}',
- type: 'post',
- data: {'ids':ids,id:id,from:from},
- dataType: 'json',
- success: function(res) {
- if(res.code === 0) {
- layer.msg(res.msg, {
- anim: 0
- ,time: 800
- }, function() {
- parent.layui.table.reload('label-table'); //重载表格
- parent.layer.close(index); //再执行关闭
- });
- } else {
- layer.msg(res.msg, {
- anim: 6
- ,time: 800
- });
- }
- }
- });
- })
- });
- </script>
- {/block}
|