123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- {extend name="public/layout" /} {block name="title"}来源渠道报表{/block} {block
- name="body"}
- <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all" />
- <link rel="stylesheet" href=" /static/css/common.css" />
- <script src="/static/js/jquery.min.js"></script>
- <script src="/static/layui/layui/lay/modules/xm-select.js"></script>
- <style>
- .cardheader {
- padding-left: 10px;
- }
- .layui-table thead tr,
- .layui-table-header {
- background-color: #f2f2f2 !important;
- }
- .layui-search {
- width: 100%;
- padding: 10px 0px 0px;
- height: 50px;
- }
- .layui-search-box {
- float: right;
- }
- #source {
- width: 300px;
- }
- .layui-table-box a {
- color: #249efb;
- }
- #select-org {
- display: inline-block;
- }
- </style>
- <body>
- <div class="layui-card">
- <div class="layui-card-body">
- <div class="layui-search">
- <div class="layui-form layui-search-box" lay-filter="search">
- <div id="select-org">
- </div>
- <div class="layui-inline" id="source"></div>
- <div class="layui-inline">
- <div class="layui-input-inline select-date">
- <input style="width: 180px" type="text" name="date" id="select_date" placeholder="开始时间 - 结束时间"
- autocomplete="off" class="layui-input" />
- </div>
- </div>
- <div class="layui-inline">
- <button class="layui-btn layuiadmin-btn-course searchBtn submitbtn" lay-submit
- lay-filter="LAY-user-front-search">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
- </button>
- </div>
- </div>
- </div>
- <table id="operater" lay-filter="operater" style="margin-top: 15px"></table>
- </div>
- </div>
- {/block} {block name="js"}
- <script>
- layui
- .config({
- base: "__LAYUI__/",
- urlbase: "/sys",
- })
- .extend({
- index: "lib/index", //主入口模块
- })
- .use(["index", "table", "laydate"], function () {
- var $ = layui.$,
- table = layui.table,
- form = layui.form,
- laydate = layui.laydate;
- var org = JSON.parse('{:json_encode($org)}');
- var select_org = '';
- //日期范围
- laydate.render({
- elem: "#select_date",
- range: true,
- });
- //监听搜索
- form.on("submit(LAY-user-front-search)", function (data) {
- let field = data.field;
- //执行重载
- table.reload('operater', {
- where: { org_id: select_org, date: field.date, source: field.source }
- });
- });
- document.onkeydown = function (event) {
- var e = event || window.event || arguments.callee.caller.arguments[0];
- if (e && e.keyCode == 13) {
- $(".submitbtn").trigger("click");
- }
- };
- table.render({
- elem: "#operater",
- url: '{:url("statistics2/source")}',
- page: false,
- height: "full-120",
- cols: [
- [
- {
- field: "source",
- title: "渠道名称",
- templet: function (d) {
- if (d.detail == 1) {
- return '<a href="javascript:void(0)" data-id="' + d.id + '" class="source-detail">' + d.source + '<a>';
- }
- return d.source;
- }
- },
- {
- field: "money",
- title: "推广消费",
- },
- {
- field: "clue",
- title: "线索量",
- },
- {
- field: "clue_money",
- title: "线索单价",
- },
- {
- field: "valid",
- title: "有效线索",
- },
- {
- field: "valid_money",
- title: "有效单价",
- },
- {
- field: "valid_percen",
- title: "有效率",
- },
- {
- field: "meet",
- title: "见面量",
- },
- {
- field: "meet_percen",
- title: "见面率",
- },
- {
- field: "grant",
- title: "毛线索见面率",
- },
- {
- field: "meet_money",
- title: "见面单价",
- },
- {
- field: "deposit",
- title: "定金量",
- },
- {
- field: "deposit_percen",
- title: "成单率",
- },
- {
- field: "sign",
- title: "合同量",
- },
- {
- field: "sign_money",
- title: "业绩总额",
- },
- {
- field: "sign_agv_money",
- title: "均单值",
- },
- {
- field: "ROI",
- title: "ROI",
- },
- ],
- ],
- text: "对不起,加载出现异常!",
- });
- $(".layui-btn.layuiadmin-btn-admin").on("click", function () {
- var type = $(this).data("type");
- active[type] ? active[type].call(this) : "";
- });
- $('.layui-card-body').on('click', '.table-detail', function () {
- let url = $(this).data('href');
- layer.open({
- title: '有效线索详情',
- type: 2,
- content: url,
- area: ['860px', '400px'],
- shade: 0.3
- });
- })
- $('.layui-card').on('click', '.source-detail', function () {
- var id = $(this).data('id');
- var title = $(this).html();
- var data = form.val("search");
- var url = '{:url("statistics2/sourceDetail")}?id=' + id + '&date=' + data.date
- layer.open({
- title: title + '详情',
- type: 2,
- content: url,
- area: ['1200px', '500px']
- });
- })
- var orgInit = function (n, xin = false) {
- var html = '<div class="layui-inline"><select class="select-org">';
- html += '<option value="">部门</option>';
- let h = 0;
- for (i in org) {
- if (n == 0) n = org[i]['pid'];
- if (n != org[i]['pid']) continue;
- html += '<option value="' + org[i]['id'] + '">' + org[i]['name'] + '</option>';
- h++;
- }
- html += '</select></div>';
- if (h == 0) return;
- if (xin) return html;
- $('#select-org').html(html);
- form.render('select');
- }
- orgInit(0);
- form.on('select', function (data) {
- if (data.value == '') {
- select_org = '';
- return;
- }
- select_org = data.value
- let next = orgInit(data.value, true);
- let parent = $(data.elem).closest('.layui-inline');
- parent.nextAll().remove();
- $('#select-org').append(next);
- form.render('select');
- });
- });
- </script>
- <script>
- xmSelect.render({
- el: '#source',
- language: 'zn',
- tips: '渠道',
- name: 'source',
- data: JSON.parse('{:json_encode($source)}')
- })
- </script>
- {/block}
- </body>
|