scheduleDailyQp2.html 11.7 KB
<style type="text/css">
	.table-bordered {
	  border: 1px solid; }
	  .table-bordered > thead > tr > th,
	  .table-bordered > thead > tr > td,
	  .table-bordered > tbody > tr > th,
	  .table-bordered > tbody > tr > td,
	  .table-bordered > tfoot > tr > th,
	  .table-bordered > tfoot > tr > td {
	    border: 1px solid; }
	  .table-bordered > thead > tr > th,
	  .table-bordered > thead > tr > td {
	    border-bottom-width: 2px; }
	 
	 .table > tbody + tbody {
	   border-top: 1px solid; }
</style>

<div class="page-head">
	<div class="page-title">
		<h1>调度工作日报表</h1>
	</div>
</div>

<div class="row">
	<div class="col-md-12">
		<div class="portlet light porttlet-fit bordered">
			<div class="portlet-title">
				<form id="history" class="form-inline" action="">
					<div style="display: inline-block; margin-left: 10px;" id="company1">
						<span class="item-label" style="width: 80px;">公司: </span>
						<select class="form-control" name="company" id="company" style="width: 160px;"></select>
					</div>
					<div style="display: inline-block; margin-left: 10px;" id="subCompany1">
						<span class="item-label" style="width: 80px;">分公司: </span>
						<select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
					</div>
					<div style="display: inline-block; margin-left: 10px;">
						<span class="item-label" style="width: 80px;">线路: </span>
						<select class="form-control" name="line" id="line" style="width: 180px;"></select>
					</div>
					<div style="display: inline-block;margin-left: 10px;">
						<span class="item-label" style="width: 80px;">时间: </span>
						<input class="form-control" type="text" id="date" style="width: 180px;"/>
					</div>
					<div class="form-group">
						<input class="btn btn-default" type="button" id="query" value="筛选"/>
						<input class="btn btn-default" type="button" id="export" value="导出"/>
					</div>
				</form>
			</div>
			<div class="portlet-body" >
				<div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 506px;height: 400px">
					<table class="table table-bordered table-hover table-checkable" id="forms">
						<thead >
							<tr >
								<th style="text-align:center;vertical-align:middle;" rowspan="3">路牌</th>
								<th style="text-align:center;vertical-align:middle;"
								 rowspan="2" colspan="2">车号</th>
								<th rowspan="3">班别</th>
								<th  colspan="3"  style="text-align:center;vertical-align:middle;">驾驶员</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th>
								<th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th>
								<th rowspan="4" style="text-align:center;vertical-align:middle;">记录项目</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">1</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">2</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">3</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">4</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">5</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">6</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">7</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">8</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">9</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">10</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">11</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">12</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">13</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">14</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">15</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">16</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">17</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">18</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">19</th>
								<th colspan="3" style="text-align:center;vertical-align:middle;">20</th>
								
							</tr>
							<tr>
								
								
								<th colspan="3">职号/接班时间</th>
								<th colspan="3">职号/接班时间</th>
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
								<th rowspan="2">到达</th>
								<th rowspan="2">早/迟</th>
								<th rowspan="2">开出</th>
								
							</tr>
							<tr>
							<th>出场</th>
								<th>调换</th>
								<th>1</th>
								<th>2</th>
								<th>3</th>
								<th>1</th>
								<th>2</th>
								<th>3</th>
							</tr>
						</thead>
						<tbody >
							 <tr >
							<td></td>
							<td>
								
							</td>
							<td>
								
							</td>
							<td>
								
							</td>
							<td>
								
							</td>
								<td >
									
								</td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
							</tr>
							 
						</tbody>
					</table>
					<div style="text-align: right;">
						<ul id="pagination" class="pagination"></ul>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script>
	$(function(){
		
		// 关闭左侧栏
		if (!$('body').hasClass('page-sidebar-closed'))
			$('.menu-toggler.sidebar-toggler').click();
		
		$("#date").datetimepicker({
			format : 'YYYY-MM-DD',
			locale : 'zh-cn'
		});
		
		var d = new Date();
		var year = d.getFullYear();
		var month = d.getMonth() + 1;
		var day = d.getDate();
		if(month < 10)
			month = "0" + month;
		if(day < 10)
			day = "0" + day;
		$("#date").val(year + "-" + month + "-" + day);
		
		$.get('/basic/lineCode2Name',function(result){
			var data=[];
			
			data.push({id: " ", text: "全部线路"});
			for(var code in result){
				data.push({id: code, text: result[code]});
			}
			initPinYinSelect2('#line',data,'');
		})
		
		var obj = [];
		$.get('/user/companyData', function(result){
			obj = result;
			var options = '';
			for(var i = 0; i < obj.length; i++){
				options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
			}
			if(obj.length == 1){
				$('#company1').hide();
				if(obj[0].children.length == 1)
					$('#subCompany1').hide();
			}
			$('#company').html(options);
			updateCompany();
		});
		$("#company").on("change",updateCompany);
		function updateCompany(){
			var company = $('#company').val();
			var options = '';
			for(var i = 0; i < obj.length; i++){
				if(obj[i].companyCode == company){
					var children = obj[i].children;
					for(var j = 0; j < children.length; j++){
						options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
					}
				}
			}
			$('#subCompany').html(options);
		}
		
		
		//查询
		$("#query").on('click',function(){
			var line = $("#line").val();
			var date = $("#date").val();
			$get('/realSchedule/scheduleDailyQp',{line:line,date:date},function(result){
				var mycars = new Array(20);
				var scheduleDaily_qp = template('scheduleDaily_qp',{list:result,lists:mycars});
				$('#forms tbody').html(scheduleDaily_qp);
			});
		});
		
		$("#export").on("click",function(){
			$get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
				window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
			});
		});
		
		
	});
	
</script>
<script type="text/html" id="scheduleDaily_qp">
	{{each list as obj i}}
		<tr>
			<td>{{obj.lp}}</td>
			<td>{{obj.cccl}}</td>
			<td>{{obj.thclzbh}}</td>
			<td>&nbsp;</td>
			<td>{{obj.jjb1}}</td>
			<td>{{obj.jjb2}}</td>
			<td>{{obj.jjb3}}</td>
			<td>{{obj.sjb1}}</td>
			<td>{{obj.sjb2}}</td>
			<td>{{obj.sjb3}}</td>
			<td>{{obj.lp}}</td>
			<td>&nbsp;</td>
			{{each lists as o j}}
			  <td>{{obj['dd'+(j+1)]}}</td>
			  <td>{{obj['cz'+(j+1)]}}</td>
			  <td>{{obj['kc'+(j+1)]}}</td>
			{{/each}}


	{{/each}}
	{{if list.length == 0}}
		<tr>
			<td colspan="17"><h6 class="muted">没有找到相关数据</h6></td>
		</tr>
	{{/if}}
</script>