Commit 06d814d8651e9326ad38acf05633514c66630024
Merge branch 'pudong_jdk8' of http://101.95.0.106:8888/panzhaov5/bsth_control into pudong_jdk8
Showing
2 changed files
with
418 additions
and
418 deletions
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -152,17 +152,17 @@ public class ReportServiceImpl implements ReportService{ | @@ -152,17 +152,17 @@ public class ReportServiceImpl implements ReportService{ | ||
| 152 | PreparedStatement ps = null; | 152 | PreparedStatement ps = null; |
| 153 | ResultSet rs = null; | 153 | ResultSet rs = null; |
| 154 | String year=date.substring(0,4); | 154 | String year=date.substring(0,4); |
| 155 | - String sql = "select * from bsth_c_arrival_info_"+year+" where device_id=? AND line_id=? " | ||
| 156 | - + " AND weeks_year>=? AND weeks_year<=? AND ts >= ? AND ts <=? order by ts"; | 155 | + String sql = "select * from bsth_c_arrival_info_"+year+" where weeks_year in (?, ?) AND line_id=? " |
| 156 | + + " AND ts >= ? AND ts <=? AND device_id=? order by ts"; | ||
| 157 | try{ | 157 | try{ |
| 158 | conn = DBUtils_MS.getConnection(); | 158 | conn = DBUtils_MS.getConnection(); |
| 159 | ps = conn.prepareStatement(sql); | 159 | ps = conn.prepareStatement(sql); |
| 160 | - ps.setString(1, sbbb); | ||
| 161 | - ps.setString(2,line); | ||
| 162 | - ps.setInt(3, weeks_year); | ||
| 163 | - ps.setInt(4, weeks_year_next); | ||
| 164 | - ps.setLong(5, date1); | ||
| 165 | - ps.setLong(6, date2); | 160 | + ps.setInt(1, weeks_year); |
| 161 | + ps.setInt(2, weeks_year_next); | ||
| 162 | + ps.setString(3,line); | ||
| 163 | + ps.setLong(4, date1); | ||
| 164 | + ps.setLong(5, date2); | ||
| 165 | + ps.setString(6, sbbb); | ||
| 166 | rs = ps.executeQuery(); | 166 | rs = ps.executeQuery(); |
| 167 | 167 | ||
| 168 | list = resultSet2Set(rs); | 168 | list = resultSet2Set(rs); |
| @@ -2219,16 +2219,16 @@ public class ReportServiceImpl implements ReportService{ | @@ -2219,16 +2219,16 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2219 | PreparedStatement ps = null; | 2219 | PreparedStatement ps = null; |
| 2220 | ResultSet rs = null; | 2220 | ResultSet rs = null; |
| 2221 | String year=date.substring(0,4); | 2221 | String year=date.substring(0,4); |
| 2222 | - String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? " | ||
| 2223 | - + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; | 2222 | + String sql = "select * from bsth_c_arrival_info_"+year+" where weeks_year=? AND line_id=? " |
| 2223 | + + " AND up_down=? AND ts >= ? AND ts <=? order by device_id,ts"; | ||
| 2224 | try{ | 2224 | try{ |
| 2225 | conn = DBUtils_MS.getConnection(); | 2225 | conn = DBUtils_MS.getConnection(); |
| 2226 | ps = conn.prepareStatement(sql); | 2226 | ps = conn.prepareStatement(sql); |
| 2227 | - ps.setString(1, line); | ||
| 2228 | - ps.setInt(2, weeks_year1); | ||
| 2229 | - ps.setLong(3, date1); | ||
| 2230 | - ps.setLong(4, date2); | ||
| 2231 | - ps.setInt(5, zd); | 2227 | + ps.setInt(1, weeks_year1); |
| 2228 | + ps.setString(2, line); | ||
| 2229 | + ps.setInt(3, zd); | ||
| 2230 | + ps.setLong(4, date1); | ||
| 2231 | + ps.setLong(5, date2); | ||
| 2232 | rs = ps.executeQuery(); | 2232 | rs = ps.executeQuery(); |
| 2233 | 2233 | ||
| 2234 | list = resultSet2Set(rs); | 2234 | list = resultSet2Set(rs); |
| @@ -2269,16 +2269,16 @@ public class ReportServiceImpl implements ReportService{ | @@ -2269,16 +2269,16 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2269 | PreparedStatement ps = null; | 2269 | PreparedStatement ps = null; |
| 2270 | ResultSet rs = null; | 2270 | ResultSet rs = null; |
| 2271 | String year=date.substring(0,4); | 2271 | String year=date.substring(0,4); |
| 2272 | - String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? " | ||
| 2273 | - + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts"; | 2272 | + String sql = "select * from bsth_c_arrival_info_"+year+" where weeks_year=? AND line_id=? " |
| 2273 | + + " AND up_down=? AND ts >= ? AND ts <=? order by device_id,ts"; | ||
| 2274 | try{ | 2274 | try{ |
| 2275 | conn = DBUtils_MS.getConnection(); | 2275 | conn = DBUtils_MS.getConnection(); |
| 2276 | ps = conn.prepareStatement(sql); | 2276 | ps = conn.prepareStatement(sql); |
| 2277 | - ps.setString(1, line); | ||
| 2278 | - ps.setInt(2, weeks_year1); | ||
| 2279 | - ps.setLong(3, date1); | ||
| 2280 | - ps.setLong(4, date2); | ||
| 2281 | - ps.setInt(5, zd); | 2277 | + ps.setInt(1, weeks_year1); |
| 2278 | + ps.setString(2, line); | ||
| 2279 | + ps.setInt(3, zd); | ||
| 2280 | + ps.setLong(4, date1); | ||
| 2281 | + ps.setLong(5, date2); | ||
| 2282 | rs = ps.executeQuery(); | 2282 | rs = ps.executeQuery(); |
| 2283 | 2283 | ||
| 2284 | list = resultSet2Set(rs); | 2284 | list = resultSet2Set(rs); |
| @@ -3880,12 +3880,12 @@ public class ReportServiceImpl implements ReportService{ | @@ -3880,12 +3880,12 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3880 | PreparedStatement ps = null; | 3880 | PreparedStatement ps = null; |
| 3881 | ResultSet rs = null; | 3881 | ResultSet rs = null; |
| 3882 | String year=date.substring(0,4); | 3882 | String year=date.substring(0,4); |
| 3883 | - String sql = "select * from bsth_c_arrival_info_"+year+" where line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | 3883 | + String sql = "select * from bsth_c_arrival_info_"+year+" where weeks_year=? AND line_id=? AND ts > ? AND ts <=? order by ts"; |
| 3884 | try{ | 3884 | try{ |
| 3885 | conn = DBUtils_MS.getConnection(); | 3885 | conn = DBUtils_MS.getConnection(); |
| 3886 | ps = conn.prepareStatement(sql); | 3886 | ps = conn.prepareStatement(sql); |
| 3887 | - ps.setString(1,line); | ||
| 3888 | - ps.setInt(2, weeks_year); | 3887 | + ps.setInt(1, weeks_year); |
| 3888 | + ps.setString(2,line); | ||
| 3889 | ps.setLong(3, date1); | 3889 | ps.setLong(3, date1); |
| 3890 | ps.setLong(4, date2); | 3890 | ps.setLong(4, date2); |
| 3891 | rs = ps.executeQuery(); | 3891 | rs = ps.executeQuery(); |
src/main/resources/static/pages/electricity/jdl/list.html
| @@ -2,401 +2,401 @@ | @@ -2,401 +2,401 @@ | ||
| 2 | .blue{ | 2 | .blue{ |
| 3 | background-color: #87CEFF | 3 | background-color: #87CEFF |
| 4 | } | 4 | } |
| 5 | -</style> | ||
| 6 | -<div class="page-head"> | ||
| 7 | - <div class="page-title"> | ||
| 8 | - <h1>车辆充电量</h1> | ||
| 9 | - </div> | ||
| 10 | -</div> | ||
| 11 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 12 | - <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 13 | - <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li> | ||
| 14 | - <li><span class="active">车辆充电管理</span></li> | ||
| 15 | -</ul> | ||
| 16 | - | ||
| 17 | -<div class="row" id="ll_oil_list"> | ||
| 18 | - <div class="col-md-12"> | ||
| 19 | - <!-- Begin: life time stats --> | ||
| 20 | - <div class="portlet light portlet-fit portlet-datatable bordered"> | ||
| 21 | - <div class="portlet-title"> | ||
| 22 | - <div class="caption"> | ||
| 23 | - <i class="fa fa-fire-extinguisher"></i> <span | ||
| 24 | - class="caption-subject font-dark sbold uppercase">车辆充电量</span> | ||
| 25 | - </div> | ||
| 26 | - <div class="actions"> | ||
| 27 | - <button type="button" class="btn btn-circle blue" id="upload"><i class="fa fa-file-excel-o"></i> | ||
| 28 | - 导入Excel | ||
| 29 | - </button> | ||
| 30 | - <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> | ||
| 31 | - 导出Excel | ||
| 32 | - </button> | ||
| 33 | - </div> | ||
| 34 | - </div> | ||
| 35 | - <div class="portlet-body"> | ||
| 36 | - <div class="table-container" style="margin-top: 0px"> | ||
| 37 | - <table | ||
| 38 | - class="table table-striped table-bordered table-hover table-checkable" | ||
| 39 | - id="datatable_dlb"> | ||
| 40 | - <thead> | ||
| 41 | - <tr role="row" class="filter"> | ||
| 42 | - <td>公司:</td> | ||
| 43 | - <td> | ||
| 44 | - <select class="form-control" id="gsbm" ></select> | ||
| 45 | - </td> | ||
| 46 | - <td>分公司:</td> | ||
| 47 | - <td> | ||
| 48 | - <select class="form-control" id="fgsbm" ></select> | ||
| 49 | - </td> | ||
| 50 | - <td>日期:</td> | ||
| 51 | - <td width="86px"> | ||
| 52 | - <input type="text" style="width: 80px" name="rq" id="rq"/> | ||
| 53 | - </td> | ||
| 54 | - <td>内部编码:</td> | ||
| 55 | - <td> | ||
| 56 | - <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> | 5 | +</style> |
| 6 | +<div class="page-head"> | ||
| 7 | + <div class="page-title"> | ||
| 8 | + <h1>车辆充电量</h1> | ||
| 9 | + </div> | ||
| 10 | +</div> | ||
| 11 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 12 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 13 | + <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li> | ||
| 14 | + <li><span class="active">车辆充电管理</span></li> | ||
| 15 | +</ul> | ||
| 16 | + | ||
| 17 | +<div class="row" id="ll_oil_list"> | ||
| 18 | + <div class="col-md-12"> | ||
| 19 | + <!-- Begin: life time stats --> | ||
| 20 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | ||
| 21 | + <div class="portlet-title"> | ||
| 22 | + <div class="caption"> | ||
| 23 | + <i class="fa fa-fire-extinguisher"></i> <span | ||
| 24 | + class="caption-subject font-dark sbold uppercase">车辆充电量</span> | ||
| 25 | + </div> | ||
| 26 | + <div class="actions"> | ||
| 27 | + <button type="button" class="btn btn-circle blue" id="upload"><i class="fa fa-file-excel-o"></i> | ||
| 28 | + 导入Excel | ||
| 29 | + </button> | ||
| 30 | + <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i> | ||
| 31 | + 导出Excel | ||
| 32 | + </button> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + <div class="portlet-body"> | ||
| 36 | + <div class="table-container" style="margin-top: 0px"> | ||
| 37 | + <table | ||
| 38 | + class="table table-striped table-bordered table-hover table-checkable" | ||
| 39 | + id="datatable_dlb"> | ||
| 40 | + <thead> | ||
| 41 | + <tr role="row" class="filter"> | ||
| 42 | + <td>公司:</td> | ||
| 43 | + <td> | ||
| 44 | + <select class="form-control" id="gsbm" ></select> | ||
| 57 | </td> | 45 | </td> |
| 58 | - | ||
| 59 | - <td width="20%"> | ||
| 60 | - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | ||
| 61 | - <i class="fa fa-search"></i> 搜索 | ||
| 62 | - </button> | ||
| 63 | - <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | ||
| 64 | - <i class="fa fa-times"></i> 重置 | ||
| 65 | - </button> | ||
| 66 | -<!-- <button class="btn btn-danger btn-sm red" id="del" style="margin-right:0px"> --> | ||
| 67 | -<!-- <i class="fa fa-times"></i> 删除 --> | ||
| 68 | -<!-- </button> --> | ||
| 69 | - </td> | ||
| 70 | - </tr> | ||
| 71 | - <tr role="row" class="heading"> | ||
| 72 | - <th>#</th> | ||
| 73 | - <th>日期</th> | 46 | + <td>分公司:</td> |
| 47 | + <td> | ||
| 48 | + <select class="form-control" id="fgsbm" ></select> | ||
| 49 | + </td> | ||
| 50 | + <td>日期:</td> | ||
| 51 | + <td width="86px"> | ||
| 52 | + <input type="text" style="width: 80px" name="rq" id="rq"/> | ||
| 53 | + </td> | ||
| 54 | + <td>内部编码:</td> | ||
| 55 | + <td> | ||
| 56 | + <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> | ||
| 57 | + </td> | ||
| 58 | + | ||
| 59 | + <td width="20%"> | ||
| 60 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | ||
| 61 | + <i class="fa fa-search"></i> 搜索 | ||
| 62 | + </button> | ||
| 63 | + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> | ||
| 64 | + <i class="fa fa-times"></i> 重置 | ||
| 65 | + </button> | ||
| 66 | +<!-- <button class="btn btn-danger btn-sm red" id="del" style="margin-right:0px"> --> | ||
| 67 | +<!-- <i class="fa fa-times"></i> 删除 --> | ||
| 68 | +<!-- </button> --> | ||
| 69 | + </td> | ||
| 70 | + </tr> | ||
| 71 | + <tr role="row" class="heading"> | ||
| 72 | + <th>#</th> | ||
| 73 | + <th>日期</th> | ||
| 74 | <th colspan="2">内部编码</th> | 74 | <th colspan="2">内部编码</th> |
| 75 | - <th colspan="2">充电量</th> | ||
| 76 | - <th colspan="2">充电站</th> | ||
| 77 | - <th colspan="2">备注</th> | ||
| 78 | -<!-- <td>操作</td> --> | ||
| 79 | - </tr> | ||
| 80 | - </thead> | ||
| 81 | - <tbody></tbody> | ||
| 82 | - </table> | ||
| 83 | - <div style="text-align: right;"> | ||
| 84 | - <ul id="pagination" class="pagination"></ul> | ||
| 85 | - </div> | ||
| 86 | - </div> | ||
| 87 | - </div> | ||
| 88 | - <div class="portlet-body"> | ||
| 89 | - <div id="modules_tree"></div> | ||
| 90 | - </div> | ||
| 91 | - </div> | ||
| 92 | - </div> | ||
| 93 | -</div> | ||
| 94 | - | ||
| 95 | - | ||
| 96 | -<script src="/assets/js/ajaxfileupload/ajaxfileupload.js"></script> | ||
| 97 | -<script> | ||
| 98 | - $(function () { | ||
| 99 | - | ||
| 100 | - // 关闭左侧栏 | ||
| 101 | - if (!$('body').hasClass('page-sidebar-closed')) | ||
| 102 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 103 | - | ||
| 104 | - $("#rq").datetimepicker({ | ||
| 105 | - format: 'YYYY-MM-DD', | ||
| 106 | - locale: 'zh-cn' | ||
| 107 | - }); | ||
| 108 | - | ||
| 109 | - var page = 0, initPagination; | ||
| 110 | - var icheckOptions = { | ||
| 111 | - radioClass: 'iradio_square-blue icheck', | ||
| 112 | - increaseArea: '20%' | ||
| 113 | - } | ||
| 114 | - | ||
| 115 | - //重置 | ||
| 116 | - $('tr.filter .filter-cancel').on('click', function () { | ||
| 117 | - $('tr.filter input, select').val('').change(); | ||
| 118 | - }); | ||
| 119 | - | ||
| 120 | - //提交 | 75 | + <th colspan="2">充电量</th> |
| 76 | + <th colspan="2">充电站</th> | ||
| 77 | + <th colspan="2">备注</th> | ||
| 78 | +<!-- <td>操作</td> --> | ||
| 79 | + </tr> | ||
| 80 | + </thead> | ||
| 81 | + <tbody></tbody> | ||
| 82 | + </table> | ||
| 83 | + <div style="text-align: right;"> | ||
| 84 | + <ul id="pagination" class="pagination"></ul> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | + </div> | ||
| 88 | + <div class="portlet-body"> | ||
| 89 | + <div id="modules_tree"></div> | ||
| 90 | + </div> | ||
| 91 | + </div> | ||
| 92 | + </div> | ||
| 93 | +</div> | ||
| 94 | + | ||
| 95 | + | ||
| 96 | +<script src="/assets/js/ajaxfileupload/ajaxfileupload.js"></script> | ||
| 97 | +<script> | ||
| 98 | + $(function () { | ||
| 99 | + | ||
| 100 | + // 关闭左侧栏 | ||
| 101 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 102 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 103 | + | ||
| 104 | + $("#rq").datetimepicker({ | ||
| 105 | + format: 'YYYY-MM-DD', | ||
| 106 | + locale: 'zh-cn' | ||
| 107 | + }); | ||
| 108 | + | ||
| 109 | + var page = 0, initPagination; | ||
| 110 | + var icheckOptions = { | ||
| 111 | + radioClass: 'iradio_square-blue icheck', | ||
| 112 | + increaseArea: '20%' | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + //重置 | ||
| 116 | + $('tr.filter .filter-cancel').on('click', function () { | ||
| 117 | + $('tr.filter input, select').val('').change(); | ||
| 118 | + }); | ||
| 119 | + | ||
| 120 | + //提交 | ||
| 121 | $('tr.filter .filter-submit').on('click', function () { | 121 | $('tr.filter .filter-submit').on('click', function () { |
| 122 | - var gsbm = $('#gsbm').val(); | ||
| 123 | - var fgsbm = $('#fgsbm').val(); | ||
| 124 | - if ($("#rq").val() == "" || $("#rq").val() ==null){ | ||
| 125 | - layer.msg('请选择日期.'); | ||
| 126 | - }else if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){ | ||
| 127 | - layer.msg('请选择公司和分公司.'); | ||
| 128 | - }else { | ||
| 129 | - | ||
| 130 | - var params = getParams(); | ||
| 131 | - | ||
| 132 | - page = 0; | ||
| 133 | - jsDoQuery(params, true); | ||
| 134 | - } | ||
| 135 | - }); | ||
| 136 | - | ||
| 137 | - | ||
| 138 | - $.get('/user/companyData', function(result){ | ||
| 139 | - obj = result; | ||
| 140 | - var options=""; | ||
| 141 | -// = '<option value="">请选择</option>'; | ||
| 142 | - for(var i = 0; i < obj.length; i++){ | ||
| 143 | - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 144 | -// setFgsqx(obj[i].companyCode); | ||
| 145 | - } | ||
| 146 | - $('#gsbm').html(options); | ||
| 147 | - updateCompany(); | ||
| 148 | - }); | ||
| 149 | - | ||
| 150 | - $("#gsbm").on("change",updateCompany); | ||
| 151 | - function updateCompany(){ | ||
| 152 | - var company = $('#gsbm').val(); | ||
| 153 | - var options =""; | ||
| 154 | -// = '<option value="">请选择</option>'; | ||
| 155 | - for(var i = 0; i < obj.length; i++){ | ||
| 156 | - if(obj[i].companyCode == company){ | ||
| 157 | - var children = obj[i].children; | ||
| 158 | - for(var j = 0; j < children.length; j++){ | ||
| 159 | - options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 160 | - } | ||
| 161 | - } | ||
| 162 | - } | ||
| 163 | - $('#fgsbm').html(options); | ||
| 164 | - } | ||
| 165 | - /* | ||
| 166 | - * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | ||
| 167 | - */ | ||
| 168 | - function jsDoQuery(p, pagination) { | ||
| 169 | - var params = {}; | ||
| 170 | - if (p) | ||
| 171 | - params = p; | ||
| 172 | - params['order'] = 'nbbm'; | ||
| 173 | - params['page'] = page; | ||
| 174 | - params['rq'] = $("#rq").val(); | ||
| 175 | - | ||
| 176 | - var j = layer.load(2); | ||
| 177 | - $get('/jdl/query', params, function (data) { | ||
| 178 | - $.each(data.dataList, function (i, obj) { | ||
| 179 | - obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | ||
| 180 | - }); | ||
| 181 | - var bodyHtm = template('jdl_list', {list:data.dataList}); | ||
| 182 | - | ||
| 183 | - $('#datatable_dlb tbody').html(bodyHtm) | ||
| 184 | - .find('.icheck').iCheck(icheckOptions) | ||
| 185 | - .on('ifChanged', iCheckChange); | ||
| 186 | - if (pagination && data.dataList.length > 0) { | ||
| 187 | - //重新分页 | ||
| 188 | - initPagination = true; | ||
| 189 | - showPagination(data); | ||
| 190 | - $('#pagination').show(); | ||
| 191 | - } else if(data.dataList.length == 0){ | ||
| 192 | - $('#pagination').hide(); | ||
| 193 | - } | ||
| 194 | - | ||
| 195 | - layer.close(j); | ||
| 196 | - | ||
| 197 | - startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | ||
| 198 | - }); | ||
| 199 | - } | ||
| 200 | - | ||
| 201 | - //改变状态 | ||
| 202 | - function startOptJzylLink(es) { | ||
| 203 | - es.editable({ | ||
| 204 | - type: 'text', | ||
| 205 | - placement: 'right', | ||
| 206 | - width: 100, | ||
| 207 | - display: false, | ||
| 208 | - validate: function (value) { | ||
| 209 | - if (!value) | ||
| 210 | - return '值不能为空!'; | ||
| 211 | - if (isNaN(value)) | ||
| 212 | - return '只能为数字!'; | ||
| 213 | - if (value < 0) | ||
| 214 | - return '值不能小于0!'; | ||
| 215 | - }, | ||
| 216 | - inputclass: 'form-control input-medium input-edtable-sm' | ||
| 217 | - }).on('save', function (e, params) { | ||
| 218 | - $(this).text(params.newValue); | ||
| 219 | - }); | ||
| 220 | - } | ||
| 221 | - | ||
| 222 | - function iCheckChange() { | ||
| 223 | - var tr = $(this).parents('tr'); | ||
| 224 | - if (this.checked) | ||
| 225 | - tr.addClass('row-active'); | ||
| 226 | - else | ||
| 227 | - tr.removeClass('row-active'); | ||
| 228 | - | ||
| 229 | - /* if($('#datatable_resource input.icheck:checked').length == 1) | ||
| 230 | - $('#removeButton').removeAttr('disabled'); | ||
| 231 | - else | ||
| 232 | - $('#removeButton').attr('disabled', 'disabled'); */ | ||
| 233 | - } | ||
| 234 | - | ||
| 235 | - function showPagination(data) { | ||
| 236 | - //分页 | ||
| 237 | - $('#pagination').jqPaginator({ | ||
| 238 | - totalPages: data.totalPages, | ||
| 239 | - visiblePages: 6, | ||
| 240 | - currentPage: page + 1, | ||
| 241 | - first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 242 | - prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 243 | - next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 244 | - last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 245 | - page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 246 | - onPageChange: function (num, type) { | ||
| 247 | - if (initPagination) { | ||
| 248 | - initPagination = false; | ||
| 249 | - return; | ||
| 250 | - } | ||
| 251 | - | ||
| 252 | - var params = getParams(); | ||
| 253 | - | ||
| 254 | - page = num - 1; | ||
| 255 | - jsDoQuery(params, true); | ||
| 256 | - } | ||
| 257 | - }); | ||
| 258 | - } | ||
| 259 | - | ||
| 260 | - | ||
| 261 | - //删除 | ||
| 262 | - $('#del').on('click', function () { | ||
| 263 | - if ($(this).attr('disabled')) | ||
| 264 | - return; | ||
| 265 | - | ||
| 266 | - var id = $('input.icheck:checked').data('id'); | ||
| 267 | - removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () { | ||
| 268 | - $('tr.filter .filter-submit').click(); | ||
| 269 | - }); | ||
| 270 | - }); | ||
| 271 | - | ||
| 272 | - //搜索线路 | ||
| 273 | - $.get('/basic/lineCode2Name',function(result){ | ||
| 274 | - var data=[]; | ||
| 275 | - | ||
| 276 | - for(var code in result){ | ||
| 277 | - data.push({id: code, text: result[code]}); | ||
| 278 | - } | ||
| 279 | - initPinYinSelect2('#xlbm',data,''); | ||
| 280 | - | ||
| 281 | - }); | ||
| 282 | - | ||
| 283 | - $('#nbbm').select2({ | ||
| 284 | - placeholder: '搜索车辆...', | ||
| 285 | - ajax: { | ||
| 286 | - url: '/realSchedule/sreachVehic', | ||
| 287 | - dataType: 'json', | ||
| 288 | - delay: 150, | ||
| 289 | - data: function (params) { | ||
| 290 | - return {nbbm: params.term}; | ||
| 291 | - }, | ||
| 292 | - processResults: function (data) { | ||
| 293 | - return { | ||
| 294 | - results: data | ||
| 295 | - }; | ||
| 296 | - }, | ||
| 297 | - cache: true | ||
| 298 | - }, | ||
| 299 | - templateResult: function (repo) { | ||
| 300 | - if (repo.loading) return repo.text; | ||
| 301 | - var h = '<span>' + repo.text + '</span>'; | ||
| 302 | - h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 303 | - return h; | ||
| 304 | - }, | ||
| 305 | - escapeMarkup: function (markup) { | ||
| 306 | - return markup; | ||
| 307 | - }, | ||
| 308 | - minimumInputLength: 1, | ||
| 309 | - templateSelection: function (repo) { | ||
| 310 | - return repo.text; | ||
| 311 | - }, | ||
| 312 | - language: { | ||
| 313 | - noResults: function () { | ||
| 314 | - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 315 | - }, | ||
| 316 | - inputTooShort: function (e) { | ||
| 317 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 318 | - }, | ||
| 319 | - searching: function () { | ||
| 320 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 321 | - } | ||
| 322 | - } | ||
| 323 | - }) | ||
| 324 | - | ||
| 325 | - //导入 | ||
| 326 | - $("#upload").on("click", function(){ | ||
| 327 | - $.get('upload.html', function(m){$(pjaxContainer).append(m);}); | ||
| 328 | - }); | ||
| 329 | - | ||
| 330 | - //导出 | ||
| 331 | - $("#export").on("click", function () { | ||
| 332 | - if ($("#rq").val() != "") { | ||
| 333 | - var gsbm=$("#gsbm").val(); | ||
| 334 | - var fgsbm=$("#fgsbm").val(); | ||
| 335 | - if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){ | ||
| 336 | - layer.msg('请选择公司和分公司.'); | ||
| 337 | - return; | ||
| 338 | - } | ||
| 339 | - var params = getParams(); | ||
| 340 | - | ||
| 341 | - params["type"] = "export"; | ||
| 342 | - $get('/jdl/query', params, function (result) { | ||
| 343 | - window.open("/downloadFile/download?fileName=车辆充电量" + moment($("#rq").val()).format("YYYYMMDD")); | ||
| 344 | - }); | ||
| 345 | - } else { | ||
| 346 | - layer.msg('请选择日期.'); | ||
| 347 | - } | ||
| 348 | - }); | ||
| 349 | - | ||
| 350 | - function getParams(){ | ||
| 351 | - var gsbm=$("#gsbm").val(); | ||
| 352 | - var fgsbm=$("#fgsbm").val(); | ||
| 353 | - var cells = $('tr.filter')[0].cells | ||
| 354 | - , params = {} | ||
| 355 | - , name; | ||
| 356 | - params["gsbm"] = gsbm; | ||
| 357 | - params["fgsbm"] = fgsbm; | ||
| 358 | - $.each(cells, function (i, cell) { | ||
| 359 | - var items = $('input,select', cell); | ||
| 360 | - for (var j = 0, item; item = items[j++];) { | ||
| 361 | - name = $(item).attr('name'); | ||
| 362 | - if (name) { | ||
| 363 | - params[name] = $(item).val(); | ||
| 364 | - } | ||
| 365 | - } | ||
| 366 | - }); | ||
| 367 | - return params; | ||
| 368 | - }; | ||
| 369 | - | ||
| 370 | - }); | ||
| 371 | - | ||
| 372 | -</script> | ||
| 373 | - | ||
| 374 | -<script id="jdl_list" type="text/html"> | ||
| 375 | - {{each list as obj i}} | ||
| 376 | - <tr> | ||
| 377 | - <td style="vertical-align: middle;"> | ||
| 378 | - <!-- <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> --> | ||
| 379 | - {{i + 1}} | ||
| 380 | - </td> | ||
| 381 | - <td>{{obj.rq}}</td> | 122 | + var gsbm = $('#gsbm').val(); |
| 123 | + var fgsbm = $('#fgsbm').val(); | ||
| 124 | + if ($("#rq").val() == "" || $("#rq").val() ==null){ | ||
| 125 | + layer.msg('请选择日期.'); | ||
| 126 | + }else if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){ | ||
| 127 | + layer.msg('请选择公司和分公司.'); | ||
| 128 | + }else { | ||
| 129 | + | ||
| 130 | + var params = getParams(); | ||
| 131 | + | ||
| 132 | + page = 0; | ||
| 133 | + jsDoQuery(params, true); | ||
| 134 | + } | ||
| 135 | + }); | ||
| 136 | + | ||
| 137 | + | ||
| 138 | + $.get('/user/companyData', function(result){ | ||
| 139 | + obj = result; | ||
| 140 | + var options=""; | ||
| 141 | +// = '<option value="">请选择</option>'; | ||
| 142 | + for(var i = 0; i < obj.length; i++){ | ||
| 143 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 144 | +// setFgsqx(obj[i].companyCode); | ||
| 145 | + } | ||
| 146 | + $('#gsbm').html(options); | ||
| 147 | + updateCompany(); | ||
| 148 | + }); | ||
| 149 | + | ||
| 150 | + $("#gsbm").on("change",updateCompany); | ||
| 151 | + function updateCompany(){ | ||
| 152 | + var company = $('#gsbm').val(); | ||
| 153 | + var options =""; | ||
| 154 | +// = '<option value="">请选择</option>'; | ||
| 155 | + for(var i = 0; i < obj.length; i++){ | ||
| 156 | + if(obj[i].companyCode == company){ | ||
| 157 | + var children = obj[i].children; | ||
| 158 | + for(var j = 0; j < children.length; j++){ | ||
| 159 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + } | ||
| 163 | + $('#fgsbm').html(options); | ||
| 164 | + } | ||
| 165 | + /* | ||
| 166 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | ||
| 167 | + */ | ||
| 168 | + function jsDoQuery(p, pagination) { | ||
| 169 | + var params = {}; | ||
| 170 | + if (p) | ||
| 171 | + params = p; | ||
| 172 | + params['order'] = 'nbbm'; | ||
| 173 | + params['page'] = page; | ||
| 174 | + params['rq'] = $("#rq").val(); | ||
| 175 | + | ||
| 176 | + var j = layer.load(2); | ||
| 177 | + $get('/jdl/query', params, function (data) { | ||
| 178 | + $.each(data.dataList, function (i, obj) { | ||
| 179 | + obj.rq = moment(obj.rq).format("YYYY-MM-DD"); | ||
| 180 | + }); | ||
| 181 | + var bodyHtm = template('jdl_list', {list:data.dataList}); | ||
| 182 | + | ||
| 183 | + $('#datatable_dlb tbody').html(bodyHtm) | ||
| 184 | + .find('.icheck').iCheck(icheckOptions) | ||
| 185 | + .on('ifChanged', iCheckChange); | ||
| 186 | + if (pagination && data.dataList.length > 0) { | ||
| 187 | + //重新分页 | ||
| 188 | + initPagination = true; | ||
| 189 | + showPagination(data); | ||
| 190 | + $('#pagination').show(); | ||
| 191 | + } else if(data.dataList.length == 0){ | ||
| 192 | + $('#pagination').hide(); | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + layer.close(j); | ||
| 196 | + | ||
| 197 | + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl')); | ||
| 198 | + }); | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + //改变状态 | ||
| 202 | + function startOptJzylLink(es) { | ||
| 203 | + es.editable({ | ||
| 204 | + type: 'text', | ||
| 205 | + placement: 'right', | ||
| 206 | + width: 100, | ||
| 207 | + display: false, | ||
| 208 | + validate: function (value) { | ||
| 209 | + if (!value) | ||
| 210 | + return '值不能为空!'; | ||
| 211 | + if (isNaN(value)) | ||
| 212 | + return '只能为数字!'; | ||
| 213 | + if (value < 0) | ||
| 214 | + return '值不能小于0!'; | ||
| 215 | + }, | ||
| 216 | + inputclass: 'form-control input-medium input-edtable-sm' | ||
| 217 | + }).on('save', function (e, params) { | ||
| 218 | + $(this).text(params.newValue); | ||
| 219 | + }); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + function iCheckChange() { | ||
| 223 | + var tr = $(this).parents('tr'); | ||
| 224 | + if (this.checked) | ||
| 225 | + tr.addClass('row-active'); | ||
| 226 | + else | ||
| 227 | + tr.removeClass('row-active'); | ||
| 228 | + | ||
| 229 | + /* if($('#datatable_resource input.icheck:checked').length == 1) | ||
| 230 | + $('#removeButton').removeAttr('disabled'); | ||
| 231 | + else | ||
| 232 | + $('#removeButton').attr('disabled', 'disabled'); */ | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + function showPagination(data) { | ||
| 236 | + //分页 | ||
| 237 | + $('#pagination').jqPaginator({ | ||
| 238 | + totalPages: data.totalPages, | ||
| 239 | + visiblePages: 6, | ||
| 240 | + currentPage: page + 1, | ||
| 241 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 242 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 243 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 244 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 245 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 246 | + onPageChange: function (num, type) { | ||
| 247 | + if (initPagination) { | ||
| 248 | + initPagination = false; | ||
| 249 | + return; | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + var params = getParams(); | ||
| 253 | + | ||
| 254 | + page = num - 1; | ||
| 255 | + jsDoQuery(params, true); | ||
| 256 | + } | ||
| 257 | + }); | ||
| 258 | + } | ||
| 259 | + | ||
| 260 | + | ||
| 261 | + //删除 | ||
| 262 | + $('#del').on('click', function () { | ||
| 263 | + if ($(this).attr('disabled')) | ||
| 264 | + return; | ||
| 265 | + | ||
| 266 | + var id = $('input.icheck:checked').data('id'); | ||
| 267 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () { | ||
| 268 | + $('tr.filter .filter-submit').click(); | ||
| 269 | + }); | ||
| 270 | + }); | ||
| 271 | + | ||
| 272 | + //搜索线路 | ||
| 273 | + $.get('/basic/lineCode2Name',function(result){ | ||
| 274 | + var data=[]; | ||
| 275 | + | ||
| 276 | + for(var code in result){ | ||
| 277 | + data.push({id: code, text: result[code]}); | ||
| 278 | + } | ||
| 279 | + initPinYinSelect2('#xlbm',data,''); | ||
| 280 | + | ||
| 281 | + }); | ||
| 282 | + | ||
| 283 | + $('#nbbm').select2({ | ||
| 284 | + placeholder: '搜索车辆...', | ||
| 285 | + ajax: { | ||
| 286 | + url: '/realSchedule/sreachVehic', | ||
| 287 | + dataType: 'json', | ||
| 288 | + delay: 150, | ||
| 289 | + data: function (params) { | ||
| 290 | + return {nbbm: params.term}; | ||
| 291 | + }, | ||
| 292 | + processResults: function (data) { | ||
| 293 | + return { | ||
| 294 | + results: data | ||
| 295 | + }; | ||
| 296 | + }, | ||
| 297 | + cache: true | ||
| 298 | + }, | ||
| 299 | + templateResult: function (repo) { | ||
| 300 | + if (repo.loading) return repo.text; | ||
| 301 | + var h = '<span>' + repo.text + '</span>'; | ||
| 302 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 303 | + return h; | ||
| 304 | + }, | ||
| 305 | + escapeMarkup: function (markup) { | ||
| 306 | + return markup; | ||
| 307 | + }, | ||
| 308 | + minimumInputLength: 1, | ||
| 309 | + templateSelection: function (repo) { | ||
| 310 | + return repo.text; | ||
| 311 | + }, | ||
| 312 | + language: { | ||
| 313 | + noResults: function () { | ||
| 314 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 315 | + }, | ||
| 316 | + inputTooShort: function (e) { | ||
| 317 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 318 | + }, | ||
| 319 | + searching: function () { | ||
| 320 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 321 | + } | ||
| 322 | + } | ||
| 323 | + }) | ||
| 324 | + | ||
| 325 | + //导入 | ||
| 326 | + $("#upload").on("click", function(){ | ||
| 327 | + $.get('upload.html', function(m){$(pjaxContainer).append(m);}); | ||
| 328 | + }); | ||
| 329 | + | ||
| 330 | + //导出 | ||
| 331 | + $("#export").on("click", function () { | ||
| 332 | + if ($("#rq").val() != "") { | ||
| 333 | + var gsbm=$("#gsbm").val(); | ||
| 334 | + var fgsbm=$("#fgsbm").val(); | ||
| 335 | + if(gsbm=="" || gsbm==null || fgsbm=="" ||fgsbm==null){ | ||
| 336 | + layer.msg('请选择公司和分公司.'); | ||
| 337 | + return; | ||
| 338 | + } | ||
| 339 | + var params = getParams(); | ||
| 340 | + | ||
| 341 | + params["type"] = "export"; | ||
| 342 | + $get('/jdl/query', params, function (result) { | ||
| 343 | + window.open("/downloadFile/download?fileName=车辆充电量" + moment($("#rq").val()).format("YYYYMMDD")); | ||
| 344 | + }); | ||
| 345 | + } else { | ||
| 346 | + layer.msg('请选择日期.'); | ||
| 347 | + } | ||
| 348 | + }); | ||
| 349 | + | ||
| 350 | + function getParams(){ | ||
| 351 | + var gsbm=$("#gsbm").val(); | ||
| 352 | + var fgsbm=$("#fgsbm").val(); | ||
| 353 | + var cells = $('tr.filter')[0].cells | ||
| 354 | + , params = {} | ||
| 355 | + , name; | ||
| 356 | + params["gsbm"] = gsbm; | ||
| 357 | + params["fgsbm"] = fgsbm; | ||
| 358 | + $.each(cells, function (i, cell) { | ||
| 359 | + var items = $('input,select', cell); | ||
| 360 | + for (var j = 0, item; item = items[j++];) { | ||
| 361 | + name = $(item).attr('name'); | ||
| 362 | + if (name) { | ||
| 363 | + params[name] = $(item).val(); | ||
| 364 | + } | ||
| 365 | + } | ||
| 366 | + }); | ||
| 367 | + return params; | ||
| 368 | + }; | ||
| 369 | + | ||
| 370 | + }); | ||
| 371 | + | ||
| 372 | +</script> | ||
| 373 | + | ||
| 374 | +<script id="jdl_list" type="text/html"> | ||
| 375 | + {{each list as obj i}} | ||
| 376 | + <tr> | ||
| 377 | + <td style="vertical-align: middle;"> | ||
| 378 | + <!-- <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}"> --> | ||
| 379 | + {{i + 1}} | ||
| 380 | + </td> | ||
| 381 | + <td>{{obj.rq}}</td> | ||
| 382 | <td colspan="2">{{obj.nbbm}}</td> | 382 | <td colspan="2">{{obj.nbbm}}</td> |
| 383 | - | ||
| 384 | - <td colspan="2">{{obj.jdl}}</td> | ||
| 385 | - <td colspan="2">{{obj.jdz}}</td> | ||
| 386 | - <td>{{obj.remarks}}</td> | ||
| 387 | - <!-- <td> | ||
| 388 | - <button class="btn btn-info btn-sm"> | ||
| 389 | - <i class="fa fa-search"></i> 修改 | ||
| 390 | - </button> | ||
| 391 | - <button class="btn btn-danger btn-sm"> | ||
| 392 | - <i class="fa fa-trash-o"></i> 删除 | ||
| 393 | - </button> | ||
| 394 | - </td> --> | ||
| 395 | - </tr> | ||
| 396 | - {{/each}} | ||
| 397 | - {{if list.length == 0}} | ||
| 398 | - <tr> | ||
| 399 | - <td colspan=9><h6 class="muted">没有找到相关数据</h6></td> | ||
| 400 | - </tr> | ||
| 401 | - {{/if}} | 383 | + |
| 384 | + <td colspan="2">{{obj.jdl}}</td> | ||
| 385 | + <td colspan="2">{{obj.jdz}}</td> | ||
| 386 | + <td>{{obj.remarks}}</td> | ||
| 387 | + <!-- <td> | ||
| 388 | + <button class="btn btn-info btn-sm"> | ||
| 389 | + <i class="fa fa-search"></i> 修改 | ||
| 390 | + </button> | ||
| 391 | + <button class="btn btn-danger btn-sm"> | ||
| 392 | + <i class="fa fa-trash-o"></i> 删除 | ||
| 393 | + </button> | ||
| 394 | + </td> --> | ||
| 395 | + </tr> | ||
| 396 | + {{/each}} | ||
| 397 | + {{if list.length == 0}} | ||
| 398 | + <tr> | ||
| 399 | + <td colspan=9><h6 class="muted">没有找到相关数据</h6></td> | ||
| 400 | + </tr> | ||
| 401 | + {{/if}} | ||
| 402 | </script> | 402 | </script> |
| 403 | \ No newline at end of file | 403 | \ No newline at end of file |