init
Showing
1 changed file
with
109 additions
and
106 deletions
| 1 | <?php $this->load->view('common/header'); ?> | 1 | <?php $this->load->view('common/header'); ?> |
| 2 | 2 | ||
| 3 | <body> | 3 | <body> |
| 4 | <div class="page-container"> | 4 | <div class="page-container"> |
| 5 | <div> | 5 | <div> |
| 6 | <button class="btn btn-primary radius" onclick="layer_show('添加', '<?=site_url('/config/add')?>')">添加</button> | 6 | <button class="btn btn-primary radius" onclick="layer_show('添加', '<?= site_url('/config/add') ?>')">添加</button> |
| 7 | </div> | 7 | </div> |
| 8 | 8 | ||
| 9 | <div class="body mt-20"> | 9 | <div class="body mt-20"> |
| 10 | <table class="table table-border table-bordered table-bg" id="table"> | 10 | <table class="table table-border table-bordered table-bg" id="table"> |
| 11 | <thead class="text-c"> | 11 | <thead class="text-c"> |
| 12 | <tr> | 12 | <tr> |
| 13 | <th width="68px">操作</th> | 13 | <th width="68px">操作</th> |
| 14 | <th>产品名称</th> | 14 | <th>产品名称</th> |
| 15 | <th>年化利率%</th> | 15 | <th>年化利率%</th> |
| 16 | <th>罚息(利率*n%)</th> | 16 | <th>罚息(利率*n%)</th> |
| 17 | <th>滞纳金</th> | 17 | <th>滞纳金</th> |
| 18 | <th>还款方式</th> | 18 | <th>还款方式</th> |
| 19 | <th>借款期限(月)</th> | 19 | <th>借款期限(月)</th> |
| 20 | <th>授额上限(元)</th> | 20 | <th>授额上限(元)</th> |
| 21 | <th>录入时间</th> | 21 | <th>录入时间</th> |
| 22 | <th>备注</th> | 22 | <th>备注</th> |
| 23 | </tr> | 23 | </tr> |
| 24 | </thead> | 24 | </thead> |
| 25 | <tbody class="text-c"> | 25 | <tbody class="text-c"> |
| 26 | </tbody> | 26 | </tbody> |
| 27 | </table> | 27 | </table> |
| 28 | </div> | ||
| 29 | </div> | 28 | </div> |
| 30 | <?php $this->load->view('common/footer'); ?> | 29 | </div> |
| 30 | <?php $this->load->view('common/footer'); ?> | ||
| 31 | 31 | ||
| 32 | <script> | 32 | <script> |
| 33 | var table = $('#table').dataTable({ | 33 | var table = $('#table').dataTable({ |
| 34 | aaSorting: [[1, "desc"]], | 34 | aaSorting: [[1, "desc"]], |
| 35 | serverSide: true, | 35 | serverSide: true, |
| 36 | processing: true, | 36 | processing: true, |
| 37 | bSort: false, | 37 | bSort: false, |
| 38 | searching: false,//是否显示搜索 | 38 | searching: false,//是否显示搜索 |
| 39 | iDisplayLength: 6, | 39 | iDisplayLength: 6, |
| 40 | bLengthChange: false, | 40 | bLengthChange: false, |
| 41 | ajax: { | 41 | ajax: { |
| 42 | url: apiBaseUrl + 'config/products', | 42 | url: apiBaseUrl + 'config/products', |
| 43 | dataFilter: function (json) { | 43 | dataFilter: function (json) { |
| 44 | var ret = {}, json = jQuery.parseJSON(json); | 44 | var ret = {}, json = jQuery.parseJSON(json); |
| 45 | ret.data = json.data || []; | 45 | ret.data = json.data || []; |
| 46 | var draw = getUrlParam('draw'); | 46 | var draw = getUrlParam('draw'); |
| 47 | if(draw) { | 47 | if (draw) { |
| 48 | ret.draw = draw; | 48 | ret.draw = draw; |
| 49 | } | 49 | } |
| 50 | ret.recordsTotal = 0; | 50 | ret.recordsTotal = 0; |
| 51 | ret.recordsFiltered = 0; | 51 | ret.recordsFiltered = 0; |
| 52 | if (json.page) { | 52 | if (json.page) { |
| 53 | ret.recordsTotal = parseInt(json.page.totalNumber); | 53 | ret.recordsTotal = parseInt(json.page.totalNumber); |
| 54 | ret.recordsFiltered = parseInt(json.page.totalNumber); | 54 | ret.recordsFiltered = parseInt(json.page.totalNumber); |
| 55 | } | ||
| 56 | return JSON.stringify(ret); | ||
| 57 | }, | ||
| 58 | data: function (data) { | ||
| 59 | data.pageSize = data.length; | ||
| 60 | data.currentPage = parseFloat(data.start / data.length) + 1; | ||
| 61 | return data; | ||
| 62 | } | 55 | } |
| 56 | return JSON.stringify(ret); | ||
| 63 | }, | 57 | }, |
| 64 | columns: [ | 58 | data: function (data) { |
| 65 | { | 59 | data.pageSize = data.length; |
| 66 | data: "id", render: function (data, type, full) { | 60 | data.currentPage = parseFloat(data.start / data.length) + 1; |
| 67 | return '<span class="dropDown dropDown_hover">\ | 61 | return data; |
| 62 | } | ||
| 63 | }, | ||
| 64 | columns: [ | ||
| 65 | { | ||
| 66 | data: "id", render: function (data, type, full) { | ||
| 67 | return '<span class="dropDown dropDown_hover">\ | ||
| 68 | <button class="btn radius size-M">请选择 <i class="Hui-iconfont"></i></button>\ | 68 | <button class="btn radius size-M">请选择 <i class="Hui-iconfont"></i></button>\ |
| 69 | <ul class="dropDown-menu menu radius box-shadow">\ | 69 | <ul class="dropDown-menu menu radius box-shadow">\ |
| 70 | <li><a href="javascript:;" onclick="layer_show(\'编辑\', \'/index.php/config/edit/' + data + '\')">编辑</a></li>\ | 70 | <li><a href="javascript:;" onclick="layer_show(\'编辑\', \'/index.php/config/edit/' + data + '\')">编辑</a></li>\ |
| 71 | <li><a href="javascript:;del('+data+')">删除</a></li>\ | 71 | <li><a href="javascript:;del(' + data + ')">删除</a></li>\ |
| 72 | </ul></span>'; | 72 | </ul></span>'; |
| 73 | } | 73 | } |
| 74 | }, | 74 | }, |
| 75 | {data: "productName"},//产品名称 | 75 | {data: "productName"},//产品名称 |
| 76 | {data: "annualInterestRate"},//年化利率 | 76 | {data: "annualInterestRate"},//年化利率 |
| 77 | {data: "interestPenalty"},//罚息 | 77 | {data: "interestPenalty"},//罚息 |
| 78 | {data: "overdueFine"},//滞纳金 | 78 | {data: "overdueFine"},//滞纳金 |
| 79 | {data: "repaymentMode"},//还款方式 | 79 | {data: "repaymentMode"},//还款方式 |
| 80 | {data: "loanDeadline"},//借款期限 | 80 | {data: "loanDeadline"},//借款期限 |
| 81 | {data: "loanLimit"},//授额上限 | 81 | {data: "loanLimit"},//授额上限 |
| 82 | {data: "createTime"},//录入时间 | 82 | {data: "createTime"},//录入时间 |
| 83 | {data: "remark"},//备注 | 83 | {data: "remark"},//备注 |
| 84 | ] | 84 | ] |
| 85 | }); | 85 | }); |
| 86 | 86 | ||
| 87 | function del(id) { | 87 | function del(id) { |
| 88 | layer.confirm('确认删除', { | 88 | layer.confirm('确认删除', { |
| 89 | btn: ['确认','取消'], | 89 | btn: ['确认', '取消'], |
| 90 | title: '删除产品', | 90 | title: '删除产品', |
| 91 | icon: 3 | 91 | icon: 3 |
| 92 | }, function(){ | 92 | }, function () { |
| 93 | $.ajax({ | 93 | $.ajax({ |
| 94 | type: 'delete', | 94 | type: 'delete', |
| 95 | url: apiBaseUrl + 'config/product/' + id, | 95 | url: apiBaseUrl + 'config/product/' + id, |
| 96 | cache: false, | 96 | cache: false, |
| 97 | dataType: 'json', | 97 | dataType: 'json', |
| 98 | contentType: "application/json; charset=UTF-8", | 98 | contentType: "application/json; charset=UTF-8", |
| 99 | success: function (data) { | 99 | success: function (data) { |
| 100 | if (data.msg) { | 100 | if (data.msg) { |
| 101 | layer.alert(data.msg); | 101 | layer.alert(data.msg); |
| 102 | } else if (data.code != 0) { | 102 | } else if (data.code != 0) { |
| 103 | layer.alert('请求失败'); | 103 | layer.alert('请求失败'); |
| 104 | } else { | 104 | } else { |
| 105 | layer.msg('删除成功'); | 105 | layer.msg('删除成功'); |
| 106 | } | 106 | } |
| 107 | if(!data.code) { | 107 | setTimeout(function () { |
| 108 | window.parent.reload(); | 108 | if (!data.code) { |
| 109 | window.reload(); | ||
| 109 | layer_close(); | 110 | layer_close(); |
| 110 | } | 111 | } |
| 111 | }, | 112 | }, 500); |
| 112 | error: function () { | 113 | }, |
| 113 | layer.alert("请求失败") | 114 | error: function () { |
| 114 | } | 115 | layer.alert("请求失败") |
| 115 | }) | 116 | } |
| 117 | }) | ||
| 118 | |||
| 119 | }); | ||
| 120 | } | ||
| 116 | 121 | ||
| 117 | }); | 122 | function reload() { |
| 118 | } | 123 | table.fnDraw(); |
| 119 | function reload() { | 124 | } |
| 120 | table.fnDraw(); | 125 | </script> |
| 121 | } | ||
| 122 | </script> | ||
| 123 | </body> | 126 | </body> |
| 124 | <html> | 127 | <html> | ... | ... |
-
Please register or sign in to post a comment