123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- @endsection
- @section('right')
- <div class="col-md-2">
- <div class="input-group">
- <span class="input-group-btn">
- <button type="button" class="btn btn-md btn-success" onclick="units.add(0,'{{$siteId}}')"
- style="margin-left: 10px;"><span class="glyphicon glyphicon-plus"></span> 添加</button>
- <button type="button" class="btn btn-md btn-danger" onclick="units.del()"
- style="margin-left: 10px"><span class="glyphicon glyphicon-remove"></span> 删除</button>
- </span>
- </div>
- </div>
- <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="table-responsive">
- <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer_extend')
- <script>
- var units = {
- del: function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- layer.confirm('确定删除?', {icon: 3, title: '是否删除'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/witness-project/delete-row/1',
- type: 'post',
- data: {ids: ids},
- tableRefresh: '#table'
- });
- });
- },
- add: function (id, siteId) {
- layer.open({
- type: 2,
- content: ['/admin/witness-project/introduce-add/' + id + '/' + siteId],
- area: ['60%', '60%'],
- title: '编辑'
- });
- },
- save: function (id, siteId) {
- layer.open({
- type: 2,
- content: ['/admin/witness-project/introduce-add/' + id + '/' + siteId],
- area: ['60%', '60%'],
- title: '编辑'
- });
- },
- getIdsBySelections: function () {
- var selections = $("#table").bootstrapTable('getSelections');
- var ids = [];
- $.each(selections, function (inx, val) {
- ids.push(val.id);
- });
- return ids;
- }
- };
- var config = {};
- config.url = '/admin/witness-project/introduce/{{$siteId}}';
- config.pageSize = 20;
- config.showColumns = true;
- config.columns = [ //字段
- {checkbox: true},
- {
- title: '序号', align: 'center', formatter: function (value, item, index) {
- return index + 1;
- },
- width: '10px'
- },
- {title: '客户姓名', field: 'customer_name', align: 'center', width: '120px'},
- {title: '职位', field: 'position', align: 'center'},
- {title: '电话', field: 'tel', align: 'center'},
- {title: '订单成交量', field: 'order_volume', align: 'center'},
- {title: '礼品名称', field: 'gift_name', align: 'center'},
- {title: '礼品金额(元)', field: 'gift_amount', align: 'center'},
- {title: '送礼时间', field: 'gift_time', align: 'center'},
- {title: '成交客户', field: 'transaction_customer', align: 'center'},
- {title: '备注', field: 'remark', align: 'center'},
- {
- title: '操作', field: 'id', align: 'center',
- formatter: function (value, row) {
- return '<button onclick="units.save(' + row.id + ',' + row.site_id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>';
- }
- }
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|