Commit 51b5031b2dc287677c86f777dd44e0a9228e87db

Authored by 廖磊
1 parent 966e73ff

1

src/main/resources/static/pages/oil/list.html
1 <div class="page-head"> 1 <div class="page-head">
2 - <div class="page-title">  
3 - <h1>进出场存油量</h1>  
4 - </div> 2 + <div class="page-title">
  3 + <h1>进出场存油量</h1>
  4 + </div>
5 </div> 5 </div>
6 6
7 <ul class="page-breadcrumb breadcrumb"> 7 <ul class="page-breadcrumb breadcrumb">
8 - <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>  
9 - <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>  
10 - <li><span class="active">进出场存油量</span></li> 8 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  10 + <li><span class="active">进出场存油量</span></li>
11 </ul> 11 </ul>
12 12
13 -<div class="row">  
14 - <div class="col-md-12">  
15 - <!-- Begin: life time stats -->  
16 - <div class="portlet light portlet-fit portlet-datatable bordered">  
17 - <div class="portlet-title">  
18 - <div class="caption">  
19 - <i class="fa fa-fire-extinguisher"></i> <span  
20 - class="caption-subject font-dark sbold uppercase">进出场存油量表</span>  
21 - </div>  
22 - <div class="actions">  
23 - <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a>  
24 -<!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> -->  
25 - <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i> 拆分/保存</button>  
26 - <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->  
27 - <div class="btn-group">  
28 - <a class="btn red btn-outline btn-circle" href="javascript:;"  
29 - data-toggle="dropdown"> <i class="fa fa-share"></i> <span  
30 - class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>  
31 - </a>  
32 - <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">  
33 - <li><a href="javascript:;" data-action="0"  
34 - class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息  
35 - </a></li>  
36 - <li><a href="javascript:;" data-action="1"  
37 - class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场)  
38 - </a></li>  
39 - <li><a href="javascript:;" id="checkYl" data-action="3"  
40 - class="tool-action"> <i class="fa fa-gg-circle"></i>  
41 - 核对加注量(有加油无里程)  
42 - </a></li>  
43 - <li class="divider"></li>  
44 - <li><a href="javascript:;" data-action="3"  
45 - class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i>  
46 - 导出Excel  
47 - </a></li>  
48 - </ul>  
49 - </div>  
50 - </div>  
51 - </div>  
52 - <div class="portlet-body">  
53 - <div class="table-container" style="margin-top: 10px">  
54 - <table  
55 - class="table table-striped table-bordered table-hover table-checkable"  
56 - id="datatable_ylb">  
57 - <thead>  
58 - <tr role="row" class="filter">  
59 - <td colspan="3">  
60 - <!-- 公司:  
61 - <select name="ssgsdm" id="ssgsdm">  
62 - <option value="">请选择...</option>  
63 - <option value="1">可用</option>  
64 - <option value="0">禁用</option>  
65 - </select> --> 13 +<div class="row" id="liaolei_oil_list">
  14 + <div class="col-md-12">
  15 + <!-- Begin: life time stats -->
  16 + <div class="portlet light portlet-fit portlet-datatable bordered">
  17 + <div class="portlet-title">
  18 + <div class="caption">
  19 + <i class="fa fa-fire-extinguisher"></i> <span
  20 + class="caption-subject font-dark sbold uppercase">进出场存油量表</span>
  21 + </div>
  22 + <div class="actions">
  23 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a>
  24 + <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> -->
  25 + <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i>
  26 + 拆分/保存
  27 + </button>
  28 + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->
  29 + <div class="btn-group">
  30 + <a class="btn red btn-outline btn-circle" href="javascript:;"
  31 + data-toggle="dropdown"> <i class="fa fa-share"></i> <span
  32 + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>
  33 + </a>
  34 + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">
  35 + <li><a href="javascript:;" data-action="0"
  36 + class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息
  37 + </a></li>
  38 + <li><a href="javascript:;" data-action="1"
  39 + class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场)
  40 + </a></li>
  41 + <li><a href="javascript:;" id="checkYl" data-action="3"
  42 + class="tool-action"> <i class="fa fa-gg-circle"></i>
  43 + 核对加注量(有加油无里程)
  44 + </a></li>
  45 + <li class="divider"></li>
  46 + <li><a href="javascript:;" data-action="3"
  47 + class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i>
  48 + 导出Excel
  49 + </a></li>
  50 + </ul>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + <div class="portlet-body">
  55 + <div class="table-container" style="margin-top: 10px">
  56 + <table
  57 + class="table table-striped table-bordered table-hover table-checkable"
  58 + id="datatable_ylb">
  59 + <thead>
  60 + <tr role="row" class="filter">
  61 + <td colspan="3">
  62 + <!-- 公司:
  63 + <select name="ssgsdm" id="ssgsdm">
  64 + <option value="">请选择...</option>
  65 + <option value="1">可用</option>
  66 + <option value="0">禁用</option>
  67 + </select> -->
66 </td> 68 </td>
67 - <td >  
68 -<!-- <select name="fgsdm"> -->  
69 -<!-- <option value="">请选择...</option> -->  
70 -<!-- <option value="1">可用</option> -->  
71 -<!-- <option value="0">禁用</option> -->  
72 -<!-- </select> -->  
73 -  
74 - 日期:  
75 - </td>  
76 - <td colspan="2">  
77 - <input type="text" style="width: 80px" name="rq" id="rq"/>  
78 - </td>  
79 - <td colspan="2">  
80 - 线路:  
81 - </td>  
82 - <td colspan="3">  
83 - <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>  
84 - &nbsp;  
85 - </td>  
86 - <td colspan="2">  
87 - 内部编码:  
88 - </td>  
89 - <td colspan="3">  
90 - <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;" ></select>  
91 - </td>  
92 - <td colspan="4">  
93 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >  
94 - <i class="fa fa-search"></i> 搜索</button>  
95 -  
96 - <button class="btn btn-sm red btn-outline filter-cancel">  
97 - <i class="fa fa-times"></i> 重置</button>  
98 -  
99 - </td>  
100 - </tr>  
101 - <tr role="row" class="heading">  
102 - <th width="2%">#</th>  
103 - <th width="8%">日期</th>  
104 - <th width="5%">公司</th>  
105 - <th width="8%">线路</th>  
106 - <th width="5%">自编号</th>  
107 - <th width="6%">驾驶员</th>  
108 - <th width="4%">加油量</th>  
109 - <th width="5%">出场公里</th>  
110 - <th width="4%">进场公里</th>  
111 - <th width="4%">出场存油</th>  
112 - <th width="4%">进场存油</th>  
113 - <th width="5%">油耗</th>  
114 - <th width="5%">燃油类型</th>  
115 - <th width="4%">尿素</th>  
116 - <th width="5%">耗损原因</th>  
117 - <th width="5%">耗损油量</th>  
118 - <th width="5%">当日总里程</th>  
119 - <th width="5%">数据类型</th>  
120 - <th width="5%">百公里油耗</th>  
121 -<!-- <th width="5%">操作</th> -->  
122 - </tr>  
123 - </thead>  
124 - <tbody></tbody>  
125 - </table>  
126 - <div style="text-align: right;">  
127 - <ul id="pagination" class="pagination"></ul>  
128 - </div>  
129 - </div>  
130 - </div>  
131 - </div>  
132 - </div> 69 + <td>
  70 + <!-- <select name="fgsdm"> -->
  71 + <!-- <option value="">请选择...</option> -->
  72 + <!-- <option value="1">可用</option> -->
  73 + <!-- <option value="0">禁用</option> -->
  74 + <!-- </select> -->
  75 +
  76 + 日期:
  77 + </td>
  78 + <td colspan="2">
  79 + <input type="text" style="width: 80px" name="rq" id="rq"/>
  80 + </td>
  81 + <td colspan="2">
  82 + 线路:
  83 + </td>
  84 + <td colspan="3">
  85 + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
  86 + &nbsp;
  87 + </td>
  88 + <td colspan="2">
  89 + 内部编码:
  90 + </td>
  91 + <td colspan="3">
  92 + <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select>
  93 + </td>
  94 + <td colspan="4">
  95 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom">
  96 + <i class="fa fa-search"></i> 搜索
  97 + </button>
  98 +
  99 + <button class="btn btn-sm red btn-outline filter-cancel">
  100 + <i class="fa fa-times"></i> 重置
  101 + </button>
  102 +
  103 + </td>
  104 + </tr>
  105 + <tr role="row" class="heading">
  106 + <th width="2%">#</th>
  107 + <th width="8%">日期</th>
  108 + <th width="5%">公司</th>
  109 + <th width="8%">线路</th>
  110 + <th width="5%">自编号</th>
  111 + <th width="6%">驾驶员</th>
  112 + <th width="4%">加油量</th>
  113 + <th width="5%">出场公里</th>
  114 + <th width="4%">进场公里</th>
  115 + <th width="4%">出场存油</th>
  116 + <th width="4%">进场存油</th>
  117 + <th width="5%">油耗</th>
  118 + <th width="5%">燃油类型</th>
  119 + <th width="4%">尿素</th>
  120 + <th width="5%">耗损原因</th>
  121 + <th width="5%">耗损油量</th>
  122 + <th width="5%">当日总里程</th>
  123 + <th width="5%">数据类型</th>
  124 + <th width="5%">百公里油耗</th>
  125 + <!-- <th width="5%">操作</th> -->
  126 + </tr>
  127 + </thead>
  128 + <tbody></tbody>
  129 + </table>
  130 + <div style="text-align: right;">
  131 + <ul id="pagination" class="pagination"></ul>
  132 + </div>
  133 + </div>
  134 + </div>
  135 + </div>
  136 + </div>
133 </div> 137 </div>
134 138
135 <script id="ylb_list_temp" type="text/html"> 139 <script id="ylb_list_temp" type="text/html">
136 -{{each list as obj i}}  
137 -<tr>  
138 - <td style="vertical-align: middle;">  
139 - <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}">  
140 - </td>  
141 -  
142 - <td>  
143 -{{obj.rq}}  
144 - </td>  
145 - <td>  
146 - {{obj.gsname}}  
147 - </td>  
148 - <td>  
149 - {{obj.xlname}}  
150 - </td>  
151 - <td>  
152 - {{obj.nbbm}}  
153 - </td>  
154 - <td>  
155 - {{obj.jsy}}  
156 - </td>  
157 - <td>  
158 - {{obj.jzl}}  
159 - </td>  
160 - <td>  
161 - {{obj.czlc}}  
162 - </td>  
163 - <td>  
164 - {{obj.jzlc}}  
165 - </td>  
166 - <td>  
167 - {{obj.czyl}}  
168 - </td>  
169 - <td>  
170 -<a href="javascript:startOptJzylLink('jzyl{{obj.id}}')" id="jzyl{{obj.id}}" >  
171 - {{obj.jzyl}}  
172 -</a>  
173 - </td>  
174 - <td>  
175 - {{obj.yh}}  
176 - </td>  
177 - <td>  
178 - {{obj.rylx}}  
179 - </td>  
180 - <td>  
181 - {{obj.ns}}  
182 - </td>  
183 - <td>  
184 - {{obj.shyy}}  
185 - </td>  
186 - <td>  
187 - {{obj.sh}}  
188 - </td>  
189 - <td>  
190 - {{obj.zlc}}  
191 - </td>  
192 - <td>  
193 - {{obj.yhlx}}  
194 - </td>  
195 - <td>  
196 - {{obj.bglyh}}  
197 - </td>  
198 - <td>  
199 - <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>-->  
200 - </td>  
201 -</tr>  
202 -{{/each}}  
203 -{{if list.length == 0}}  
204 -<tr>  
205 - <td colspan=20><h6 class="muted">没有找到相关数据</h6></td>  
206 -</tr>  
207 -{{/if}} 140 + {{each list as obj i}}
  141 + <tr>
  142 + <td style="vertical-align: middle;">
  143 + <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}">
  144 + </td>
  145 +
  146 + <td>
  147 + {{obj.rq}}
  148 + </td>
  149 + <td>
  150 + {{obj.gsname}}
  151 + </td>
  152 + <td>
  153 + {{obj.xlname}}
  154 + </td>
  155 + <td>
  156 + {{obj.nbbm}}
  157 + </td>
  158 + <td>
  159 + {{obj.jsy}}
  160 + </td>
  161 + <td>
  162 + {{obj.jzl}}
  163 + </td>
  164 + <td>
  165 + {{obj.czlc}}
  166 + </td>
  167 + <td>
  168 + {{obj.jzlc}}
  169 + </td>
  170 + <td>
  171 + {{obj.czyl}}
  172 + </td>
  173 + <td>
  174 + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl">
  175 + {{obj.jzyl}}
  176 + </a>
  177 + </td>
  178 + <td>
  179 + {{obj.yh}}
  180 + </td>
  181 + <td>
  182 + {{obj.rylx}}
  183 + </td>
  184 + <td>
  185 + {{obj.ns}}
  186 + </td>
  187 + <td>
  188 + {{obj.shyy}}
  189 + </td>
  190 + <td>
  191 + {{obj.sh}}
  192 + </td>
  193 + <td>
  194 + {{obj.zlc}}
  195 + </td>
  196 + <td>
  197 + {{obj.yhlx}}
  198 + </td>
  199 + <td>
  200 + {{obj.bglyh}}
  201 + </td>
  202 + <td>
  203 + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>-->
  204 + </td>
  205 + </tr>
  206 + {{/each}}
  207 + {{if list.length == 0}}
  208 + <tr>
  209 + <td colspan=20><h6 class="muted">没有找到相关数据</h6></td>
  210 + </tr>
  211 + {{/if}}
208 </script> 212 </script>
209 213
210 <script> 214 <script>
211 -$(function(){  
212 - $("#checkYl").on('click',function(){  
213 - console.log("核对加注量");  
214 - if($("#rq").val()!=""){  
215 - var cells = $('tr.filter')[0].cells  
216 - ,params = {}  
217 - ,name;  
218 - $.each(cells, function(i, cell){  
219 - var items = $('input,select', cell);  
220 - for(var j = 0, item; item = items[j++];){  
221 - name = $(item).attr('name');  
222 - if(name){  
223 - params[name] = $(item).val();  
224 - }  
225 - }  
226 - });  
227 - $get('/ylb/checkYl', params, function(){  
228 - jsDoQuery(null,true);  
229 - });  
230 - }else{  
231 - layer.msg('请选择日期.');  
232 - }  
233 - })  
234 -  
235 - //进场等于出场  
236 - $("#outAndIn").on('click',function(){  
237 - console.log("进场油量等于出场油量");  
238 - if($("#rq").val()!=""){  
239 - var cells = $('tr.filter')[0].cells  
240 - ,params = {}  
241 - ,name;  
242 - $.each(cells, function(i, cell){  
243 - var items = $('input,select', cell);  
244 - for(var j = 0, item; item = items[j++];){  
245 - name = $(item).attr('name');  
246 - if(name){  
247 - params[name] = $(item).val();  
248 - }  
249 - }  
250 - });  
251 - $get('/ylb/outAndIn', params, function(){  
252 - jsDoQuery(null,true);  
253 - });  
254 - }else{  
255 - layer.msg('请选择日期.');  
256 - }  
257 - })  
258 - //拆分  
259 - $("#sortButton").on('click',function(){  
260 - console.log("拆分油量");  
261 - if($("#rq").val()!=""){  
262 - var id = $('input.icheck:checked').data('id');  
263 - if(typeof(id)=='undefined'){  
264 - layer.msg("请选择一行进行拆分");  
265 - }else{  
266 - //获取输入的进场存油  
267 - var jzyl=$("#jzyl"+id).html();  
268 - var params = {};  
269 - params['jzyl']=jzyl;  
270 - params['id']=id;  
271 - $get('/ylb/sort', params, function(){  
272 - jsDoQuery(null,true);  
273 - });  
274 -  
275 - }  
276 - }else{  
277 - layer.msg('请选择日期.');  
278 - }  
279 - })  
280 - //获取加存信息  
281 - $("#obtain").on('click', function(){  
282 - console.log("获取加存");  
283 - if($("#rq").val()!=""){  
284 - var cells = $('tr.filter')[0].cells  
285 - ,params = {}  
286 - ,name;  
287 - $.each(cells, function(i, cell){  
288 - var items = $('input,select', cell);  
289 - for(var j = 0, item; item = items[j++];){  
290 - name = $(item).attr('name');  
291 - if(name){  
292 - params[name] = $(item).val();  
293 - }  
294 - }  
295 - });  
296 - $get('/ylb/obtain', params, function(){  
297 - jsDoQuery(params,true);  
298 - });  
299 - }else{  
300 - layer.msg('请选择日期.');  
301 - }  
302 -  
303 - })  
304 - $("#rq").datetimepicker({  
305 - format : 'YYYY-MM-DD',  
306 - locale : 'zh-cn'  
307 - });  
308 -  
309 - if($("#rq").val()!=""){  
310 - jsDoQuery(null,true);  
311 - }  
312 - var page = 0, initPagination;  
313 - var icheckOptions = {  
314 - radioClass: 'iradio_square-blue icheck',  
315 - increaseArea: '20%'  
316 - }  
317 -  
318 - //重置  
319 - $('tr.filter .filter-cancel').on('click', function(){  
320 - $('tr.filter input, select').val('').change();  
321 - });  
322 -  
323 - //提交  
324 - $('tr.filter .filter-submit').on('click', function(){  
325 - if($("#rq").val()!=""){  
326 - var cells = $('tr.filter')[0].cells  
327 - ,params = {}  
328 - ,name;  
329 - $.each(cells, function(i, cell){  
330 - var items = $('input,select', cell);  
331 - for(var j = 0, item; item = items[j++];){  
332 - name = $(item).attr('name');  
333 - if(name){  
334 - params[name] = $(item).val();  
335 - }  
336 - }  
337 - });  
338 - page = 0;  
339 - jsDoQuery(params, true);  
340 - }else{  
341 - layer.msg('请选择日期.');  
342 - }  
343 - });  
344 -  
345 - /*  
346 - * 获取数据 p: 要提交的参数, pagination: 是否重新分页  
347 - */  
348 - function jsDoQuery(p, pagination){  
349 - var params = {};  
350 - if(p)  
351 - params = p;  
352 - //更新时间排序  
353 - console.log(params);  
354 - params['order'] = 'nbbm';  
355 - params['page'] = page;  
356 - params['rq']=$("#rq").val();  
357 - var i = layer.load(2);  
358 - console.log(params);  
359 - $get('/ylb' ,params, function(data){  
360 - $.each(data.content, function(i, obj) {  
361 - obj.rq = moment(obj.rq).format("YYYY-MM-DD"); 215 + $(function () {
  216 + //var id = 15;
  217 + //$('.in_carpark_jzyl[data-id='+id+']', '#liaolei_oil_list')
  218 +
  219 + $("#checkYl").on('click', function () {
  220 + console.log("核对加注量");
  221 + if ($("#rq").val() != "") {
  222 + var cells = $('tr.filter')[0].cells
  223 + , params = {}
  224 + , name;
  225 + $.each(cells, function (i, cell) {
  226 + var items = $('input,select', cell);
  227 + for (var j = 0, item; item = items[j++];) {
  228 + name = $(item).attr('name');
  229 + if (name) {
  230 + params[name] = $(item).val();
  231 + }
  232 + }
  233 + });
  234 + $get('/ylb/checkYl', params, function () {
  235 + jsDoQuery(null, true);
  236 + });
  237 + } else {
  238 + layer.msg('请选择日期.');
  239 + }
  240 + })
  241 +
  242 + //进场等于出场
  243 + $("#outAndIn").on('click', function () {
  244 + console.log("进场油量等于出场油量");
  245 + if ($("#rq").val() != "") {
  246 + var cells = $('tr.filter')[0].cells
  247 + , params = {}
  248 + , name;
  249 + $.each(cells, function (i, cell) {
  250 + var items = $('input,select', cell);
  251 + for (var j = 0, item; item = items[j++];) {
  252 + name = $(item).attr('name');
  253 + if (name) {
  254 + params[name] = $(item).val();
  255 + }
  256 + }
  257 + });
  258 + $get('/ylb/outAndIn', params, function () {
  259 + jsDoQuery(null, true);
  260 + });
  261 + } else {
  262 + layer.msg('请选择日期.');
  263 + }
  264 + })
  265 + //拆分
  266 + $("#sortButton").on('click', function () {
  267 + console.log("拆分油量");
  268 + if ($("#rq").val() != "") {
  269 + var id = $('input.icheck:checked').data('id');
  270 + if (typeof(id) == 'undefined') {
  271 + layer.msg("请选择一行进行拆分");
  272 + } else {
  273 + //获取输入的进场存油
  274 + var jzyl = $("#jzyl" + id).html();
  275 + var params = {};
  276 + params['jzyl'] = jzyl;
  277 + params['id'] = id;
  278 + $get('/ylb/sort', params, function () {
  279 + jsDoQuery(null, true);
  280 + });
  281 +
  282 + }
  283 + } else {
  284 + layer.msg('请选择日期.');
  285 + }
  286 + })
  287 + //获取加存信息
  288 + $("#obtain").on('click', function () {
  289 + console.log("获取加存");
  290 + if ($("#rq").val() != "") {
  291 + var cells = $('tr.filter')[0].cells
  292 + , params = {}
  293 + , name;
  294 + $.each(cells, function (i, cell) {
  295 + var items = $('input,select', cell);
  296 + for (var j = 0, item; item = items[j++];) {
  297 + name = $(item).attr('name');
  298 + if (name) {
  299 + params[name] = $(item).val();
  300 + }
  301 + }
  302 + });
  303 + $get('/ylb/obtain', params, function () {
  304 + jsDoQuery(params, true);
  305 + });
  306 + } else {
  307 + layer.msg('请选择日期.');
  308 + }
  309 +
  310 + })
  311 + $("#rq").datetimepicker({
  312 + format: 'YYYY-MM-DD',
  313 + locale: 'zh-cn'
  314 + });
  315 +
  316 + if ($("#rq").val() != "") {
  317 + jsDoQuery(null, true);
  318 + }
  319 + var page = 0, initPagination;
  320 + var icheckOptions = {
  321 + radioClass: 'iradio_square-blue icheck',
  322 + increaseArea: '20%'
  323 + }
  324 +
  325 + //重置
  326 + $('tr.filter .filter-cancel').on('click', function () {
  327 + $('tr.filter input, select').val('').change();
  328 + });
  329 +
  330 + //提交
  331 + $('tr.filter .filter-submit').on('click', function () {
  332 + if ($("#rq").val() != "") {
  333 + var cells = $('tr.filter')[0].cells
  334 + , params = {}
  335 + , name;
  336 + $.each(cells, function (i, cell) {
  337 + var items = $('input,select', cell);
  338 + for (var j = 0, item; item = items[j++];) {
  339 + name = $(item).attr('name');
  340 + if (name) {
  341 + params[name] = $(item).val();
  342 + }
  343 + }
  344 + });
  345 + page = 0;
  346 + jsDoQuery(params, true);
  347 + } else {
  348 + layer.msg('请选择日期.');
  349 + }
  350 + });
  351 +
  352 + /*
  353 + * 获取数据 p: 要提交的参数, pagination: 是否重新分页
  354 + */
  355 + function jsDoQuery(p, pagination) {
  356 + var params = {};
  357 + if (p)
  358 + params = p;
  359 + //更新时间排序
  360 + console.log(params);
  361 + params['order'] = 'nbbm';
  362 + params['page'] = page;
  363 + params['rq'] = $("#rq").val();
  364 + var i = layer.load(2);
  365 + console.log(params);
  366 + $get('/ylb', params, function (data) {
  367 + $.each(data.content, function (i, obj) {
  368 + obj.rq = moment(obj.rq).format("YYYY-MM-DD");
  369 + });
  370 + var bodyHtm = template('ylb_list_temp', {list: data.content});
  371 +
  372 + $('#datatable_ylb tbody').html(bodyHtm)
  373 + .find('.icheck').iCheck(icheckOptions)
  374 + .on('ifChanged', iCheckChange);
  375 + if (pagination && data.content.length > 0) {
  376 + //重新分页
  377 + initPagination = true;
  378 + showPagination(data);
  379 + }
  380 + layer.close(i);
  381 +
  382 + startOptJzylLink($('#liaolei_oil_list .in_carpark_jzyl'));
  383 + });
  384 + }
  385 +
  386 + //改变状态
  387 + function startOptJzylLink(es) {
  388 + es.editable({
  389 + type: 'text',
  390 + placement: 'right',
  391 + width: 100,
  392 + display: false,
  393 + validate: function (value) {
  394 + if (!value)
  395 + return '值不能为空!';
  396 + if (isNaN(value))
  397 + return '只能为数字!';
  398 + if (value < 0)
  399 + return '值不能小于0!';
  400 + },
  401 + inputclass: 'form-control input-medium input-edtable-sm'
  402 + })
  403 + .on('save', function (e, params) {
  404 + $(this).text(params.newValue);
  405 + });
  406 + }
  407 +
  408 + function iCheckChange() {
  409 + var tr = $(this).parents('tr');
  410 + if (this.checked)
  411 + tr.addClass('row-active');
  412 + else
  413 + tr.removeClass('row-active');
  414 +
  415 + /* if($('#datatable_resource input.icheck:checked').length == 1)
  416 + $('#removeButton').removeAttr('disabled');
  417 + else
  418 + $('#removeButton').attr('disabled', 'disabled'); */
  419 + }
  420 +
  421 + function showPagination(data) {
  422 + //分页
  423 + $('#pagination').jqPaginator({
  424 + totalPages: data.totalPages,
  425 + visiblePages: 6,
  426 + currentPage: page + 1,
  427 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  428 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  429 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  430 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  431 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  432 + onPageChange: function (num, type) {
  433 + if (initPagination) {
  434 + initPagination = false;
  435 + return;
  436 + }
  437 +
  438 + var cells = $('tr.filter')[0].cells
  439 + , params = {}
  440 + , name;
  441 + $.each(cells, function (i, cell) {
  442 + var items = $('input,select', cell);
  443 + for (var j = 0, item; item = items[j++];) {
  444 + name = $(item).attr('name');
  445 + if (name) {
  446 + params[name] = $(item).val();
  447 + }
  448 + }
  449 + });
  450 + page = num - 1;
  451 + jsDoQuery(params, true);
  452 + }
  453 + });
  454 + }
  455 +
  456 +
  457 + //删除
  458 + $('#removeButton').on('click', function () {
  459 + if ($(this).attr('disabled'))
  460 + return;
  461 +
  462 + var id = $('input.icheck:checked').data('id');
  463 + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () {
  464 + $('tr.filter .filter-submit').click();
362 }); 465 });
363 - var bodyHtm = template('ylb_list_temp', {list: data.content}); 466 + });
  467 +
  468 + //搜索线路
  469 + $.get('/basic/lineCode2Name',function(result){
  470 + var data=[];
364 471
365 - $('#datatable_ylb tbody').html(bodyHtm)  
366 - .find('.icheck').iCheck(icheckOptions)  
367 - .on('ifChanged', iCheckChange);  
368 - if(pagination && data.content.length > 0){  
369 - //重新分页  
370 - initPagination = true;  
371 - showPagination(data); 472 + for(var code in result){
  473 + data.push({id: code, text: result[code]});
372 } 474 }
373 - layer.close(i);  
374 - });  
375 - }  
376 -  
377 - function iCheckChange(){  
378 - var tr = $(this).parents('tr');  
379 - if(this.checked)  
380 - tr.addClass('row-active');  
381 - else  
382 - tr.removeClass('row-active');  
383 -  
384 - /* if($('#datatable_resource input.icheck:checked').length == 1)  
385 - $('#removeButton').removeAttr('disabled');  
386 - else  
387 - $('#removeButton').attr('disabled', 'disabled'); */  
388 - }  
389 -  
390 - function showPagination(data){  
391 - //分页  
392 - $('#pagination').jqPaginator({  
393 - totalPages: data.totalPages,  
394 - visiblePages: 6,  
395 - currentPage: page + 1,  
396 - first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',  
397 - prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',  
398 - next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',  
399 - last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',  
400 - page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',  
401 - onPageChange: function (num, type) {  
402 - if(initPagination){  
403 - initPagination = false;  
404 - return;  
405 - }  
406 -  
407 - var cells = $('tr.filter')[0].cells  
408 - ,params = {}  
409 - ,name;  
410 - $.each(cells, function(i, cell){  
411 - var items = $('input,select', cell);  
412 - for(var j = 0, item; item = items[j++];){  
413 - name = $(item).attr('name');  
414 - if(name){  
415 - params[name] = $(item).val();  
416 - }  
417 - }  
418 - });  
419 - page = num - 1;  
420 - jsDoQuery(params, true);  
421 - }  
422 - });  
423 - }  
424 -  
425 -  
426 - //删除  
427 - $('#removeButton').on('click', function(){  
428 - if($(this).attr('disabled'))  
429 - return;  
430 -  
431 - var id = $('input.icheck:checked').data('id');  
432 - removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){  
433 - $('tr.filter .filter-submit').click();  
434 - });  
435 - });  
436 -  
437 - //搜索线路  
438 - $('#xlbm').select2({  
439 - placeholder: '搜索线路...',  
440 - ajax: {  
441 - url: '/realSchedule/findLine',  
442 - type: 'post',  
443 - dataType: 'json',  
444 - delay: 150,  
445 - data: function(params){  
446 - return{line: params.term};  
447 - },  
448 - processResults: function (data) {  
449 - return {  
450 - results: data  
451 - };  
452 - },  
453 - cache: true  
454 - },  
455 - templateResult: function(repo){  
456 - if (repo.loading) return repo.text;  
457 - var h = '<span>'+repo.text+'</span>';  
458 - return h;  
459 - },  
460 - escapeMarkup: function (markup) { return markup; },  
461 - minimumInputLength: 1,  
462 - templateSelection: function(repo){  
463 - return repo.text;  
464 - },  
465 - language: {  
466 - noResults: function(){  
467 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
468 - },  
469 - inputTooShort : function(e) {  
470 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
471 - },  
472 - searching : function() {  
473 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
474 - }  
475 - }  
476 - });  
477 -  
478 - $('#nbbm').select2({  
479 - placeholder: '搜索车辆...',  
480 - ajax: {  
481 - url: '/realSchedule/sreachVehic',  
482 - dataType: 'json',  
483 - delay: 150,  
484 - data: function(params){  
485 - return{nbbm: params.term};  
486 - },  
487 - processResults: function (data) {  
488 - return {  
489 - results: data  
490 - };  
491 - },  
492 - cache: true  
493 - },  
494 - templateResult: function(repo){  
495 - if (repo.loading) return repo.text;  
496 - var h = '<span>'+repo.text+'</span>';  
497 - h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');  
498 - return h;  
499 - },  
500 - escapeMarkup: function (markup) { return markup; },  
501 - minimumInputLength: 1,  
502 - templateSelection: function(repo){  
503 - return repo.text;  
504 - },  
505 - language: {  
506 - noResults: function(){  
507 - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';  
508 - },  
509 - inputTooShort : function(e) {  
510 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';  
511 - },  
512 - searching : function() {  
513 - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';  
514 - }  
515 - }  
516 - })  
517 -  
518 - 475 + initPinYinSelect2('#xlbm',data,'');
  476 +
  477 + })
  478 +
  479 + $('#nbbm').select2({
  480 + placeholder: '搜索车辆...',
  481 + ajax: {
  482 + url: '/realSchedule/sreachVehic',
  483 + dataType: 'json',
  484 + delay: 150,
  485 + data: function (params) {
  486 + return {nbbm: params.term};
  487 + },
  488 + processResults: function (data) {
  489 + return {
  490 + results: data
  491 + };
  492 + },
  493 + cache: true
  494 + },
  495 + templateResult: function (repo) {
  496 + if (repo.loading) return repo.text;
  497 + var h = '<span>' + repo.text + '</span>';
  498 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  499 + return h;
  500 + },
  501 + escapeMarkup: function (markup) {
  502 + return markup;
  503 + },
  504 + minimumInputLength: 1,
  505 + templateSelection: function (repo) {
  506 + return repo.text;
  507 + },
  508 + language: {
  509 + noResults: function () {
  510 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  511 + },
  512 + inputTooShort: function (e) {
  513 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  514 + },
  515 + searching: function () {
  516 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  517 + }
  518 + }
  519 + })
  520 +
  521 +
519 //导出 522 //导出
520 -  
521 - $("#export").on("click",function(){  
522 - if($("#rq").val()!=""){  
523 - var cells = $('tr.filter')[0].cells  
524 - ,params = {}  
525 - ,name;  
526 - $.each(cells, function(i, cell){  
527 - var items = $('input,select', cell);  
528 - for(var j = 0, item; item = items[j++];){  
529 - name = $(item).attr('name');  
530 - if(name){  
531 - params[name] = $(item).val();  
532 - }  
533 - }  
534 - });  
535 - console.log(params);  
536 - $post('/ylb/listExport',params,function(result){  
537 - console.log(result);  
538 - window.open("/downloadFile/download?fileName=进出场存油量"+moment($("#rq").val()).format("YYYYMMDD"));  
539 - });  
540 - }else{  
541 - layer.msg('请选择日期.');  
542 - }  
543 - });  
544 -  
545 -});  
546 -//改变状态  
547 -function startOptJzylLink(id){  
548 - $('#'+id).editable({  
549 - type: 'text',  
550 - placement: 'right',  
551 - width:100,  
552 - display: false,  
553 - validate: function(value){  
554 - if(!value)  
555 - return '值不能为空!';  
556 - if(isNaN(value))  
557 - return '只能为数字!';  
558 - if(value<0)  
559 - return '值不能小于0!';  
560 - },  
561 - inputclass: 'form-control input-medium input-edtable-sm'  
562 - })  
563 - .on('save', function(e, params) {  
564 - $('#'+id).text(params.newValue);  
565 - });  
566 -  
567 -  
568 -  
569 -} 523 +
  524 + $("#export").on("click", function () {
  525 + if ($("#rq").val() != "") {
  526 + var cells = $('tr.filter')[0].cells
  527 + , params = {}
  528 + , name;
  529 + $.each(cells, function (i, cell) {
  530 + var items = $('input,select', cell);
  531 + for (var j = 0, item; item = items[j++];) {
  532 + name = $(item).attr('name');
  533 + if (name) {
  534 + params[name] = $(item).val();
  535 + }
  536 + }
  537 + });
  538 + console.log(params);
  539 + $post('/ylb/listExport', params, function (result) {
  540 + console.log(result);
  541 + window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD"));
  542 + });
  543 + } else {
  544 + layer.msg('请选择日期.');
  545 + }
  546 + });
  547 +
  548 + });
570 </script> 549 </script>
571 \ No newline at end of file 550 \ No newline at end of file