123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- @endsection
- @section('right')
- <form class="row" id="searchForm" onsubmit="units.search();return false;">
- <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" style="margin-left: 10px"
- onclick="units.exportExcel()">下载
- </button>
- <button type="button" class="btn btn-warning btn-sm" style="margin-left: 10px"
- onclick="units.exportAllExcel()">下载近两个月全部询盘
- </button>
- </div>
- </div>
- <div class="col-md-6 pull-right">
- <div class="input-group">
- <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">
- <div>
- </div>
- <table id="table" class="table table-condensed"
- data-mobile-responsive="true"></table>
- </div>
- @endsection
- @section('footer_extend')
- <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?notCustomer=1&time_range=' + time_range);
- },
- exportAllExcel: function () {
- window.open('/admin/inquires/{{$siteId}}/export-all-excel');
- },
- 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
- });
- },
- mailDetail: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/inquires-mail/' + id + '?siteId=' + "{{$siteId}}"],
- area: ['90%', '100%'],
- title: '',
- closeBtn: 0
- });
- }
- };
- var config = {};
- config.url = '/admin/site/' + "{{$siteId}}" + '/inquires';
- config.columns = [ //字段
- {
- title: '序号', align: 'center', formatter: function (value, item, index) {
- return index + 1;
- }
- },
- {
- title: '姓名', field: 'sender_name', align: 'center',
- formatter: function (value, row) {
- return '<a href="javascript:;" onclick="units.detail(' + row.id + ')">' + (value.length < 1 ? "详情" : value) + '</a>'
- }
- },
- {title: '邮箱', field: 'sender_email', align: 'center'},
- {title: '国家', field: 'location', align: 'center'},
- {title: '电话', field: 'phone', align: 'center'},
- {title: '状态', field: 'is_read', align: 'center'},
- {
- title: '是否真实询盘', field: 'is_delete', align: 'center', formatter: function (value, row) {
- return value ? '否' : '是';
- }
- },
- {title: '询盘时间', field: 'created_at', align: 'center'},
- {
- title: '邮件时间', field: 'mail_date', align: 'center',
- formatter: function (value, row) {
- return '<a href="javascript:;" onclick="units.mailDetail(' + row.id + ')">' + (value.length < 1 ? "详情" : value) + '</a>'
- }
- }
- ];
- 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
|