123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- @extends('admin/layout')
- @section('content')
- <style>
- @media screen and (max-width: 812px) {
- .table-responsive #table tbody tr td:nth-child(1), .table-responsive #table tbody tr td:nth-child(3), .table-responsive #table tbody tr td:nth-child(4), .table-responsive #table tbody tr td:nth-child(5), .table-responsive #table tbody tr td:nth-child(7) {
- display: none
- }
- .table-responsive #table thead tr th:nth-child(1), .table-responsive #table thead tr th:nth-child(3), .table-responsive #table thead tr th:nth-child(4), .table-responsive #table thead tr th:nth-child(5), .table-responsive #table thead tr th:nth-child(7) {
- display: none
- }
- }
- @media screen and (max-width: 768px) {
- .table-responsive #table thead {
- display: block !important;
- }
- }
- @media screen and (max-width: 480px) {
- .bootstrap-table .fixed-table-container .table tbody tr {
- display: block !important;
- }
- .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(1) {
- display: none;
- }
- .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(3) {
- display: none;
- }
- .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(4) {
- display: none;
- }
- .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(5) {
- display: none;
- }
- .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(7) {
- display: none;
- }
- }
- </style>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <div class="row">
- <form class="row" id="searchForm">
- <div class="col-md-4">
- <div class="input-group">
- 询盘总数:<span style="font-weight: 600" id="allInquire">0</span>
- 真实询盘:<span style="font-weight: 600;" id="realInquire">0</span>
- <button type="button" class="btn btn-warning btn-sm"
- onclick="units.exportExcel()" style="margin-left: 10px">下载
- </button>
- </div>
- </div>
- <div class="col-md-6 pull-right">
- <div class="input-group">
- <select data-placeholder="请选择状态..." class="form-control"
- style="width:150px;float: right" name="is_delete" id="is_delete"
- onchange="tips.selectPage();">
- <option value="" selected>是否真实询盘</option>
- <option value="0">真实询盘</option>
- <option value="1">虚假询盘</option>
- </select>
- <input type="hidden" value="all" name="time_range" id="time_range">
- <span class="input-group-btn">
- <button type="button" class="btn btn-md" onclick="units.search('week')"
- style="margin-right: 2px"> 最近七天</button>
- <button type="button" class="btn btn-md" onclick="units.search('month')"
- style="margin-right: 2px"> 最近30天</button>
- <button type="button" class="btn btn-md" onclick="units.search('year')"
- style="margin-right: 2px"> 最近一年</button>
- <button type="button" class="btn btn-md" onclick="units.search('all')"
- style="margin-right: 2px"> 全部</button>
- </span>
- <input type="text" placeholder="请选择日期范围" class="input-md form-control" id="date_range">
- </div>
- </div>
- </form>
- <hr>
- <div class="table-responsive">
- <table id="table" class="table table-condensed"
- data-mobile-responsive="true"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
- <script>
- laydate.render({
- elem: '#date_range',
- type: 'date',
- range: true,
- done: function (value, date, endDate) {
- units.search(value);
- }
- });
- var units = {
- exportExcel: function () {
- var time_range = $("#time_range").val();
- window.open('/admin/inquires/{{$siteId}}/export-excel?time_range=' + time_range);
- },
- search: function ($time_range) {
- $("#time_range").val($time_range);
- tips.selectPage();
- },
- detail: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/inquires/' + id + '?siteId=' + "{{$siteId}}"],
- area: ['90%', '100%'],
- title: '',
- closeBtn: 0
- });
- },
- assignUser: function (inquireId) {
- var params = '?inquireIds[]=' + inquireId;
- layer.open({
- type: 2,
- content: '/admin/inquires/assign-user' + params,
- area: ['50%', '100%'],
- title: '详情'
- });
- }
- };
- var config = {};
- config.url = '/admin/site/' + "{{$siteId}}" + '/inquires?';
- config.pageSize = 50;
- config.columns = [ //字段
- // {checkbox: true},
- {
- title: '序号', align: 'center', formatter: function (value, item, index) {
- return index + 1;
- }
- },
- // {
- // title: '标题', field: 'title', align: 'center', width: '350px',
- // formatter: function (value, row) {
- // return '<a href="javascript:;" onclick="units.detail(' + row.id + ')">' + value + '</a>'
- // }
- // },
- {title: '姓名', field: 'sender_name', align: 'center'},
- {title: '邮箱', field: 'sender_email', align: 'center'},
- // {title: '平台链接', field: 'translate_words', align: 'center'},
- {title: '状态', field: 'is_read', align: 'center'},
- {
- title: '是否真实询盘', field: 'is_delete', align: 'center',
- formatter: function (value, row) {
- if(row.is_delete==1){
- return '否';
- }else{
- return '是';
- }
- }
- },
- {title: '询盘时间', field: 'created_at', align: 'center'},
- {
- title: '操作', field: 'id', align: 'center',
- formatter: function (value, row) {
- var str = '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>查看</button>';
- if ("{{$nowRoleId}}" == 5) { //客户界面
- str += '<button onclick="units.assignUser(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>分配</button>';
- }
- return str;
- }
- }
- ];
- config.onLoadError = function (status, jqXHR) {
- $(".no-records-found td").text('数据请求异常,请检查分配的服务器是否正确');
- };
- config.onLoadSuccess = function (data) {
- var extra = data.extra;
- $("#allInquire").text(extra.allInquire);
- $("#realInquire").text(extra.realInquire);
- };
- tips.bootstrapTable(config);
- </script>
- @endsection
|