소스 검색

分页和交互

caipin 8 년 전
부모
커밋
8cb208bb5c

+ 34 - 34
global/js/invoice.js

@@ -374,41 +374,41 @@ $(function() {
 	});
 	
 	
-	$("a[node-irDelete]").click(function() {
-		
-		var postData = $(this).attr("data-isKey");
-		$("input[id='claimdKey']").val(postData);
+	$("a[node-post='upEm']").click(function() {
+		var postData = $(this).attr("post-data");
 		
-		//$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
-//		var url = "/ajaxGetInvoiceReceivablesByStaff";
-//		$.ajax({
-//			url : url,
-//			type : "post",
-//			cache : false,
-//			dataType : "json",
-//			data : {
-//				postData : postData
-//			},
-//			global : true,
-//			success : function(data) {
-//				if (data.status == 1) {
-//					
-//					$("input[name='receivablesPrice']").val(data.detail.receivablesPrice);
-//					$("input[name='receivablesMessage']").val(data.detail.receivablesMessage);
-//					$("input[name='receivablesDate']").val(data.detail.receivablesDate);
-//					
-//					$("select[html-rbank]").html(data.rbankHtml);
-//					
-//					$("input[id='claimuKey']").val(postData);
-//					$("select[html-rcategory]").html(data.categoryHtml);
-//					$("select[html-rstaff]").html(data.staffHtml);
-//				} else
-//					$("div[loading-msg='categoryStaff']").html("illegal request");
-//			},
-//			error : function(err) {
-//				$("div[loading-msg='true']").html("");
-//			}
-//		});
+		$("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
+		var url = "/ajaxGetInvoicePostDetail";
+		$.ajax({
+			url : url,
+			type : "post",
+			cache : false,
+			dataType : "json",
+			data : {
+				iidKey : postData
+			},
+			global : true,
+			success : function(data) {
+				if (data.status == 1) {
+					
+					$("input[name='iidKey']").val(postData);
+					
+					$("td[recipients-data='express-msgU']").html(data.invoiceDetail.recipients);
+					$("td[recipientsPhone-data='express-msgU']").html(data.invoiceDetail.recipientsPhone);
+					$("td[recipientsAddress-data='express-msgU']").html(data.invoiceDetail.recipientsAddress);
+					$("td[mailItems-data='express-msgU']").html(data.invoiceDetail.mailItems);
+					$("textarea[actualItems-data='express-msgU']").val(data.invoiceDetail.actualItems);
+					
+					$("select[name='express']").html(data.invoiceDetail.eaHtml);
+					
+					$("input[expressNumber-data='express-msgU']").val(data.invoiceDetail.expressNumber);
+					$("div[loading-msg='express-msg']").html("");
+				} else
+					$("div[loading-msg='express-msg']").html("illegal request");
+			},
+			error : function(err) {
+			}
+		});
 	});
 	
 	

+ 1 - 0
protected/config/acl.conf.php

@@ -58,6 +58,7 @@ $acl ['发票邮寄'] ['allow'] = array (
 				'invoicePost',
 				'ajaxGetInvoicePostDetail',
 				'invoiceExpressAddDo',
+				'invoiceExpressUpdateDo',
 				'invoiceTAchieve'
 		) 
 );

+ 7 - 0
protected/config/routes.conf.php

@@ -406,6 +406,7 @@ $route['get']['/invoicePrintAchieve/:page/:date/:MebSea'] = array('InvoiceContro
 $route['*']['/invoicePost'] = array('InvoiceController', 'invoicePost');
 $route['*']['/invoiceExpressAddDo'] = array('InvoiceController', 'invoiceExpressAddDo');
 $route['post']['/ajaxGetInvoicePostDetail'] = array('InvoiceController', 'ajaxGetInvoicePostDetail');
+$route['post']['/invoiceExpressUpdateDo'] = array('InvoiceController', 'invoiceExpressUpdateDo');
 
 $route['get']['/invoicePostAchieve'] = array('InvoiceController', 'invoiceTAchieve');
 $route['get']['/invoicePostAchieve/:page'] = array('InvoiceController', 'invoiceTAchieve');
@@ -416,6 +417,12 @@ $route['get']['/invoicePostAchieve/:page/:date/:MebSea'] = array('InvoiceControl
 //发票退票
 $route['get']['/invoiceUntread'] = array('InvoiceController', 'invoiceUntread');
 $route['post']['/invoiceUntreadEstablishedDo'] = array('InvoiceController', 'invoiceUntreadEstablishedDo');
+
+$route['get']['/invoiceUntreadAchieve'] = array('InvoiceController', 'invoiceTAchieve');
+$route['get']['/invoiceUntreadAchieve/:page'] = array('InvoiceController', 'invoiceTAchieve');
+$route['get']['/invoiceUntreadAchieve/:page/:date'] = array('InvoiceController', 'invoiceTAchieve');
+$route['get']['/invoiceUntreadAchieve/:page/:date/:MebSea'] = array('InvoiceController', 'invoiceTAchieve');
+
 //收款管理
 $route['get']['/invoiceReceivables'] = array('InvoiceController', 'invoiceReceivables');
 $route['post']['/invoiceReceivablesDo'] = array('InvoiceController', 'invoiceReceivablesDo');

+ 134 - 84
protected/controller/InvoiceController.php

@@ -13,8 +13,7 @@ class InvoiceController extends DooController {
 	public $data;
 	private $INVOICEKEY = "APPROVAL";
 	private $INVOICECOLLECTPATH = "protected/cache/invoiceCollect/";
-	private $ACTION='';
-	
+	private $ACTION = '';
 	public function beforeRun($resource, $action) {
 		Doo::loadModel ( "invoiceManage" );
 		$invoiceManage = new invoiceManage ();
@@ -56,8 +55,8 @@ class InvoiceController extends DooController {
 				Doo::loadModel ( 'staff' );
 				$staff = new staff ();
 				
-				$uriPartsOrig = explode('/', $_SERVER['REQUEST_URI']);
-				$this->ACTION=$uriPartsOrig[1];
+				$uriPartsOrig = explode ( '/', $_SERVER ['REQUEST_URI'] );
+				$this->ACTION = $uriPartsOrig [1];
 				
 				$this->data ['new'] = $this->isInvoiceNew ();
 				$this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
@@ -911,6 +910,34 @@ class InvoiceController extends DooController {
 		$invoice->setInvoiceByCondition ( $item );
 		return '/invoicePost';
 	}
+	function invoiceExpressUpdateDo() {
+		Doo::loadModel ( 'invoice' );
+		$invoice = new invoice ();
+		
+		$action = $this->get_args ( 'action' ) ? $this->get_args ( 'action' ) : "";
+		
+		$iid = $this->get_args ( 'iidKey' ) ? $this->get_args ( 'iidKey' ) : "";
+		$expressCompany = $this->get_args ( 'express' ) ? $this->get_args ( 'express' ) : "";
+		$expressNumber = $this->get_args ( 'nu' ) ? $this->get_args ( 'nu' ) : "";
+		$actualItems = $this->get_args ( 'actualItems' ) ? $this->get_args ( 'actualItems' ) : "";
+		$iid = $invoice->authcode ( $iid );
+		if (! is_numeric ( $iid ) && empty ( $expressCompany ) && empty ( $expressNumber ) && empty ( $actualItems ))
+			die ( 'illegal request' );
+		
+		$item = array (
+				'iid' => $iid,
+				'updateTime' => date ( "Y-m-d H:i:s" ),
+				
+				'expressCompany' => $expressCompany,
+				'expressNumber' => $expressNumber,
+				'actualItems' => $actualItems,
+				'poster' => $this->staff [0] ['username'] 
+		);
+		
+		$invoice->setInvoiceByCondition ( $item );
+		return $action;
+	}
+	
 	/**
 	 * 退票处理页面
 	 */
@@ -1883,7 +1910,6 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		
-		
 		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
 		
 		$page_size = 2;
@@ -1907,13 +1933,13 @@ class InvoiceController extends DooController {
 		$pageinfo ['page'] = array (
 				'previous' => '' 
 		);
-		$sql = '(status=1 or status=3 or status=4) and processApprovals!=""'. $con;
+		$sql = '(status=1 or status=3 or status=4) and processApprovals!=""' . $con;
 		$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, "invoiceApprovalAchieve", $get, "" );
 		
 		$limit = $pageinfo ['lower'] . ',' . $page_size;
 		
 		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
-	//print_r($list);
+		// print_r($list);
 		$this->data ['MebSeaEn'] = $MebSea;
 		$this->data ['MebSea'] = urlencode ( $MebSea );
 		$this->data ['get'] = $get;
@@ -1926,7 +1952,6 @@ class InvoiceController extends DooController {
 		$this->data ['receiptMemu'] = 'invoiceApproval';
 		$this->render ( "/admin/invoiceApprovalAchieve", $this->data );
 	}
-	
 	function invoiceTAchieve() {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
@@ -1936,81 +1961,93 @@ class InvoiceController extends DooController {
 		$staff = new staff ();
 		
 		$MebSea = isset ( $this->params ['MebSea'] ) ? urldecode ( $this->params ['MebSea'] ) : '';
-	
+		
 		$page_size = 2;
 		$page = isset ( $this->params ['page'] ) && is_numeric ( $this->params ['page'] ) ? $this->params ['page'] : 1;
 		$date = isset ( $this->params ['date'] ) ? $this->params ['date'] : 'MONTHO';
-	
+		
 		$get = "/" . $date;
-	
+		
 		$con = '';
 		if ($date == 'MONTHO')
 			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 MONTH)';
-			elseif ($date == 'MONTHT')
+		elseif ($date == 'MONTHT')
 			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH)';
-			elseif ($date == 'MONTHY')
+		elseif ($date == 'MONTHY')
 			$con = ' and updateTime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR)';
-	
-			if (! empty ( $MebSea )) {
-				$con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" or invoicePrice like "%' . $MebSea . '%" )';
-				$get .= "/" . $MebSea;
-			}
-			$pageinfo ['page'] = array (
-					'previous' => ''
-			);
-			
-			$sql="";$action="";
-			if ($this->ACTION=='invoicePrintAchieve'){
-				$sql = "status=2 and printStatus=1 and moldManage like '%[\"" . $this->staff [0] ['sid'] . "\",%'". $con;
-				$action="invoicePrintAchieve";
-			}elseif ($this->ACTION=='invoicePostAchieve'){
-				// and untreadStatus=0
-				$sql = "postStatus=1 and doPost=1 and status=2 and isDelete=0". $con;
-				$action="invoicePostAchieve";
-			}
-			
-			$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, $action, $get, "" );
-			$limit = $pageinfo ['lower'] . ',' . $page_size;
-			$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
-			
-			$this->data ['MebSeaEn'] = $MebSea;
-			$this->data ['MebSea'] = urlencode ( $MebSea );
-			$this->data ['get'] = $get;
-			$this->data ['page'] = $pageinfo;
-			
-			$this->data ['date'] = $date;
-	
-			$this->data ['memu'] = "invoice";
-			$this->data ['staff'] = $this->staff;
-			
-			if ($this->ACTION=='invoicePrintAchieve'){
-				foreach ( $list as $key => $value ) {
-					$list [$key] ['iidKey'] = $XDeode->encode ( $value ['iid'] );
-			
-					$lastApprover = json_decode ( $value ['processApprovals'], true );
-					if (! empty ( $lastApprover )) {
-						$lastApproverKey = array_keys ( $lastApprover );
-						$lastApprover = end ( $lastApprover );
-			
-						$staffDetail = $staff->getOne ( array (
-								'where' => 'sid=' . end ( $lastApproverKey ),
-								'asArray' => true
-						) );
-						$lastApprover ['username'] = $staffDetail ['username'];
-					}
-					$list [$key] ['lastApprover'] = $lastApprover;
+		
+		if (! empty ( $MebSea )) {
+			$con .= ' and ( invoiceTitle like "%' . $MebSea . '%" or invoiceCompany like "%' . $MebSea . '%" or invoicePrice like "%' . $MebSea . '%" )';
+			$get .= "/" . $MebSea;
+		}
+		$pageinfo ['page'] = array (
+				'previous' => '' 
+		);
+		
+		$sql = "";
+		$action = "";
+		if ($this->ACTION == 'invoicePrintAchieve') {
+			$sql = "status=2 and printStatus=1 and moldManage like '%[\"" . $this->staff [0] ['sid'] . "\",%'" . $con;
+			$action = "invoicePrintAchieve";
+		} elseif ($this->ACTION == 'invoicePostAchieve') {
+			// and untreadStatus=0
+			$sql = "postStatus=1 and doPost=1 and status=2 and isDelete=0" . $con;
+			$action = "invoicePostAchieve";
+		} elseif ($this->ACTION == 'invoiceUntreadAchieve') {
+			$sql = " printStatus=1 and untreadStatus=2 and status=2 " . $con;
+			$action = "invoiceUntreadAchieve";
+		}
+		
+		$pageinfo = $this->get_page ( "CLD_invoice", $sql, $page, $page_size, $action, $get, "" );
+		$limit = $pageinfo ['lower'] . ',' . $page_size;
+		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $sql );
+		
+		$this->data ['MebSeaEn'] = $MebSea;
+		$this->data ['MebSea'] = urlencode ( $MebSea );
+		$this->data ['get'] = $get;
+		$this->data ['page'] = $pageinfo;
+		
+		$this->data ['date'] = $date;
+		
+		$this->data ['memu'] = "invoice";
+		$this->data ['staff'] = $this->staff;
+		
+		if ($this->ACTION == 'invoicePrintAchieve') {
+			foreach ( $list as $key => $value ) {
+				$list [$key] ['iidKey'] = $XDeode->encode ( $value ['iid'] );
+				
+				$lastApprover = json_decode ( $value ['processApprovals'], true );
+				if (! empty ( $lastApprover )) {
+					$lastApproverKey = array_keys ( $lastApprover );
+					$lastApprover = end ( $lastApprover );
+					
+					$staffDetail = $staff->getOne ( array (
+							'where' => 'sid=' . end ( $lastApproverKey ),
+							'asArray' => true 
+					) );
+					$lastApprover ['username'] = $staffDetail ['username'];
 				}
-				$this->data ['receiptMemu'] = 'invoicePrint';
-				$this->data ['list'] = $list;
-				$this->render ( "/admin/invoicePrintAchieve", $this->data );
-			}elseif ($this->ACTION=='invoicePostAchieve'){
-			
-				$this->data ['receiptMemu'] = 'invoicePost';
-				$this->data ['list'] = $list;
-				$this->render ( "/admin/invoicePostAchieve", $this->data );
+				$list [$key] ['lastApprover'] = $lastApprover;
 			}
+			$this->data ['receiptMemu'] = 'invoicePrint';
+			$this->data ['list'] = $list;
+			$this->render ( "/admin/invoicePrintAchieve", $this->data );
+		} elseif ($this->ACTION == 'invoicePostAchieve') {
 			
+			Doo::loadModel ( 'express' );
+			$express = new express ();
+			$expressList = $express->getExpressByAll ();
 			
+			$this->data ['expressList'] = $expressList;
+			$this->data ['receiptMemu'] = 'invoicePost';
+			$this->data ['list'] = $list;
+			$this->render ( "/admin/invoicePostAchieve", $this->data );
+		} elseif ($this->ACTION == 'invoiceUntreadAchieve') {
+			
+			$this->data ['receiptMemu'] = 'invoiceUntread';
+			$this->data ['list'] = $list;
+			$this->render ( "/admin/invoiceUntreadAchieve", $this->data );
+		}
 	}
 	
 	/**
@@ -2140,6 +2177,9 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoice' );
 		$invoice = new invoice ();
 		$iid = $invoice->authcode ( $iid );
+		Doo::loadModel ( 'express' );
+		$express = new express ();
+		$expressList = $express->getExpressByAll ();
 		
 		if (! is_numeric ( $iid )) {
 			echo json_encode ( array (
@@ -2152,6 +2192,16 @@ class InvoiceController extends DooController {
 		$select = "iid,recipients,recipientsPhone,recipientsAddress,mailItems,expressCompany,expressNumber,actualItems";
 		$invoiceDetail = $invoice->getInvoiceByIid ( $iid, $select );
 		
+		$html = "";
+		foreach ( $expressList as $key => $value ) {
+			if ($value ['company'] == $invoiceDetail ['expressCompany'])
+				$html .= '<option selected value="' . $value ['company'] . ':' . $value ['com'] . '">' . $value ['company'] . '</option>';
+			else
+				$html .= '<option value="' . $value ['company'] . ':' . $value ['com'] . '">' . $value ['company'] . '</option>';
+		}
+		
+		$invoiceDetail ['eaHtml'] = $html;
+		
 		echo json_encode ( array (
 				'status' => 1,
 				'invoiceDetail' => $invoiceDetail 
@@ -2626,7 +2676,7 @@ class InvoiceController extends DooController {
 			$invoiceOperationLog = new invoiceOperationLog ();
 			
 			$detail = $invoice->getInvoiceByIsid ( $serial, $this->staff [0] ['sid'] );
-			$invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $detail['iid'] );
+			$invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $detail ['iid'] );
 			
 			if (empty ( $detail ))
 				$html = '';
@@ -2670,21 +2720,21 @@ class InvoiceController extends DooController {
 						</tr><tr>
 							<th class="taC" width="150">邮寄物品</th><td colspan="3">' . $detail ['mailItems'] . '</td>
 						</tr></tbody></table>';
-				if(!empty($invoiceOperationLogList)){
-					$html.='<table class="table table-bordered table-condensed"><tbody><tr><th width="60%" class="taC">审批流程</th></tr><tr><td>';
-					foreach($invoiceOperationLogList as $key=>$value){
-						$html.='<blockquote><p><span class="colGray">'.$value['date'].'</span>&nbsp;
-						'.$value['category'].'-'.$value['username'].'&nbsp;';
-						if($value['status']==2){
-							$html.='<span class="colGreen">同意</span>';
-						}elseif($value['status']==3){
-							$html.='<span class="colOrange">退回</span>';
-						}elseif($value['status']==5){
-							$html.='<span class="colGreen">打印</span>';
+				if (! empty ( $invoiceOperationLogList )) {
+					$html .= '<table class="table table-bordered table-condensed"><tbody><tr><th width="60%" class="taC">审批流程</th></tr><tr><td>';
+					foreach ( $invoiceOperationLogList as $key => $value ) {
+						$html .= '<blockquote><p><span class="colGray">' . $value ['date'] . '</span>&nbsp;
+						' . $value ['category'] . '-' . $value ['username'] . '&nbsp;';
+						if ($value ['status'] == 2) {
+							$html .= '<span class="colGreen">同意</span>';
+						} elseif ($value ['status'] == 3) {
+							$html .= '<span class="colOrange">退回</span>';
+						} elseif ($value ['status'] == 5) {
+							$html .= '<span class="colGreen">打印</span>';
 						}
-						$html.=$value['operation'].'</p></blockquote>';
+						$html .= $value ['operation'] . '</p></blockquote>';
 					}
-					$html.='</td></tr></tbody></table>';	
+					$html .= '</td></tr></tbody></table>';
 				}
 				$html .= '</div><div class="modal-footer"><a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a></div></div></div>';
 			}

+ 10 - 0
protected/model/invoice.php

@@ -536,8 +536,18 @@ class invoice extends DooModel {
 		foreach ( $list as $key => $value ) {
 			$list [$key] ['iidKey'] = $this->authcode ( $value ['iid'], '' );
 			$list [$key] ['iidKeyK'] = $XDeode->encode ( $value ['iid'] );
+			
+			$list [$key] ['untreadCompany'] = '';
+			$list [$key] ['untreadCom'] = '';
+			if (! empty ( $value ['untreadCompany'] )) {
+				$express = explode ( ":", $value ['untreadCompany'] );
+				$list [$key] ['untreadCompany'] = $express [0];
+				$list [$key] ['untreadCom'] = $express [1];
+			}
+			
 			$list [$key] ['irList'] = $invoiceReceivables->getInvoiceReceivablesInIridString ( $value ['irid'] );
 			$list [$key] ['operationLog'] = $invoiceOperationLog->getInvoiceOperationLogByIid( $value ['iid'], 'desc' );
+			$list [$key] ['OperationLog'] = $invoiceOperationLog->getInvoiceOperationByStatus ( $value ['iid'], 6 );
 			$list [$key] ['sumPrice'] = 0;
 			if (! empty ( $list [$key] ['irList'] ))
 				$list [$key] ['sumPrice'] = $list [$key] ['irList'] [0] ['sumPrice'];

+ 67 - 51
protected/plugin/TemplateTag.php

@@ -4,6 +4,7 @@
 // You can move this to common.conf.php $config['TEMPLATE_GLOBAL_TAGS'] = array('isset', 'empty');
 // Every public static methods in TemplateTag class (or tag classes from modules) are available in templates without the need to define in TEMPLATE_GLOBAL_TAGS
 Doo::conf ()->TEMPLATE_GLOBAL_TAGS = array (
+		'isTimeTR',
 		'isInvoiceNew',
 		'upper',
 		'tofloat',
@@ -16,12 +17,19 @@ Doo::conf ()->TEMPLATE_GLOBAL_TAGS = array (
 		'empty',
 		'make_date',
 		'inarray',
-		'getGlobals' ,
-		'isInvoiceMoldShow'
+		'getGlobals',
+		'isInvoiceMoldShow' 
 );
-
-function isInvoiceNew($type="GLOBAL"){
+function isTimeTR($day = 3,$cTime) {
+	$flag=false;
+	$thenTime=time();
+	$futureTime=strtotime('+'.$day.' day',strtotime($cTime));
+	if($thenTime<$futureTime)
+		$flag=true;
 	
+	return $flag;
+}
+function isInvoiceNew($type = "GLOBAL") {
 	Doo::loadModel ( 'invoice' );
 	$invoice = new invoice ();
 	Doo::loadModel ( 'invoiceReceivables' );
@@ -31,58 +39,66 @@ function isInvoiceNew($type="GLOBAL"){
 	
 	$st = $staff->getUserByIdList ( $_COOKIE ["staff"] );
 	
-	//我的发票待处理
-	$pendingInvoice  = $invoice->getOne ( array (
-					'where' => "(status=3 or status=4 or (status=2 and printStatus=1 and untreadStatus=0 ) or (status=2 and printStatus=1 and untreadStatus=2 )  )  and isDelete=0 and sid=" . $_COOKIE ["staff"],
-					'desc' => 'iid',
-					'asArray' => TRUE 
-			) );
-	//我的收款待入账
+	// 我的发票待处理
+	$pendingInvoice = $invoice->getOne ( array (
+			'where' => "(status=3 or status=4 or (status=2 and printStatus=1 and untreadStatus=0 ) or (status=2 and printStatus=1 and untreadStatus=2 )  )  and isDelete=0 and sid=" . $_COOKIE ["staff"],
+			'desc' => 'iid',
+			'asArray' => TRUE 
+	) );
+	// 我的收款待入账
 	$myClaim = $invoiceReceivables->getOne ( array (
-			'where' => " receivablesStaff like '" . $_COOKIE ["staff"] . "-%' and receivablesCategory like '" . $st[0]['cid'] . ":%' and bindStatus=0",
+			'where' => " receivablesStaff like '" . $_COOKIE ["staff"] . "-%' and receivablesCategory like '" . $st [0] ['cid'] . ":%' and bindStatus=0",
 			'desc' => 'irid',
-			'asArray' => TRUE
+			'asArray' => TRUE 
 	) );
-	//发票审批
-	$approval=$invoice->getOne ( array (
+	// 发票审批
+	$approval = $invoice->getOne ( array (
 			'where' => 'status=1 and pendingApprovals=' . $_COOKIE ["staff"],
 			'desc' => 'iid',
-			'asArray' => true
+			'asArray' => true 
 	) );
-	//发票邮寄
+	// 发票邮寄
 	$post = $invoice->getOne ( array (
 			'where' => "postStatus=0 and doPost=1 and status=2",
-			'asArray' => TRUE
+			'asArray' => TRUE 
 	) );
-	//发票打印
+	// 发票打印
 	$print = $invoice->getOne ( array (
 			'where' => "status=2 and printStatus=0 and moldManage like '%[\"" . $_COOKIE ["staff"] . "\",%'",
 			'desc' => 'iid',
-			'asArray' => TRUE
+			'asArray' => TRUE 
 	) );
-	//发票退票
+	// 发票退票
 	$untread = $invoice->getOne ( array (
 			'where' => " printStatus=1 and untreadStatus=1 and status=2 ",
-			'asArray' => TRUE
+			'asArray' => TRUE 
 	) );
 	
-	$new=array('GLOBAL'=>FALSE,'pendingInvoice'=>FALSE,'myClaim'=>FALSE,'approval'=>FALSE,'post'=>FALSE,'print'=>FALSE,'untread'=>FALSE);
+	$new = array (
+			'GLOBAL' => FALSE,
+			'pendingInvoice' => FALSE,
+			'myClaim' => FALSE,
+			'approval' => FALSE,
+			'post' => FALSE,
+			'print' => FALSE,
+			'untread' => FALSE 
+	);
 	
-	if (!empty($pendingInvoice)||!empty($myClaim)||!empty($approval)||!empty($post)||!empty($print)||!empty($untread))
-		$new['GLOBAL']=TRUE;
-	if (!empty($pendingInvoice))
-		$new['pendingInvoice']=TRUE;
-	if (!empty($myClaim))
-		$new['myClaim']=TRUE;
-	if (!empty($approval))
-		$new['approval']=TRUE;
-	if (!empty($post))
-		$new['post']=TRUE;
-	if (!empty($print))
-		$new['print']=TRUE;
-	if (!empty($untread))
-		$new['untread']=TRUE;
-	return $new[$type];
+	if (! empty ( $pendingInvoice ) || ! empty ( $myClaim ) || ! empty ( $approval ) || ! empty ( $post ) || ! empty ( $print ) || ! empty ( $untread ))
+		$new ['GLOBAL'] = TRUE;
+	if (! empty ( $pendingInvoice ))
+		$new ['pendingInvoice'] = TRUE;
+	if (! empty ( $myClaim ))
+		$new ['myClaim'] = TRUE;
+	if (! empty ( $approval ))
+		$new ['approval'] = TRUE;
+	if (! empty ( $post ))
+		$new ['post'] = TRUE;
+	if (! empty ( $print ))
+		$new ['print'] = TRUE;
+	if (! empty ( $untread ))
+		$new ['untread'] = TRUE;
+	return $new [$type];
 }
 
 /**
@@ -95,22 +111,22 @@ function isInvoiceMoldShow($sid = 0, $mold = '') {
 	if (! empty ( $sid ) && ! empty ( $mold )) {
 		Doo::loadModel ( "invoiceManage" );
 		$invoiceManage = new invoiceManage ();
-		$imList = $invoiceManage->getInvoiceByMold($mold);
-		$list=array();
-		foreach ($imList['staffList'] as $k=>$v){
-			array_push($list, $v[0]);
+		$imList = $invoiceManage->getInvoiceByMold ( $mold );
+		$list = array ();
+		foreach ( $imList ['staffList'] as $k => $v ) {
+			array_push ( $list, $v [0] );
 		}
 		$fileInvoice = file_get_contents ( "protected/config/invoice/invoice.ini" );
 		$fileInvoice = json_decode ( $fileInvoice, true );
-		$delIM=array();
-		if (isset($fileInvoice[$mold]))
-			$delIM= explode( ',', $fileInvoice[$mold] );
-		foreach ($delIM as $key=>$value){
-			if (!empty($value))
-					array_push($list, $value);
+		$delIM = array ();
+		if (isset ( $fileInvoice [$mold] ))
+			$delIM = explode ( ',', $fileInvoice [$mold] );
+		foreach ( $delIM as $key => $value ) {
+			if (! empty ( $value ))
+				array_push ( $list, $value );
 		}
 		$list = array_unique ( $list );
-		return inarray($sid,$list);
+		return inarray ( $sid, $list );
 	} else
 		return false;
 }
@@ -119,7 +135,7 @@ function getGlobals($var) {
 		getReceiptCount ();
 	elseif ($var == 'NEW2')
 		getExeCount ();
-	//echo $GLOBALS[$var].'/'.$var.'<br/>';
+		// echo $GLOBALS[$var].'/'.$var.'<br/>';
 	return $GLOBALS [$var];
 }
 function inarray($v1, $v2) {
@@ -199,7 +215,7 @@ function getReceiptCount() {
 	$receipt = new receipt ();
 	
 	$dateCondition = " and Year(date) =" . $year;
-	$approvalCondition=' and (nowStaff like "%,'.$_COOKIE ["staff"].'%" or nowStaff like "%'.$_COOKIE ["staff"].',%" or nowStaff='.$_COOKIE ["staff"].' ) ';
+	$approvalCondition = ' and (nowStaff like "%,' . $_COOKIE ["staff"] . '%" or nowStaff like "%' . $_COOKIE ["staff"] . ',%" or nowStaff=' . $_COOKIE ["staff"] . ' ) ';
 	$receiptList = $receipt->find ( array (
 			'where' => ' status=' . $status . $dateCondition . $approvalCondition,
 			'desc' => 'rid',

+ 65 - 50
protected/view/admin/invoicePostAchieve.html

@@ -63,28 +63,16 @@
 							<td>{{invoiceList' value.expressCompany}}:
 							<a href="#shipping" node-post="express-msg" post-data="{{invoicePost' value.iidKey}}" data-toggle="modal">{{invoiceList' value.expressNumber}}</a></td>
 										<td>{{invoiceList' value.poster}} {{invoiceList' value.postTime}}</td>
-							<td></td>
+							<td>
+							
+							<!-- if isTimeTR(3,{{invoiceList' value.postTime}}) -->
+							<a href="#editshipping" node-post="upEm" post-data="{{invoicePost' value.iidKey}}" data-toggle="modal">修改邮寄</a>
+							<!-- endif -->
+							</td>
 						</tr>
 						<!-- endloop -->
 						
-						<tr>
-							<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-							<td>珠海XXXX公司</td>
-							<td><b>¥3000.00</b></td>
-							<td>广东办刘飞 2016-03-03 12:20:20</td>
-							<td>顺丰速运:<a href="#shipping" data-toggle="modal">01239812382398</a></td>
-							<td>赵淑燕 2016-03-03 12:20:20</td>
-							<td><a href="#editshipping" data-toggle="modal">修改邮寄</a></td>
-						</tr>
-						<tr>
-							<td><a href="#invdetail" data-toggle="modal">#F20160316001</a></td>
-							<td>珠海XXXX公司</td>
-							<td><b>¥3000.00</b><sup>专</sup></td>
-							<td>广东办刘飞 2016-03-03 12:20:20</td>
-							<td>顺丰速运:<a href="#shipping" data-toggle="modal">01239812382398</a></td>
-							<td>赵淑燕 2016-03-03 12:20:20</td>
-							<td><a href="#editshipping" data-toggle="modal">修改邮寄</a></td>
-						</tr>
+						
 						</tbody>
 					</table>
 				</div>
@@ -118,13 +106,12 @@
 								<!-- else -->
 								<li><a href="/invoicePostAchieve/{{page.next}}{{get}}" title="下一页">&gt;</a></li>
 								<!-- endif -->
-			  					
 			  		</ul>
 			  	</div>				
 			</div>
 		</div>
 	</div>
-		<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
 	
 	<div class="modal  fade" id="invdetail">
 		
@@ -135,6 +122,9 @@
 	<div class="modal hide fade" id="editshipping">
 		<div class="modal-dialog">
 			<div class="modal-content">
+			<form action="/invoiceExpressUpdateDo" name="invoiceExpress" method="post">
+				<input type="hidden" name="iidKey" value="">
+				<input type="hidden" name="action" value="/invoicePostAchieve/{{page.on_page}}{{get}}">
 				<div class="modal-header">
 					<h3>邮寄物品</h3>
 				</div>
@@ -142,44 +132,69 @@
 					<div class="alert">
 						已邮寄发票,3天内可修改邮寄信息。
 					</div>
+					<input type="hidden" name="iidKey" value="">
 					<table class="table table-bordered table-condensed">
 						<tbody>
-						<tr>
-							<th colspan="4" class="taC">申请邮寄信息</th>
-						</tr>
-						<tr>
-							<th class="taC" width="100">收件人</th><td>陈工</td>
-							<th class="taC" width="100">收件人手机/电话</th><td>12345678901</td>
-						</tr>
-						<tr>
-							<th class="taC" width="100">收件地址</th><td colspan="3">广东省珠海市XXX路XXX号</td>
-						</tr>
-						<tr>
-							<th class="taC" width="100">邮寄物品</th><td colspan="3">合同x1、锁套装x1</td>
-						</tr>
+							<tr>
+								<th colspan="4" class="taC">申请邮寄信息</th>
+							</tr>
+							<tr>
+								<th class="taC" width="100">收件人</th>
+								<td recipients-data='express-msgU'></td>
+								<th class="taC" width="100">收件人手机/电话</th>
+								<td recipientsPhone-data='express-msgU'></td>
+							</tr>
+							<tr>
+								<th class="taC" width="100">收件地址</th>
+								<td recipientsAddress-data='express-msgU' colspan="3"></td>
+							</tr>
+							<tr>
+								<th class="taC" width="100">邮寄物品</th>
+								<td mailItems-data='express-msgU' colspan="3"></td>
+							</tr>
 						</tbody>
 					</table>
+					
+					
 					<table class="table table-bordered table-condensed">
-						<tbody>
-						<tr>
-							<th colspan="4" class="taC">实际邮寄信息</th>
-						</tr>
-						<tr>
-							<th class="taC" width="100"><span class="colRed">*</span>快递公司</th><td>
-							<select><option>顺丰速运</option><option>圆通速运</option></select></td>
-						</tr>
-						<tr>
-							<th class="taC" width="100"><span class="colRed">*</span>快递单号</th><td><input type="text"></td></tr>
-						<tr>
-							<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th><td colspan="3"><textarea class="span4"></textarea></td>
-						</tr>
-						</tbody>
-					</table>
+							<tbody>
+								<tr>
+									<th colspan="2" class="taC">实际邮寄信息</th>
+								</tr>
+								<tr>
+									<th class="taC" width="100"><span class="colRed">*</span>快递公司</th>
+									<td><select name="express">
+											<!-- loop expressList -->
+											<option value="{{expressList' value.company}}:{{expressList' value.com}}">{{expressList' value.company}}</option>
+											<!-- endloop -->
+
+									</select></td>
+								</tr>
+								<tr>
+									<th class="taC" width="100"><span class="colRed">*</span>快递单号</th>
+									<td><input type="text" expressNumber-data='express-msgU' name="nu"
+										placeholder="请正确填写单号,方便跟踪查询。"></td>
+								</tr>
+								<tr>
+									<th class="taC" width="100"><span class="colRed">*</span>邮寄物品</th>
+									<td><textarea actualItems-data='express-msgU' name="actualItems" class="span4"
+											placeholder="请详细填写邮寄的快递包含什么物件。"></textarea></td>
+								</tr>
+							</tbody>
+						</table>
+					
+					
+					
+					
+					
+					
 				</div>
 				<div class="modal-footer">
-					<a href="#" class="button" data-dismiss="modal">确定</a>
+					<input type="submit" class="button" value="确定">
 					<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
 				</div>
+				</form>
+				
 			</div></div>
 	</div>
 	<!--编辑-->

+ 1 - 1
protected/view/admin/invoiceUntread.html

@@ -65,7 +65,7 @@
 						</div>
 						<div class="clearfix">
 							
-							<legend><div class="fR"><a href="invoice-return-all.html">查看更多</a></div>最近退票</legend>
+							<legend><div class="fR"><a href="/invoiceUntreadAchieve">查看更多</a></div>最近退票</legend>
 							<!-- if !empty({{establishedInvoice}}) -->
 							<table class="table table-bordered table-condensed">
 								<tbody>

+ 141 - 0
protected/view/admin/invoiceUntreadAchieve.html

@@ -0,0 +1,141 @@
+<!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include 'menuReceipt' -->
+				</ul>
+			</div>
+			
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<!-- include 'invoiceMenu' -->
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+				<legend>
+					已退发票
+				</legend>
+				<div class="demandCate">
+					<ul class="cateList">
+						<li><a <!-- if {{date}}=='MONTHO' --> class="now" <!-- endif --> href="/invoiceUntreadAchieve/1/MONTHO/{{MebSea}}">最近一个月</a>
+	  					<a <!-- if {{date}}=='MONTHT' --> class="now" <!-- endif --> href="/invoiceUntreadAchieve/1/MONTHT/{{MebSea}}">最近三个月</a>
+	  					<a <!-- if {{date}}=='MONTHY' --> class="now" <!-- endif --> href="/invoiceUntreadAchieve/1/MONTHY/{{MebSea}}" >今年</a>
+	  					<a <!-- if {{date}}=='MONTHA' --> class="now" <!-- endif --> href="/invoiceUntreadAchieve/1/MONTHA/{{MebSea}}" >更旧</a></li>
+						<li>
+							<div class="search">
+								<div class="input-append">
+									<form action="/invoiceUntreadAchieve/1/{{date}}" id="ira" method="get" >
+								<input class="span3" type="text"  data-irmMebSea value="{{MebSeaEn}}" placeholder="发票抬头、开票金额">
+								<button class="btn btn-small" node-iramMebSea type="button">搜索</button>
+								</form>
+								</div>
+							</div></li>
+					</ul>
+				</div>
+				<div class="saeaList">
+					<table class="table table-hover">
+						<tbody>
+						<tr class="thead"><th>开票流水号</th><th>开票单位(抬头)</th><th>开票金额</th><th>提交退票</th><th>快递信息</th><th>确认退票</th></tr>
+						
+						<!-- loop list -->
+						<tr>
+							<td><a href="#invdetail" node-invoice='INFO' data-isKey="{{pendingInvoice' value.iidKeyK}}" data-toggle="modal">{{list' value.invoiceSerial}}</a></td>
+							<td><!-- if !empty({{list' value.invoiceType}}) -->
+	                                   	{{list' value.invoiceCompany}}
+	                                    <!-- else -->
+	                                    {{list' value.invoiceTitle}}
+	                                    <!-- endif --></td>
+							<td>
+							<!-- if !empty({{list' value.invoiceType}}) -->
+	                        <b>¥{{list' value.invoicePrice}}</b><sup>专</sup>
+	                          <!-- else -->
+	                          <b>¥{{list' value.invoicePrice}}</b>
+	                          <!-- endif -->
+							</td>
+							
+							<td>{{list' value.categoryName}}{{list' value.userName}} {{list' value.date}}</td>
+							<td>{{invoiceList' value.untreadCompany}}:
+                                    <a href="#shipping" title="{{invoiceList' value.untreadItems}}" node-express="untread" data-toggle="modal">{{invoiceList' value.untreadNumber}}</a> 
+                                    <a target="_blank" href="http://www.kuaidi100.com/chaxun?com={{invoiceList' value.untreadCom}}&nu={{invoiceList' value.untreadNumber}}">查询快递</a> 
+                                    </td>
+							<td>{{establishedInvoice' value.OperationLog.username}} {{establishedInvoice' value.OperationLog.date}}</td>
+						</tr>
+						<!-- endloop -->
+						
+						</tbody>
+					</table>
+				</div>
+						  		<!--翻页-->
+				<div class="demandPage">
+					<ul class="pagination fL">
+	  							<!-- if {{page.previous}}==0 -->
+								<li><a href="javascript:void(0)" title="上一页">&lt;</a></li>
+								<!-- else -->
+								<li><a href="/invoiceUntreadAchieve/{{page.previous}}{{get}}" title="上一页">&lt;</a></li>
+								<!-- endif -->	
+								
+	  							<!-- if {{page.on_page}}>=3 -->
+	  							<li><a href="/invoiceUntreadAchieve/1{{get}}" title="上一页">1</a></li>
+	  							<li class="point"><span>...</span></li>
+	  							<!-- endif -->
+	  							
+	  							{{page.page}}
+	  							
+	  							<!-- if {{page.on_page}}<3 && {{page.total_page}}>5 -->
+	  							<li><a href="/invoiceUntreadAchieve/4{{get}}" >4</a></li>
+	  							<li><a href="/invoiceUntreadAchieve/5{{get}}" >5</a></li>
+	  							<!-- endif -->
+	  							
+	  							<!-- if {{page.total_page}}>3 -->
+	  							<li class="point"><span>...</span></li>
+			  					<!-- endif -->
+			  					
+			  					<!-- if {{page.next}}=={{page.on_page}} -->
+								<li><a href="javascript:void(0)" title="下一页">&gt;</a></li>
+								<!-- else -->
+								<li><a href="/invoiceUntreadAchieve/{{page.next}}{{get}}" title="下一页">&gt;</a></li>
+								<!-- endif -->
+			  		</ul>
+			  	</div>				
+			</div>
+		</div>
+	</div>
+	<!--弹出快递跟踪-->
+<div class="modal hide fade" id="shipping">
+	<div class="modal-dialog">
+		<div class="modal-content">
+    <div class="modal-header">
+    <h3>邮寄物品</h3>
+    </div>
+    <div class="modal-body saeaList">
+		<table class="table table-bordered table-condensed">
+			<tbody>
+			<tr>
+				<th class="taC">退票邮寄物品</th>
+			</tr>
+			<tr>
+				<td node-express="msg">发票</td>
+			</tr>
+			</tbody>
+		</table>
+		
+    </div>
+	<div class="modal-footer">
+	    <a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+	</div>
+			</div></div>
+</div>
+	<div loading-msg='true' style="position:absolute;  left:50%;  top:50%;  "></div>
+	
+	<div class="modal  fade" id="invdetail">
+		
+		<div id="nc"></div>
+	</div>
+<script type="text/javascript">autoFlashHeight();</script>	
+</body>