123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- @extends('admin/layout')
- @section('content')
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title"></div>
- <div class="ibox-content">
- <form class="row" id="searchForm">
- <div class="col-md-1 pull-right">
- <div class="input-group">
- {{--<input type="text" placeholder="请输入关键词" class="input-md form-control" name="keyword"--}}
- {{--id="keyword">--}}
- {{--<span class="input-group-btn">--}}
- {{--<button type="button" class="btn btn-md btn-primary"--}}
- {{--onclick="units.search()"> 搜索</button>--}}
- <button type="reset" class="btn btn-md btn-primary" onclick="units.fresh()"
- name="resetBtn"> 刷新
- </button>
- </span>
- </div>
- </div>
- {{--<div class="col-sm-2 pull-right" style="text-align: right">--}}
- {{--<button type="button" class="btn btn-md btn-primary" id="addBtn"> 添加</button>--}}
- {{--</div>--}}
- </form>
- <hr>
- <div class="table-responsive">
- <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script>
- var units = {
- search: function () {
- tips.selectPage();
- },
- fresh: function () {
- tips.tableRefresh();
- },
- getIdsBySelections: function () {
- var selections = $("#table").bootstrapTable('getSelections');
- var ids = [];
- $.each(selections, function (inx, val) {
- ids.push(val.id);
- });
- return ids;
- },
- delete: function (id) {
- layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
- var config = {url: '/admin/enquiry/destroy', type: 'delete', data: {id: id}};
- config.success = function (result) {
- layer.msg(result.message, {icon: 6, time: 1500});
- tips.tableRefresh('#table');
- };
- tips.ajax(config);
- });
- },
- detail: function (id) {
- layer.open({
- type: 2,
- content: ['/admin/enquiry/detail/' + id],
- area: ['50%', '60%'],
- title: '详情'
- });
- }
- };
- var config = {};
- config.url = '/admin/enquiry/list';
- config.columns = [ //字段
- {checkbox: true},
- {
- title: '序号', align: 'center', formatter: function (value, item, index) {
- return index + 1;
- }
- },
- {title: '公司名称', field: 'company_name', align: 'center'},
- {title: '姓名', field: 'name', align: 'center'},
- {title: '电话', field: 'phone', align: 'center'},
- {title: '类型', field: 'tx_type_title', align: 'center'},
- {title: '状态', field: 'tx_status_title', align: 'center'},
- {title: '创建时间', field: 'created_at', align: 'center'},
- {
- title: '操作', field: 'id', align: 'center',
- formatter: function (value) {
- return (
- '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button> ' +
- '<button onclick="units.delete(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>删除</button>'
- );
- }
- }
- ];
- tips.bootstrapTable(config);
- //
- // $(document).on('click', '#on', function () {
- // var ids = units.getIdsBySelections();
- // if (ids.length === 0) {
- // layer.alert('请先选择您所要操作的对象',{icon:0});
- // return;
- // }
- // tips.ajax({url: '/admin/system/users/on', type: 'put', data: {ids: ids}});
- // tips.tableRefresh('#table');
- // });
- //
- //
- // $(document).on('click', '#off', function () {
- // var ids = units.getIdsBySelections();
- // if (ids.length === 0) {
- // layer.alert('请先选择您所要操作的对象',{icon:0});
- // return;
- // }
- // tips.ajax({url: '/admin/system/users/off', type: 'put', data: {ids: ids}});
- // tips.tableRefresh('#table');
- // });
- $(document).on('click', '#allotStaff', function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- var siteIds = '?';
- $.each(ids, function (inx, val) {
- siteIds += 'siteIds[]=' + val + '&';
- });
- layer.open({
- type: 2,
- content: ['/admin/project/site/allot' + siteIds],
- area: ['50%', '50%'],
- title: '修改'
- });
- });
- /**
- * 批量删除
- */
- $(document).on('click', '#batchDelete', function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
- tips.ajax({url: '/admin/project/sites', type: 'delete', data: {ids: ids}});
- tips.tableRefresh('#table');
- });
- });
- $(document).on('click', '#add', function () {
- layer.open({
- type: 2,
- content: ['/admin/project/site/show/0'],
- area: ['90%', '90%'],
- title: '添加'
- });
- });
- </script>
- @endsection
|