app/views/educode_sales/activities/index.html.erb in educode_sales-0.9.66 vs app/views/educode_sales/activities/index.html.erb in educode_sales-0.9.67

- old
+ new

@@ -1,350 +1,14 @@ -<script type="text/html" id="activity_toolbar"> - <div class="layui-btn-container"> - <span class="table-label">活动列表</span> - <% if can? :create, EducodeSales::Activity %> - <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="import">导入数据</button> - <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加活动</button> - <% end %> - </div> -</script> -<div style="margin: 10px 10px 10px 10px"> - <form class="layui-form layui-form-pane" lay-filter="search_ideas"> - <div class="layui-form-item"> - <div class="layui-inline "> - <label class="layui-form-label">活动名称</label> - <div class="layui-input-inline"> - <input type="text" class="layui-input" name="name" autocomplete="off"> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">会议类型</label> - <div class="layui-input-inline"> - <%= select_tag "clazz_id", options_for_select(['全国会议', '区域会议', '单校会议', '国赛', '省赛', '夏令营'], ""), { include_blank: true } %> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">销售经理</label> - <div class="layui-input-inline"> - <%= select_tag "staff_id", options_for_select(@staffs, ""), { include_blank: true } %> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">生态经理</label> - <div class="layui-input-inline"> - <%= select_tag "manage", options_for_select(@staffs, ""), { include_blank: true } %> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">协助人员</label> - <div class="layui-input-inline"> - <%= select_tag "assists", options_for_select(@staffs, ""), { include_blank: true } %> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">报告专家</label> - <div class="layui-input-inline"> - <input type="text" class="layui-input" name="expert" autocomplete="off"> - </div> - </div> - <div class="layui-inline"> - <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_activity_search">重置 - </button> - <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_activity">搜 索 - </button> - </div> +<div class="layui-tab" lay-filter="operation_tab"> + <ul class="layui-tab-title"> + <li class="layui-this follows_li">跟进动态</li> + <li class="businesses_list_li" >活动列表</li> + </ul> + <div class="layui-tab-content"> + <div class="layui-tab-item layui-show"> + <%= render 'follows' %> </div> - </form> -</div> -<div class="min-height-table"> -<table class="layui-hide" id="activities_table" lay-filter="activities_table"></table> -</div> - -<script type="text/html" id="currentTableBar"> - <% if can? :update, EducodeSales::Activity %> - <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a> - <% end %> - <% if can? :destroy, EducodeSales::Activity %> - <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a> - <% end %> -</script> - -<script type="text/html" id="teachers"> - <a href="javascript:void(0);" lay-event="teachers" class="layui-table-link">{{ d.name}}</a> -</script> -<script type="text/html" id="teachers_count"> - <a href="javascript:void(0);" lay-event="teachers_count" class="layui-table-link">{{ d.teachers_count}}</a> -</script> -<script type="text/html" id="schools_count"> - <a href="javascript:void(0);" lay-event="schools_count" class="layui-table-link">{{ d.schools_count}}</a> -</script> -<script> - layui.use(['form', 'table', 'miniPage', 'element', 'request'], function () { - var $ = layui.jquery, - form = layui.form, - table = layui.table, - request = layui.request, - miniPage = layui.miniPage; - - table.render({ - elem: '#activities_table', - url: '/missions/activities', - toolbar: '#activity_toolbar', - totalRow:true, - defaultToolbar: [], - cols: [ - [ - { - field: 'id', - title:'序号',type: 'numbers', - totalRowText:'合计', - width: 60 - }, - { - field: 'name', - title: '活动名称', - width: 180, - templet: '#teachers' - }, - { - field: 'clazz_id', - width: 120, - title: '会议类型' - }, - { - field: 'staff', - width: 120, - title: '销售经理' - }, - { - field: 'staff_manage', - width: 180, - title: '生态经理' - }, - { - field: 'staff_assist', - width: 180, - title: '协助人员' - }, - { - field: 'expert', - width: 180, - title: '报告专家' - }, - { - field: 'start_at', - width: 200, - title: '时间', - sort: true, - }, - { - field: 'days', - title: '天数', - width: 200 - }, - { - field: 'schools_count', - title: '学校数', - width: 200, - totalRow: true, - templet: '#schools_count' - }, - { - field: 'teachers_count', - title: '教师数', - width: 200, - totalRow:true, - templet: '#teachers_count' - }, - { - field: 'students_count', - title: '学生数', - totalRow:'{{ parseInt(d.TOTAL_NUMS) }}', - width: 200 - }, - { - title: '操作', - width: 120, - fixed: 'right', - toolbar: '#currentTableBar', - align: "center" - } - ] - ], - limit: 20, - limits: [10,15,20,30,40,50,60,70,80,90], - page: true - }); - - var sort = {}; - table.on('sort(activities_table)', function (obj) { - sort.field = obj.field; - sort.order = obj.type; - table.reload('activities_table', { - initSort: obj, - where: { - sort: sort - } - }); - }) - // 监听搜索操作 - form.on('submit(search_activity)', function (data) { - search = data.field - table.reload('activities_table', { - page: { - curr: 1 - }, - where: {q: search, sort: sort} - }, 'data'); - return false; - }); - table.on('toolbar(activities_table)', function (obj) { - if (obj.event === 'add') { // 监听添加操作 - var content = miniPage.getHrefContent('/missions/activities/new'); - var openWH = miniPage.getOpenWidthHeight(); - index = layer.open({ - title: '添加活动', - type: 1, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: [openWH[0] + 'px', openWH[1] + 'px'], - offset: [openWH[2] + 'px', openWH[3] + 'px'], - content: content, - success: function (layero, index) { - form.render('select'); - } - }); - $(window).on("resize", function () { - layer.full(index); - }); - } - else if (obj.event === 'import') { // - var content = miniPage.getHrefContent('/missions/teachers/import'); - var openWH = miniPage.getOpenWidthHeight(); - import_index = layer.open({ - title: '导入数据', - type: 1, - shade: 0.2, - shadeClose: true, - area: ['200px', '100px'], - offset: 'auto', - closeBtn: 0, - content: content, - }); - $(window).on("resize", function () { - layer.full(index); - }); - } - }); - - table.on('tool(activities_table)', function (obj) { - var data = obj.data; - var id = data.id - if (obj.event === 'edit') { - var content = miniPage.getHrefContent('/missions/activities/' + id + '/edit'); - var openWH = miniPage.getOpenWidthHeight(); - var index = layer.open({ - title: '编辑', - type: 1, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: [openWH[0] + 'px', openWH[1] + 'px'], - offset: [openWH[2] + 'px', openWH[3] + 'px'], - content: content, - success: function (layero, index) { - console.log(data); - // $("#name").val(data.name); - // 重新渲染弹层中的下拉选择框select - form.render('select'); - }, - }); - $(window).on("resize", function () { - layer.full(index); - }); - return false; - } else if (obj.event === 'delete') { - layer.confirm('确定删除' + data.name, function (index) { - request.delete('missions/activities/' + data.id, {}, function (res) { - layer.close(index); - table.reload("activities_table") - }) - }); - } else if (obj.event === 'teachers') { - activity_id = obj.data.id - var content = miniPage.getHrefContent('/missions/activities/show_teachers'); - openWH = miniPage.getOpenWidthHeight(); - index = layer.open({ - title: '活动列表/' + data.name, - type: 1, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: [openWH[0] + 'px', openWH[1] + 'px'], - offset: [openWH[2] + 'px', openWH[3] + 'px'], - content: content, - success: function (layero, index) { - form.render('select'); - }, - }); - $(window).on("resize", function () { - layer.full(index); - }); - return false; - } - else if (obj.event === 'teachers_count') { - activity_id = obj.data.id; - school_id = ''; - content = miniPage.getHrefContent('/missions/activities/show_teachers'); - openWH = miniPage.getOpenWidthHeight(); - index2 = layer.open({ - title: '活动列表/' + data.name, - type: 1, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: [openWH[0] + 'px', openWH[1] + 'px'], - offset: [openWH[2] + 'px', openWH[3] + 'px'], - content: content, - success: function (layero, index) { - form.render('select'); - }, - }); - $(window).on("resize", function () { - layer.full(index); - }); - return false; - } else if (obj.event == 'schools_count') { - activity_id = obj.data.id; - activity_name = data.name; - school_id = ''; - content = miniPage.getHrefContent('/missions/activities/' + obj.data.id +'/show_schools'); - openWH = miniPage.getOpenWidthHeight(); - index2 = layer.open({ - title: '活动列表/' + data.name, - type: 1, - shade: 0.2, - maxmin: true, - shadeClose: true, - area: [openWH[0] + 'px', openWH[1] + 'px'], - offset: [openWH[2] + 'px', openWH[3] + 'px'], - content: content, - success: function (layero, index) { - form.render('select'); - }, - }); - $(window).on("resize", function () { - layer.full(index); - }); - return false; - } - }); - - }); -</script> -<style> - .layui-table-tool-temp{ - padding-right: 30px; !important; - } - -</style> + <div class="layui-tab-item follows_div"> + <%= render 'index' %> + </div> + </div> +</div> \ No newline at end of file