caipin vor 7 Jahren
Ursprung
Commit
981e02c8b8

+ 17 - 1
global/js/receipt.js

@@ -10,6 +10,22 @@ function receiptYear(){
 	 form.submit();  
 }
 
+function receiptDate(){
+	var form = $('#up'); 
+	//$('#year').val($('#date').val());
+	form.submit();  
+}
+
+function reportPM(){
+	var name=$('#report').val();
+	if(name=='ALL')
+		$("tr[node-all='true']").show();
+	else{
+		$("tr[node-all='true']").hide();
+		$("tr[node-box='"+name+"']").show();
+	}
+}
+
 function receiptMoth(){
 	 var form = $('#up'); 
 	 $('#year').val($('#Y').val());
@@ -62,7 +78,7 @@ function expensesDefray(status,rid){
 }
 
 function showOpinion(receiptOrder){
-	console.log(receiptOrder);
+	//console.log(receiptOrder);
 	$('#orderBody').html('读取中');
 	var url="/ajaxGetReceiptOrder";
 	

+ 39 - 6
protected/controller/ReceiptController.php

@@ -2510,6 +2510,10 @@ class ReceiptController extends DooController {
 		$cid = $this->get_args ( 'cid' ) ? $this->get_args ( 'cid' ) : 0;
 		$sid = $this->get_args ( 'sid' ) ? $this->get_args ( 'sid' ) : 0;
 		
+		$rdate = $this->get_args ( 'date' ) ? $this->get_args ( 'date' ) : "";
+		
+		//echo $rdate;
+		
 		if (empty ( $status ))
 			$status = $this->get_args ( 'status' ) && is_numeric ( $this->get_args ( 'status' ) ) ? $this->get_args ( 'status' ) : 0;
 		
@@ -2544,16 +2548,21 @@ class ReceiptController extends DooController {
 			// $dateCondition="";
 			// else
 		$dateCondition = " and Year(date) =" . $year;
-		
+/*		
 		if (! empty ( $month ))
 			$dateCondition = " and Year(date) =" . $year . " and Month(date) = " . $month;
 		
-		if($status == 'done'){
-			$dateCondition = " and Year(pastDate) =" . $year;
-			if (! empty ( $month ))
+ 		if($status == 'done'){
+ 			$dateCondition = " and Year(pastDate) =" . $year;
+ 			if (! empty ( $month ))
 				$dateCondition = " and Year(pastDate) =" . $year . " and Month(pastDate) = " . $month;
-		}
-			
+ 		}
+	*/	
+//date ( 'Y-m' )
+		if(!empty($rdate)&&$status == 'done')
+			$dateCondition=" and date_format(pastDate,'%Y-%m')='".$rdate."' ";
+		elseif (!empty($rdate))
+			$dateCondition=" and date_format(date,'%Y-%m')='".$rdate."' ";
 		$categoryList = $Lcategory->find ( array (
 				'asArray' => true 
 		) );
@@ -2645,9 +2654,14 @@ class ReceiptController extends DooController {
 		// echo '1 '.$dateCondition.$cateCondition.$staffCondition.' and verify in ('.$vid.')';
 		// print_r($pageinfo);
 		
+		
+		
 		$Locate = 0;
 		
+		
+		$reportList=array();
 		foreach ( $receiptList as $key => $value ) {
+			
 			$receiptList [$key] ['Locate'] = $Locate;
 			$Locate ++;
 			$receiptList [$key] ['reviseDetail'] = array ();
@@ -2704,9 +2718,28 @@ class ReceiptController extends DooController {
 					'where' => 'sid=' . $value ['staff'],
 					'asArray' => true 
 			) );
+			
+			array_push($reportList, $receiptList [$key] ['staffDetail']['sid'].'-'.$receiptList [$key] ['staffDetail']['username']);
+			
 			$receiptList [$key] ['button'] = $button;
 			$receiptList [$key] ['nowStaffArray'] = explode ( ',', $value ['nowStaff'] );
 		}
+		
+		
+		$reportList=array_unique($reportList);
+		$reportHtml='';
+		foreach ($reportList as $key=>$value){
+			$v=explode("-", $value);
+			$reportHtml.='<option value="'.$v[1].'">'.$v[1].'</option>';
+		}
+		
+		//print_r($reportList);
+
+		$data['reportHtml']=$reportHtml;
+
+		//$reportHtml.='<option value="ALL">'.$value[''].'</option>';
+			
+		
 		// print_r($receiptList);die;
 		// $data['verifyDetail']=$verifyDetail;
 		

+ 17 - 4
protected/view/admin/approvalExpenses.html

@@ -31,7 +31,7 @@
 				
 					
 	  				
-	  				<ul class="   cateList  " >
+	  				<ul class=" cateList " >
 	  					<li>
 	  					
 	  					<a <!-- if {{status}}=='pendApproval' --> class="now" <!-- endif --> href="/approvalExpenses/pendApproval">待审批</a>
@@ -39,14 +39,27 @@
 	  					<a  <!-- if {{status}}=='done' --> class="now" <!-- endif --> href="/approvalExpenses/done">费用完成</a>
 	  					<a <!-- if {{status}}=='termination' --> class="now" <!-- endif --> href="/approvalExpenses/termination">终止</a>
 	  					
+	  					</li>
 	  					
+	  					<!-- if {{status}}=='pendApproval'  -->
 	  					
-	  					</li>
+	  					<li>
+	  					<select id="report" onChange="reportPM();">
+	  					<option value="ALL">员工</option>
+	  					{{reportHtml}}
+	  					</select>
+						</li>
+	  					
+	  					<!-- endif -->
 	  					
 	  					<!-- if {{status}}=='done' || {{status}}=='termination' --> 
+	  					<li >
+	  					<input type="month" name="date" id="date" style="width:120px" onChange="receiptDate();" value="">
+	  					</li>
+	  					
+	  					
 	  					<li>
 						<select name="year" id="Y" onChange="receiptYear();">
-	  					
 	  					<!-- include 'year' -->
 	  					</select>
 	  					<select name="month" id="M" onChange="receiptMoth();">
@@ -85,7 +98,7 @@
 	  					<th width="120">费用所在办事处</th><th width="120">报销单号</th><th>报销说明</th><th width="100">状态</th><th width="100">操作</th></tr></thead>
 	  					<tbody>
 	  					<!-- loop receiptList -->
-	  						<tr>
+	  						<tr node-all='true' node-box='{{receiptList' value.staffDetail.username}}' >
 	  							<td><div class="avtra"><img src="{{receiptList' value.staffDetail.avatar}}_2.jpg" width="32"><br>{{receiptList' value.staffDetail.username}}</div></td>
 	  							<td><!-- if {{receiptDetail' value.Rtype}}==1 --> 
 	  							借款